diff --git a/checklists/checklist.php b/checklists/checklist.php index 0a3ee2db71..9ad39d7676 100644 --- a/checklists/checklist.php +++ b/checklists/checklist.php @@ -37,7 +37,7 @@ $clArray = $clManager->getClMetaData(); $activateKey = $KEY_MOD_IS_ACTIVE; $showDetails = 0; -if($clid && $clArray['defaultSettings']){ +if(isset($clArray['defaultSettings'])){ $defaultArr = json_decode($clArray['defaultSettings'], true); $showDetails = $defaultArr['ddetails']; if(!$defaultOverride){ @@ -156,7 +156,7 @@ function changeImageSource(elem){
@@ -548,12 +548,7 @@ function changeImageSource(elem){
'; - echo $LANG['TOTAL_TAXA']; - echo ' ('; - echo ''.(isset($LANG['DETAILS'])?$LANG['DETAILS']:'details').''; - echo ')'; - echo ': '; + echo '' . $LANG['TOTAL_TAXA'] . ': '; echo $clManager->getTaxaCount(); ?>
diff --git a/checklists/checklistadmin.php b/checklists/checklistadmin.php index 5e38bda4c6..dfb86019db 100644 --- a/checklists/checklistadmin.php +++ b/checklists/checklistadmin.php @@ -43,9 +43,10 @@ } } elseif($action == 'deleteChecklist'){ - $status = $clManager->deleteChecklist($_POST['delclid']); - if($status === true) header('Location: ../index.php'); - echo $statusStr = $clManager->getErrorMessage(); + if($clManager->deleteChecklist($_POST['delclid'])){ + header('Location: ../index.php'); + } + else $statusStr = 'ERROR deleting checklist: '.$clManager->getErrorMessage(); } elseif($action == 'addEditor'){ $statusStr = $clManager->addEditor($_POST['editoruid']); diff --git a/classes/ChecklistAdmin.php b/classes/ChecklistAdmin.php index a2c32cd31f..80c7fb9bb6 100644 --- a/classes/ChecklistAdmin.php +++ b/classes/ChecklistAdmin.php @@ -22,7 +22,7 @@ public function getMetaData($pid = null){ $inventoryManager = new ImInventories(); $inventoryManager->setClid($this->clid); $retArr = $inventoryManager->getChecklistMetadata($pid); - $this->clName = $retArr['name']; + if($retArr) $this->clName = $retArr['name']; } return $retArr; } diff --git a/classes/GamesManager.php b/classes/GamesManager.php index c214a9495b..0e844c7648 100644 --- a/classes/GamesManager.php +++ b/classes/GamesManager.php @@ -186,7 +186,6 @@ public function getFlashcardImages(){ } if($this->taxonFilter) $sql .= 'AND (ts.Family = "'.$this->taxonFilter.'" OR t.sciname Like "'.$this->taxonFilter.'%") '; $sql .= 'ORDER BY RAND() LIMIT 1000 '; - //echo 'sql: '.$sql; exit; if($rs = $this->conn->query($sql)){ while($r = $rs->fetch_object()){ $retArr[$r->tidaccepted]['tid'] = $r->tid; @@ -393,9 +392,7 @@ public function setDynClid($id){ } public function setTaxonFilter($tValue){ - if(preg_match('/^[\D\s]+$/',$tValue)){ - $this->taxonFilter = $tValue; - } + $this->taxonFilter = $tValue; } public function setShowCommon($sc){ diff --git a/classes/ImInventories.php b/classes/ImInventories.php index d26fa05c15..297a8650f6 100644 --- a/classes/ImInventories.php +++ b/classes/ImInventories.php @@ -43,25 +43,27 @@ public function getChecklistMetadata($pid){ $retArr['datelastmodified'] = $row->datelastmodified; } $result->free(); - if($retArr['type'] == 'excludespp'){ - $sql = 'SELECT clid FROM fmchklstchildren WHERE clidchild = '.$this->clid; - $rs = $this->conn->query($sql); - while($r = $rs->fetch_object()){ - $retArr['excludeparent'] = $r->clid; - } - $rs->free(); - } - if($pid && is_numeric($pid)){ - $sql = 'SELECT clNameOverride, mapChecklist, sortSequence, notes FROM fmchklstprojlink WHERE clid = '.$this->clid.' AND pid = '.$pid; - $rs = $this->conn->query($sql); - if($rs){ - if($r = $rs->fetch_object()){ - $retArr['clNameOverride'] = $this->cleanOutStr($r->clNameOverride); - $retArr['mapchecklist'] = $r->mapChecklist; - $retArr['sortsequence'] = $r->sortSequence; + if($retArr){ + if($retArr['type'] == 'excludespp'){ + $sql = 'SELECT clid FROM fmchklstchildren WHERE clidchild = '.$this->clid; + $rs = $this->conn->query($sql); + while($r = $rs->fetch_object()){ + $retArr['excludeparent'] = $r->clid; } $rs->free(); } + if($pid && is_numeric($pid)){ + $sql = 'SELECT clNameOverride, mapChecklist, sortSequence, notes FROM fmchklstprojlink WHERE clid = '.$this->clid.' AND pid = '.$pid; + $rs = $this->conn->query($sql); + if($rs){ + if($r = $rs->fetch_object()){ + $retArr['clNameOverride'] = $this->cleanOutStr($r->clNameOverride); + $retArr['mapchecklist'] = $r->mapChecklist; + $retArr['sortsequence'] = $r->sortSequence; + } + $rs->free(); + } + } } } return $retArr; @@ -91,7 +93,7 @@ public function insertChecklist($fieldArr){ if($stmt = $this->conn->prepare($sql)){ $stmt->bind_param('sssssssdddsssisi', $clName, $authors, $type, $locality, $publication, $abstract, $notes, $latCentroid, $longCentroid, $pointRadiusMeters, $access, $defaultSettings, $dynamicSql, $uid, $footprintWkt, $sortSequence); if($stmt->execute()){ - if($stmt->affected_rows || !$stmt->error){ + if($stmt->affected_rows && !$stmt->error){ $clid = $stmt->insert_id; } else $this->errorMessage = 'ERROR inserting fmchecklists record (2): '.$stmt->error; @@ -132,7 +134,7 @@ public function updateChecklist($inputArr){ if($stmt = $this->conn->prepare($sql)){ $stmt->bind_param($typeStr, ...$paramArr); if($stmt->execute()){ - if($stmt->affected_rows || !$stmt->error){ + if(!$stmt->error){ $status = true; } else $this->errorMessage = 'ERROR updating fmchecklists record (2): '.$stmt->error; @@ -168,23 +170,26 @@ public function updateChecklist($inputArr){ } public function deleteChecklist(){ - $status = true; + $status = false; $roleArr = $this->getManagers('ClAdmin', 'fmchecklists', $this->clid); unset($roleArr[$GLOBALS['SYMB_UID']]); if(!$roleArr){ - $sql = 'DELETE FROM fmchecklists WHERE (clid = '.$this->clid.')'; - if($this->conn->query($sql)){ - //Delete userpermissions reference once patch is submitted - $this->deleteUserRole('ClAdmin', $this->clid, $GLOBALS['SYMB_UID']); - } - else{ - $this->errorMessage = 'ERROR attempting to delete checklist: '.$this->conn->error; - $status = false; + $this->deleteChecklistTaxaLinks(); + $sql = 'DELETE FROM fmchecklists WHERE clid = ?'; + if($stmt = $this->conn->prepare($sql)){ + $stmt->bind_param('i', $this->clid); + $stmt->execute(); + if($stmt->affected_rows && !$stmt->error){ + $status = true; + //Delete userpermissions reference once patch is submitted + $this->deleteUserRole('ClAdmin', $this->clid, $GLOBALS['SYMB_UID']); + } + else $this->errorMessage = $stmt->error; + $stmt->close(); } } else{ $this->errorMessage = 'Checklist cannot be deleted until all editors are removed. Remove editors and then try again.'; - $status = false; } return $status; } @@ -205,6 +210,22 @@ public function getChecklistArr($pid = 0){ return $retArr; } + //Checklist taxa linkages + private function deleteChecklistTaxaLinks(){ + $status = false; + if($this->clid){ + $sql = 'DELETE FROM fmchklsttaxalink WHERE clid = ?'; + if($stmt = $this->conn->prepare($sql)){ + $stmt->bind_param('i', $this->clid); + $stmt->execute(); + if($stmt->error) $this->errorMessage = $stmt->error; + else $status = true; + $stmt->close(); + } + } + return $status; + } + //Child-Parent checklist functions public function insertChildChecklist($clidChild, $modifiedUid){ $status = false; @@ -212,7 +233,7 @@ public function insertChildChecklist($clidChild, $modifiedUid){ if($stmt = $this->conn->prepare($sql)){ $stmt->bind_param('iii', $this->clid, $clidChild, $modifiedUid); if($stmt->execute()){ - if($stmt->affected_rows || !$stmt->error){ + if($stmt->affected_rows && !$stmt->error){ $status = true; } else $this->errorMessage = 'ERROR inserting child checklist record (2): '.$stmt->error; @@ -278,7 +299,7 @@ public function insertProject($inputArr){ if($stmt = $this->conn->prepare($sql)){ $stmt->bind_param('ssssi', $projName, $managers, $fullDescription, $notes, $isPublic); if($stmt->execute()){ - if($stmt->affected_rows || !$stmt->error){ + if($stmt->affected_rows && !$stmt->error){ $newPid = $stmt->insert_id; $this->pid = $newPid; } @@ -302,7 +323,7 @@ public function updateProject($inputArr){ if($stmt = $this->conn->prepare($sql)){ $stmt->bind_param('ssssii', $projName, $managers, $fullDescription, $notes, $isPublic, $this->pid); if($stmt->execute()){ - if($stmt->affected_rows || !$stmt->error){ + if(!$stmt->error){ $status = true; } else $this->errorMessage = 'ERROR updating fmprojects record (2): '.$stmt->error; @@ -384,7 +405,7 @@ public function insertUserRole($uid, $role, $tableName, $tablePK, $uidAssignedBy if($stmt = $this->conn->prepare($sql)){ $stmt->bind_param('isssi', $uid, $role, $tableName, $tablePK, $uidAssignedBy); if($stmt->execute()){ - if($stmt->affected_rows || !$stmt->error){ + if($stmt->affected_rows && !$stmt->error){ $status = true; } else $this->errorMessage = 'ERROR inserting user role record (2): '.$stmt->error; diff --git a/classes/OccurrenceEditorManager.php b/classes/OccurrenceEditorManager.php index 67802aa23c..965fcdad1b 100644 --- a/classes/OccurrenceEditorManager.php +++ b/classes/OccurrenceEditorManager.php @@ -128,12 +128,12 @@ public function setQueryVariables($overrideQry = false){ if(array_key_exists('q_ocrfrag',$_REQUEST) && $_REQUEST['q_ocrfrag']) $this->qryArr['ocr'] = trim($_REQUEST['q_ocrfrag']); if(array_key_exists('q_imgonly',$_REQUEST) && $_REQUEST['q_imgonly']) $this->qryArr['io'] = 1; if(array_key_exists('q_withoutimg',$_REQUEST) && $_REQUEST['q_withoutimg']) $this->qryArr['woi'] = 1; - for($x=1;$x<9;$x++){ + for($x=1; $x<9; $x++){ if(array_key_exists('q_customandor'.$x,$_REQUEST) && $_REQUEST['q_customandor'.$x]) $this->qryArr['cao'.$x] = $_REQUEST['q_customandor'.$x]; if(array_key_exists('q_customopenparen'.$x,$_REQUEST) && $_REQUEST['q_customopenparen'.$x]) $this->qryArr['cop'.$x] = $_REQUEST['q_customopenparen'.$x]; if(array_key_exists('q_customfield'.$x,$_REQUEST) && $_REQUEST['q_customfield'.$x]) $this->qryArr['cf'.$x] = $_REQUEST['q_customfield'.$x]; if(array_key_exists('q_customtype'.$x,$_REQUEST) && $_REQUEST['q_customtype'.$x]) $this->qryArr['ct'.$x] = $_REQUEST['q_customtype'.$x]; - if(array_key_exists('q_customvalue'.$x,$_REQUEST) && $_REQUEST['q_customvalue'.$x]) $this->qryArr['cv'.$x] = trim($_REQUEST['q_customvalue'.$x]); + if(array_key_exists('q_customvalue'.$x,$_REQUEST)) $this->qryArr['cv'.$x] = trim($_REQUEST['q_customvalue'.$x]); if(array_key_exists('q_customcloseparen'.$x,$_REQUEST) && $_REQUEST['q_customcloseparen'.$x]) $this->qryArr['ccp'.$x] = $_REQUEST['q_customcloseparen'.$x]; } if(array_key_exists('orderby',$_REQUEST)) $this->qryArr['orderby'] = trim($_REQUEST['orderby']); @@ -474,7 +474,7 @@ private function setSqlWhere(){ } //Custom search fields $customWhere = ''; - for($x=1;$x<9;$x++){ + for($x=1; $x<9; $x++){ $cao = (array_key_exists('cao'.$x,$this->qryArr)?$this->cleanInStr($this->qryArr['cao'.$x]):''); $cop = (array_key_exists('cop'.$x,$this->qryArr)?$this->cleanInStr($this->qryArr['cop'.$x]):''); $customField = (array_key_exists('cf'.$x,$this->qryArr)?$this->cleanInStr($this->qryArr['cf'.$x]):''); @@ -496,14 +496,14 @@ private function setSqlWhere(){ } if($customField == 'o.otherCatalogNumbers'){ $customWhere .= $cao.' ('.substr($this->setCustomSqlFragment($customField, $customTerm, $customValue, $cao, $cop, $ccp),3).' '; - if($customTerm != 'NOT EQUALS' && $customTerm != 'NOT LIKE'){ + if($customTerm != 'NOT_EQUALS' && $customTerm != 'NOT_LIKE'){ $caoOverride = 'OR'; if($customTerm == 'NULL') $caoOverride = 'AND'; $customWhere .= $this->setCustomSqlFragment('id.identifierValue', $customTerm, $customValue, $caoOverride, $cop, $ccp); } else{ $customWhere .= 'AND o.occid NOT IN(SELECT occid FROM omoccuridentifiers WHERE identifierValue '; - if($customTerm == 'NOT LIKE') $customWhere .= 'NOT LIKE'; + if($customTerm == 'NOT_LIKE') $customWhere .= 'NOT_LIKE'; else $customWhere .= '!='; $customWhere .= ' "'.$this->cleanInStr($customValue).'")'; } @@ -536,22 +536,22 @@ private function setCustomSqlFragment($customField, $customTerm, $customValue, $ elseif($customTerm == 'NOTNULL'){ $sqlFrag .= $cao.($cop?' '.$cop:'').' ('.$customField.' IS NOT NULL) '.($ccp?$ccp.' ':''); } - elseif($customTerm == 'NOT EQUALS' && $customValue){ + elseif($customTerm == 'NOT_EQUALS'){ if(!is_numeric($customValue)) $customValue = '"'.$customValue.'"'; $sqlFrag .= $cao.($cop?' '.$cop:'').' (('.$customField.' != '.$customValue.') OR ('.$customField.' IS NULL)) '.($ccp?$ccp.' ':''); } - elseif($customTerm == 'GREATER' && $customValue){ + elseif($customTerm == 'GREATER'){ if(!is_numeric($customValue)) $customValue = '"'.$customValue.'"'; $sqlFrag .= $cao.($cop?' '.$cop:'').' ('.$customField.' > '.$customValue.') '.($ccp?$ccp.' ':''); } - elseif($customTerm == 'LESS' && $customValue){ + elseif($customTerm == 'LESS'){ if(!is_numeric($customValue)) $customValue = '"'.$customValue.'"'; $sqlFrag .= $cao.($cop?' '.$cop:'').' ('.$customField.' < '.$customValue.') '.($ccp?$ccp.' ':''); } elseif($customTerm == 'LIKE' && $customValue){ $sqlFrag .= $cao.($cop?' '.$cop:'').' ('.$customField.' LIKE "%'.trim($customValue,'%').'%") '.($ccp?$ccp.' ':''); } - elseif($customTerm == 'NOT LIKE' && $customValue){ + elseif($customTerm == 'NOT_LIKE' && $customValue){ $sqlFrag .= $cao.($cop?' '.$cop:'').' (('.$customField.' NOT LIKE "%'.trim($customValue,'%').'%") OR ('.$customField.' IS NULL)) '.($ccp?$ccp.' ':''); } elseif($customTerm == 'STARTS' && $customValue){ diff --git a/classes/SpecUploadBase.php b/classes/SpecUploadBase.php index a19e5a8c10..d60340ddf1 100644 --- a/classes/SpecUploadBase.php +++ b/classes/SpecUploadBase.php @@ -554,10 +554,7 @@ protected function cleanUpload(){ if($this->collMetadataArr["managementtype"] == 'Snapshot' || $this->collMetadataArr["managementtype"] == 'Aggregate'){ //If collection is a snapshot, map upload to existing records. These records will be updated rather than appended $this->outputMsg('
  • Linking records (e.g. matching Primary Identifier)...
  • '); - $sql = 'UPDATE uploadspectemp u INNER JOIN omoccurrences o ON (u.dbpk = o.dbpk) AND (u.collid = o.collid) '. - 'SET u.occid = o.occid '. - 'WHERE (u.collid IN('.$this->collId.')) AND (u.occid IS NULL) AND (u.dbpk IS NOT NULL) AND (o.dbpk IS NOT NULL)'; - $this->conn->query($sql); + $this->updateOccidMatchingDbpk(); } $this->prepareAssociatedMedia(); @@ -575,31 +572,13 @@ protected function cleanUpload(){ if($this->collMetadataArr["managementtype"] == 'Live Data' || $this->uploadType == $this->SKELETAL){ if($this->matchCatalogNumber){ - //Match records based on Catalog Number - $sql = 'UPDATE uploadspectemp u INNER JOIN omoccurrences o ON (u.catalogNumber = o.catalogNumber) AND (u.collid = o.collid) '. - 'SET u.occid = o.occid '. - 'WHERE (u.collid IN('.$this->collId.')) AND (u.occid IS NULL) AND (u.catalogNumber IS NOT NULL) AND (o.catalogNumber IS NOT NULL) '; - if($this->collMetadataArr['colltype'] == 'General Observations' && $this->observerUid) $sql .= ' AND o.observeruid = '.$this->observerUid; - if(!$this->conn->query($sql)){ - $this->outputMsg('
  • Warning: unable to match on catalog number: '.$this->conn->error.'
  • '); + if(!$this->updateOccidMatchingCatalogNumber()){ + $this->outputMsg('
  • Warning: unable to match on catalog number: '.$this->errorStr.'
  • '); } } if($this->matchOtherCatalogNumbers){ - //Match records based on other Catalog Numbers fields - $sql2 = 'UPDATE uploadspectemp u INNER JOIN omoccurrences o ON u.collid = o.collid '. - 'SET u.occid = o.occid '. - 'WHERE (u.collid IN('.$this->collId.')) AND (u.occid IS NULL) AND (u.otherCatalogNumbers = o.otherCatalogNumbers) '; - if($this->collMetadataArr['colltype'] == 'General Observations' && $this->observerUid) $sql2 .= ' AND o.observeruid = '.$this->observerUid; - if(!$this->conn->query($sql2)){ - $this->outputMsg('
  • Warning: unable to match on otherCatalogNumbers: '.$this->conn->error.'
  • '); - } - $sql2b = 'UPDATE uploadspectemp u INNER JOIN omoccurrences o ON u.collid = o.collid '. - 'INNER JOIN omoccuridentifiers i ON o.occid = i.occid '. - 'SET u.occid = o.occid '. - 'WHERE (u.collid IN('.$this->collId.')) AND (u.occid IS NULL) AND (u.othercatalogNumbers = i.identifiervalue) '; - if($this->collMetadataArr['colltype'] == 'General Observations' && $this->observerUid) $sql2b .= ' AND o.observeruid = '.$this->observerUid; - if(!$this->conn->query($sql2b)){ - $this->outputMsg('
  • Warning: unable to match on omoccuridentifiers: '.$this->conn->error.'
  • '); + if(!$this->updateOccidMatchingOtherCatalogNumbers()){ + $this->outputMsg('
  • Warning: unable to match on otherCatalogNumbers/omoccuridentifiers: '.$this->errorStr.'
  • '); } } } @@ -860,7 +839,7 @@ protected function recordCleaningStage2(){ $this->outputMsg('
  • Populating source identifiers (dbpk) to relink specimens processed within portal...
  • '); $sql = 'UPDATE IGNORE uploadspectemp u INNER JOIN omoccurrences o ON (u.catalogNumber = o.catalogNumber) AND (u.collid = o.collid) '. 'SET u.occid = o.occid, o.dbpk = u.dbpk '. - 'WHERE (u.collid IN('.$this->collId.')) AND (u.occid IS NULL) AND (u.catalogNumber IS NOT NULL) AND (o.catalogNumber IS NOT NULL) AND (o.dbpk IS NULL) '; + 'WHERE (u.collid IN('.$this->collId.')) AND (u.occid IS NULL) AND (o.dbpk IS NULL) AND (u.catalogNumber IS NOT NULL) '; $this->conn->query($sql); } @@ -965,11 +944,8 @@ protected function transferOccurrences(){ $this->outputMsg('
  • FAILED! ERROR: '.$this->conn->error.'
  • '); //$this->outputMsg($sql); } - $sql = 'UPDATE uploadspectemp u INNER JOIN omoccurrences o ON u.dbpk = o.dbpk '. - 'SET u.occid = o.occid '. - 'WHERE o.collid = '.$this->collId.' AND u.collid = '.$this->collId.' AND u.occid IS NULL'; - if(!$this->conn->query($sql)){ - $this->outputMsg('
  • ERROR updating occid on recent Insert batch: '.$this->conn->error.'
  • '); + if(!$this->updateOccidMatchingDbpk()){ + $this->outputMsg('
  • ERROR updating occid on recent Insert batch: '.$this->errorStr.'
  • '); } $this->outputMsg('
  • '.$cnt.': '.$insertCnt.' inserted
  • '); $insertTarget -= $transactionInterval; @@ -978,20 +954,13 @@ protected function transferOccurrences(){ //Link all newly intersted records back to uploadspectemp in prep for loading determiantion history and associatedmedia $this->outputMsg('
  • Linking records in prep for loading extended data...
  • '); - //Update occid by matching dbpk - $sqlOcc1 = 'UPDATE uploadspectemp u INNER JOIN omoccurrences o ON (u.dbpk = o.dbpk) AND (u.collid = o.collid) '. - 'SET u.occid = o.occid '. - 'WHERE (u.occid IS NULL) AND (u.dbpk IS NOT NULL) AND (u.collid IN('.$this->collId.'))'; - if(!$this->conn->query($sqlOcc1)){ - $this->outputMsg('
  • ERROR updating occid after occurrence insert: '.$this->conn->error.'
  • '); + if(!$this->updateOccidMatchingDbpk()){ + $this->outputMsg('
  • ERROR updating occid after occurrence insert: '.$this->errorStr.'
  • '); } //Update occid by linking catalognumbers - $sqlOcc2 = 'UPDATE uploadspectemp u INNER JOIN omoccurrences o ON (u.catalogNumber = o.catalogNumber) AND (u.collid = o.collid) '. - 'SET u.occid = o.occid '. - 'WHERE (u.collid IN('.$this->collId.')) AND (u.occid IS NULL) AND (u.catalogNumber IS NOT NULL) AND (o.catalogNumber IS NOT NULL) '; - if(!$this->conn->query($sqlOcc2)){ - $this->outputMsg('
  • ERROR updating occid (2nd step) after occurrence insert: '.$this->conn->error.'
  • '); - } + //if(!$this->updateOccidMatchingCatalogNumber()){ + //$this->outputMsg('
  • ERROR updating occid (2nd step) after occurrence insert: '.$this->errorStr.'
  • '); + //} $this->transferExsiccati(); $this->transferGeneticLinks(); @@ -999,8 +968,8 @@ protected function transferOccurrences(){ $this->transferMaterialSampleData(); //Setup and add datasets and link datasets to current user - } + $this->setDeterminations(); } private function versionInternalEdits(){ @@ -1260,6 +1229,41 @@ private function transferMaterialSampleData(){ } } + private function setDeterminations(){ + if($this->collId){ + if($this->uploadType == $this->FILEUPLOAD || $this->uploadType == $this->SKELETAL){ + //Reset existing current determinations to match fields in the omoccurrences table (e.g. import data changes, will equal current determinations) + $sql = 'UPDATE uploadspectemp u INNER JOIN omoccurrences o ON u.occid = o.occid + INNER JOIN omoccurdeterminations d ON o.occid = d.occid + SET d.sciname = o.sciname, d.identifiedBy = o.identifiedBy, d.dateIdentified = o.dateIdentified, d.family = o.family, + d.scientificNameAuthorship = o.scientificNameAuthorship, d.tidInterpreted = o.tidInterpreted, d.identificationQualifier = o.identificationQualifier, + d.identificationReferences = o.identificationReferences, d.identificationRemarks = o.identificationRemarks, d.taxonRemarks = o.taxonRemarks + WHERE o.collid = ? AND d.isCurrent = 1'; + if($stmt = $this->conn->prepare($sql)){ + $stmt->bind_param('i', $this->collId); + $stmt->execute(); + if($stmt->error) $this->outputMsg('
  • ERROR resetting determinations: '.$stmt->error.'
  • '); + $stmt->close(); + } + + //Add new determinations to omoccurdetermination table + $sql = 'INSERT INTO omoccurdeterminations(occid, sciname, identifiedBy, dateIdentified, family, scientificNameAuthorship, tidInterpreted, identificationQualifier, + identificationReferences, identificationRemarks, taxonRemarks, isCurrent) + SELECT o.occid, IFNULL(o.sciname, "undetermined") AS sciname, IFNULL(o.identifiedBy, "unknown") AS identifiedBy, IFNULL(o.dateIdentified, "s.d.") AS dateIdentified, o.family, o.scientificNameAuthorship, o.tidInterpreted, o.identificationQualifier, + o.identificationReferences, o.identificationRemarks, o.taxonRemarks, 1 AS isCurrent + FROM uploadspectemp u INNER JOIN omoccurrences o ON u.occid = o.occid + LEFT JOIN omoccurdeterminations d ON o.occid = d.occid + WHERE o.collid = ? AND d.occid IS NULL;'; + if($stmt = $this->conn->prepare($sql)){ + $stmt->bind_param('i', $this->collId); + $stmt->execute(); + if($stmt->error) $this->outputMsg('
  • ERROR adding determinations: '.$stmt->error.'
  • '); + $stmt->close(); + } + } + } + } + protected function transferIdentificationHistory(){ $sql = 'SELECT count(*) AS cnt FROM uploaddetermtemp WHERE (collid IN('.$this->collId.'))'; $rs = $this->conn->query($sql); @@ -1960,6 +1964,68 @@ public function addFilterCondition($columnName, $condition, $value){ } } + //Occurrence PK coordination functions + private function updateOccidMatchingDbpk(){ + $status = false; + $sql = 'UPDATE uploadspectemp u INNER JOIN omoccurrences o ON u.dbpk = o.dbpk AND u.collid = o.collid + SET u.occid = o.occid + WHERE u.occid IS NULL AND u.dbpk IS NOT NULL AND o.collid = ?'; + if($stmt = $this->conn->prepare($sql)){ + $stmt->bind_param('i', $this->collId); + $stmt->execute(); + if(!$stmt->error) $status = true; + else $this->errorStr = $stmt->error; + $stmt->close(); + } + return $status; + } + + private function updateOccidMatchingCatalogNumber(){ + $status = false; + $sql = 'UPDATE uploadspectemp u INNER JOIN omoccurrences o ON u.catalogNumber = o.catalogNumber AND u.collid = o.collid + SET u.occid = o.occid + WHERE u.occid IS NULL AND u.catalogNumber IS NOT NULL AND o.collid = ? '; + if($this->collMetadataArr['colltype'] == 'General Observations' && $this->observerUid) $sql .= ' AND o.observeruid = '.$this->observerUid; + if($stmt = $this->conn->prepare($sql)){ + $stmt->bind_param('i', $this->collId); + $stmt->execute(); + if(!$stmt->error) $status = true; + else $this->errorStr = $stmt->error; + $stmt->close(); + } + return $status; + } + + private function updateOccidMatchingOtherCatalogNumbers(){ + $status = false; + $sql = 'UPDATE uploadspectemp u INNER JOIN omoccurrences o ON u.otherCatalogNumbers = o.otherCatalogNumbers AND u.collid = o.collid + SET u.occid = o.occid + WHERE u.occid IS NULL AND u.otherCatalogNumbers IS NOT NULL AND o.collid = ? '; + if($this->collMetadataArr['colltype'] == 'General Observations' && $this->observerUid) $sql .= 'AND o.observeruid = '.$this->observerUid; + if($stmt = $this->conn->prepare($sql)){ + $stmt->bind_param('i', $this->collId); + $stmt->execute(); + if(!$stmt->error) $status = true; + else $this->errorStr = $stmt->error; + $stmt->close(); + } + + $sql2 = 'UPDATE uploadspectemp u INNER JOIN omoccurrences o ON u.collid = o.collid + INNER JOIN omoccuridentifiers i ON (o.occid = i.occid) AND (u.othercatalogNumbers = i.identifiervalue) + SET u.occid = o.occid + WHERE u.occid IS NULL AND o.collid = ? '; + if($this->collMetadataArr['colltype'] == 'General Observations' && $this->observerUid) $sql2 .= 'AND o.observeruid = '.$this->observerUid; + if($stmt2 = $this->conn->prepare($sql2)){ + $stmt2->bind_param('i', $this->collId); + $stmt2->execute(); + if(!$stmt2->error) $status = true; + else $this->errorStr = $stmt2->error; + $stmt2->close(); + } + return $status; + } + + //Data functions private function getPaleoTerms(){ $paleoTermArr = array_merge($this->getPaleoDwcTerms(),$this->getPaleoSymbTerms()); sort($paleoTermArr); diff --git a/classes/TaxonomyEditorManager.php b/classes/TaxonomyEditorManager.php index 46ac3fe3c2..65856188e9 100644 --- a/classes/TaxonomyEditorManager.php +++ b/classes/TaxonomyEditorManager.php @@ -536,7 +536,7 @@ public function loadNewName($dataArr){ 'source, notes, securitystatus, modifiedUid, modifiedTimeStamp) '. 'VALUES ("'.$this->cleanInStr($dataArr['sciname']).'","'. ($dataArr['author']?$this->cleanInStr($dataArr['author']):'').'",'. - ($dataArr['rankid']?$dataArr['rankid']:'NULL').','. + (isset($dataArr['rankid'])?$dataArr['rankid']:0).','. ($dataArr['unitind1']?'"'.$this->cleanInStr($dataArr['unitind1']).'"':'NULL').',"'. $this->cleanInStr($dataArr['unitname1']).'",'. ($dataArr['unitind2']?'"'.$this->cleanInStr($dataArr['unitind2']).'"':'NULL').','. @@ -547,7 +547,6 @@ public function loadNewName($dataArr){ ($dataArr['notes']?'"'.$this->cleanInStr($dataArr['notes']).'"':'NULL').','. $this->cleanInStr($dataArr['securitystatus']).','. $GLOBALS['SYMB_UID'].',"'.date('Y-m-d H:i:s').'")'; - //echo "sqlTaxa: ".$sqlTaxa; if($this->conn->query($sqlTaxa)){ $tid = $this->conn->insert_id; //Load accepteance status into taxstatus table diff --git a/classes/TaxonomyHarvester.php b/classes/TaxonomyHarvester.php index 49ab3eeb5f..4cf66c7bd6 100644 --- a/classes/TaxonomyHarvester.php +++ b/classes/TaxonomyHarvester.php @@ -1162,7 +1162,7 @@ private function loadNewTaxon($taxonArr, $tidAccepted = 0){ (isset($taxonArr['unitind3']) && $taxonArr['unitind3']?'"'.$this->cleanInStr($taxonArr['unitind3']).'"':'NULL').','. (isset($taxonArr['unitname3']) && $taxonArr['unitname3']?'"'.$this->cleanInStr($taxonArr['unitname3']).'"':'NULL').',"'. (isset($taxonArr['author']) && $taxonArr['author']?$this->cleanInStr($taxonArr['author']):'').'",'. - (isset($taxonArr['rankid']) && is_numeric($taxonArr['rankid'])?$taxonArr['rankid']:'NULL').','. + (isset($taxonArr['rankid']) && is_numeric($taxonArr['rankid'])?$taxonArr['rankid']:0).','. (isset($taxonArr['source']) && $taxonArr['source']?'"'.$this->cleanInStr($taxonArr['source']).'"':'NULL').','. $GLOBALS['SYMB_UID'].')'; if($this->conn->query($sqlInsert)){ diff --git a/collections/editor/includes/queryform.php b/collections/editor/includes/queryform.php index 2f0245cf71..ace999c5ac 100644 --- a/collections/editor/includes/queryform.php +++ b/collections/editor/includes/queryform.php @@ -20,57 +20,53 @@ $qExsiccatiId = (array_key_exists('exsid',$qryArr)?$qryArr['exsid']:''); $qImgOnly = (array_key_exists('io',$qryArr)?$qryArr['io']:0); $qWithoutImg = (array_key_exists('woi',$qryArr)?$qryArr['woi']:0); -$qCustomOpenParen1 = (array_key_exists('cop1',$qryArr)?$qryArr['cop1']:''); -$qCustomField1 = (array_key_exists('cf1',$qryArr)?$qryArr['cf1']:''); -$qCustomType1 = (array_key_exists('ct1',$qryArr)?$qryArr['ct1']:''); -$qCustomValue1 = (array_key_exists('cv1',$qryArr)?htmlentities($qryArr['cv1'], ENT_COMPAT, $CHARSET):''); -$qCustomCloseParen1 = (array_key_exists('ccp1',$qryArr)?$qryArr['ccp1']:''); -$qCustomAndOr2 = (array_key_exists('cao2',$qryArr)?$qryArr['cao2']:''); -$qCustomOpenParen2 = (array_key_exists('cop2',$qryArr)?$qryArr['cop2']:''); -$qCustomField2 = (array_key_exists('cf2',$qryArr)?$qryArr['cf2']:''); -$qCustomType2 = (array_key_exists('ct2',$qryArr)?$qryArr['ct2']:''); -$qCustomValue2 = (array_key_exists('cv2',$qryArr)?htmlentities($qryArr['cv2'], ENT_COMPAT, $CHARSET):''); -$qCustomCloseParen2 = (array_key_exists('ccp2',$qryArr)?$qryArr['ccp2']:''); -$qCustomAndOr3 = (array_key_exists('cao3',$qryArr)?$qryArr['cao3']:''); -$qCustomOpenParen3 = (array_key_exists('cop3',$qryArr)?$qryArr['cop3']:''); -$qCustomField3 = (array_key_exists('cf3',$qryArr)?$qryArr['cf3']:''); -$qCustomType3 = (array_key_exists('ct3',$qryArr)?$qryArr['ct3']:''); -$qCustomValue3 = (array_key_exists('cv3',$qryArr)?htmlentities($qryArr['cv3'], ENT_COMPAT, $CHARSET):''); -$qCustomCloseParen3 = (array_key_exists('ccp3',$qryArr)?$qryArr['ccp3']:''); -$qCustomAndOr4 = (array_key_exists('cao4',$qryArr)?$qryArr['cao4']:''); -$qCustomOpenParen4 = (array_key_exists('cop4',$qryArr)?$qryArr['cop4']:''); -$qCustomField4 = (array_key_exists('cf4',$qryArr)?$qryArr['cf4']:''); -$qCustomType4 = (array_key_exists('ct4',$qryArr)?$qryArr['ct4']:''); -$qCustomValue4 = (array_key_exists('cv4',$qryArr)?htmlentities($qryArr['cv4']):''); -$qCustomCloseParen4 = (array_key_exists('ccp4',$qryArr)?$qryArr['ccp4']:''); -$qCustomAndOr5 = (array_key_exists('cao5',$qryArr)?$qryArr['cao5']:''); -$qCustomOpenParen5 = (array_key_exists('cop5',$qryArr)?$qryArr['cop5']:''); -$qCustomField5 = (array_key_exists('cf5',$qryArr)?$qryArr['cf5']:''); -$qCustomType5 = (array_key_exists('ct5',$qryArr)?$qryArr['ct5']:''); -$qCustomValue5 = (array_key_exists('cv5',$qryArr)?htmlentities($qryArr['cv5']):''); -$qCustomCloseParen5 = (array_key_exists('ccp5',$qryArr)?$qryArr['ccp5']:''); -$qCustomAndOr6 = (array_key_exists('cao6',$qryArr)?$qryArr['cao6']:''); -$qCustomOpenParen6 = (array_key_exists('cop6',$qryArr)?$qryArr['cop6']:''); -$qCustomField6 = (array_key_exists('cf6',$qryArr)?$qryArr['cf6']:''); -$qCustomType6 = (array_key_exists('ct6',$qryArr)?$qryArr['ct6']:''); -$qCustomValue6 = (array_key_exists('cv6',$qryArr)?htmlentities($qryArr['cv6']):''); -$qCustomCloseParen6 = (array_key_exists('ccp6',$qryArr)?$qryArr['ccp6']:''); -$qCustomAndOr7 = (array_key_exists('cao7',$qryArr)?$qryArr['cao7']:''); -$qCustomOpenParen7 = (array_key_exists('cop7',$qryArr)?$qryArr['cop7']:''); -$qCustomField7 = (array_key_exists('cf7',$qryArr)?$qryArr['cf7']:''); -$qCustomType7 = (array_key_exists('ct7',$qryArr)?$qryArr['ct7']:''); -$qCustomValue7 = (array_key_exists('cv7',$qryArr)?htmlentities($qryArr['cv7']):''); -$qCustomCloseParen7 = (array_key_exists('ccp7',$qryArr)?$qryArr['ccp7']:''); -$qCustomAndOr8 = (array_key_exists('cao8',$qryArr)?$qryArr['cao8']:''); -$qCustomOpenParen8 = (array_key_exists('cop8',$qryArr)?$qryArr['cop8']:''); -$qCustomField8 = (array_key_exists('cf8',$qryArr)?$qryArr['cf8']:''); -$qCustomType8 = (array_key_exists('ct8',$qryArr)?$qryArr['ct8']:''); -$qCustomValue8 = (array_key_exists('cv8',$qryArr)?htmlentities($qryArr['cv8']):''); -$qCustomCloseParen8 = (array_key_exists('ccp8',$qryArr)?$qryArr['ccp8']:''); $qOcrFrag = (array_key_exists('ocr',$qryArr)?htmlentities($qryArr['ocr'], ENT_COMPAT, $CHARSET):''); $qOrderBy = (array_key_exists('orderby',$qryArr)?$qryArr['orderby']:''); $qOrderByDir = (array_key_exists('orderbydir',$qryArr)?$qryArr['orderbydir']:''); +$customFieldArr = array(); +if($crowdSourceMode){ + $customFieldArr = array('family'=>$LANG['FAMILY'],'sciname'=>$LANG['SCI_NAME'],'othercatalognumbers'=>$LANG['OTHER_CAT_NUMS'], + 'country'=>$LANG['COUNTRY'],'stateProvince'=>$LANG['STATE_PROVINCE'],'county'=>$LANG['COUNTY'],'municipality'=>$LANG['MUNICIPALITY'], + 'recordedby'=>$LANG['COLLECTOR'],'recordnumber'=>$LANG['COL_NUMBER'],'eventdate'=>$LANG['COL_DATE']); +} +else{ + $customFieldArr = array('associatedCollectors'=>$LANG['ASSOC_COLLECTORS'],'associatedOccurrences'=>$LANG['ASSOC_OCCS'], + 'associatedTaxa'=>$LANG['ASSOC_TAXA'],'attributes'=>$LANG['ATTRIBUTES'],'scientificNameAuthorship'=>$LANG['AUTHOR'], + 'basisOfRecord'=>$LANG['BASIS_OF_RECORD'],'behavior'=>$LANG['BEHAVIOR'],'catalogNumber'=>$LANG['CAT_NUM'],'collectionCode'=>$LANG['COL_CODE'],'recordNumber'=>$LANG['COL_NUMBER'], + 'recordedBy'=>$LANG['COL_OBS'],'coordinateUncertaintyInMeters'=>$LANG['COORD_UNCERT_M'],'country'=>$LANG['COUNTRY'], + 'county'=>$LANG['COUNTY'],'cultivationStatus'=>$LANG['CULT_STATUS'],'dataGeneralizations'=>$LANG['DATA_GEN'],'eventDate'=>$LANG['DATE'], + 'dateEntered'=>$LANG['DATE_ENTERED'],'dateLastModified'=>$LANG['DATE_LAST_MODIFIED'],'dbpk'=>$LANG['DBPK'],'decimalLatitude'=>$LANG['DEC_LAT'], + 'decimalLongitude'=>$LANG['DEC_LONG'],'maximumDepthInMeters'=>$LANG['DEPTH_MAX'],'minimumDepthInMeters'=>$LANG['DEPTH_MIN'], + 'verbatimAttributes'=>$LANG['DESCRIPTION'],'disposition'=>$LANG['DISPOSITION'],'dynamicProperties'=>$LANG['DYNAMIC_PROPS'], + 'maximumElevationInMeters'=>$LANG['ELEV_MAX_M'],'minimumElevationInMeters'=>$LANG['ELEV_MIN_M'], + 'establishmentMeans'=>$LANG['ESTAB_MEANS'],'family'=>$LANG['FAMILY'],'fieldNotes'=>$LANG['FIELD_NOTES'],'fieldnumber'=>$LANG['FIELD_NUMBER'], + 'geodeticDatum'=>$LANG['GEO_DATUM'],'georeferenceProtocol'=>$LANG['GEO_PROTOCOL'], + 'georeferenceRemarks'=>$LANG['GEO_REMARKS'],'georeferenceSources'=>$LANG['GEO_SOURCES'], + 'georeferenceVerificationStatus'=>$LANG['GEO_VERIF_STATUS'],'georeferencedBy'=>$LANG['GEO_BY'],'habitat'=>$LANG['HABITAT'], + 'identificationQualifier'=>$LANG['ID_QUALIFIER'],'identificationReferences'=>$LANG['ID_REFERENCES'], + 'identificationRemarks'=>$LANG['ID_REMARKS'],'identifiedBy'=>$LANG['IDED_BY'],'individualCount'=>$LANG['IND_COUNT'], + 'informationWithheld'=>$LANG['INFO_WITHHELD'],'institutionCode'=>$LANG['INST_CODE'],'labelProject'=>$LANG['LAB_PROJECT'], + 'language'=>$LANG['LANGUAGE'],'lifeStage'=>$LANG['LIFE_STAGE'],'locationid'=>$LANG['LOCATION_ID'],'locality'=>$LANG['LOCALITY'], + 'localitySecurity'=>$LANG['LOC_SEC'],'localitySecurityReason'=>$LANG['LOC_SEC_REASON'],'locationRemarks'=>$LANG['LOC_REMARKS'], + 'username'=>$LANG['MODIFIED_BY'],'municipality'=>$LANG['MUNICIPALITY'],'occurrenceRemarks'=>$LANG['NOTES_REMARKS'],'ocrFragment'=>$LANG['OCR_FRAGMENT'], + 'otherCatalogNumbers'=>$LANG['OTHER_CAT_NUMS'],'ownerInstitutionCode'=>$LANG['OWNER_CODE'],'preparations'=>$LANG['PREPARATIONS'], + 'reproductiveCondition'=>$LANG['REP_COND'],'samplingEffort'=>$LANG['SAMP_EFFORT'],'samplingProtocol'=>$LANG['SAMP_PROTOCOL'], + 'sciname'=>$LANG['SCI_NAME'],'sex'=>$LANG['SEX'],'stateProvince'=>$LANG['STATE_PROVINCE'], + 'substrate'=>$LANG['SUBSTRATE'],'taxonRemarks'=>$LANG['TAXON_REMARKS'],'typeStatus'=>$LANG['TYPE_STATUS'],'verbatimCoordinates'=>$LANG['VERBAT_COORDS'], + 'verbatimEventDate'=>$LANG['VERBATIM_DATE'],'verbatimDepth'=>$LANG['VERBATIM_DEPTH'],'verbatimElevation'=>$LANG['VERBATIM_ELE']); +} +$customTermArr = array('EQUALS', 'NOT_EQUALS', 'STARTS', 'LIKE', 'NOT_LIKE', 'GREATER', 'LESS', 'NULL', 'NOTNULL'); +$customArr = array(); +for($x=1; $x<9; $x++){ + if(array_key_exists('cao'.$x, $qryArr) && ($qryArr['cao'.$x] == 'AND' || $qryArr['cao'.$x] == 'OR')) $customArr[$x]['andor'] = $qryArr['cao'.$x]; + if(array_key_exists('cop'.$x, $qryArr) && preg_match('/^\({1,3}$/', $qryArr['cop'.$x])) $customArr[$x]['openparen'] = $qryArr['cop'.$x]; + if(array_key_exists('cf'.$x, $qryArr) && array_key_exists($qryArr['cf'.$x], $customFieldArr)) $customArr[$x]['field'] = $qryArr['cf'.$x]; + if(array_key_exists('ct'.$x, $qryArr) && in_array($qryArr['ct'.$x], $customTermArr)) $customArr[$x]['term'] = $qryArr['ct'.$x]; + if(array_key_exists('cv'.$x, $qryArr)) $customArr[$x]['value'] = htmlspecialchars($qryArr['cv'.$x], HTML_SPECIAL_CHARS_FLAGS); + if(array_key_exists('ccp'.$x, $qryArr) && preg_match('/^\){1,3}$/', $qryArr['ccp'.$x])) $customArr[$x]['closeparen'] = $qryArr['ccp'.$x]; +} + //Set processing status $processingStatusArr = array(); if(isset($PROCESSINGSTATUS) && $PROCESSINGSTATUS){ @@ -196,371 +192,71 @@ } } } - $advFieldArr = array(); - if($crowdSourceMode){ - $advFieldArr = array('family'=>$LANG['FAMILY'],'sciname'=>$LANG['SCI_NAME'],'othercatalognumbers'=>$LANG['OTHER_CAT_NUMS'], - 'country'=>$LANG['COUNTRY'],'stateProvince'=>$LANG['STATE_PROVINCE'],'county'=>$LANG['COUNTY'],'municipality'=>$LANG['MUNICIPALITY'], - 'recordedby'=>$LANG['COLLECTOR'],'recordnumber'=>$LANG['COL_NUMBER'],'eventdate'=>$LANG['COL_DATE']); - } - else{ - $advFieldArr = array('associatedCollectors'=>$LANG['ASSOC_COLLECTORS'],'associatedOccurrences'=>$LANG['ASSOC_OCCS'], - 'associatedTaxa'=>$LANG['ASSOC_TAXA'],'attributes'=>$LANG['ATTRIBUTES'],'scientificNameAuthorship'=>$LANG['AUTHOR'], - 'basisOfRecord'=>$LANG['BASIS_OF_RECORD'],'behavior'=>$LANG['BEHAVIOR'],'catalogNumber'=>$LANG['CAT_NUM'],'collectionCode'=>$LANG['COL_CODE'],'recordNumber'=>$LANG['COL_NUMBER'], - 'recordedBy'=>$LANG['COL_OBS'],'coordinateUncertaintyInMeters'=>$LANG['COORD_UNCERT_M'],'country'=>$LANG['COUNTRY'], - 'county'=>$LANG['COUNTY'],'cultivationStatus'=>$LANG['CULT_STATUS'],'dataGeneralizations'=>$LANG['DATA_GEN'],'eventDate'=>$LANG['DATE'], - 'dateEntered'=>$LANG['DATE_ENTERED'],'dateLastModified'=>$LANG['DATE_LAST_MODIFIED'],'dbpk'=>$LANG['DBPK'],'decimalLatitude'=>$LANG['DEC_LAT'], - 'decimalLongitude'=>$LANG['DEC_LONG'],'maximumDepthInMeters'=>$LANG['DEPTH_MAX'],'minimumDepthInMeters'=>$LANG['DEPTH_MIN'], - 'verbatimAttributes'=>$LANG['DESCRIPTION'],'disposition'=>$LANG['DISPOSITION'],'dynamicProperties'=>$LANG['DYNAMIC_PROPS'], - 'maximumElevationInMeters'=>$LANG['ELEV_MAX_M'],'minimumElevationInMeters'=>$LANG['ELEV_MIN_M'], - 'establishmentMeans'=>$LANG['ESTAB_MEANS'],'family'=>$LANG['FAMILY'],'fieldNotes'=>$LANG['FIELD_NOTES'],'fieldnumber'=>$LANG['FIELD_NUMBER'], - 'geodeticDatum'=>$LANG['GEO_DATUM'],'georeferenceProtocol'=>$LANG['GEO_PROTOCOL'], - 'georeferenceRemarks'=>$LANG['GEO_REMARKS'],'georeferenceSources'=>$LANG['GEO_SOURCES'], - 'georeferenceVerificationStatus'=>$LANG['GEO_VERIF_STATUS'],'georeferencedBy'=>$LANG['GEO_BY'],'habitat'=>$LANG['HABITAT'], - 'identificationQualifier'=>$LANG['ID_QUALIFIER'],'identificationReferences'=>$LANG['ID_REFERENCES'], - 'identificationRemarks'=>$LANG['ID_REMARKS'],'identifiedBy'=>$LANG['IDED_BY'],'individualCount'=>$LANG['IND_COUNT'], - 'informationWithheld'=>$LANG['INFO_WITHHELD'],'institutionCode'=>$LANG['INST_CODE'],'labelProject'=>$LANG['LAB_PROJECT'], - 'language'=>$LANG['LANGUAGE'],'lifeStage'=>$LANG['LIFE_STAGE'],'locationid'=>$LANG['LOCATION_ID'],'locality'=>$LANG['LOCALITY'], - 'localitySecurity'=>$LANG['LOC_SEC'],'localitySecurityReason'=>$LANG['LOC_SEC_REASON'],'locationRemarks'=>$LANG['LOC_REMARKS'], - 'username'=>$LANG['MODIFIED_BY'],'municipality'=>$LANG['MUNICIPALITY'],'occurrenceRemarks'=>$LANG['NOTES_REMARKS'],'ocrFragment'=>$LANG['OCR_FRAGMENT'], - 'otherCatalogNumbers'=>$LANG['OTHER_CAT_NUMS'],'ownerInstitutionCode'=>$LANG['OWNER_CODE'],'preparations'=>$LANG['PREPARATIONS'], - 'reproductiveCondition'=>$LANG['REP_COND'],'samplingEffort'=>$LANG['SAMP_EFFORT'],'samplingProtocol'=>$LANG['SAMP_PROTOCOL'], - 'sciname'=>$LANG['SCI_NAME'],'sex'=>$LANG['SEX'],'stateProvince'=>$LANG['STATE_PROVINCE'], - 'substrate'=>$LANG['SUBSTRATE'],'taxonRemarks'=>$LANG['TAXON_REMARKS'],'typeStatus'=>$LANG['TYPE_STATUS'],'verbatimCoordinates'=>$LANG['VERBAT_COORDS'], - 'verbatimEventDate'=>$LANG['VERBATIM_DATE'],'verbatimDepth'=>$LANG['VERBATIM_DEPTH'],'verbatimElevation'=>$LANG['VERBATIM_ELE']); - } - // sort($advFieldArr); - ?> -
    - : - - - - - - - - -
    -
    - : - - - - - - - - - -
    -
    - : - - - - - - - - - -
    -
    - Custom Field 4: - - - - - - - - - -
    -
    - Custom Field 5: - - - - - - - - - -
    -
    - Custom Field 6: - - - - - - - - - -
    -
    - Custom Field 7: - - - - - - - - - -
    -
    - Custom Field 8: - - - + + + + - - - - -
    + + + + + + + + +
    +
    1) document.getElementById("customdiv"+x).style.display = "none"; + } f.q_imgonly.checked = false; f.q_withoutimg.checked = false; f.orderby.value = ""; f.orderbydir.value = "ASC"; - - // Hide all the custom field divs except the first on reset - document.getElementById('customdiv2').style.display = "none"; - document.getElementById('customdiv3').style.display = "none"; - document.getElementById('customdiv4').style.display = "none"; - document.getElementById('customdiv5').style.display = "none"; - document.getElementById('customdiv6').style.display = "none"; - document.getElementById('customdiv7').style.display = "none"; - document.getElementById('customdiv8').style.display = "none"; } \ No newline at end of file diff --git a/collections/editor/occurrenceeditor.php b/collections/editor/occurrenceeditor.php index 072638b514..f66bc5432a 100644 --- a/collections/editor/occurrenceeditor.php +++ b/collections/editor/occurrenceeditor.php @@ -519,7 +519,7 @@ function requestImage(){ - +