//TODO: add code to automatically select hide locality details when taxon/state match name on list
include_once '../../config/symbini.php';
include_once $SERVER_ROOT . '/classes/ObservationSubmitManager.php';
header("Content-Type: text/html; charset=" . $CHARSET);
if (!$SYMB_UID) {
    header('Location: ../../profile/index.php?refurl=../collections/editor/observatoinsubmit.php?' . $_SERVER['QUERY_STRING']);
}
$action = array_key_exists("action", $_REQUEST) ? $_REQUEST["action"] : "";
$collId = array_key_exists("collid", $_REQUEST) ? $_REQUEST["collid"] : 0;
$clid = array_key_exists("clid", $_REQUEST) ? $_REQUEST["clid"] : 0;
$recordedBy = array_key_exists("recordedby", $_REQUEST) ? $_REQUEST["recordedby"] : 0;
//Sanitation
if (!is_numeric($clid)) {
    $clid = 0;
}
$obsManager = new ObservationSubmitManager();
$obsManager->setCollid($collId);
$collMap = $obsManager->getCollMap();
if (!$collId && $collMap) {
    $collId = $collMap['collid'];
}
$isEditor = 0;
$occid = 0;
if ($collMap) {
    if ($isAdmin) {
        $isEditor = 1;
    } elseif (array_key_exists("CollAdmin", $USER_RIGHTS) && in_array($collId, $USER_RIGHTS['CollAdmin'])) {
        $isEditor = 1;
    } elseif (array_key_exists("CollEditor", $USER_RIGHTS) && in_array($collId, $USER_RIGHTS['CollEditor'])) {
        $isEditor = 1;
    }
<?php

//TODO: add code to automatically select hide locality details when taxon/state match name on list
include_once '../../config/symbini.php';
include_once $serverRoot . '/classes/ObservationSubmitManager.php';
header("Content-Type: text/html; charset=" . $charset);
if (!$SYMB_UID) {
    header('Location: ../../profile/index.php?refurl=../collections/editor/observatoinsubmit.php?' . $_SERVER['QUERY_STRING']);
}
$action = array_key_exists("action", $_REQUEST) ? $_REQUEST["action"] : "";
$collId = array_key_exists("collid", $_REQUEST) ? $_REQUEST["collid"] : 0;
$clid = array_key_exists("clid", $_REQUEST) ? $_REQUEST["clid"] : 0;
$obsManager = new ObservationSubmitManager($collId);
$collMap = $obsManager->getCollMap();
if (!$collId && $collMap) {
    $collId = $collMap['collid'];
}
$isEditor = 0;
$occid = 0;
if ($collMap) {
    if ($isAdmin) {
        $isEditor = 1;
    } elseif (array_key_exists("CollAdmin", $userRights) && in_array($collId, $userRights['CollAdmin'])) {
        $isEditor = 1;
    } elseif (array_key_exists("CollEditor", $userRights) && in_array($collId, $userRights['CollEditor'])) {
        $isEditor = 1;
    }
    if ($isEditor && $action == "Submit Observation") {
        if (isset($useImageMagick) && $useImageMagick) {
            $obsManager->setUseImageMagick(1);
        }