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();
    if ($isAdmin || array_key_exists("CollAdmin", $userRights) && in_array($collId, $userRights["CollAdmin"])) {
        $isEditor = 1;
    }
    if ($collMap && $collMap['colltype'] == 'General Observations') {
        $isGenObs = 1;
    }
    if (!$isEditor) {
        if ($isGenObs) {
            if (array_key_exists("CollEditor", $userRights) && in_array($collId, $userRights["CollEditor"])) {
                //Approved General Observation editors can add records
                $isEditor = 2;
            } elseif ($action) {
                //Lets assume that Edits where submitted and they remain on same specimen, user is still approved
Exemple #2
0
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;
        }
    }
    if ($isEditor) {
        if ($action == 'Add Record') {
            $statusStr = $occManager->addOccurrence($_POST);