diff --git a/presentation/lookAndFeel/knowledgeTree/documentmanagement/moveDocumentBL.php b/presentation/lookAndFeel/knowledgeTree/documentmanagement/moveDocumentBL.php index a8b5f91..476191a 100644 --- a/presentation/lookAndFeel/knowledgeTree/documentmanagement/moveDocumentBL.php +++ b/presentation/lookAndFeel/knowledgeTree/documentmanagement/moveDocumentBL.php @@ -27,7 +27,7 @@ require_once("../../../../config/dmsDefaults.php"); -KTUtil::extractGPC('fConfirmed', 'fDocumentIDs', 'fFolderID', 'fForMove'); +KTUtil::extractGPC('fConfirmed', 'fDocumentIDs', 'fFolderID', 'fForMove', 'fRememberDocumentID'); require_once("$default->fileSystemRoot/lib/security/Permission.inc"); @@ -50,6 +50,15 @@ require_once("$default->fileSystemRoot/presentation/Html.inc"); $aUnmovedDocs = array(); if (checkSession()) { + + if (isset($fRememberDocumentID)) { + $fDocumentIDs = $_SESSION['documents'][$fRememberDocumentID]; + } else { + $sUniqueID = KTUtil::randomString(); + $_SESSION["documents"][$sUniqueID] = $fDocumentIDs; + $fRememberDocumentID = $sUniqueID; + } + if (isset($fDocumentIDs) && isset($fFolderID)) { if (isset($fForMove)) { @@ -167,28 +176,28 @@ if (checkSession()) { $sNewDocumentFileSystemPath = Folder::getFolderPath($fFolderID) . $oDocument->getFileName(); if (!file_exists($sNewDocumentFileSystemPath)) { // display confirmation page - $oPatternCustom->setHtml(getConfirmationPage($fFolderID, $fDocumentIDs)); + $oPatternCustom->setHtml(getConfirmationPage($fFolderID, $fRememberDocumentID)); } else { // filename collision - $oPatternCustom->setHtml(getPage($fFolderID, $fDocumentIDs, _("This folder already contains a document of the same name.") . " " . _("Please choose another directory"))); + $oPatternCustom->setHtml(getPage($fFolderID, $fRememberDocumentID, _("This folder already contains a document of the same name.") . " " . _("Please choose another directory"))); break; } } else { // the right document type isn't mapped - $oPatternCustom->setHtml(getPage($fFolderID, $fDocumentIDs, _("You can't move the document to this folder because it cannot store the document type of your document.") . " " . _("Please choose another directory"))); + $oPatternCustom->setHtml(getPage($fFolderID, $fRememberDocumentID, _("You can't move the document to this folder because it cannot store the document type of your document.") . " " . _("Please choose another directory"))); break; } } - $main->setFormAction($_SERVER["PHP_SELF"] . "?fForMove=1&fDocumentID=$fDocumentID&fFolderID=$fFolderID"); + $main->setFormAction($_SERVER["PHP_SELF"] . "?fForMove=1&fRememberDocumentID=$fRememberDocumentID&fFolderID=$fFolderID"); $main->setCentralPayload($oPatternCustom); $main->render(); } } else { // (isset($fForMove)) require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); $oPatternCustom = & new PatternCustom(); - $oPatternCustom->setHtml(getPage($fFolderID, $fDocumentIDs)); + $oPatternCustom->setHtml(getPage($fFolderID, $fRememberDocumentID)); $main->setCentralPayload($oPatternCustom); - $main->setFormAction($_SERVER["PHP_SELF"] . "?fForMove=1&fDocumentID=$fDocumentID&fFolderID=$fFolderID"); + $main->setFormAction($_SERVER["PHP_SELF"] . "?fForMove=1&fRememberDocumentID=$fRememberDocumentID&fFolderID=$fFolderID"); $main->render(); } } else { // (isset($fDocumentIDs) && isset($fFolderID)) diff --git a/presentation/lookAndFeel/knowledgeTree/documentmanagement/moveDocumentUI.inc b/presentation/lookAndFeel/knowledgeTree/documentmanagement/moveDocumentUI.inc index f3233b7..a2d92cb 100644 --- a/presentation/lookAndFeel/knowledgeTree/documentmanagement/moveDocumentUI.inc +++ b/presentation/lookAndFeel/knowledgeTree/documentmanagement/moveDocumentUI.inc @@ -25,8 +25,10 @@ * @package documentmanagement */ -function getConfirmationPage($iFolderID, $iDocumentIDs) { +function getConfirmationPage($iFolderID, $sRememberDocumentID) { global $default; + $iDocumentIDs = $_SESSION['documents'][$sRememberDocumentID]; + $sToRender = renderHeading(_("Move Document")); $sToRender .= "\n"; $sToRender .= "\n"; @@ -37,8 +39,8 @@ function getConfirmationPage($iFolderID, $iDocumentIDs) { $sToRender .= "\n"; $sToRender .= "\n"; - $sQueryString .= "fDocumentIDs[]=$iDocumentIDs[$i]&"; } + $sQueryString .= "fRememberDocumentID=$sRememberDocumentID&"; $sToRender .= "\n"; $sToRender .= "
" . _("Are you sure you want to move") . ":
" . $oDocument->getDisplayPath() . "  " . _("to") . "  " . Folder::getFolderDisplayPath($iFolderID) . " > " . $oDocument->getFileName() . "
rootUrl/control.php?action=moveDocument&" . $sQueryString . @@ -53,8 +55,10 @@ function getConfirmationPage($iFolderID, $iDocumentIDs) { } -function getPage($iFolderID, $iDocumentIDs, $sErrorMessage = "") { +function getPage($iFolderID, $sRememberDocumentID, $sErrorMessage = "") { global $default; + $iDocumentIDs = $_SESSION['documents'][$sRememberDocumentID]; + $sToRender = renderHeading(_("Move Document")); $sToRender .= "\n"; if ($sErrorMessage) { @@ -65,8 +69,8 @@ function getPage($iFolderID, $iDocumentIDs, $sErrorMessage = "") { for ($i = 0; $i < count($iDocumentIDs); $i++) { $sToRender .= "\n"; $sToRender .= "\n"; - $sQueryString .= "fDocumentIDs[]=$iDocumentIDs[$i]&"; } + $sQueryString .= "fRememberDocumentID=$sRememberDocumentID&"; $sToRender .= ""; $sToRender .= "\n";
  '" . Document::getDocumentDisplayPath($iDocumentIDs[$i]) . "'
" . _("To Folder") . ":