Exemplo n.º 1
0
             //Lets assume that Edits where submitted and they remain on same specimen, user is still approved
             $isEditor = 2;
         } elseif ($occManager->getObserverUid() == $symbUid) {
             //Users can edit their own records
             $isEditor = 2;
         }
     } elseif (array_key_exists("CollEditor", $userRights) && in_array($collId, $userRights["CollEditor"])) {
         $isEditor = 2;
     } elseif (array_key_exists("CollTaxon", $userRights) && $occId) {
         //Check to see if this user is authorized to edit this occurrence given their taxonomic editing authority
         //0 = not editor, 2 = full editor, 3 = taxon editor, but not for this specific occurrence
         $isEditor = $occManager->isTaxonomicEditor();
     }
 }
 if ($action == "Save Edits") {
     $statusStr = $occManager->editOccurrence($_POST, $crowdSourceMode ? 1 : $isEditor);
 }
 if ($isEditor == 1 || $isEditor == 2 || $crowdSourceMode) {
     if ($action == 'Save OCR') {
         $statusStr = $occManager->insertTextFragment($_POST['imgid'], $_POST['rawtext'], $_POST['rawnotes'], $_POST['rawsource']);
         if (is_numeric($statusStr)) {
             $newPrlid = $statusStr;
             $statusStr = '';
         }
     } elseif ($action == 'Save OCR Edits') {
         $statusStr = $occManager->saveTextFragment($_POST['editprlid'], $_POST['rawtext'], $_POST['rawnotes'], $_POST['rawsource']);
     } elseif ($action == 'Delete OCR') {
         $statusStr = $occManager->deleteTextFragment($_POST['delprlid']);
     }
 }
 if ($isEditor) {