Exemplo n.º 1
0
<?php

include_once '../../../config/symbini.php';
include_once $SERVER_ROOT . '/classes/OccurrenceEditorManager.php';
include_once $SERVER_ROOT . '/classes/OccurrenceDuplicate.php';
header("Content-Type: text/html; charset=" . $CHARSET);
$occid = $_GET['occid'];
$occIndex = $_GET['occindex'];
$crowdSourceMode = $_GET['csmode'];
$occManager = new OccurrenceEditorManager();
$occManager->setOccId($occid);
$oArr = $occManager->getOccurMap();
$occArr = $oArr[$occid];
$genticArr = $occManager->getGeneticArr();
$dupManager = new OccurrenceDuplicate();
$dupClusterArr = $dupManager->getClusterArr($occid);
$lastName = $dupManager->parseLastName($occArr['recordedby']);
?>
<script type="text/javascript">

	$(function() {
		var dialog;

		dialog = $( "#dialog-dupelist" ).dialog({
			autoOpen: false,
			height: 300,
			width: 350,
			modal: true,
			close: function() {
			}
		});
Exemplo n.º 2
0
<?php

include_once '../../../config/symbini.php';
include_once $serverRoot . '/classes/OccurrenceEditorManager.php';
$collId = $_REQUEST['collid'];
$fieldName = $_REQUEST['fieldname'];
$oldValue = $_REQUEST['oldvalue'];
$buMatch = array_key_exists('bumatch', $_REQUEST) ? $_REQUEST['bumatch'] : 0;
$ouid = array_key_exists('ouid', $_REQUEST) ? $_REQUEST['ouid'] : 0;
$retCnt = '';
if ($fieldName) {
    $occManager = new OccurrenceEditorManager();
    $occManager->setCollId($collId);
    if ($ouid) {
        $occManager->setQueryVariables(array('ouid' => $ouid));
    } else {
        $occManager->setQueryVariables();
    }
    $occManager->setSqlWhere();
    $retCnt = $occManager->getBatchUpdateCount($fieldName, $oldValue, $buMatch);
}
echo $retCnt;
 public function __destruct()
 {
     parent::__destruct();
 }
<?php

include_once '../../config/symbini.php';
include_once $serverRoot . '/classes/OccurrenceEditorManager.php';
header("Content-Type: text/html; charset=" . $charset);
$collId = array_key_exists('collid', $_REQUEST) ? $_REQUEST['collid'] : 0;
$recLimit = array_key_exists('reclimit', $_REQUEST) ? $_REQUEST['reclimit'] : 1000;
$occIndex = array_key_exists('occindex', $_REQUEST) ? $_REQUEST['occindex'] : 0;
$ouid = array_key_exists('ouid', $_REQUEST) ? $_REQUEST['ouid'] : 0;
$crowdSourceMode = array_key_exists('csmode', $_REQUEST) ? $_REQUEST['csmode'] : 0;
$reset = array_key_exists('reset', $_REQUEST) ? $_REQUEST['reset'] : false;
$action = array_key_exists('submitaction', $_REQUEST) ? $_REQUEST['submitaction'] : '';
$occManager = new OccurrenceEditorManager();
if ($crowdSourceMode) {
    $occManager->setCrowdSourceMode(1);
}
$isEditor = 0;
//If not editor, edits will be submitted to omoccuredits table but not applied to omoccurrences
$displayQuery = 0;
$isGenObs = 0;
$collMap = array();
$recArr = array();
$headerMapBase = array('catalognumber' => 'Catalog Number', 'othercatalognumbers' => 'Other Catalog #', 'family' => 'Family', 'identificationqualifier' => 'ID Qualifier', 'sciname' => 'Scientific name', 'scientificnameauthorship' => 'Author', 'recordedby' => 'Collector', 'recordnumber' => 'Number', 'associatedcollectors' => 'Associated Collectors', 'eventdate' => 'Event Date', 'verbatimeventdate' => 'Verbatim Date', 'identificationremarks' => 'Identification Remarks', 'taxonremarks' => 'Taxon Remarks', 'identifiedby' => 'Identified By', 'dateidentified' => 'Date Identified', 'identificationreferences' => 'Identification References', 'country' => 'Country', 'stateprovince' => 'State/Province', 'county' => 'county', 'municipality' => 'municipality', 'locality' => 'locality', 'decimallatitude' => 'Latitude', 'decimallongitude' => 'Longitude', 'geodeticdatum' => 'Datum', 'coordinateuncertaintyinmeters' => 'Uncertainty In Meters', 'verbatimcoordinates' => 'Verbatim Coordinates', 'georeferencedby' => 'Georeferenced By', 'georeferenceprotocol' => 'Georeference Protocol', 'georeferencesources' => 'Georeference Sources', 'georeferenceverificationstatus' => 'Georef Verification Status', 'georeferenceremarks' => 'Georef Remarks', 'minimumelevationinmeters' => 'Min. Elev. (m)', 'maximumelevationinmeters' => 'Max. Elev. (m)', 'verbatimelevation' => 'Verbatim Elev.', 'habitat' => 'Habitat', 'substrate' => 'Substrate', 'occurrenceremarks' => 'Notes (Occurrence Remarks)', 'associatedtaxa' => 'Associated Taxa', 'verbatimattributes' => 'Description', 'lifestage' => 'Life Stage', 'sex' => 'Sex', 'individualcount' => 'Individual Count', 'samplingprotocol' => 'Sampling Protocol', 'preparations' => 'Preparations', 'reproductivecondition' => 'Reproductive Condition', 'typestatus' => 'Type Status', 'cultivationstatus' => 'Cultivation Status', 'establishmentmeans' => 'Establishment Means', 'disposition' => 'disposition', 'duplicatequantity' => 'Duplicate Qty', 'datelastmodified' => 'Date Last Modified', 'processingstatus' => 'Processing Status', 'recordenteredby' => 'Entered By', 'basisofrecord' => 'Basis Of Record');
$headMap = array();
$qryCnt = 0;
$statusStr = '';
if ($symbUid) {
    //Set variables
    $occManager->setSymbUid($symbUid);
    $occManager->setCollId($collId);
    $collMap = $occManager->getCollMap();
Exemplo n.º 5
0
<?php

include_once '../../../config/symbini.php';
include_once $serverRoot . '/classes/OccurrenceEditorManager.php';
header("Content-Type: text/html; charset=" . $charset);
$occid = $_GET['occid'];
$occIndex = $_GET['occindex'];
$collId = $_GET['collid'];
$occManager = new OccurrenceEditorManager();
$occManager->setOccId($occid);
?>
<div id="admindiv">
	<?php 
$editArr = $occManager->getEditArr();
//$externalEdits = $occManager->getExternalEditArr();
//if($editArr || $externalEdits){
if ($editArr) {
    if ($editArr) {
        ?>
			<fieldset style="padding:15px;margin:10px 0px;">
				<legend><b>Edit History</b></legend>
				<?php 
        if (array_key_exists('CollAdmin', $USER_RIGHTS) && in_array($collId, $USER_RIGHTS['CollAdmin'])) {
            ?>
					<div style="float:right;" title="Manage Edit History">
						<a href="../editor/editreviewer.php?collid=<?php 
            echo $collId . '&occid=' . $occid;
            ?>
" target="_blank"><img src="../../images/edit.png" style="border:0px;width:14px;" /></a>
					</div>
					<?php 
Exemplo n.º 6
0
 public function mergeRecords($targetOccid, $sourceOccid)
 {
     $status = true;
     $editorManager = new OccurrenceEditorManager($this->conn);
     if ($editorManager->mergeRecords($targetOccid, $sourceOccid)) {
         if (!$editorManager->deleteOccurrence($sourceOccid)) {
             $this->errorStr = $editorManager->getErrorStr();
         }
     } else {
         $this->errorStr = $editorManager->getErrorStr;
         $status = false;
     }
     return $status;
 }
Exemplo n.º 7
0
<?php

include_once '../../config/symbini.php';
include_once $SERVER_ROOT . '/classes/OccurrenceEditorManager.php';
include_once $SERVER_ROOT . '/classes/ProfileManager.php';
header("Content-Type: text/html; charset=" . $CHARSET);
if (!$SYMB_UID) {
    header('Location: ../../profile/index.php?refurl=../collections/editor/occurdataentry.php?' . $_SERVER['QUERY_STRING']);
}
$collid = array_key_exists('collid', $_REQUEST) ? $_REQUEST['collid'] : 0;
$action = array_key_exists('submitaction', $_POST) ? $_POST['submitaction'] : '';
$occManager = new OccurrenceEditorManager();
$isEditor = 0;
//If not editor, edits will be submitted to omoccuredits table but not applied to omoccurrences
$collMap = array();
$statusStr = '';
$isGenObs = 0;
if ($SYMB_UID) {
    //Set variables
    $occManager->setSymbUid($SYMB_UID);
    $occManager->setCollId($collid);
    $collMap = $occManager->getCollMap();
    if ($collMap && $collMap['colltype'] == 'General Observations') {
        $isGenObs = 1;
    }
    if ($isAdmin || $collid && array_key_exists("CollAdmin", $USER_RIGHTS) && in_array($collid, $USER_RIGHTS["CollAdmin"])) {
        $isEditor = 1;
    } else {
        if (array_key_exists("CollEditor", $USER_RIGHTS) && in_array($collid, $USER_RIGHTS["CollEditor"])) {
            $isEditor = 2;
        }
Exemplo n.º 8
0
 public function mergeDupeArr($occidArr)
 {
     $status = true;
     $this->verboseMode = 2;
     $editorManager = new OccurrenceEditorManager($this->conn);
     foreach ($occidArr as $target => $occArr) {
         $mergeArr = array($target);
         foreach ($occArr as $source) {
             if ($source != $target) {
                 if ($editorManager->mergeRecords($target, $source)) {
                     $mergeArr[] = $source;
                 } else {
                     $this->logOrEcho($editorManager->getErrorStr(), 1);
                     $status = false;
                 }
             }
         }
         if (count($mergeArr) > 1) {
             $this->logOrEcho('Merged records: ' . implode(', ', $mergeArr), 1);
         }
     }
     return $status;
 }
 public function mergeRecords($targetOccid, $sourceOccid)
 {
     global $charset;
     if (!$targetOccid || !$sourceOccid) {
         return 'ERROR: target or source is null';
     }
     if ($targetOccid == $sourceOccid) {
         return 'ERROR: target and source are equal';
     }
     $status = true;
     $oArr = array();
     //Merge records
     $sql = 'SELECT * FROM omoccurrences WHERE occid = ' . $targetOccid . ' OR occid = ' . $sourceOccid;
     $rs = $this->conn->query($sql);
     while ($r = $rs->fetch_assoc()) {
         $tempArr = array_change_key_case($r);
         $id = $tempArr['occid'];
         unset($tempArr['occid']);
         unset($tempArr['collid']);
         unset($tempArr['dbpk']);
         unset($tempArr['datelastmodified']);
         $oArr[$id] = $tempArr;
     }
     $rs->free();
     $tArr = $oArr[$targetOccid];
     $sArr = $oArr[$sourceOccid];
     $sqlFrag = '';
     foreach ($sArr as $k => $v) {
         if ($v != '' && $tArr[$k] == '') {
             $sqlFrag .= ',' . $k . '="' . $v . '"';
         }
     }
     if ($sqlFrag) {
         //Remap source to target
         $sqlIns = 'UPDATE omoccurrences SET ' . substr($sqlFrag, 1) . ' WHERE occid = ' . $targetOccid;
         //echo $sqlIns;
         $this->conn->query($sqlIns);
     }
     //Remap determinations
     $sql = 'UPDATE omoccurdeterminations SET occid = ' . $targetOccid . ' WHERE occid = ' . $sourceOccid;
     $this->conn->query($sql);
     //Delete occurrence edits
     $sql = 'DELETE FROM omoccuredits WHERE occid = ' . $sourceOccid;
     $this->conn->query($sql);
     //Remap images
     $sql = 'UPDATE images SET occid = ' . $targetOccid . ' WHERE occid = ' . $sourceOccid;
     $this->conn->query($sql);
     //Remap comments
     $sql = 'UPDATE omoccurcomments SET occid = ' . $targetOccid . ' WHERE occid = ' . $sourceOccid;
     $this->conn->query($sql);
     //Remap exsiccati
     $sql = 'UPDATE omexsiccatiocclink SET occid = ' . $targetOccid . ' WHERE occid = ' . $sourceOccid;
     $this->conn->query($sql);
     //Remap occurrence dataset links
     $sql = 'UPDATE omoccurdatasetlink SET occid = ' . $targetOccid . ' WHERE occid = ' . $sourceOccid;
     $this->conn->query($sql);
     //Remap loans
     $sql = 'UPDATE omoccurloanslink SET occid = ' . $targetOccid . ' WHERE occid = ' . $sourceOccid;
     $this->conn->query($sql);
     //Remap checklists voucher links
     $sql = 'UPDATE fmvouchers SET occid = ' . $targetOccid . ' WHERE occid = ' . $sourceOccid;
     $this->conn->query($sql);
     //Remap survey lists
     $sql = 'UPDATE omsurveyoccurlink SET occid = ' . $targetOccid . ' WHERE occid = ' . $sourceOccid;
     $this->conn->query($sql);
     //Delete source record data through the Editor class so that record is properly archived
     $editorManager = new OccurrenceEditorManager();
     $status = $editorManager->deleteOccurrence($sourceOccid);
     if (strpos($status, 'ERROR') === 0) {
         $status = '';
     }
     return $status;
 }
Exemplo n.º 10
0
$goToMode = array_key_exists('gotomode', $_REQUEST) ? $_REQUEST['gotomode'] : 0;
$occIndex = array_key_exists('occindex', $_REQUEST) && $_REQUEST['occindex'] != "" ? $_REQUEST['occindex'] : false;
$ouid = array_key_exists('ouid', $_REQUEST) ? $_REQUEST['ouid'] : 0;
$crowdSourceMode = array_key_exists('csmode', $_REQUEST) ? $_REQUEST['csmode'] : 0;
$action = array_key_exists('submitaction', $_REQUEST) ? $_REQUEST['submitaction'] : '';
if (!$action && array_key_exists('carryloc', $_REQUEST)) {
    $goToMode = 2;
}
//Create Occurrence Manager
$occManager;
if (strpos($action, 'Determination') || strpos($action, 'Verification')) {
    $occManager = new OccurrenceEditorDeterminations();
} elseif (strpos($action, 'Image')) {
    $occManager = new OccurrenceEditorImages();
} else {
    $occManager = new OccurrenceEditorManager();
}
if ($crowdSourceMode) {
    $occManager->setCrowdSourceMode(1);
}
$isEditor = 0;
//If not editor, edits will be submitted to omoccuredits table but not applied to omoccurrences
$displayQuery = 0;
$isGenObs = 0;
$collMap = array();
$occArr = array();
$imgArr = array();
$specImgArr = array();
$fragArr = array();
$qryCnt = false;
$statusStr = '';
Exemplo n.º 11
0
<?php

include_once '../../config/symbini.php';
include_once $serverRoot . '/classes/OccurrenceEditorManager.php';
include_once $serverRoot . '/classes/ProfileManager.php';
header("Content-Type: text/html; charset=" . $charset);
header("Cache-Control: no-cache, must-revalidate");
// HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
// Date in the past
$collid = array_key_exists('collid', $_REQUEST) ? $_REQUEST['collid'] : 0;
$action = array_key_exists('submitaction', $_REQUEST) ? $_REQUEST['submitaction'] : '';
if (!$SYMB_UID) {
    header('Location: ../../profile/index.php?refurl=../collections/editor/occurrenceeditor.php?' . $_SERVER['QUERY_STRING']);
}
$occManager = new OccurrenceEditorManager();
$isEditor = 0;
//If not editor, edits will be submitted to omoccuredits table but not applied to omoccurrences
$collMap = array();
$statusStr = '';
$isGenObs = 0;
if ($SYMB_UID) {
    //Set variables
    $occManager->setSymbUid($SYMB_UID);
    $occManager->setCollId($collid);
    $collMap = $occManager->getCollMap();
    if ($collMap && $collMap['colltype'] == 'General Observations') {
        $isGenObs = 1;
    }
    //Bring in config variables
    if ($isGenObs) {
Exemplo n.º 12
0
<?php

include_once '../../../config/symbini.php';
include_once $SERVER_ROOT . '/classes/OccurrenceEditorManager.php';
include_once $SERVER_ROOT . '/classes/OccurrenceDuplicate.php';
header("Content-Type: text/html; charset=" . $CHARSET);
$occid = $_GET['occid'];
$occIndex = $_GET['occindex'];
$crowdSourceMode = $_GET['csmode'];
$occManager = new OccurrenceEditorManager();
$occManager->setOccId($occid);
$oArr = $occManager->getOccurMap();
$occArr = $oArr[$occid];
$genticArr = $occManager->getGeneticArr();
$dupManager = new OccurrenceDuplicate();
$dupClusterArr = $dupManager->getClusterArr($occid);
$lastName = $dupManager->parseLastName($occArr['recordedby']);
?>
<script>
	function validateVoucherAddForm(f){
		if(f.clidvoucher.value == ""){
			alert("Select a checklist to which you want to link the voucher");
			return false;
		}
		if(f.tidvoucher.value == ""){
			alert("Voucher cannot be linked to a checklist until the taxonomic name has been resolved (e.g. name not linked to taxonomic thesaurus");
			return false;
		}
		return true;
	}