diff --git a/classes/SpecUploadBase.php b/classes/SpecUploadBase.php index 269bab7d7d..b08ded0627 100644 --- a/classes/SpecUploadBase.php +++ b/classes/SpecUploadBase.php @@ -16,6 +16,7 @@ class SpecUploadBase extends SpecUpload{ private $matchCatalogNumber = 1; private $matchOtherCatalogNumbers = 0; private $versionDataEdits = false; + private $overwriteData = false; private $verifyImageUrls = false; private $processingStatus = ''; protected $nfnIdentifier; @@ -918,7 +919,14 @@ protected function transferOccurrences(){ $sqlFragArr[$v] = 'o.processingStatus = u.processingStatus'; } elseif($this->uploadType == $this->SKELETAL || $this->uploadType == $this->NFNUPLOAD){ - $sqlFragArr[$v] = 'o.'.$v.' = IFNULL(o.'.$v.',u.'.$v.')'; + // start NEON customization + if($this->overwriteData){ + $sqlFragArr[$v] = 'o.' . $v . ' = u.' . $v; + } + else{ + $sqlFragArr[$v] = 'o.'.$v.' = IFNULL(o.'.$v.',u.'.$v.')'; + } + // end NEON customization } else{ $sqlFragArr[$v] = 'o.'.$v.' = u.'.$v; @@ -1013,8 +1021,16 @@ private function versionInternalEdits(){ foreach($this->targetFieldArr as $field){ if(in_array($field, $excludedFieldArr)) continue; if($r[$field] != $r['old_'.$field]){ - if($this->uploadType == $this->SKELETAL && $r['old_'.$field]) continue; - $this->insertOccurEdit($r['occid'], $field, $r[$field], $r['old_'.$field]); + // start NEON customization + if($this->uploadType == $this->SKELETAL){ + if ($this->overwriteData || !$r['old_'.$field]) { + $this->insertOccurEdit($r['occid'], $field, $r[$field], $r['old_'.$field]); + } + else { + continue; + } + } + // end NEON customization } } } @@ -2207,6 +2223,10 @@ public function setVersionDataEdits($v){ $this->versionDataEdits = $v; } + public function setOverwriteData($v){ + $this->overwriteData = $v; + } + public function setVerifyImageUrls($v){ $this->verifyImageUrls = $v; } diff --git a/collections/admin/specuploadmap.php b/collections/admin/specuploadmap.php index b4652e8946..e08358d3c2 100644 --- a/collections/admin/specuploadmap.php +++ b/collections/admin/specuploadmap.php @@ -19,6 +19,7 @@ $matchCatNum = array_key_exists('matchcatnum',$_REQUEST)?true:false; $matchOtherCatNum = array_key_exists('matchothercatnum',$_REQUEST)&&$_REQUEST['matchothercatnum']?true:false; $versionData = array_key_exists('versiondata',$_REQUEST) && $_REQUEST['versiondata']?true:false; +$overwriteData = array_key_exists('allowOverwrite',$_REQUEST) && $_REQUEST['allowOverwrite']?true:false; $verifyImages = array_key_exists('verifyimages',$_REQUEST) && $_REQUEST['verifyimages']?true:false; $processingStatus = array_key_exists('processingstatus',$_REQUEST)?$_REQUEST['processingstatus']:''; $dbpk = array_key_exists('dbpk',$_REQUEST)?$_REQUEST['dbpk']:''; @@ -39,6 +40,7 @@ if($matchCatNum !== true) $matchCatNum = false; if($matchOtherCatNum !== true) $matchOtherCatNum = false; if($versionData !== true) $versionData = false; +if($overwriteData !== true) $overwriteData = false; if($verifyImages !== true) $verifyImages = false; if(!preg_match('/^[a-zA-Z0-9\s_-]+$/',$processingStatus)) $processingStatus = ''; if($dbpk) $dbpk = htmlspecialchars($dbpk); @@ -75,6 +77,7 @@ $duManager->setMatchCatalogNumber($matchCatNum); $duManager->setMatchOtherCatalogNumbers($matchOtherCatNum); $duManager->setVersionDataEdits($versionData); +$duManager->setOverwriteData($overwriteData); $duManager->setVerifyImageUrls($verifyImages); $duManager->setProcessingStatus($processingStatus); @@ -633,6 +636,11 @@ function pkChanged(selObj){ + +
+ + +
diff --git a/collections/admin/specuploadprocessor.php b/collections/admin/specuploadprocessor.php index 3e10424669..cf9d634abd 100644 --- a/collections/admin/specuploadprocessor.php +++ b/collections/admin/specuploadprocessor.php @@ -20,6 +20,7 @@ $matchCatNum = array_key_exists('matchcatnum',$_REQUEST)?true:false; $matchOtherCatNum = array_key_exists('matchothercatnum',$_REQUEST)&&$_REQUEST['matchothercatnum']?true:false; $versionData = array_key_exists('versiondata',$_REQUEST) && $_REQUEST['versiondata']?true:false; +$overwriteData = array_key_exists('overwritedata',$_REQUEST) && $_REQUEST['overwritedata']?true:false; $verifyImages = array_key_exists('verifyimages',$_REQUEST)&&$_REQUEST['verifyimages']?true:false; $processingStatus = array_key_exists('processingstatus',$_REQUEST)?$_REQUEST['processingstatus']:''; $finalTransfer = array_key_exists('finaltransfer',$_REQUEST)?$_REQUEST['finaltransfer']:0; @@ -41,6 +42,7 @@ if($matchCatNum !== true) $matchCatNum = false; if($matchOtherCatNum !== true) $matchOtherCatNum = false; if($versionData !== true) $versionData = false; +if($overwriteData !== true) $overwriteData = false; if($verifyImages !== true) $verifyImages = false; if(!preg_match('/^[a-zA-Z0-9\s_-]+$/',$processingStatus)) $processingStatus = ''; if(!is_numeric($finalTransfer)) $finalTransfer = 0; @@ -83,6 +85,7 @@ $duManager->setMatchCatalogNumber($matchCatNum); $duManager->setMatchOtherCatalogNumbers($matchOtherCatNum); $duManager->setVersionDataEdits($versionData); +$duManager->setOverwriteData($overwriteData); $duManager->setVerifyImageUrls($verifyImages); $duManager->setProcessingStatus($processingStatus); @@ -234,6 +237,7 @@ + diff --git a/content/lang/collections/admin/specupload.en.php b/content/lang/collections/admin/specupload.en.php index b79d251e37..72b8d8bde1 100644 --- a/content/lang/collections/admin/specupload.en.php +++ b/content/lang/collections/admin/specupload.en.php @@ -113,6 +113,7 @@ $LANG['VER_MAPPING'] = 'Verify Mapping'; $LANG['SAVE_MAP'] = 'Save Mapping'; $LANG['VERSION_DATA_CHANGES'] = 'Version data changes'; +$LANG['OVERWRITE_DATA'] = 'Overwrite existing data'; $LANG['VER_LINKS_MEDIA'] = 'Verify image links from associatedMedia field'; $LANG['SKEL_EXPLAIN'] = 'Skeletal Files consist of stub data that is easy to capture in bulk during the imaging process. This data is used to seed new records to which images are linked. @@ -121,7 +122,7 @@ $LANG['SKEL_EXPLAIN_P1'] = 'General file uploads typically consist of full records, while skeletal uploads will almost always be an annotated record with data for only a few selected fields'; $LANG['SKEL_EXPLAIN_P2'] = 'The catalog number field is required for skeletal file uploads since this field is used to find matches on images or existing records'; $LANG['SKEL_EXPLAIN_P3'] = 'In cases where a record already exists, a general file upload will completely replace the existing record with the data in the new record. - On the other hand, a skeletal upload will augment the existing record only with new field data. Fields are only added if data does not already exist within the target field.'; + On the other hand, a skeletal upload will augment the existing record only with new field data. Fields are only added if data does not already exist within the target field, unless the option to overwrite existing data is selected'; $LANG['SKEL_EXPLAIN_P4'] = 'If a record DOES NOT already exist, a new record will be created in both cases, but only the skeletal record will be tagged as unprocessed'; $LANG['NOT_AUTH'] = 'ERROR: you are not authorized to upload to this collection'; $LANG['PAGE_ERROR'] = 'ERROR: Either you have tried to reach this page without going through the collection management menu or you have tried to upload a file that is too large. diff --git a/content/lang/collections/admin/specupload.es.php b/content/lang/collections/admin/specupload.es.php index 6ec239aab6..a81e75d135 100644 --- a/content/lang/collections/admin/specupload.es.php +++ b/content/lang/collections/admin/specupload.es.php @@ -113,6 +113,7 @@ $LANG['VER_MAPPING'] = 'Verificar Mapeo'; $LANG['SAVE_MAP'] = 'Guardar Mapeo'; $LANG['VERSION_DATA_CHANGES'] = 'Version data changes'; +$LANG['OVERWRITE_DATA'] = 'Sobrescribir datos existentes'; $LANG['VER_LINKS_MEDIA'] = 'Verificar enlaces de imágenes en el campo associatedMedia'; $LANG['SKEL_EXPLAIN'] = 'Los Archivos Esqueléticos consisten en un conjunnto de datos que son fáciles de capturar por lote durante el procesamiento de imágenes. Los datos son utilizados para crear nuevos registros a los cuales las imágenes son vinculados. diff --git a/content/lang/collections/admin/specupload.fr.php b/content/lang/collections/admin/specupload.fr.php index f2eface54d..39901048cf 100644 --- a/content/lang/collections/admin/specupload.fr.php +++ b/content/lang/collections/admin/specupload.fr.php @@ -112,6 +112,7 @@ $LANG['LOADING_DATA'] = 'Chargement Données dans Symbiota'; $LANG['VER_MAPPING'] = 'Vérifier Mappage'; $LANG['VERSION_DATA_CHANGES'] = 'Version data changes'; +$LANG['OVERWRITE_DATA'] = 'Ecraser les données existantes'; $LANG['SAVE_MAP'] = 'Enregistrer Mappage'; $LANG['VER_LINKS_MEDIA'] = "Vérifier les liens d'image à partir du champ associatedMedia (Média Associé)"; $LANG['SKEL_EXPLAIN'] = "Les fichiers squelettes sont constitués de données stub faciles à capturer en masse pendant le processus d'imagerie.