diff --git a/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/listDeletedDocumentsBL.php b/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/listDeletedDocumentsBL.php new file mode 100644 index 0000000..300767a --- /dev/null +++ b/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/listDeletedDocumentsBL.php @@ -0,0 +1,44 @@ +fileSystemRoot/lib/documentmanagement/Document.inc"); +require_once("$default->fileSystemRoot/lib/visualpatterns/PatternMainPage.inc"); +require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); +require_once("$default->fileSystemRoot/lib/visualpatterns/PatternTableSqlQuery.inc"); +require_once("$default->uiDirectory/documentmanagement/documentUI.inc"); + +require_once("listDeletedDocumentsUI.inc"); +require_once("$default->fileSystemRoot/presentation/Html.inc"); + +/** + * $Id$ + * + * Business logic for listing deleted documents. + * + * Licensed under the GNU GPL. For full terms see the file DOCS/COPYING. + * + * @version $Revision$ + * @author Michael Joseph , Jam Warehouse (Pty) Ltd, South Africa + * @package presentation.lookAndFeel.knowledgeTree.administration.documentmanagement + */ + +if (checkSession()) { + global $default; + + $oContent = new PatternCustom(); + + if ($fDocumentIDs) { + // tack on POSTed document ids and redirect to the expunge deleted documents page + foreach ($fDocumentIDs as $fDocumentID) { + $sQueryString .= "fDocumentIDs[]=$fDocumentID&"; + } + controllerRedirect("expungeDeletedDocuments", $sQueryString); + } else { + $oContent->setHtml(renderListDeletedDocumentsPage(Document::getList("status_id=" . DELETED))); + } + require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); + $main->setCentralPayload($oContent); + $main->setFormAction($_SERVER["PHP_SELF"]); + $main->render(); +} +?> \ No newline at end of file diff --git a/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/listDeletedDocumentsUI.inc b/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/listDeletedDocumentsUI.inc new file mode 100644 index 0000000..cab3eaa --- /dev/null +++ b/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/listDeletedDocumentsUI.inc @@ -0,0 +1,53 @@ +, Jam Warehouse (Pty) Ltd, South Africa + * @package presentation.lookAndFeel.knowledgeTree.administration.documentmanagement + */ + +/** + * Lists all deleted documents + */ +function renderListDeletedDocumentsPage($aDocuments) { + global $default; + + $sToRender = renderHeading("Expunge Deleted Documents"); + $sToRender .= ""; + if (count($aDocuments) > 0) { + $sToRender .= "\n"; + $sToRender .= "\n"; + $sToRender .= ""; + // loop through them + for ($i = 0; $i < count($aDocuments); $i++) { + $sToRender .= "\t\n"; + $sToRender .= "\t\t\n"; + $sToRender .= "\t\n"; + } + $sToRender .= ""; + $sToRender .= "\n"; + } else { + $sToRender .= ""; + $sToRender .= ""; + $sToRender .= "\n"; + + } + $sToRender .= "
The following documents have been deleted from the DMS.
Select the documents you would like to completely remove and click 'Expunge', or click on the document name link to restore the document.
\n"; + $sToRender .= "getID() . "\"/>\n"; + // get an existing folder to restore the document to + $oFolder = Folder::get($aDocuments[$i]->getFolderID()); + // if the folder no longer exists, use the root folder to start browsing from + $iFolderID = ($oFolder ? $aDocuments[$i]->getFolderID() : User::getUserRootFolderID()); + $sToRender .= generateControllerLink("restoreDeletedDocument", + "fDocumentID=" . $aDocuments[$i]->getID() . "&fFolderID=$iFolderID", + ($aDocuments[$i]->getFolderID() == $iFolderID) ? $aDocuments[$i]->getDisplayPath(true) : $aDocuments[$i]->getIcon() . $aDocuments[$i]->getName()) . "\n"; + $sToRender .= "\t\t
graphicsUrl/widgets/expunge.gif\" border=\"0\"/>
There are currently no deleted documents in the system
graphicsUrl/widgets/back.gif\" border=\"0\"/>
"; + return $sToRender; +} +?> \ No newline at end of file