예제 #1
0
                echo '</a>';
            }
            echo ': ' . $retArr['cnt'] . ' images';
            echo '</li>';
        }
        echo '</ul>';
    } else {
        echo '<div style="font-weight:bold;">All images have properly mapped thumbnails. Nothing needs to be done.</div>';
    }
    ?>
					</div>
					<div style="margin:15px;">
						<?php 
    if ($action == "Build Thumbnails") {
        echo '<div style="font-weight:bold;">Starting processing...</div>';
        $imgManager->buildThumbnailImages($collid);
        echo '<div style="font-weight:bold;">Finished!</div>';
        echo '<div style="margin-top:20px"><a href="thumbnailbuilder.php?collid=' . $collid . '">Return to Main Menus</a></div>';
    } else {
        if ($reportArr) {
            ?>
								<form name="tnbuilderform" action="thumbnailbuilder.php" method="post">
									<input type="hidden" name="collid" value="<?php 
            echo $collid;
            ?>
">
									<input type="submit" name="action" value="Build Thumbnails">
								</form>
								<div style="margin:10px;">
									* This function will build thumbnail images for all image records that have NULL values for the thumbnail field.
								</div>
예제 #2
0
 protected function finalCleanup()
 {
     $this->outputMsg('<li>Transfer process complete</li>');
     //Update uploaddate
     $sql = 'UPDATE omcollectionstats SET uploaddate = CURDATE() WHERE collid = ' . $this->collId;
     $this->conn->query($sql);
     //Remove records from occurrence temp table (uploadspectemp)
     $sql = 'DELETE FROM uploadspectemp WHERE (collid = ' . $this->collId . ') OR (initialtimestamp < DATE_SUB(CURDATE(),INTERVAL 3 DAY))';
     $this->conn->query($sql);
     //Optimize table to reset indexes
     $this->conn->query('OPTIMIZE TABLE uploadspectemp');
     //Remove records from determination temp table (uploaddetermtemp)
     $sql = 'DELETE FROM uploaddetermtemp WHERE (collid = ' . $this->collId . ') OR (initialtimestamp < DATE_SUB(CURDATE(),INTERVAL 3 DAY))';
     $this->conn->query($sql);
     //Optimize table to reset indexes
     $this->conn->query('OPTIMIZE TABLE uploaddetermtemp');
     //Remove records from image temp table (uploadimagetemp)
     $sql = 'DELETE FROM uploadimagetemp WHERE (collid = ' . $this->collId . ') OR (initialtimestamp < DATE_SUB(CURDATE(),INTERVAL 3 DAY))';
     $this->conn->query($sql);
     //Optimize table to reset indexes
     $this->conn->query('OPTIMIZE TABLE uploadimagetemp');
     //Do some more cleaning of the data after it haas been indexed in the omoccurrences table
     $occurUtil = new OccurrenceUtilities();
     $this->outputMsg('<li>Cleaning house</li>');
     ob_flush();
     flush();
     if (!$occurUtil->generalOccurrenceCleaning($this->collId)) {
         $errorArr = $occurUtil->getErrorArr();
         foreach ($errorArr as $errorStr) {
             echo '<li style="margin-left:20px;">' . $errorStr . '</li>';
         }
     }
     $this->outputMsg('<li style="margin-left:10px;">Protecting sensitive species...</li>');
     ob_flush();
     flush();
     if (!$occurUtil->protectRareSpecies($this->collId)) {
         $errorArr = $occurUtil->getErrorArr();
         foreach ($errorArr as $errorStr) {
             echo '<li style="margin-left:20px;">' . $errorStr . '</li>';
         }
     }
     $this->outputMsg('<li style="margin-left:10px;">Updating statistics...</li>');
     ob_flush();
     flush();
     if (!$occurUtil->updateCollectionStats($this->collId)) {
         $errorArr = $occurUtil->getErrorArr();
         foreach ($errorArr as $errorStr) {
             echo '<li style="margin-left:20px;">' . $errorStr . '</li>';
         }
     }
     /*
     $this->outputMsg('<li style="margin-left:10px;">Searching for duplicate Catalog Numbers... ');
     ob_flush();
     flush();
     $sql = 'SELECT catalognumber FROM omoccurrences GROUP BY catalognumber, collid '.
     	'HAVING Count(*)>1 AND collid = '.$this->collId.' AND catalognumber IS NOT NULL';
     $rs = $this->conn->query($sql);
     if($rs->num_rows){
     	$this->outputMsg('<span style="color:red;">Duplicate Catalog Numbers exist</span></li>');
     	$this->outputMsg('<li style="margin-left:10px;">');
     	$this->outputMsg('Open <a href="../cleaning/occurrencecleaner.php?collid='.$this->collId.'&action=listdupscatalog" target="_blank">Occurrence Cleaner</a> to resolve this issue');
     	$this->outputMsg('</li>');
     }
     else{
     	$this->outputMsg('All good!</li>');
     }
     $rs->free();
     */
     $this->outputMsg('<li style="margin-left:10px;">Populating global unique identifiers (GUIDs) for all records... </li>');
     ob_flush();
     flush();
     $uuidManager = new UuidFactory();
     $uuidManager->setSilent(1);
     $uuidManager->populateGuids();
     if ($this->imageTransferCount) {
         $this->outputMsg('<li style="margin-left:10px;">Building thumbnails for ' . $this->imageTransferCount . ' specimen images... </li>');
         ob_flush();
         flush();
         //Clean and populate null basic url and thumbnailurl fields
         $imgManager = new ImageCleaner();
         $imgManager->setVerbose(0);
         $imgManager->buildThumbnailImages($this->collId);
     }
 }