getMLText("invalid_doc_id"))),getMLText("invalid_doc_id")); } $document = $dms->getDocument(intval($_POST["documentid"])); if (!is_object($document)) { UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id")); } if (!isset($_POST["version"]) || !is_numeric($_POST["version"]) || intval($_POST["version"])<1) { UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("invalid_version")); } $version = $_POST["version"]; $version = $document->getContentByVersion($version); if (!is_object($version)) { UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("invalid_version")); } $workflow = $version->getWorkflow(); if (!is_object($workflow)) { UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("document_has_no_workflow")); } if (!isset($_POST["subworkflow"]) || !is_numeric($_POST["subworkflow"]) || intval($_POST["subworkflow"])<1) { UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("invalid_workflow")); } $subworkflow = $dms->getWorkflow($_POST["subworkflow"]); if (!is_object($subworkflow)) { UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_workflow")); } $folder = $document->getFolder(); /* Create object for checking access to certain operations */ $accessop = new SeedDMS_AccessOperation($document, $user, $settings); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); $view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'version'=>$version, 'subworkflow'=>$subworkflow)); if($view) { $view->setParam('accessobject', $accessop); $view->show(); exit; } ?>