Skip to content

Commit

Permalink
Merge pull request #9 from BioKIC/master
Browse files Browse the repository at this point in the history
Merge BioKIC/Symbiota developments
  • Loading branch information
egbot authored May 31, 2023
2 parents 9b0d12d + de15df7 commit c3e49aa
Show file tree
Hide file tree
Showing 17 changed files with 472 additions and 418 deletions.
2 changes: 0 additions & 2 deletions classes/ChecklistVoucherReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,6 @@ private function getMissingTaxaBaseSql($sqlFrag){
public function getMissingProblemTaxa(){
$retArr = Array();
if($sqlFrag = $this->getSqlFrag()){
//Make sure tidinterpreted are valid
//$this->conn->query('UPDATE omoccurrences o INNER JOIN taxa t ON o.sciname = t.sciname SET o.tidinterpreted = t.tid WHERE o.tidinterpreted IS NULL');
//Grab records
$sql = 'SELECT DISTINCT o.occid, c.institutioncode, c.collectioncode, o.catalognumber, o.sciname, o.recordedby, o.recordnumber, o.eventdate, '.
'CONCAT_WS("; ",o.country, o.stateprovince, o.county, o.locality) as locality '.
Expand Down
6 changes: 4 additions & 2 deletions classes/ImageLocalProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -1557,7 +1557,8 @@ private function updateCollectionStats(){

$this->logOrEcho('Cleaning house...');
$collString = implode(',',$this->collProcessedArr);
if(!$occurMain->generalOccurrenceCleaning($collString)){
$occurMain->setCollidStr($collString);
if(!$occurMain->generalOccurrenceCleaning()){
$errorArr = $occurMain->getErrorArr();
foreach($errorArr as $errorStr){
$this->logOrEcho($errorStr,1);
Expand All @@ -1570,7 +1571,8 @@ private function updateCollectionStats(){

$this->logOrEcho('Updating statistics...');
foreach($this->collProcessedArr as $collid){
if(!$occurMain->updateCollectionStats($collid)){
$occurMain->setCollidStr($collid);
if(!$occurMain->updateCollectionStatsBasic()){
$errorArr = $occurMain->getErrorArr();
foreach($errorArr as $errorStr){
$this->logOrEcho($errorStr,1);
Expand Down
9 changes: 6 additions & 3 deletions classes/ImageProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,8 @@ public function loadFileData($postArr){
$occurMain = new OccurrenceMaintenance($this->conn);

$this->logOrEcho('Updating statistics...');
if(!$occurMain->updateCollectionStats($this->collid)){
$occurMain->setCollidStr($this->collid);
if(!$occurMain->updateCollectionStatsBasic()){
$errorArr = $occurMain->getErrorArr();
foreach($errorArr as $errorStr){
$this->logOrEcho($errorStr,1);
Expand Down Expand Up @@ -545,7 +546,8 @@ private function cleanHouse($collList){
/*
$this->logOrEcho('General cleaning...',2);
$collString = implode(',',$collList);
if(!$occurMain->generalOccurrenceCleaning($collString)){
$occurMain->setCollidStr($collString);
if(!$occurMain->generalOccurrenceCleaning()){
$errorArr = $occurMain->getErrorArr();
foreach($errorArr as $errorStr){
$this->logOrEcho($errorStr,1);
Expand All @@ -559,7 +561,8 @@ private function cleanHouse($collList){
if($collList){
$this->logOrEcho('Updating collection statistics...',2);
foreach($collList as $collid){
if(!$occurMain->updateCollectionStats($collid)){
$occurMain->setCollidStr($collid);
if(!$occurMain->updateCollectionStatsBasic()){
$errorArr = $occurMain->getErrorArr();
foreach($errorArr as $errorStr){
$this->logOrEcho($errorStr,1);
Expand Down
9 changes: 6 additions & 3 deletions classes/OccurrenceCollectionProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -507,20 +507,22 @@ public function getBasicStats(){

public function updateStatistics($verbose = false){
$occurMaintenance = new OccurrenceMaintenance();
$occurMaintenance->setCollidStr($this->collid);
if($verbose){
echo '<ul>';
$occurMaintenance->setVerbose(true);
echo '<li>General cleaning in preparation for collecting stats...</li>';
flush();
ob_flush();
}
$occurMaintenance->generalOccurrenceCleaning($this->collid);
$occurMaintenance->generalOccurrenceCleaning();
$occurMaintenance->batchUpdateGeoreferenceIndex();
if($verbose){
echo '<li>Updating statistics...</li>';
flush();
ob_flush();
}
$occurMaintenance->updateCollectionStats($this->collid, true);
$occurMaintenance->updateCollectionStatsFull();
if($verbose){
echo '<li>Finished updating collection statistics</li>';
flush();
Expand Down Expand Up @@ -602,7 +604,8 @@ public function batchUpdateStatistics($collId){
echo '<li style="margin-left:15px;">Cleaning statistics for: '.$r->collectionname.'</li>';
flush();
ob_flush();
$occurMaintenance->updateCollectionStats($r->collid, true);
$occurMaintenance->setCollidStr($r->collid);
$occurMaintenance->updateCollectionStatsFull();
}
$rs->free();
echo '<li>Statistics update complete!</li>';
Expand Down
Loading

0 comments on commit c3e49aa

Please sign in to comment.