diff --git a/presentation/lookAndFeel/knowledgeTree/documentmanagement/addDocumentLinkBL.php b/presentation/lookAndFeel/knowledgeTree/documentmanagement/addDocumentLinkBL.php deleted file mode 100644 index 802ec56..0000000 --- a/presentation/lookAndFeel/knowledgeTree/documentmanagement/addDocumentLinkBL.php +++ /dev/null @@ -1,85 +0,0 @@ -fileSystemRoot/lib/documentmanagement/Document.inc"); - require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentLink.inc"); - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); - require_once("$default->fileSystemRoot/lib/security/Permission.inc"); - require_once("$default->fileSystemRoot/lib/documentmanagement/LinkType.inc"); - require_once("$default->fileSystemRoot/presentation/Html.inc"); - require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); - require_once("documentUI.inc"); - require_once("addDocumentLinkUI.inc"); - - $oDocument = Document::get($fDocumentID); - if (Permission::userHasDocumentWritePermission($oDocument)) { - //user has permission to link this document to another - if (isset($fForStore)) { - //create a new document link - $oDocumentLink = & new DocumentLink($fDocumentID, $fTargetDocumentID, $fLinkTypeID); - if ($oDocumentLink->create()) { - controllerRedirect("viewDocument", "fDocumentID=$fDocumentID&fShowSection=linkedDocuments"); - } else { - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); - //an error occured while trying to create the document link - $oPatternCustom = & new PatternCustom(); - $oPatternCustom->setHtml(getPage($fDocumentID)); - if ($default->bNN4) { - $main->setOnLoadJavaScript("disable(document.MainForm.fTargetDocument)"); - } - $main->setCentralPayload($oPatternCustom); - $main->setFormAction($_SERVER["PHP_SELF"] . "?fDocumentID=$fDocumentID&fForStore=1"); - $main->setHasRequiredFields(true); - $main->setErrorMessage(_("An error occured whilst attempting to link the two documents")); - $main->render(); - } - } else { - //display the add page - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); - - $oPatternCustom = & new PatternCustom(); - $oPatternCustom->setHtml(getPage($fDocumentID)); - if ($default->bNN4) { - $main->setOnLoadJavaScript("disable(document.MainForm.fTargetDocument)"); - } - $main->setCentralPayload($oPatternCustom); - $main->setFormAction($_SERVER["PHP_SELF"] . "?fDocumentID=$fDocumentID&fForStore=1"); - $main->setHasRequiredFields(true); - $main->render(); - } - } -} -?> diff --git a/presentation/lookAndFeel/knowledgeTree/documentmanagement/addDocumentLinkUI.inc b/presentation/lookAndFeel/knowledgeTree/documentmanagement/addDocumentLinkUI.inc deleted file mode 100644 index c25021f..0000000 --- a/presentation/lookAndFeel/knowledgeTree/documentmanagement/addDocumentLinkUI.inc +++ /dev/null @@ -1,97 +0,0 @@ -"; - $sToRender .= ""; - //had a slight problem with netscape 4.7x - it doesn't support disabled. So I had to use - //javascript to set the onFocus attribute to blur - if (!$default->bNN4) { - //for any other browser but netscape 4.7 do this - $sToRender .= "" . _("Document to link") . "\n"; - } else { - //for netscape 4.7 do this - $sToRender .= "" . _("Document to link") . "\n"; - } - $sToRender .= ""; - $sToRender .= "Link Type".getLinkTypesList($name="fLinkTypeID")."\n"; - $sToRender .= "\n"; - - $sToRender .= "\n"; - $sToRender .= "\n"; - $sToRender .= "
rootUrl . "/control.php?action=viewDocument&fDocumentID=$iDocumentID\">
\n"; - $sToRender .= "\n"; - $sToRender .= "\n"; - $sToRender .= "\n"; - - return $sToRender . "\n\n" . getValidationJavaScript() . "\n\n" . getBrowseJavaScript(); -} - -function getValidationJavaScript() { - $sToRender .= "\n\n\n\n"; - return $sToRender; -} - -function getBrowseJavaScript() { - $sToRender = "\n"; - return $sToRender; -} - -function getLinkTypesList($name="", $selected="") { - $sToRender = "\n"; - return $sToRender; -} - -?> diff --git a/presentation/lookAndFeel/knowledgeTree/documentmanagement/bulkImport.php b/presentation/lookAndFeel/knowledgeTree/documentmanagement/bulkImport.php deleted file mode 100644 index 9c00e22..0000000 --- a/presentation/lookAndFeel/knowledgeTree/documentmanagement/bulkImport.php +++ /dev/null @@ -1,136 +0,0 @@ -oFolder =& $this->oValidator->validateFolder($_REQUEST['fFolderId']); - $this->oPermission =& $this->oValidator->validatePermissionByName('ktcore.permissions.write'); - $this->oValidator->userHasPermissionOnItem($this->oUser, $this->oPermission, $this->oFolder); - return true; - } - - function do_main() { - $oTemplating =& KTTemplating::getSingleton(); - $oTemplate = $oTemplating->loadTemplate('ktcore/import/fs_import'); - $aTypes = $this->getDocumentTypes(); - $iDefaultType = $aTypes[0]->getId(); - $aFields = array( - 'folder_id' => $this->oFolder->getID(), - 'folder_path_array' => $this->oFolder->getPathArray(), - 'document_type_choice' => $this->getDocumentTypeChoice($aTypes, 'getMetadataForType(this.value);'), - 'generic_metadata_fields' => $this->getGenericMetadataFields(), - 'type_metadata_fields' => $this->getTypeMetadataFields($iDefaultType), - ); - return $oTemplate->render($aFields); - } - - function getDocumentTypeChoice($aTypes, $onchange = "") { - $oTemplating =& KTTemplating::getSingleton(); - $oTemplate = $oTemplating->loadTemplate('ktcore/document/document_type_choice'); - $aFields = array( - 'document_types' => $aTypes, - 'onchange' => $onchange, - ); - return $oTemplate->render($aFields); - } - - function getGenericMetadataFields() { - $oTemplating = KTTemplating::getSingleton(); - $oTemplate = $oTemplating->loadTemplate("ktcore/metadata/editable_metadata_fields"); - $aTemplateData = array( - 'caption' => _('Generic meta data'), - 'empty_message' => _("No Generic Meta Data"), - 'fields' => DocumentField::getList(array('is_generic = ?', array(true))), - ); - return $oTemplate->render($aTemplateData); - } - - function getTypeMetadataFields($iDocumentTypeID) { - global $default; - /*ok*/ $sQuery = array("SELECT DF.id AS id " . - "FROM document_fields AS DF LEFT JOIN document_type_fields_link AS DTFL ON DTFL.field_id = DF.id " . - "WHERE DF.is_generic = ? " . - "AND DTFL.document_type_id = ?", array(false, $iDocumentTypeID)); - - $aIDs = DBUtil::getResultArray($sQuery); - - $aFields = array(); - foreach ($aIDs as $iID) { - $aFields[] =& call_user_func(array('DocumentField', 'get'), $iID); - } - $aTemplateData = array( - 'caption' => _('Type specific meta data'), - 'empty_message' => _("No Type Specific Meta Data"), - 'fields' => $aFields, - ); - $oTemplating = KTTemplating::getSingleton(); - $oTemplate = $oTemplating->loadTemplate("ktcore/metadata/editable_metadata_fields"); - return $oTemplate->render($aTemplateData); - } - - function getDocumentTypes() { - $sTable = KTUtil::getTableName('folder_doctypes'); - $aQuery = array( - "SELECT document_type_id FROM $sTable WHERE folder_id = ?", - array($this->oFolder->getId()), - ); - $aIds = DBUtil::getResultArrayKey($aQuery, 'document_type_id'); - $aRet = array(); - foreach ($aIds as $iId) { - $aRet[] = DocumentType::get($iId); - } - return $aRet; - } - - function do_import() { - $matches = array(); - $aFields = array(); - foreach ($_REQUEST as $k => $v) { - if (preg_match('/^emd(\d+)$/', $k, $matches)) { - $aFields[] = array(DocumentField::get($matches[1]), $v); - } - } - - $aOptions = array( - 'documenttype' => DocumentType::get($fDocumentTypeID), - 'metadata' => $aFields, - ); - - $fs =& new KTFSImportStorage($_REQUEST['fPath']); - $bm =& new KTBulkImportManager($this->oFolder, $fs, $this->oUser, $aOptions); - DBUtil::startTransaction(); - $res = $bm->import(); - if (PEAR::isError($res)) { - DBUtil::rollback(); - $_SESSION["KTErrorMessage"][] = _("Bulk import failed") . ": " . $res->getMessage(); - } else { - DBUtil::commit(); - } - - controllerRedirect("browse", 'fFolderID=' . $this->oFolder->getID()); - exit(0); - } -} - -$d =& new KTBulkImportDispatcher; -$d->dispatch(); - -?> diff --git a/presentation/lookAndFeel/knowledgeTree/documentmanagement/downloadBL.php b/presentation/lookAndFeel/knowledgeTree/documentmanagement/downloadBL.php deleted file mode 100644 index 56967c1..0000000 --- a/presentation/lookAndFeel/knowledgeTree/documentmanagement/downloadBL.php +++ /dev/null @@ -1,103 +0,0 @@ -, Jam Warehouse (Pty) Ltd, South Africa - * @package documentmanagement - */ - -require_once("../../../../config/dmsDefaults.php"); - -KTUtil::extractGPC('fDocumentID', 'fForInlineView', 'fVersion'); - -require_once("$default->fileSystemRoot/lib/security/Permission.inc"); -require_once("$default->fileSystemRoot/lib/documentmanagement/PhysicalDocumentManager.inc"); -require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentTransaction.inc"); -require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); -require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); - -require_once(KT_LIB_DIR . '/storage/storagemanager.inc.php'); -$oStorage =& KTStorageManagerUtil::getSingleton(); - -// start the session for a download- workaround for the IE SSL bug -if (!checkSession(true)) { - exit(0); -} - -if (!isset($fDocumentID)) { - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); - $oPatternCustom = new PatternCustom(); - $oPatternCustom->setHtml("\n"); - $main->setErrorMessage(_("You have not chosen a document to view")); - $main->setCentralPayload($oPatternCustom); - $main->render(); - exit(0); -} - -$oDocument = Document::get($fDocumentID); -if (!Permission::userHasDocumentReadPermission($oDocument)) { - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); - $oPatternCustom = new PatternCustom(); - if ($oDocument) { - $oPatternCustom->setHtml("\n"); - } else { - $oPatternCustom->setHtml("\n"); - } - $main->setErrorMessage(_("Either you do not have permission to view this document, or the document you have chosen no longer exists on the file system.")); - $main->setCentralPayload($oPatternCustom); - $main->render(); - exit(0); -} - -if (isset($fForInlineView)) { - $oDocumentTransaction = & new DocumentTransaction($fDocumentID, "Inline view", VIEW); - $oDocumentTransaction->create(); - PhysicalDocumentManager::inlineViewPhysicalDocument($fDocumentID); - exit(0); -} - -//if the user has document read permission, perform the download -if (isset($fVersion)) { - // we're downloading an old version of the document - $oDocumentTransaction = & new DocumentTransaction($fDocumentID, "Document version $fVersion downloaded", DOWNLOAD); - $oDocumentTransaction->create(); - - // if the document is currently checked out, and we're the version we're downloading - // is the same as the current version, then download the current version of the document - if ($oDocument->getIsCheckedOut() && ($fVersion == $oDocument->getVersion())) { - $oStorage->download($oDocument); - } else { - PhysicalDocumentManager::downloadVersionedPhysicalDocument($fDocumentID, $fVersion); - } - exit(0); -} - -// download the current version -$oDocumentTransaction = & new DocumentTransaction($fDocumentID, "Document downloaded", DOWNLOAD); -$oDocumentTransaction->create(); -$oStorage->download($oDocument); -exit(0); - -?> diff --git a/presentation/lookAndFeel/knowledgeTree/documentmanagement/removeDocumentLinkBL.php b/presentation/lookAndFeel/knowledgeTree/documentmanagement/removeDocumentLinkBL.php deleted file mode 100644 index 49fbfc9..0000000 --- a/presentation/lookAndFeel/knowledgeTree/documentmanagement/removeDocumentLinkBL.php +++ /dev/null @@ -1,92 +0,0 @@ -fileSystemRoot/lib/security/Permission.inc"); - require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); - require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentLink.inc"); - require_once("$default->fileSystemRoot/presentation/Html.inc"); - require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); - require_once("documentUI.inc"); - require_once("removeDocumentLinkUI.inc"); - - $oDocument = Document::get($fDocumentID); - if (Permission::userHasDocumentWritePermission($oDocument)) { - if (isset($fForDelete)) { - //deleting a document link - $oDocumentLink = DocumentLink::get($fDocumentLinkID); - if ($oDocumentLink->delete()) { - controllerRedirect("viewDocument", "fDocumentID=$fParentDocumentID&fShowSection=linkedDocuments"); - } else { - //an error occured whilst trying to delete the document link - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); - - $oParentDocument = Document::get($fParentDocumentID); - $oChildDocument = Document::get($fChildDocumentID); - - $oPatternCustom = & new PatternCustom(); - $oPatternCustom->setHtml(getPage($oParentDocument->getName(), $oChildDocument->getName(), $fParentDocumentID)); - $main->setCentralPayload($oPatternCustom); - $main->setFormAction($_SERVER["PHP_SELF"] . "?fDocumentLinkID=$fDocumentLinkID&fParentDocumentID=$fParentDocumentID&fChildDocumentID=$fChildDocumentID&fForDelete=1"); - $main->setErrorMessage(_("An error occured whilst attempting to delete the link between the two documents")); - $main->render(); - } - } else { - //user has document write permission and can therefore remove the - //link between the two documents - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); - - $oParentDocument = Document::get($fParentDocumentID); - $oChildDocument = Document::get($fChildDocumentID); - - $oPatternCustom = & new PatternCustom(); - $oPatternCustom->setHtml(getPage($oParentDocument->getName(), $oChildDocument->getName(), $fParentDocumentID)); - $main->setCentralPayload($oPatternCustom); - $main->setFormAction($_SERVER["PHP_SELF"] . "?fDocumentLinkID=$fDocumentLinkID&fParentDocumentID=$fParentDocumentID&fChildDocumentID=$fChildDocumentID&fForDelete=1"); - $main->render(); - } - } else { - //user does not have permission to be here - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); - - $oPatternCustom = & new PatternCustom(); - $oPatternCustom->setHtml(""); - $main->setCentralPayload($oPatternCustom); - $main->setErrorMessage(_("You do not have permission to delete links between documents")); - $main->render(); - } -} -?> diff --git a/presentation/lookAndFeel/knowledgeTree/documentmanagement/removeDocumentLinkUI.inc b/presentation/lookAndFeel/knowledgeTree/documentmanagement/removeDocumentLinkUI.inc deleted file mode 100644 index 34ad168..0000000 --- a/presentation/lookAndFeel/knowledgeTree/documentmanagement/removeDocumentLinkUI.inc +++ /dev/null @@ -1,51 +0,0 @@ -\n"; - $sToRender .= "\n"; - $sToRender .= "" . _("You have chosen to delete the link between these two documents") . ": '$sParentDocumentName' / '$sChildDocumentName'\n"; - $sToRender .= "\n"; - $sToRender .= "\n"; - $sToRender .= " \n"; - $sToRender .= "\n"; - $sToRender .= "" . _("Select 'Delete' to confirm or 'Cancel' to cancel") . "\n"; - $sToRender .= "\n"; - $sToRender .= "\n"; - $sToRender .= " \n"; - $sToRender .= "\n"; ; - $sToRender .= "\n"; - $sToRender .= "
rootUrl/control.php?action=viewDocument&fDocumentID=" . $iParentDocumentID . "\">
"; - $sToRender .= ""; - $sToRender .= ""; - return $sToRender; -} - -?>