From ae02a1cc63e726d894696a557d0016e41d977f55 Mon Sep 17 00:00:00 2001 From: Neil Blakey-Milner Date: Fri, 10 Jun 2005 19:03:31 +0000 Subject: [PATCH] Avoid using javascript:go(-1), instead pass returning IDs. --- presentation/lookAndFeel/knowledgeTree/documentmanagement/browseBL.php | 3 +++ presentation/lookAndFeel/knowledgeTree/documentmanagement/deleteDocumentUI.inc | 12 +++++++++++- presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/presentation/lookAndFeel/knowledgeTree/documentmanagement/browseBL.php b/presentation/lookAndFeel/knowledgeTree/documentmanagement/browseBL.php index f046d36..63ed1d4 100644 --- a/presentation/lookAndFeel/knowledgeTree/documentmanagement/browseBL.php +++ b/presentation/lookAndFeel/knowledgeTree/documentmanagement/browseBL.php @@ -64,15 +64,18 @@ if (isset($fActions)) { $sQueryString .= "fDocumentIDs[]=$fDocumentID&"; } } + $sQueryString .= "fReturnFolderID=$fFolderID&"; switch ($fActions) { case "delete": // delete all selected docs controllerRedirect("deleteDocument", $sQueryString); + exit(0); break; case "move": // Move selected docs to root folder controllerRedirect("moveDocument", $sQueryString . "fFolderID=1"); + exit(0); break; } } diff --git a/presentation/lookAndFeel/knowledgeTree/documentmanagement/deleteDocumentUI.inc b/presentation/lookAndFeel/knowledgeTree/documentmanagement/deleteDocumentUI.inc index 1abb0e3..54343f0 100644 --- a/presentation/lookAndFeel/knowledgeTree/documentmanagement/deleteDocumentUI.inc +++ b/presentation/lookAndFeel/knowledgeTree/documentmanagement/deleteDocumentUI.inc @@ -44,7 +44,17 @@ function getPage($aDocumentIDs) { $sToRender .= "\n"; $sToRender .= " \n"; $sToRender .= "\n"; - $sToRender .= "
"; + $sToRender .= "
"; + $sToRender .= ""; + $sToRender .= " "; + if (KTUtil::arrayGet($_REQUEST, "fReturnFolderID")) { + $sToRender .= generateControllerLink("browse", "fFolderID=" . $_REQUEST['fReturnFolderID'], ""); + } else if (KTUtil::arrayGet($_REQUEST, "fReturnDocumentID")) { + $sToRender .= generateControllerLink("viewDocument", "fDocumentID=" . $_REQUEST['fReturnDocumentID'], ""); + } else { + $sToRender .= ""; + } + $sToRender .= "
"; $sToRender .= ""; $sToRender .= "\n"; diff --git a/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc b/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc index 13f142c..940356f 100644 --- a/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc +++ b/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc @@ -481,6 +481,7 @@ function displayEmailButton($oDocument) { function displayDeleteButton($oDocument, $bEdit) { if ($bEdit) { $sQueryString = "fDocumentIDs[]=" . $oDocument->getID(); + $sQueryString .= "&fReturnDocumentID=" . $oDocument->getID(); if ($oDocument->getIsCheckedOut()) { $sDisabledText = _("This document can't be deleted because its checked out"); } -- libgit2 0.21.4