Commit 4e0c677e9c739b23d5b9c5108392d3f5001d2e30
1 parent
3c61f02a
Allow large numbers of documents to be deleted or moved by using POST
for the initial submission, and then forwarding a unique identifier as a key to a list of documents to delete in the session. Reported by: Ray Booysen (twyford) SF Tracker: 1221326 git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3373 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
4 changed files
with
19 additions
and
13 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/browseBL.php
| ... | ... | @@ -58,12 +58,9 @@ if (!checkSession()) { |
| 58 | 58 | |
| 59 | 59 | if (isset($fActions)) { |
| 60 | 60 | // tack on POSTed document ids and redirect to the expunge deleted documents page |
| 61 | - $sQueryString = ""; | |
| 62 | - if (isset($fDocumentIDs) ) { | |
| 63 | - foreach ($fDocumentIDs as $fDocumentID) { | |
| 64 | - $sQueryString .= "fDocumentIDs[]=$fDocumentID&"; | |
| 65 | - } | |
| 66 | - } | |
| 61 | + $sUniqueID = KTUtil::randomString(); | |
| 62 | + $_SESSION["documents"][$sUniqueID] = $fDocumentIDs; | |
| 63 | + $sQueryString = "fRememberDocumentID=$sUniqueID&"; | |
| 67 | 64 | $sQueryString .= "fReturnFolderID=$fFolderID&"; |
| 68 | 65 | |
| 69 | 66 | switch ($fActions) { |
| ... | ... | @@ -130,7 +127,7 @@ if (($fBrowseType == "folder") && (!isset($fFolderID))) { |
| 130 | 127 | $oContent->addHtml(renderPage($aResults, $fBrowseType, $fSortBy, $fSortDirection)); |
| 131 | 128 | $main->setCentralPayload($oContent); |
| 132 | 129 | $main->setFormAction($_SERVER["PHP_SELF"]); |
| 133 | -$main->setSubmitMethod("GET"); | |
| 130 | +$main->setSubmitMethod("GET"); | |
| 134 | 131 | $main->render(); |
| 135 | 132 | |
| 136 | 133 | ?> | ... | ... |
presentation/lookAndFeel/knowledgeTree/documentmanagement/browseUI.inc
| ... | ... | @@ -334,8 +334,8 @@ function renderDocumentList($aResults, $sNoDocumentsMessage, $sNoPermissionMessa |
| 334 | 334 | $sToRender .= "<tr><td colspan=\"" . ($oBrowser->columns() + 1) . "\" >"; |
| 335 | 335 | $sToRender .= "<input type=\"hidden\" name=\"fActions\">"; |
| 336 | 336 | |
| 337 | - $sToRender .= "<input type=\"image\" onclick=\"document.MainForm.fActions.value='move'; document.MainForm.submit()\" src=\"" . KTHtml::getMoveButton() . "\" border=\"0\"/>"; | |
| 338 | - $sToRender .= "<input type=\"image\" onclick=\"document.MainForm.fActions.value='delete'; document.MainForm.submit()\" src=\"" . KTHtml::getDeleteButton() . "\" border=\"0\"/>"; | |
| 337 | + $sToRender .= "<input type=\"image\" onclick=\"document.MainForm.fActions.value='move'; document.MainForm.method = 'POST'; document.MainForm.submit()\" src=\"" . KTHtml::getMoveButton() . "\" border=\"0\"/>"; | |
| 338 | + $sToRender .= "<input type=\"image\" onclick=\"document.MainForm.fActions.value='delete'; document.MainForm.method = 'POST'; document.MainForm.submit()\" src=\"" . KTHtml::getDeleteButton() . "\" border=\"0\"/>"; | |
| 339 | 339 | $sToRender .= "</td></tr>\n"; |
| 340 | 340 | // Change for group Operations |
| 341 | 341 | ... | ... |
presentation/lookAndFeel/knowledgeTree/documentmanagement/deleteDocumentBL.php
| ... | ... | @@ -28,7 +28,7 @@ |
| 28 | 28 | |
| 29 | 29 | require_once("../../../../config/dmsDefaults.php"); |
| 30 | 30 | |
| 31 | -KTUtil::extractGPC('fDeleteConfirmed', 'fDocumentIDs'); | |
| 31 | +KTUtil::extractGPC('fDeleteConfirmed', 'fDocumentIDs', 'fRememberDocumentID'); | |
| 32 | 32 | |
| 33 | 33 | require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); |
| 34 | 34 | require_once("$default->fileSystemRoot/lib/foldermanagement/FolderUserRole.inc"); |
| ... | ... | @@ -48,6 +48,14 @@ require_once("deleteDocumentUI.inc"); |
| 48 | 48 | $aNondeletedDocs = array(); |
| 49 | 49 | |
| 50 | 50 | if (checkSession()) { |
| 51 | + | |
| 52 | + if (isset($fRememberDocumentID)) { | |
| 53 | + $fDocumentIDs = $_SESSION['documents'][$fRememberDocumentID]; | |
| 54 | + } else { | |
| 55 | + $sUniqueID = KTUtil::randomString(); | |
| 56 | + $_SESSION["documents"][$sUniqueID] = $fDocumentIDs; | |
| 57 | + $fRememberDocumentID = $sUniqueID; | |
| 58 | + } | |
| 51 | 59 | |
| 52 | 60 | if (isset($fDocumentIDs)) { |
| 53 | 61 | |
| ... | ... | @@ -212,7 +220,7 @@ if (checkSession()) { |
| 212 | 220 | //get confirmation first |
| 213 | 221 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); |
| 214 | 222 | $oPatternCustom = & new PatternCustom(); |
| 215 | - $oPatternCustom->addHtml(getPage($fDocumentIDs)); | |
| 223 | + $oPatternCustom->addHtml(getPage($fRememberDocumentID)); | |
| 216 | 224 | $main->setCentralPayload($oPatternCustom); |
| 217 | 225 | $main->render(); |
| 218 | 226 | } | ... | ... |
presentation/lookAndFeel/knowledgeTree/documentmanagement/deleteDocumentUI.inc
| ... | ... | @@ -24,8 +24,9 @@ |
| 24 | 24 | * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa |
| 25 | 25 | * @package documentmanagement |
| 26 | 26 | */ |
| 27 | -function getPage($aDocumentIDs) { | |
| 27 | +function getPage($sRememberDocumentID) { | |
| 28 | 28 | global $default; |
| 29 | + $aDocumentIDs = $_SESSION['documents'][$sRememberDocumentID]; | |
| 29 | 30 | $sToRender = renderHeading(_("Delete Document")); |
| 30 | 31 | $sToRender .= "<table border=\"0\">\n"; |
| 31 | 32 | $sToRender .= "<tr>\n"; |
| ... | ... | @@ -35,8 +36,8 @@ function getPage($aDocumentIDs) { |
| 35 | 36 | $oDocument = Document::get($aDocumentIDs[$i]); |
| 36 | 37 | $sToRender .= "<tr>\n"; |
| 37 | 38 | $sToRender .= "<td> '" . $oDocument->getDisplayPath() . "'</td>\n"; |
| 38 | - $sQueryString .= "fDocumentIDs[]=$aDocumentIDs[$i]&"; | |
| 39 | 39 | } |
| 40 | + $sQueryString = "fRememberDocumentID=$sRememberDocumentID&"; | |
| 40 | 41 | $sToRender .= "<tr><tr><tr><tr>\n"; |
| 41 | 42 | |
| 42 | 43 | $sToRender .= "<td>" . _("Select 'Delete' to confirm the deletion, or 'Cancel' to cancel it") . "</td>\n"; | ... | ... |