Skip to content

Commit

Permalink
Merge pull request #6 from BioKIC/master
Browse files Browse the repository at this point in the history
Merge BioKIC hot fixes
  • Loading branch information
egbot committed May 15, 2023
2 parents ae88346 + f690ba7 commit 1b8bb41
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion classes/ChecklistVoucherAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ public function getVoucherProjects(){
}
$rs->free();
}
if($retArr){
if($retArr && $this->clid){
//Tag collection most likely to be target
$sql = 'SELECT o.collid, COUNT(v.occid) as cnt
FROM fmvouchers v INNER JOIN omoccurrences o ON v.occid = o.occid
Expand Down
17 changes: 8 additions & 9 deletions classes/SpecUploadBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -573,9 +573,6 @@ protected function cleanUpload(){
}
}

//Prefrom general cleaning and parsing tasks
$this->recordCleaningStage1();

if($this->collMetadataArr["managementtype"] == 'Live Data' || $this->uploadType == $this->SKELETAL){
if($this->matchCatalogNumber){
//Match records based on Catalog Number
Expand Down Expand Up @@ -614,6 +611,9 @@ protected function cleanUpload(){
}
}

//Prefrom general cleaning and parsing tasks
$this->recordCleaningStage1();

$this->cleanImages();
//Reset $treansferCnt so that count is accurate since some records may have been deleted due to data integrety issues
$this->setTransferCount();
Expand Down Expand Up @@ -739,6 +739,11 @@ private function recordCleaningStage1(){
WHERE s.collid IN('.$this->collId.') AND d.collid IN('.$this->collId.') AND d.isCurrent = 1 AND s.sciname IS NULL AND s.identifiedBy IS NULL AND s.dateIdentified IS NULL ';
$this->conn->query($sql);

$this->outputMsg('<li style="margin-left:10px;">Setting basisOfRecord for new records, if not designated within import file...</li>');
$borValue = 'PreservedSpecimen';
if(strpos($this->collMetadataArr['colltype'], 'Observations') !== false) $borValue = 'HumanObservation';
$sql = 'UPDATE uploadspectemp SET basisOfRecord = "'.$borValue.'" WHERE basisOfRecord IS NULL AND occid IS NULL';
$this->conn->query($sql);
}

public function getTransferReport(){
Expand Down Expand Up @@ -842,12 +847,6 @@ public function finalTransfer(){
protected function recordCleaningStage2(){
$this->outputMsg('<li>Starting Stage 2 cleaning</li>');

//Make sure default value, based on management type, is set for basisOfRecord
$borValue = 'HumanObservation';
if($this->collMetadataArr['colltype'] == 'Preserved Specimens') $borValue = 'HumanObservation';
$sql = 'UPDATE uploadspectemp SET basisOfRecord = "'.$borValue.'" WHERE basisOfRecord IS NULL AND occid IS NULL';
$this->conn->query($sql);

if($this->uploadType == $this->NFNUPLOAD){
//Remove specimens without links back to source
$sql = 'DELETE FROM uploadspectemp WHERE (occid IS NULL) AND (collid IN('.$this->collId.'))';
Expand Down
2 changes: 1 addition & 1 deletion config/symbbase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
header('X-Frame-Options: DENY');
header('Cache-control: private'); // IE 6 FIX
date_default_timezone_set('America/Phoenix');
$CODE_VERSION = '3.0.3';
$CODE_VERSION = '3.0.4';

if(!isset($CLIENT_ROOT) && isset($clientRoot)) $CLIENT_ROOT = $clientRoot;
if(substr($CLIENT_ROOT,-1) == '/') $CLIENT_ROOT = substr($CLIENT_ROOT,0,strlen($CLIENT_ROOT)-1);
Expand Down

0 comments on commit 1b8bb41

Please sign in to comment.