From 4e0c677e9c739b23d5b9c5108392d3f5001d2e30 Mon Sep 17 00:00:00 2001 From: nbm Date: Wed, 15 Jun 2005 19:54:21 +0000 Subject: [PATCH] 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. --- presentation/lookAndFeel/knowledgeTree/documentmanagement/browseBL.php | 11 ++++------- presentation/lookAndFeel/knowledgeTree/documentmanagement/browseUI.inc | 4 ++-- presentation/lookAndFeel/knowledgeTree/documentmanagement/deleteDocumentBL.php | 12 ++++++++++-- presentation/lookAndFeel/knowledgeTree/documentmanagement/deleteDocumentUI.inc | 5 +++-- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/presentation/lookAndFeel/knowledgeTree/documentmanagement/browseBL.php b/presentation/lookAndFeel/knowledgeTree/documentmanagement/browseBL.php index 63ed1d4..dafd7a9 100644 --- a/presentation/lookAndFeel/knowledgeTree/documentmanagement/browseBL.php +++ b/presentation/lookAndFeel/knowledgeTree/documentmanagement/browseBL.php @@ -58,12 +58,9 @@ if (!checkSession()) { if (isset($fActions)) { // tack on POSTed document ids and redirect to the expunge deleted documents page - $sQueryString = ""; - if (isset($fDocumentIDs) ) { - foreach ($fDocumentIDs as $fDocumentID) { - $sQueryString .= "fDocumentIDs[]=$fDocumentID&"; - } - } + $sUniqueID = KTUtil::randomString(); + $_SESSION["documents"][$sUniqueID] = $fDocumentIDs; + $sQueryString = "fRememberDocumentID=$sUniqueID&"; $sQueryString .= "fReturnFolderID=$fFolderID&"; switch ($fActions) { @@ -130,7 +127,7 @@ if (($fBrowseType == "folder") && (!isset($fFolderID))) { $oContent->addHtml(renderPage($aResults, $fBrowseType, $fSortBy, $fSortDirection)); $main->setCentralPayload($oContent); $main->setFormAction($_SERVER["PHP_SELF"]); -$main->setSubmitMethod("GET"); +$main->setSubmitMethod("GET"); $main->render(); ?> diff --git a/presentation/lookAndFeel/knowledgeTree/documentmanagement/browseUI.inc b/presentation/lookAndFeel/knowledgeTree/documentmanagement/browseUI.inc index 553455c..3ac391f 100644 --- a/presentation/lookAndFeel/knowledgeTree/documentmanagement/browseUI.inc +++ b/presentation/lookAndFeel/knowledgeTree/documentmanagement/browseUI.inc @@ -334,8 +334,8 @@ function renderDocumentList($aResults, $sNoDocumentsMessage, $sNoPermissionMessa $sToRender .= "columns() + 1) . "\" >"; $sToRender .= ""; - $sToRender .= ""; - $sToRender .= ""; + $sToRender .= ""; + $sToRender .= ""; $sToRender .= "\n"; // Change for group Operations diff --git a/presentation/lookAndFeel/knowledgeTree/documentmanagement/deleteDocumentBL.php b/presentation/lookAndFeel/knowledgeTree/documentmanagement/deleteDocumentBL.php index dfa7784..57325b7 100644 --- a/presentation/lookAndFeel/knowledgeTree/documentmanagement/deleteDocumentBL.php +++ b/presentation/lookAndFeel/knowledgeTree/documentmanagement/deleteDocumentBL.php @@ -28,7 +28,7 @@ require_once("../../../../config/dmsDefaults.php"); -KTUtil::extractGPC('fDeleteConfirmed', 'fDocumentIDs'); +KTUtil::extractGPC('fDeleteConfirmed', 'fDocumentIDs', 'fRememberDocumentID'); require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); require_once("$default->fileSystemRoot/lib/foldermanagement/FolderUserRole.inc"); @@ -48,6 +48,14 @@ require_once("deleteDocumentUI.inc"); $aNondeletedDocs = array(); if (checkSession()) { + + if (isset($fRememberDocumentID)) { + $fDocumentIDs = $_SESSION['documents'][$fRememberDocumentID]; + } else { + $sUniqueID = KTUtil::randomString(); + $_SESSION["documents"][$sUniqueID] = $fDocumentIDs; + $fRememberDocumentID = $sUniqueID; + } if (isset($fDocumentIDs)) { @@ -212,7 +220,7 @@ if (checkSession()) { //get confirmation first require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); $oPatternCustom = & new PatternCustom(); - $oPatternCustom->addHtml(getPage($fDocumentIDs)); + $oPatternCustom->addHtml(getPage($fRememberDocumentID)); $main->setCentralPayload($oPatternCustom); $main->render(); } diff --git a/presentation/lookAndFeel/knowledgeTree/documentmanagement/deleteDocumentUI.inc b/presentation/lookAndFeel/knowledgeTree/documentmanagement/deleteDocumentUI.inc index 54343f0..d2d4460 100644 --- a/presentation/lookAndFeel/knowledgeTree/documentmanagement/deleteDocumentUI.inc +++ b/presentation/lookAndFeel/knowledgeTree/documentmanagement/deleteDocumentUI.inc @@ -24,8 +24,9 @@ * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa * @package documentmanagement */ -function getPage($aDocumentIDs) { +function getPage($sRememberDocumentID) { global $default; + $aDocumentIDs = $_SESSION['documents'][$sRememberDocumentID]; $sToRender = renderHeading(_("Delete Document")); $sToRender .= "\n"; $sToRender .= "\n"; @@ -35,8 +36,8 @@ function getPage($aDocumentIDs) { $oDocument = Document::get($aDocumentIDs[$i]); $sToRender .= "\n"; $sToRender .= "\n"; - $sQueryString .= "fDocumentIDs[]=$aDocumentIDs[$i]&"; } + $sQueryString = "fRememberDocumentID=$sRememberDocumentID&"; $sToRender .= "\n"; $sToRender .= "\n"; -- libgit2 0.21.4
  '" . $oDocument->getDisplayPath() . "'
" . _("Select 'Delete' to confirm the deletion, or 'Cancel' to cancel it") . "