Commit 9e97723b122dbf71574f0ca96fe5f41da96fff81
1 parent
bb0c2096
Obsoleted by admin/dispatcher-based implementation
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4326 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
5 changed files
with
0 additions
and
509 deletions
presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/archivedDocumentsUI.inc deleted
| 1 | -<?php | ||
| 2 | -/** | ||
| 3 | - * $Id$ | ||
| 4 | - * | ||
| 5 | - * This page holds all presentation code for displaying document archiving searching. | ||
| 6 | - * | ||
| 7 | - * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com | ||
| 8 | - * | ||
| 9 | - * This program is free software; you can redistribute it and/or modify | ||
| 10 | - * it under the terms of the GNU General Public License as published by | ||
| 11 | - * the Free Software Foundation; either version 2 of the License, or | ||
| 12 | - * (at your option) any later version. | ||
| 13 | - * | ||
| 14 | - * This program is distributed in the hope that it will be useful, | ||
| 15 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | - * GNU General Public License for more details. | ||
| 18 | - * | ||
| 19 | - * You should have received a copy of the GNU General Public License | ||
| 20 | - * along with this program; if not, write to the Free Software | ||
| 21 | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 22 | - * | ||
| 23 | - * @version $Revision$ | ||
| 24 | - * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa | ||
| 25 | - * @package administration.documentmanagement | ||
| 26 | - */ | ||
| 27 | - | ||
| 28 | -/** | ||
| 29 | - * Displays the status of restored documents | ||
| 30 | - */ | ||
| 31 | -function renderStatusPage($aSuccessDocuments, $aErrorDocuments) { | ||
| 32 | - global $default; | ||
| 33 | - | ||
| 34 | - $sToRender = renderHeading(_("Archived Documents Restoration Status")); | ||
| 35 | - $sToRender .= "<table>"; | ||
| 36 | - if (count($aSuccessDocuments) > 0) { | ||
| 37 | - $sToRender .= "<tr><td>" . _("The following documents were successfully restored:") . "</td></tr>\n"; | ||
| 38 | - $sToRender .= "<tr/><tr/>"; | ||
| 39 | - for ($i=0; $i<count($aSuccessDocuments); $i++) { | ||
| 40 | - $sToRender .= "<tr><td>" . generateControllerLink("viewDocument", "fDocumentID=" . $aSuccessDocuments[$i]->getID(), $aSuccessDocuments[$i]->getDisplayPath()) . "</td></tr>\n"; | ||
| 41 | - } | ||
| 42 | - } | ||
| 43 | - if (count($aErrorDocuments) > 0) { | ||
| 44 | - $sToRender .= "<tr><td>" . _("There were errors restoring the following documents:") . "</td></tr>\n"; | ||
| 45 | - $sToRender .= "<tr/><tr/>"; | ||
| 46 | - for ($i=0; $i<count($aErrorDocuments); $i++) { | ||
| 47 | - $sToRender .= "<tr><td>" . $aErrorDocuments[$i]->getDisplayPath(true) . "</td></tr>\n"; | ||
| 48 | - } | ||
| 49 | - } | ||
| 50 | - $sToRender .= "<tr/><tr/>"; | ||
| 51 | - $sToRender .= "<tr><td>" . generateControllerLink("archivedDocuments", "", "<img src=\"" . KTHtml::getBackButton() . "\" border=\"0\"></td></tr>"); | ||
| 52 | - $sToRender .= "</table>"; | ||
| 53 | - return $sToRender; | ||
| 54 | -} | ||
| 55 | - | ||
| 56 | -/** | ||
| 57 | - * Gives the user a last chance to bail out before restoring the documents | ||
| 58 | - */ | ||
| 59 | -function renderRestoreConfirmationPage($aDocuments) { | ||
| 60 | - global $default; | ||
| 61 | - | ||
| 62 | - $sToRender = renderHeading(_("Restore Archived Documents")); | ||
| 63 | - $sToRender .= "<table>"; | ||
| 64 | - $sToRender .= "<tr><td>" . _("The documents you have chosen to restore from the archive are listed below.") . "</td></tr>\n"; | ||
| 65 | - $sToRender .= "<tr><td>" . _("Click 'Restore' to confirm restoration, or 'Cancel' to abort.") . "</td></tr>\n"; | ||
| 66 | - $sToRender .= "<tr/><tr/>"; | ||
| 67 | - | ||
| 68 | - // loop through them | ||
| 69 | - for ($i = 0; $i < count($aDocuments); $i++) { | ||
| 70 | - $sToRender .= "\t<tr>\n"; | ||
| 71 | - $sToRender .= "\t\t<td bgcolor=\"" . getColour($i) . "\">\n"; | ||
| 72 | - $sToRender .= "<input type=\"hidden\" name=\"fDocumentIDs[]\" value=\"" . $aDocuments[$i]->getID() . "\"/>\n"; | ||
| 73 | - $sToRender .= $aDocuments[$i]->getDisplayPath(true) . "\n"; | ||
| 74 | - $sToRender .= "\t\t</td>\n"; | ||
| 75 | - $sToRender .= "\t</tr>\n"; | ||
| 76 | - } | ||
| 77 | - $sToRender .= "<tr/><tr/>"; | ||
| 78 | - $sToRender .= "<input type=\"hidden\" name=\"fConfirm\" value=\"1\">"; | ||
| 79 | - $sToRender .= "<tr><td><input type=\"image\" src=\"" . KTHtml::getRestoreButton() . "\" border=\"0\"/></a>\n"; | ||
| 80 | - $sToRender .= "<a href=\"javascript:history.go(-1)\"><img src=\"" . KTHtml::getCancelButton() . "\" border=\"0\"></a></td></tr>"; | ||
| 81 | - $sToRender .= "</table>"; | ||
| 82 | - return $sToRender; | ||
| 83 | -} | ||
| 84 | - | ||
| 85 | -/** | ||
| 86 | - * Displays the archived document search form | ||
| 87 | - */ | ||
| 88 | -function renderSearchPage($aMetaTagIDs = array()) { | ||
| 89 | - global $default; | ||
| 90 | - $sToRender = renderHeading(_("Archived Documents Search")); | ||
| 91 | - | ||
| 92 | - $sToRender .= "<table width=\"600\">\n"; | ||
| 93 | - $sToRender .= "<tr>\n"; | ||
| 94 | - $sToRender .= "<td>" . _("Search text:") . " <input type=\"text\" size=\"60\" name=\"fSearchString\" value=\"$sSearchString\" />\n"; | ||
| 95 | - $sToRender .= "<input type=\"image\" src=\"" . KTHtml::getSubmitButton() . "\" border=\"0\"></td>\n"; | ||
| 96 | - $sToRender .= "</tr>\n"; | ||
| 97 | - $sToRender .= "<tr>\n"; | ||
| 98 | - $sToRender .= "<td> </td>\n"; | ||
| 99 | - $sToRender .= "</tr>\n"; | ||
| 100 | - $sToRender .= "<tr>\n"; | ||
| 101 | - $sToRender .= "<td>" . getMetaData($aMetaTagIDs) . "</td>\n"; | ||
| 102 | - $sToRender .= "</tr>\n"; | ||
| 103 | - $sToRender .= "<tr>\n"; | ||
| 104 | - $sToRender .= "<td> </td>\n"; | ||
| 105 | - $sToRender .= "</tr>\n"; | ||
| 106 | - $sToRender .= "</table>\n"; | ||
| 107 | - | ||
| 108 | - $sToRender .= "\n\n<SCRIPT LANGUAGE=\"javascript\">\n "; | ||
| 109 | - $sToRender .= "<!--\n"; | ||
| 110 | - $sToRender .= "function validateForm() {\n"; | ||
| 111 | - $sToRender .= "\tif (!(validRequired(document.MainForm.fSearchString, 'Search text'))) {\n"; | ||
| 112 | - $sToRender .= "\t\treturn false;\n\t}\n"; | ||
| 113 | - $sToRender .= "\treturn true;\n}\n"; | ||
| 114 | - $sToRender .= "-->\n"; | ||
| 115 | - $sToRender .= "</SCRIPT>\n\n"; | ||
| 116 | - | ||
| 117 | - return $sToRender; | ||
| 118 | -} | ||
| 119 | - | ||
| 120 | -/** | ||
| 121 | - * Performs the search and displays the results | ||
| 122 | - */ | ||
| 123 | -function renderArchivedDocumentsResultsPage($aDocuments) { | ||
| 124 | - global $default; | ||
| 125 | - | ||
| 126 | - $sToRender = renderHeading(_("Archived Documents Search Results")); | ||
| 127 | - $sToRender .= "<table>"; | ||
| 128 | - $sToRender .= "<tr><td>" . _("Select the archived documents you'd like to restore, and click 'Restore', or 'Cancel' to abort") . "</td></tr>\n"; | ||
| 129 | - for ($i=0; $i<count($aDocuments); $i++) { | ||
| 130 | - // and print document paths with checkboxes | ||
| 131 | - $sToRender .= "\t<tr>\n"; | ||
| 132 | - $sToRender .= "\t\t<td bgcolor=\"" . getColour($i) . "\">\n"; | ||
| 133 | - $sToRender .= "<input type=\"checkbox\" name=\"fDocumentIDs[]\" value=\"" . $aDocuments[$i]->getID() . "\"/>\n"; | ||
| 134 | - $sToRender .= $aDocuments[$i]->getDisplayPath(true) . "\n"; | ||
| 135 | - $sToRender .= "\t\t</td>\n"; | ||
| 136 | - $sToRender .= "\t</tr>\n"; | ||
| 137 | - } | ||
| 138 | - $sToRender .= "<tr><td><input type=\"image\" src=\"" . KTHtml::getRestoreButton() . "\" border=\"0\"/></a>\n"; | ||
| 139 | - $sToRender .= generateControllerLink("archivedDocuments", "", "<img src=\"" . KTHtml::getCancelButton() . "\" border=\"0\"></td></tr>"); | ||
| 140 | - $sToRender .= "</table>"; | ||
| 141 | - | ||
| 142 | - return $sToRender; | ||
| 143 | -} | ||
| 144 | -?> |
presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/expungeDeletedDocumentsUI.inc deleted
| 1 | -<?php | ||
| 2 | -/** | ||
| 3 | - * $Id$ | ||
| 4 | - * | ||
| 5 | - * This page holds all presentation code for expunging documents pages. | ||
| 6 | - * | ||
| 7 | - * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com | ||
| 8 | - * | ||
| 9 | - * This program is free software; you can redistribute it and/or modify | ||
| 10 | - * it under the terms of the GNU General Public License as published by | ||
| 11 | - * the Free Software Foundation; either version 2 of the License, or | ||
| 12 | - * (at your option) any later version. | ||
| 13 | - * | ||
| 14 | - * This program is distributed in the hope that it will be useful, | ||
| 15 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | - * GNU General Public License for more details. | ||
| 18 | - * | ||
| 19 | - * You should have received a copy of the GNU General Public License | ||
| 20 | - * along with this program; if not, write to the Free Software | ||
| 21 | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 22 | - * | ||
| 23 | - * @version $Revision$ | ||
| 24 | - * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa | ||
| 25 | - * @package administration.documentmanagement | ||
| 26 | - */ | ||
| 27 | - | ||
| 28 | -/** | ||
| 29 | - * Gives the user a last chance to bail out before expunging the documents | ||
| 30 | - */ | ||
| 31 | -function renderConfirmDocuments($aDocuments) { | ||
| 32 | - global $default; | ||
| 33 | - | ||
| 34 | - $sToRender = renderHeading(_("Expunge Deleted Documents")); | ||
| 35 | - $sToRender .= "<table>"; | ||
| 36 | - $sToRender .= "<tr><td>" . _("The documents you have chosen to expunge are listed below.") . "</td></tr>\n"; | ||
| 37 | - $sToRender .= "<tr><td>" . _("Click 'Expunge' to confirm deletion, or 'Cancel' to abort.") . "</td></tr>\n"; | ||
| 38 | - $sToRender .= "<tr/><tr/>"; | ||
| 39 | - | ||
| 40 | - // loop through them | ||
| 41 | - for ($i = 0; $i < count($aDocuments); $i++) { | ||
| 42 | - $sToRender .= "\t<tr>\n"; | ||
| 43 | - $sToRender .= "\t\t<td bgcolor=\"" . getColour($i) . "\">\n"; | ||
| 44 | - $sToRender .= "<input type=\"hidden\" name=\"fDocumentIDs[]\" value=\"" . $aDocuments[$i]->getID() . "\"/>\n"; | ||
| 45 | - $sToRender .= $aDocuments[$i]->getDisplayPath(true) . "\n"; | ||
| 46 | - $sToRender .= "\t\t</td>\n"; | ||
| 47 | - $sToRender .= "\t</tr>\n"; | ||
| 48 | - } | ||
| 49 | - $sToRender .= "<tr/><tr/>"; | ||
| 50 | - $sToRender .= "<input type=\"hidden\" name=\"fConfirm\" value=\"1\">"; | ||
| 51 | - $sToRender .= "<tr><td><input type=\"image\" src=\"" . KTHtml::getExpungeButton() . "\" border=\"0\"/></a>\n"; | ||
| 52 | - $sToRender .= generateControllerLink("deletedDocuments", "", "<img src=\"" . KTHtml::getCancelButton() . "\" border=\"0\"></td></tr>"); | ||
| 53 | - $sToRender .= "</table>"; | ||
| 54 | - return $sToRender; | ||
| 55 | -} | ||
| 56 | - | ||
| 57 | -/** | ||
| 58 | - * Displays the status of expunged documents | ||
| 59 | - */ | ||
| 60 | -function renderStatusPage($aSuccessDocuments, $aErrorDocuments) { | ||
| 61 | - global $default; | ||
| 62 | - | ||
| 63 | - $sToRender = renderHeading(_("Expunge Deleted Documents Status")); | ||
| 64 | - $sToRender .= "<table>"; | ||
| 65 | - if (count($aSuccessDocuments) > 0) { | ||
| 66 | - $sToRender .= "<tr><td>" . _("The following documents were successfully expunged:") . "</td></tr>\n"; | ||
| 67 | - $sToRender .= "<tr/><tr/>"; | ||
| 68 | - for ($i=0; $i<count($aSuccessDocuments); $i++) { | ||
| 69 | - $sToRender .= "<tr><td>" . $aSuccessDocuments[$i] . "</td></tr>\n"; | ||
| 70 | - } | ||
| 71 | - } | ||
| 72 | - if (count($aErrorDocuments) > 0) { | ||
| 73 | - $sToRender .= "<tr><td>" . _("There were errors restoring the following documents:") . "</td></tr>\n"; | ||
| 74 | - $sToRender .= "<tr/><tr/>"; | ||
| 75 | - for ($i=0; $i<count($aErrorDocuments); $i++) { | ||
| 76 | - $sToRender .= "<tr><td>" . $aErrorDocuments[$i] . "</td></tr>\n"; | ||
| 77 | - } | ||
| 78 | - } | ||
| 79 | - $sToRender .= "<tr/><tr/>"; | ||
| 80 | - $sToRender .= "<tr><td>" . generateControllerLink("deletedDocuments", "", "<img src=\"" . KTHtml::getBackButton() . "\" border=\"0\"></td></tr>"); | ||
| 81 | - $sToRender .= "</table>"; | ||
| 82 | - return $sToRender; | ||
| 83 | -} | ||
| 84 | -?> |
presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/listDeletedDocumentsUI.inc deleted
| 1 | -<?php | ||
| 2 | -/** | ||
| 3 | - * $Id$ | ||
| 4 | - * | ||
| 5 | - * This page holds all presentation code for displaying deleted documents management pages. | ||
| 6 | - * | ||
| 7 | - * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com | ||
| 8 | - * | ||
| 9 | - * This program is free software; you can redistribute it and/or modify | ||
| 10 | - * it under the terms of the GNU General Public License as published by | ||
| 11 | - * the Free Software Foundation; either version 2 of the License, or | ||
| 12 | - * (at your option) any later version. | ||
| 13 | - * | ||
| 14 | - * This program is distributed in the hope that it will be useful, | ||
| 15 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | - * GNU General Public License for more details. | ||
| 18 | - * | ||
| 19 | - * You should have received a copy of the GNU General Public License | ||
| 20 | - * along with this program; if not, write to the Free Software | ||
| 21 | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 22 | - * | ||
| 23 | - * @version $Revision$ | ||
| 24 | - * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa | ||
| 25 | - * @package administration.documentmanagement | ||
| 26 | - */ | ||
| 27 | - | ||
| 28 | -/** | ||
| 29 | - * Lists all deleted documents | ||
| 30 | - */ | ||
| 31 | -function renderListDeletedDocumentsPage($aDocuments) { | ||
| 32 | - global $default; | ||
| 33 | - | ||
| 34 | - $sToRender = renderHeading(_("Expunge Deleted Documents")); | ||
| 35 | - $sToRender .= "<table>"; | ||
| 36 | - if (count($aDocuments) > 0) { | ||
| 37 | - $sToRender .= "<tr><td>" . _("The following documents have been deleted from the DMS.") . "</td></tr>\n"; | ||
| 38 | - $sToRender .= "<tr><td>" . _("Select the documents you would like to completely remove and click 'Expunge', or click on the document name link to restore the document.") . "</td></tr>\n"; | ||
| 39 | - $sToRender .= "<tr/><tr/>"; | ||
| 40 | - // loop through them | ||
| 41 | - for ($i = 0; $i < count($aDocuments); $i++) { | ||
| 42 | - $sToRender .= "\t<tr>\n"; | ||
| 43 | - $sToRender .= "\t\t<td bgcolor=\"" . getColour($i) . "\">\n"; | ||
| 44 | - $sToRender .= "<input type=\"checkbox\" name=\"fDocumentIDs[]\" value=\"" . $aDocuments[$i]->getID() . "\"/>\n"; | ||
| 45 | - // get an existing folder to restore the document to | ||
| 46 | - $oFolder = Folder::get($aDocuments[$i]->getFolderID()); | ||
| 47 | - // if the folder no longer exists, use the root folder to start browsing from | ||
| 48 | - $iFolderID = ($oFolder ? $aDocuments[$i]->getFolderID() : User::getUserRootFolderID()); | ||
| 49 | - $sToRender .= generateControllerLink("restoreDeletedDocument", | ||
| 50 | - "fDocumentID=" . $aDocuments[$i]->getID() . "&fFolderID=$iFolderID", | ||
| 51 | - ($aDocuments[$i]->getFolderID() == $iFolderID) ? $aDocuments[$i]->getDisplayPath(true) : $aDocuments[$i]->getIcon() . $aDocuments[$i]->getName()) . "\n"; | ||
| 52 | - $sToRender .= "\t\t</td>\n"; | ||
| 53 | - $sToRender .= "\t</tr>\n"; | ||
| 54 | - } | ||
| 55 | - $sToRender .= "<tr/><tr/>"; | ||
| 56 | - $sToRender .= "<tr><td><input type=\"image\" src=\"" . KTHtml::getExpungeButton() . "\" border=\"0\"/></td></tr>\n"; | ||
| 57 | - } else { | ||
| 58 | - $sToRender .= "<tr><td>" . _("There are currently no deleted documents in the system") . "</td></tr>"; | ||
| 59 | - $sToRender .= "<tr/><tr/>"; | ||
| 60 | - $sToRender .= "<tr><td><a href=\"javascript:history.go(-1)\"><img src=\"" . KTHtml::getBackButton() . "\" border=\"0\"/></a></td></tr>\n"; | ||
| 61 | - | ||
| 62 | - } | ||
| 63 | - $sToRender .= "</table>"; | ||
| 64 | - return $sToRender; | ||
| 65 | -} | ||
| 66 | -?> |
presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/manageArchivedDocumentsBL.php deleted
| 1 | -<?php | ||
| 2 | -/** | ||
| 3 | - * $Id$ | ||
| 4 | - * | ||
| 5 | - * Business logic for searching archived documents | ||
| 6 | - * | ||
| 7 | - * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com | ||
| 8 | - * | ||
| 9 | - * This program is free software; you can redistribute it and/or modify | ||
| 10 | - * it under the terms of the GNU General Public License as published by | ||
| 11 | - * the Free Software Foundation; either version 2 of the License, or | ||
| 12 | - * (at your option) any later version. | ||
| 13 | - * | ||
| 14 | - * This program is distributed in the hope that it will be useful, | ||
| 15 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | - * GNU General Public License for more details. | ||
| 18 | - * | ||
| 19 | - * You should have received a copy of the GNU General Public License | ||
| 20 | - * along with this program; if not, write to the Free Software | ||
| 21 | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 22 | - * | ||
| 23 | - * @version $Revision$ | ||
| 24 | - * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa | ||
| 25 | - * @package administration.documentmanagement | ||
| 26 | - */ | ||
| 27 | - | ||
| 28 | -require_once("../../../../../config/dmsDefaults.php"); | ||
| 29 | - | ||
| 30 | -require_once("$default->fileSystemRoot/presentation/Html.inc"); | ||
| 31 | - | ||
| 32 | -KTUtil::extractGPC('fConfirm', 'fDocumentIDs', 'fForSearch', 'fSearchString', 'fShowSection', 'fStartIndex', 'fToSearch'); | ||
| 33 | - | ||
| 34 | -if (checkSession()) { | ||
| 35 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternBrowsableSearchResults.inc"); | ||
| 36 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternEditableTableSqlQuery.inc"); | ||
| 37 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | ||
| 38 | - require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); | ||
| 39 | - require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); | ||
| 40 | - require_once("$default->fileSystemRoot/lib/security/Permission.inc"); | ||
| 41 | - require_once("$default->fileSystemRoot/lib/archiving/ArchiveRestorationRequest.inc"); | ||
| 42 | - require_once("$default->fileSystemRoot/presentation/Html.inc"); | ||
| 43 | - require_once(KT_DIR . "/presentation/lookAndFeel/knowledgeTree/search/advancedSearchUtil.inc"); | ||
| 44 | - require_once(KT_DIR . "/presentation/lookAndFeel/knowledgeTree/search/advancedSearchUI.inc"); | ||
| 45 | - require_once("archivedDocumentsUI.inc"); | ||
| 46 | - | ||
| 47 | - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | ||
| 48 | - | ||
| 49 | - $main->setFormAction($_SERVER["PHP_SELF"]); | ||
| 50 | - | ||
| 51 | - if (!isset($fStartIndex)) { | ||
| 52 | - $fStartIndex = 1; | ||
| 53 | - } | ||
| 54 | - | ||
| 55 | - $oContent = new PatternCustom; | ||
| 56 | - | ||
| 57 | - if (strlen($fForSearch)) { | ||
| 58 | - dealWithAdvancedSearch($_REQUEST, $fStartIndex); | ||
| 59 | - } else if ($fDocumentIDs) { | ||
| 60 | - // got some documents to restore | ||
| 61 | - | ||
| 62 | - // instantiate document objects | ||
| 63 | - $aDocuments = array(); | ||
| 64 | - for ($i = 0; $i < count($fDocumentIDs); $i++) { | ||
| 65 | - $aDocuments[] = & Document::get($fDocumentIDs[$i]); | ||
| 66 | - } | ||
| 67 | - | ||
| 68 | - if ($fConfirm) { | ||
| 69 | - // restore the specified documents | ||
| 70 | - | ||
| 71 | - $aErrorDocuments = array(); | ||
| 72 | - $aSuccessDocuments = array(); | ||
| 73 | - for ($i = 0; $i < count($aDocuments); $i++) { | ||
| 74 | - if ($aDocuments[$i]) { | ||
| 75 | - // set the status to live | ||
| 76 | - $aDocuments[$i]->setStatusID(LIVE); | ||
| 77 | - if ($aDocuments[$i]->update()) { | ||
| 78 | - // success | ||
| 79 | - $default->log->info("manageArchivedDocumentsBL.php set status for document id=" . $fDocumentIDs[$i]); | ||
| 80 | - $aSuccessDocuments[] = $aDocuments[$i]; | ||
| 81 | - | ||
| 82 | - // check if there are requests for this document to be archived | ||
| 83 | - $aRequests = ArchiveRestorationRequest::getList(array("document_id = ?", $aDocuments[$i]->getID()));/*ok*/ | ||
| 84 | - $default->log->info("manageArchivedDocumentsBL.php about to send notification for " . count($aRequests) . " restoration requests for document id " . $aDocuments[$i]->getID()); | ||
| 85 | - for ($j=0; $j<count($aRequests); $j++) { | ||
| 86 | - // email the users | ||
| 87 | - // FIXME: refactor notification | ||
| 88 | - // TODO: check email notification and valid email address | ||
| 89 | - $oRequestUser = User::get($aRequests[$j]->getRequestUserID()); | ||
| 90 | - $sBody = "The document '" . generateControllerLink("viewDocument", "fDocumentID=" . $aDocuments[$i]->getID(), $aDocuments[$i]->getName()) . "'"; | ||
| 91 | - $sBody .= " has been restored from the archive."; | ||
| 92 | - $oEmail = & new Email(); | ||
| 93 | - if ($oEmail->send($oRequestUser->getEmail(), _("Archived Document Restored"), $sBody)) { | ||
| 94 | - $default->log->info("manageArchivedDocumentsBL.php sent email to " . $oRequestUser->getEmail()); | ||
| 95 | - // now delete the request | ||
| 96 | - $iRequestID = $aRequests[$j]->getID(); | ||
| 97 | - if ($aRequests[$j]->delete()) { | ||
| 98 | - $default->log->info("manageArchivedDocumentsBL.php removing restoration request $iRequestID"); | ||
| 99 | - } else { | ||
| 100 | - $default->log->error("manageArchivedDocumentsBL.php error removing request $iRequestID"); | ||
| 101 | - } | ||
| 102 | - } else { | ||
| 103 | - $default->log->error("manageArchivedDocumentsBL.php error notifying " . arrayToString($oEmail) . " for document id " . $aDocuments[$i]->getID() . " restoration"); | ||
| 104 | - } | ||
| 105 | - } | ||
| 106 | - } else { | ||
| 107 | - // error updating status change | ||
| 108 | - $default->log->error("manageArchivedDocumentsBL.php couldn't retrieve document id=" . $fDocumentIDs[$i]); | ||
| 109 | - $aErrorDocuments[] = $aDocuments[$i]; | ||
| 110 | - } | ||
| 111 | - } else { | ||
| 112 | - // error retrieving document object | ||
| 113 | - $default->log->error("manageArchivedDocumentsBL.php couldn't retrieve document id=" . $fDocumentIDs[$i]); | ||
| 114 | - } | ||
| 115 | - } | ||
| 116 | - // display status page. | ||
| 117 | - $oContent->setHtml(renderStatusPage($aSuccessDocuments, $aErrorDocuments)); | ||
| 118 | - } else { | ||
| 119 | - // ask for confirmation before restoring the documents | ||
| 120 | - $oContent->setHtml(renderRestoreConfirmationPage($aDocuments)); | ||
| 121 | - } | ||
| 122 | - } else { | ||
| 123 | - //display search criteria | ||
| 124 | - $oContent->setHtml(getSearchPage("", array(), _("Archived Documents Search"), true)); | ||
| 125 | - $main->setFormAction($_SERVER["PHP_SELF"] . "?fForSearch=1"); | ||
| 126 | - } | ||
| 127 | - $main->setHasRequiredFields(true); | ||
| 128 | - $main->setCentralPayload($oContent); | ||
| 129 | - $main->render(); | ||
| 130 | -} | ||
| 131 | - | ||
| 132 | -?> |
presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/restoreDeletedDocumentsUI.inc deleted
| 1 | -<?php | ||
| 2 | -/** | ||
| 3 | - * $Id$ | ||
| 4 | - * | ||
| 5 | - * This page holds all presentation code for expunging documents pages. | ||
| 6 | - * | ||
| 7 | - * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com | ||
| 8 | - * | ||
| 9 | - * This program is free software; you can redistribute it and/or modify | ||
| 10 | - * it under the terms of the GNU General Public License as published by | ||
| 11 | - * the Free Software Foundation; either version 2 of the License, or | ||
| 12 | - * (at your option) any later version. | ||
| 13 | - * | ||
| 14 | - * This program is distributed in the hope that it will be useful, | ||
| 15 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | - * GNU General Public License for more details. | ||
| 18 | - * | ||
| 19 | - * You should have received a copy of the GNU General Public License | ||
| 20 | - * along with this program; if not, write to the Free Software | ||
| 21 | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 22 | - * | ||
| 23 | - * @version $Revision$ | ||
| 24 | - * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa | ||
| 25 | - * @package administration.documentmanagement | ||
| 26 | - */ | ||
| 27 | - | ||
| 28 | -/** | ||
| 29 | - * Displays the status of expunged documents | ||
| 30 | - */ | ||
| 31 | -function renderStatusPage($oDocument) { | ||
| 32 | - global $default; | ||
| 33 | - | ||
| 34 | - $sToRender = renderHeading(_("Restore Deleted Document")); | ||
| 35 | - $sToRender .= "<table>"; | ||
| 36 | - $sToRender .= "<tr><td>" . _("The document") . " <strong>" . $oDocument->getName() . "</strong> " . _("was successfully restored:") . "</td></tr>\n"; | ||
| 37 | - $sToRender .= "<tr><td>" . generateControllerLink("viewDocument", "fDocumentID=" . $oDocument->getID(), $oDocument->getDisplayPath(true)) . "\n"; | ||
| 38 | - $sToRender .= "<tr/><tr/>"; | ||
| 39 | - | ||
| 40 | - $sToRender .= "<tr><td>" . generateControllerLink("deletedDocuments", "", "<img src=\"" . KTHtml::getBackButton() . "\" border=\"0\"></td></tr>"); | ||
| 41 | - $sToRender .= "</table>"; | ||
| 42 | - return $sToRender; | ||
| 43 | -} | ||
| 44 | - | ||
| 45 | -/** | ||
| 46 | - * Gives the user a last chance to bail out before restoring the document | ||
| 47 | - */ | ||
| 48 | -function renderConfirmationPage($iDocumentID, $iFolderID) { | ||
| 49 | - global $default; | ||
| 50 | - $sToRender = renderHeading(_("Restore Deleted Document")); | ||
| 51 | - $sToRender .= "<table>\n"; | ||
| 52 | - $sToRender .= "<tr>\n<td>" . | ||
| 53 | - sprintf(_("Are you sure you want to restore deleted document <strong>%s</strong>"),Document::getDocumentName($iDocumentID)) . | ||
| 54 | - "</td></tr>"; | ||
| 55 | - $sToRender .= "<tr><td>" . _("to folder") . " <strong>" . Folder::getFolderDisplayPath($iFolderID) . "</strong>?</td></tr>\n"; | ||
| 56 | - $sToRender .= "</tr><tr/><tr/>\n"; | ||
| 57 | - $sToRender .= "<tr><td>" . generateControllerLink("restoreDeletedDocument", "fDocumentID=$iDocumentID&fFolderID=$iFolderID&fForMove=1&fConfirmed=1", "<img src=\"" . KTHtml::getRestoreButton() . "\" border=\"0\"/>") . " "; | ||
| 58 | - $sToRender .= generateControllerLink("restoreDeletedDocument", "fDocumentID=$iDocumentID&fFolderID=$iFolderID", "<img src=\"" . KTHtml::getCancelButton() . "\" border=\"0\"/>") . "</td></tr>\n"; | ||
| 59 | - $sToRender .= "</table>\n"; | ||
| 60 | - return $sToRender; | ||
| 61 | -} | ||
| 62 | - | ||
| 63 | -/** | ||
| 64 | - * Displays the folder browse page | ||
| 65 | - */ | ||
| 66 | -function renderFolderBrowsePage($iDocumentID, $iFolderID) { | ||
| 67 | - global $default; | ||
| 68 | - $sToRender = renderHeading(_("Restore Deleted Document")); | ||
| 69 | - $sToRender .= "<table width=100%>\n"; | ||
| 70 | - $sToRender .= "<tr>\n"; | ||
| 71 | - $sToRender .= "<td>" . renderFolderPath($iFolderID, generateControllerUrl("restoreDeletedDocument", "fDocumentID=$iDocumentID", false)) . "</td>\n"; | ||
| 72 | - $sToRender .= "</tr>\n"; | ||
| 73 | - $sToRender .= "</table>\n"; | ||
| 74 | - $sToRender .= "<table width=\"100%\">\n"; | ||
| 75 | - $sToRender .= "<tr>\n"; | ||
| 76 | - $sToRender .= "<td>" . renderFolderList($iFolderID, generateControllerUrl("restoreDeletedDocument", "fDocumentID=$iDocumentID", false)) . "</td>\n"; | ||
| 77 | - $sToRender .= "</tr>\n"; | ||
| 78 | - $sToRender .= "<tr><td><table><tr><td colspan=\"3\">" . _("Select the folder you would like to restore deleted document") . " <strong>" . Document::getDocumentName($iDocumentID) . "</strong> to.</td></tr>"; | ||
| 79 | - $sToRender .= "<tr/><tr><td><input type=\"image\" src=\"" . KTHtml::getRestoreHereButton() . "\" border=\"0\"/> " . generateControllerLink("deletedDocuments", "", "<img src=\"" . KTHtml::getCancelButton() . "\" border=\"0\">") . "</td></tr></table></td>\n"; | ||
| 80 | - $sToRender .= "</table>\n"; | ||
| 81 | - return $sToRender; | ||
| 82 | -} | ||
| 83 | -?> |