Commit 9a75fb15d6d73a7cb052f3c0b866c3e7ce13b455
1 parent
72a96a3c
Allow the user to select multiple documents for deletion or moving.
Submitted by: Stefano Ciancio <s.ciancio@pisa.iol.it> git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2944 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
8 changed files
with
307 additions
and
115 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/browseBL.php
| ... | ... | @@ -25,6 +25,7 @@ require_once("$default->fileSystemRoot/presentation/Html.inc"); |
| 25 | 25 | * fDocumentTypeID - the document type id to browse [optional depending on fBrowseType] |
| 26 | 26 | * fSortBy - the document attribute to sort the browse results by |
| 27 | 27 | * fSortDirection - the direction to sort |
| 28 | + * fActions - action for group operations | |
| 28 | 29 | * |
| 29 | 30 | * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com |
| 30 | 31 | * |
| ... | ... | @@ -49,6 +50,27 @@ require_once("$default->fileSystemRoot/presentation/Html.inc"); |
| 49 | 50 | |
| 50 | 51 | // only if we have a valid session |
| 51 | 52 | if (checkSession()) { |
| 53 | + if (isset($fActions)) { | |
| 54 | + // tack on POSTed document ids and redirect to the expunge deleted documents page | |
| 55 | + $sQueryString = ""; | |
| 56 | + if (isset($fDocumentIDs) ) { | |
| 57 | + foreach ($fDocumentIDs as $fDocumentID) { | |
| 58 | + $sQueryString .= "fDocumentIDs[]=$fDocumentID&"; | |
| 59 | + } | |
| 60 | + } | |
| 61 | + | |
| 62 | + switch ($fActions) { | |
| 63 | + case "delete": | |
| 64 | + // delete all selected docs | |
| 65 | + controllerRedirect("deleteDocument", $sQueryString); | |
| 66 | + break; | |
| 67 | + case "move": | |
| 68 | + // Move selected docs to root folder | |
| 69 | + controllerRedirect("moveDocument", $sQueryString . "fFolderID=1"); | |
| 70 | + break; | |
| 71 | + } | |
| 72 | + } | |
| 73 | + | |
| 52 | 74 | // retrieve variables |
| 53 | 75 | if (!$fBrowseType) { |
| 54 | 76 | // required param not set- internal error or user querystring hacking |
| ... | ... | @@ -86,4 +108,5 @@ if (checkSession()) { |
| 86 | 108 | $main->setSubmitMethod("GET"); |
| 87 | 109 | $main->render(); |
| 88 | 110 | } |
| 89 | -?> | |
| 90 | 111 | \ No newline at end of file |
| 112 | + | |
| 113 | +?> | ... | ... |
presentation/lookAndFeel/knowledgeTree/documentmanagement/browseUI.inc
| ... | ... | @@ -289,6 +289,7 @@ function renderDocumentList($aResults, $sNoDocumentsMessage, $sNoPermissionMessa |
| 289 | 289 | // in order for candy striping to work we need to take the number of folders |
| 290 | 290 | // into account when alternating |
| 291 | 291 | $sToRender .= "<tr bgcolor=\"" . getColour($i+$iFolderCount) . "\" width=\"100%\"><td valign=\"bottom\">" . |
| 292 | + "<input type=\"checkbox\" name=\"fDocumentIDs[]\" value=\"" . $aResults["documents"][$i]->getID() . "\"/>" . | |
| 292 | 293 | ($bTemplateBrowsing ? displayDocumentLinkForTemplateBrowsing($aResults["documents"][$i], $bDisplayFullPath) : |
| 293 | 294 | displayDocumentLink($aResults["documents"][$i], $bDisplayFullPath)) . "</td>"; |
| 294 | 295 | |
| ... | ... | @@ -304,6 +305,22 @@ function renderDocumentList($aResults, $sNoDocumentsMessage, $sNoPermissionMessa |
| 304 | 305 | } |
| 305 | 306 | $sToRender .= "</tr>\n"; |
| 306 | 307 | } |
| 308 | + | |
| 309 | + $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"]))); | |
| 310 | + $sTDBGColour = $default->siteMap->getSectionColour($sSectionName, "td"); | |
| 311 | + | |
| 312 | + $sToRender .= "<tr bgcolor=\"". $sTDBGColour . "\"><td colspan=\"5\" valign=\"bottom\">" . | |
| 313 | + "<input type=\"checkbox\" name=\"selectall\" onClick=\"selectAll()\"/> Select all documents</td></tr>"; | |
| 314 | + | |
| 315 | + $sToRender .= "<tr><td colspan=\"5\" >"; | |
| 316 | + $sToRender .= "<input type=\"hidden\" name=\"fActions\">"; | |
| 317 | + | |
| 318 | + $sToRender .= "<input type=\"image\" onclick=\"document.MainForm.fActions.value='move'; document.MainForm.submit()\" src=\"$default->graphicsUrl/widgets/move.gif\" border=\"0\"/>"; | |
| 319 | + $sToRender .= "<input type=\"image\" onclick=\"document.MainForm.fActions.value='delete'; document.MainForm.submit()\" src=\"$default->graphicsUrl/widgets/delete.gif\" border=\"0\"/>"; | |
| 320 | + $sToRender .= "</td></tr>\n"; | |
| 321 | + // Change for group Operations | |
| 322 | + | |
| 323 | + | |
| 307 | 324 | } else if ($aResults["accessDenied"]) { |
| 308 | 325 | $sToRender .= "<tr><td>$sNoPermissionMessage</td></tr>"; |
| 309 | 326 | } else { |
| ... | ... | @@ -341,6 +358,21 @@ function renderPage($aResults, $sBrowseType, $sSortBy, $sSortDirection, $bTempla |
| 341 | 358 | |
| 342 | 359 | $sToRender = renderHeading(_("Browse collection")); |
| 343 | 360 | |
| 361 | + // Script function to select all documents | |
| 362 | + $sToRender = "\n\n<SCRIPT LANGUAGE=\"javascript\">\n "; | |
| 363 | + $sToRender .= "<!--\n"; | |
| 364 | + $sToRender .= "function selectAll() {\n"; | |
| 365 | + $sToRender .= "\tf = document.MainForm;\n"; | |
| 366 | + $sToRender .= "\tc = f.selectall.checked;\n"; | |
| 367 | + $sToRender .= "\tif (f.elements['fDocumentIDs[]']) {\n"; | |
| 368 | + $sToRender .= "\t\tif (f.elements['fDocumentIDs[]'].length > 1) {\n"; | |
| 369 | + $sToRender .= "\t\t\tfor (i = 0; i < f.elements['fDocumentIDs[]'].length; i++) f.elements['fDocumentIDs[]'][i].checked = c;\n"; | |
| 370 | + $sToRender .= "\t\t} else {\n"; | |
| 371 | + $sToRender .= "\t\t\tf.elements['fDocumentIDs[]'].checked = c;\n"; | |
| 372 | + $sToRender .= "\t}}}\n"; | |
| 373 | + $sToRender .= "//-->\n"; | |
| 374 | + $sToRender .= "</SCRIPT>\n\n"; | |
| 375 | + | |
| 344 | 376 | $sToRender .= "<table border=\"0\" cellpadding=\"5\" width=\"100%\"><tr><td bgcolor=\"$sTDBGColour\">"; |
| 345 | 377 | switch ($sBrowseType) { |
| 346 | 378 | case "folder" : $sToRender .= displayFolderPathLink(Folder::getFolderPathAsArray($aResults["folders"][0]->getID()), | ... | ... |
presentation/lookAndFeel/knowledgeTree/documentmanagement/deleteDocumentBL.php
| ... | ... | @@ -42,45 +42,100 @@ require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/fo |
| 42 | 42 | |
| 43 | 43 | require_once("deleteDocumentUI.inc"); |
| 44 | 44 | |
| 45 | +$aNondeletedDocs = array(); | |
| 46 | + | |
| 47 | + | |
| 45 | 48 | if (checkSession()) { |
| 46 | 49 | |
| 47 | - if (isset($fDocumentID)) { | |
| 48 | - $oDocument = Document::get($fDocumentID); | |
| 49 | - if (Permission::userHasDocumentWritePermission($oDocument)) { | |
| 50 | + if (isset($fDocumentIDs)) { | |
| 51 | + | |
| 52 | + // Check permission and collaboration for all documents | |
| 53 | + for ($i = 0; $i < count($fDocumentIDs); $i++) { | |
| 54 | + | |
| 55 | + $oDocument = Document::get($fDocumentIDs[$i]); | |
| 56 | + if (!Permission::userHasDocumentWritePermission($oDocument)) { | |
| 57 | + | |
| 58 | + // user does not have permission to delete the document | |
| 59 | + require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | |
| 60 | + $oPatternCustom = & new PatternCustom(); | |
| 61 | + $oPatternCustom->setHtml(renderErrorPage("You do not have, at least, permission to delete one document: " . | |
| 62 | + $oDocument->getName() . "<br>Please deselect it and retry.")); | |
| 63 | + $main->setCentralPayload($oPatternCustom); | |
| 64 | + $main->render(); | |
| 65 | + return; | |
| 66 | + | |
| 67 | + } else { | |
| 68 | + | |
| 50 | 69 | // check if there is collaboration for this document |
| 51 | - $aFolderUserRoles = FolderUserRole::getList("document_id = $fDocumentID"); | |
| 70 | + $aFolderUserRoles = FolderUserRole::getList("document_id = $fDocumentIDs[$i]"); | |
| 52 | 71 | // check if any of them are active |
| 53 | 72 | $bActive = false; |
| 54 | - for ($i=0; $i<count($aFolderUserRoles); $i++) { | |
| 55 | - $default->log->info("delDoc bActive=" . ($bActive ? "1" : "0") . ";folderUserRoleID=" . $aFolderUserRoles[$i]->getGroupFolderApprovalID() . "; active=" . ($aFolderUserRoles[$i]->getActive() ? "1" : "0")); | |
| 56 | - $bActive = $bActive || $aFolderUserRoles[$i]->getActive(); | |
| 73 | + for ($j=0; $j<count($aFolderUserRoles); $j++) { | |
| 74 | + $default->log->info("delDoc bActive=" . ($bActive ? "1" : "0") . ";folderUserRoleID=" . $aFolderUserRoles[$j]->getGroupFolderApprovalID() . "; active=" . ($aFolderUserRoles[$j]->getActive() ? "1" : "0")); | |
| 75 | + $bActive = $bActive || $aFolderUserRoles[$j]->getActive(); | |
| 76 | + } | |
| 77 | + | |
| 78 | + if ($bActive) { | |
| 79 | + | |
| 80 | + // there are active collaboration roles for this doc | |
| 81 | + require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | |
| 82 | + $oPatternCustom = & new PatternCustom(); | |
| 83 | + $oPatternCustom->setHtml(renderErrorPage("You can't, at least, delete one document " . | |
| 84 | + $oDocument->getName() . " because it's still in collaboration")); | |
| 85 | + $main->setCentralPayload($oPatternCustom); | |
| 86 | + $main->render(); | |
| 87 | + return; | |
| 88 | + } | |
| 57 | 89 | } |
| 58 | - if (!$bActive) { | |
| 59 | - // there aren't any active roles for this doc | |
| 90 | + } | |
| 91 | + | |
| 92 | + | |
| 93 | + /* Delete all files | |
| 94 | + If an error occured while deleting a file, then: | |
| 95 | + - make a rollback of the current file | |
| 96 | + - insert document object in $aNondeletedDocs array | |
| 97 | + - delete the other selected file | |
| 98 | + | |
| 99 | + At the end check the $aNondeletedDocs array | |
| 100 | + - if is empty then OK | |
| 101 | + - if is not empty then show the nondeleted files list | |
| 102 | + */ | |
| 103 | + | |
| 104 | + // Delete all files with possible rollback | |
| 60 | 105 | if (isset($fDeleteConfirmed)) { |
| 61 | - //deletion of document is confirmed | |
| 62 | - $oDocument = Document::get($fDocumentID); | |
| 106 | + | |
| 107 | + // deletion of all documents are confirmed | |
| 108 | + for ($i = 0; $i < count($fDocumentIDs); $i++) { | |
| 109 | + | |
| 110 | + $oDocument = Document::get($fDocumentIDs[$i]); | |
| 63 | 111 | if (isset($oDocument)) { |
| 112 | + // New transaction | |
| 64 | 113 | $sDocumentPath = Folder::getFolderPath($oDocument->getFolderID()) . $oDocument->getFileName(); |
| 65 | - $oDocumentTransaction = & new DocumentTransaction($fDocumentID, "Document deleted", DELETE); | |
| 114 | + $oDocumentTransaction = & new DocumentTransaction($fDocumentIDs[$i], "Document deleted", DELETE); | |
| 66 | 115 | $oDocumentTransaction->create(); |
| 116 | + | |
| 67 | 117 | // flip the status id |
| 68 | 118 | $oDocument->setStatusID(DELETED); |
| 119 | + | |
| 69 | 120 | // store |
| 70 | 121 | if ($oDocument->update()) { |
| 71 | 122 | // now move the document to the delete folder |
| 72 | 123 | if (PhysicalDocumentManager::delete($oDocument)) { |
| 73 | 124 | // successfully deleted the document |
| 74 | - $default->log->info("deleteDocumentBL.php successfully deleted document " . $oDocument->getFileName() . " from folder " . Folder::getFolderPath($oDocument->getFolderID()) . " id=" . $oDocument->getFolderID()); | |
| 125 | + $default->log->info("deleteDocumentBL.php successfully deleted document " . | |
| 126 | + $oDocument->getFileName() . " from folder " . | |
| 127 | + Folder::getFolderPath($oDocument->getFolderID()) . | |
| 128 | + " id=" . $oDocument->getFolderID()); | |
| 75 | 129 | |
| 76 | 130 | // delete all collaboration roles |
| 77 | - for ($i=0; $i<count($aFolderUserRoles); $i++) { | |
| 78 | - $default->log->info("delDoc deleting folderuserroleID=" . $aFolderUserRoles[$i]->getGroupFolderApprovalID()); | |
| 79 | - $aFolderUserRoles[$i]->delete(); | |
| 131 | + for ($j=0; $j<count($aFolderUserRoles); $j++) { | |
| 132 | + $default->log->info("delDoc deleting folderuserroleID=" . $aFolderUserRoles[$j]->getGroupFolderApprovalID()); | |
| 133 | + $aFolderUserRoles[$j]->delete(); | |
| 80 | 134 | } |
| 81 | 135 | |
| 82 | 136 | // fire subscription alerts for the deleted document |
| 83 | - $count = SubscriptionEngine::fireSubscription($fDocumentID, SubscriptionConstants::subscriptionAlertType("RemoveSubscribedDocument"), | |
| 137 | + $count = SubscriptionEngine::fireSubscription($fDocumentIDs[$i], | |
| 138 | + SubscriptionConstants::subscriptionAlertType("RemoveSubscribedDocument"), | |
| 84 | 139 | SubscriptionConstants::subscriptionType("DocumentSubscription"), |
| 85 | 140 | array( "folderID" => $oDocument->getFolderID(), |
| 86 | 141 | "removedDocumentName" => $oDocument->getName(), |
| ... | ... | @@ -88,14 +143,12 @@ if (checkSession()) { |
| 88 | 143 | $default->log->info("deleteDocumentBL.php fired $count subscription alerts for removed document " . $oDocument->getName()); |
| 89 | 144 | |
| 90 | 145 | // remove all document subscriptions for this document |
| 91 | - if (SubscriptionManager::removeSubscriptions($fDocumentID, SubscriptionConstants::subscriptionType("DocumentSubscription"))) { | |
| 146 | + if (SubscriptionManager::removeSubscriptions($fDocumentIDs[$i], SubscriptionConstants::subscriptionType("DocumentSubscription"))) { | |
| 92 | 147 | $default->log->info("deleteDocumentBL.php removed all subscriptions for this document"); |
| 93 | 148 | } else { |
| 94 | 149 | $default->log->error("deleteDocumentBL.php couldn't remove document subscriptions"); |
| 95 | 150 | } |
| 96 | 151 | |
| 97 | - // redirect to the browse folder page | |
| 98 | - redirect("$default->rootUrl/control.php?action=browse&fFolderID=" . $oDocument->getFolderID()); | |
| 99 | 152 | } else { |
| 100 | 153 | //could not delete the document from the file system |
| 101 | 154 | $default->log->error("deleteDocumentBL.php Filesystem error deleting document " . $oDocument->getFileName() . " from folder " . Folder::getFolderPath($oDocument->getFolderID()) . " id=" . $oDocument->getFolderID()); |
| ... | ... | @@ -104,11 +157,10 @@ if (checkSession()) { |
| 104 | 157 | $oDocument->update(); |
| 105 | 158 | //get rid of the document transaction |
| 106 | 159 | $oDocumentTransaction->delete(); |
| 107 | - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | |
| 108 | - $oPatternCustom = & new PatternCustom(); | |
| 109 | - $oPatternCustom->setHtml(renderErrorPage("The document could not be deleted from the file system", $fDocumentID)); | |
| 110 | - $main->setCentralPayload($oPatternCustom); | |
| 111 | - $main->render(); | |
| 160 | + | |
| 161 | + // Store the doc with problem | |
| 162 | + array_push($aNondeletedDocs, array($oDocument, "Could not delete document on file system")); | |
| 163 | + | |
| 112 | 164 | } |
| 113 | 165 | } else { |
| 114 | 166 | //could not update the documents status in the db |
| ... | ... | @@ -116,42 +168,49 @@ if (checkSession()) { |
| 116 | 168 | |
| 117 | 169 | //get rid of the document transaction |
| 118 | 170 | $oDocumentTransaction->delete(); |
| 119 | - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | |
| 120 | - $oPatternCustom = & new PatternCustom(); | |
| 121 | - $oPatternCustom->setHtml(renderErrorPage("The document could not be deleted from the database", $fDocumentID)); | |
| 122 | - $main->setCentralPayload($oPatternCustom); | |
| 123 | - $main->render(); | |
| 171 | + | |
| 172 | + // Store the doc with problem | |
| 173 | + array_push($aNondeletedDocs, array($oDocument, "Could not update document in database")); | |
| 174 | + | |
| 124 | 175 | } |
| 125 | 176 | } else { |
| 126 | 177 | //could not load document object |
| 127 | - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | |
| 128 | - $oPatternCustom = & new PatternCustom(); | |
| 129 | - $oPatternCustom->setHtml(renderErrorPage("An error occured whilst retrieving the document from the database", $fDocumentID)); | |
| 130 | - $main->setCentralPayload($oPatternCustom); | |
| 131 | - $main->render(); | |
| 178 | + | |
| 179 | + // Store the doc with problem | |
| 180 | + array_push($aNondeletedDocs, array($oDocument, "Could not load document in database")); | |
| 181 | + | |
| 132 | 182 | } |
| 133 | - } else { | |
| 134 | - //get confirmation first | |
| 135 | - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | |
| 136 | - $oPatternCustom = & new PatternCustom(); | |
| 137 | - $oDocument = Document::get($fDocumentID); | |
| 138 | - $oPatternCustom->setHtml(getPage($fDocumentID, $oDocument->getFolderID(), $oDocument->getName())); | |
| 139 | - $main->setCentralPayload($oPatternCustom); | |
| 140 | - $main->render(); | |
| 141 | 183 | } |
| 142 | - } else { | |
| 143 | - // there are active collaboration roles for this doc | |
| 184 | + | |
| 185 | + // List nondeleted documents | |
| 186 | + if (!empty($aNondeletedDocs) ) { | |
| 187 | + | |
| 144 | 188 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); |
| 145 | 189 | $oPatternCustom = & new PatternCustom(); |
| 146 | - $oPatternCustom->setHtml(renderErrorPage("You can't delete this document because it's still in collaboration", $fDocumentID)); | |
| 190 | + | |
| 191 | + $sError = "An error occured deleting the following document(s): <br><br>"; | |
| 192 | + foreach ($aNondeletedDocs as $oDoc) { | |
| 193 | + $sError .= $oDoc[0]->getDisplayPath() . ": " .$oDoc[1] . "<br>"; | |
| 194 | + } | |
| 195 | + $sError .= "<br>The other documents are been deleted."; | |
| 196 | + | |
| 197 | + $oPatternCustom->addHtml(renderErrorPage($sError)); | |
| 147 | 198 | $main->setCentralPayload($oPatternCustom); |
| 148 | 199 | $main->render(); |
| 200 | + | |
| 201 | + reset($aNondeletedDocs); | |
| 202 | + | |
| 203 | + } else { | |
| 204 | + // redirect to the browse folder page | |
| 205 | + redirect("$default->rootUrl/control.php?action=browse&fFolderID=" . $oDocument->getFolderID()); | |
| 149 | 206 | } |
| 207 | + | |
| 208 | + | |
| 150 | 209 | } else { |
| 151 | - //user does not have permission to delete the document | |
| 210 | + //get confirmation first | |
| 152 | 211 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); |
| 153 | 212 | $oPatternCustom = & new PatternCustom(); |
| 154 | - $oPatternCustom->setHtml(renderErrorPage("You do not have permission to delete this document", $fDocumentID)); | |
| 213 | + $oPatternCustom->addHtml(getPage($fDocumentIDs)); | |
| 155 | 214 | $main->setCentralPayload($oPatternCustom); |
| 156 | 215 | $main->render(); |
| 157 | 216 | } |
| ... | ... | @@ -164,3 +223,5 @@ if (checkSession()) { |
| 164 | 223 | $main->render(); |
| 165 | 224 | } |
| 166 | 225 | } |
| 226 | + | |
| 227 | +?> | ... | ... |
presentation/lookAndFeel/knowledgeTree/documentmanagement/deleteDocumentUI.inc
| ... | ... | @@ -24,30 +24,27 @@ |
| 24 | 24 | * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa |
| 25 | 25 | * @package documentmanagement |
| 26 | 26 | */ |
| 27 | - | |
| 28 | -function getDocumentPath($iFolderID, $sDocumentName) { | |
| 29 | - global $default; | |
| 30 | - $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"]))); | |
| 31 | - $sTDBGColour = $default->siteMap->getSectionColour($sSectionName, "td"); | |
| 32 | - $sDocumentPath = displayFolderPathLink(Folder::getFolderPathAsArray($iFolderID), Folder::getFolderPathNamesAsArray($iFolderID), "$default->rootUrl/control.php?action=browse") . " > " . $sDocumentName; | |
| 33 | - return "<table border=\"0\" width = 100%><tr><td bgcolor=\"$sTDBGColour\">$sDocumentPath</td></tr></table>\n"; | |
| 34 | -} | |
| 35 | - | |
| 36 | -function getPage($iDocumentID, $iFolderID, $sDocumentName) { | |
| 27 | +function getPage($fDocumentIDs) { | |
| 37 | 28 | global $default; |
| 38 | 29 | $sToRender = renderHeading(_("Delete Document")); |
| 39 | - $sToRender .= getDocumentPath($iFolderID, $sDocumentName) . "<br>\n"; | |
| 40 | 30 | $sToRender .= "<table border=\"0\">\n"; |
| 41 | 31 | $sToRender .= "<tr>\n"; |
| 42 | - $sToRender .= "<td>You have chosen to delete the document entitled '" . $sDocumentName . "'.</td>\n"; | |
| 43 | - $sToRender .= "<tr>\n"; | |
| 32 | + $sToRender .= "<td>You have chosen to delete the following document(s): <br><br></td>\n"; | |
| 33 | + | |
| 34 | + for ($i = 0; $i < count($fDocumentIDs); $i++) { | |
| 35 | + $oDocument = Document::get($fDocumentIDs[$i]); | |
| 44 | 36 | $sToRender .= "<tr>\n"; |
| 37 | + $sToRender .= "<td> '" . $oDocument->getDisplayPath() . "'</td>\n"; | |
| 38 | + $sQueryString .= "fDocumentIDs[]=$fDocumentIDs[$i]&"; | |
| 39 | + } | |
| 40 | + $sToRender .= "<tr><tr><tr><tr>\n"; | |
| 41 | + | |
| 45 | 42 | $sToRender .= "<td>Select 'Delete' to confirm the deletion, or 'Cancel' to cancel it</td>\n"; |
| 46 | 43 | $sToRender .= "<tr>\n"; |
| 47 | 44 | $sToRender .= "<tr>\n"; |
| 48 | 45 | $sToRender .= "<td> </td>\n"; |
| 49 | 46 | $sToRender .= "<tr>\n"; |
| 50 | - $sToRender .= "<td><table><tr><td><a href=\"" . $_SERVER["PHP_SELF"] . "?fDocumentID=$iDocumentID&fDeleteConfirmed=1\"><img src=\"$default->graphicsUrl/widgets/delete.gif\" border=\"0\"></a></td> <td><a href=\"$default->rootUrl/control.php?action=viewDocument&fDocumentID=" . $iDocumentID . "\"><img src=\"$default->graphicsUrl/widgets/cancel.gif\" border=\"0\"></a></td></tr></table></td>"; | |
| 47 | + $sToRender .= "<td><table><tr><td><a href=\"" . $_SERVER["PHP_SELF"] . "?$sQueryString&fDeleteConfirmed=1\"><img src=\"$default->graphicsUrl/widgets/delete.gif\" border=\"0\"></a></td> <td><a href=\"javascript:history.go(-1)\"><img src=\"$default->graphicsUrl/widgets/cancel.gif\" border=\"0\"></a></td></tr></table></td>"; | |
| 51 | 48 | $sToRender .= "</tr>"; |
| 52 | 49 | $sToRender .= "</table>\n"; |
| 53 | 50 | |
| ... | ... | @@ -63,7 +60,7 @@ function renderErrorPage($sErrorMessage, $iDocumentID = "") { |
| 63 | 60 | $sToRender = renderHeading(_("Delete Document")); |
| 64 | 61 | $sToRender .= "<table>\n"; |
| 65 | 62 | $sToRender .= "<tr><td><p class=\"errorText\">$sErrorMessage</p>\n" . |
| 66 | - "<a href=\"javascript:history.go(-1)\"><img src=\"$default->graphicsUrl/widgets/back.gif\" border=\"0\"/></a>\n" . | |
| 63 | + "<a href=\"javascript:history.go(-2)\"><img src=\"$default->graphicsUrl/widgets/back.gif\" border=\"0\"/></a>\n" . | |
| 67 | 64 | "</p></td></tr></table>\n"; |
| 68 | 65 | return $sToRender; |
| 69 | 66 | } | ... | ... |
presentation/lookAndFeel/knowledgeTree/documentmanagement/moveDocumentBL.php
| ... | ... | @@ -45,15 +45,24 @@ require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/do |
| 45 | 45 | require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc"); |
| 46 | 46 | require_once("$default->fileSystemRoot/presentation/Html.inc"); |
| 47 | 47 | |
| 48 | +$aUnmovedDocs = array(); | |
| 49 | + | |
| 48 | 50 | if (checkSession()) { |
| 49 | 51 | |
| 50 | - if (isset($fDocumentID) && isset($fFolderID)) { | |
| 52 | + if (isset($fDocumentIDs) && isset($fFolderID)) { | |
| 51 | 53 | if (isset($fForMove)) { |
| 52 | 54 | if ($fConfirmed) { |
| 55 | + for ($i = 0; $i < count($fDocumentIDs); $i++) { | |
| 56 | + | |
| 53 | 57 | //we're trying to move a document |
| 54 | - $oDocument = & Document::get($fDocumentID); | |
| 58 | + $oDocument = & Document::get($fDocumentIDs[$i]); | |
| 55 | 59 | $oFolder = & Folder::get($fFolderID); |
| 56 | 60 | $iOldFolderID = $oDocument->getFolderID(); |
| 61 | + | |
| 62 | + // check that there is no filename collision in the destination directory | |
| 63 | + $sNewDocumentFileSystemPath = Folder::getFolderPath($fFolderID) . $oDocument->getFileName(); | |
| 64 | + if (!file_exists($sNewDocumentFileSystemPath)) { | |
| 65 | + | |
| 57 | 66 | if (Permission::userHasDocumentWritePermission($oDocument) && Permission::userHasFolderWritePermission($oFolder)) { |
| 58 | 67 | //if the user has both document and folder write permissions |
| 59 | 68 | //get the old document path |
| ... | ... | @@ -65,9 +74,8 @@ if (checkSession()) { |
| 65 | 74 | $sOldDocumentFileSystemPath = Folder::getFolderPath($iOldFolderID) . $oDocument->getFileName(); |
| 66 | 75 | //move the document on the file system |
| 67 | 76 | if (PhysicalDocumentManager::moveDocument($sOldDocumentFileSystemPath, $oDocument, $oFolder)) { |
| 68 | - | |
| 69 | 77 | // fire subscription alerts for the moved document (and the folder its in) |
| 70 | - $count = SubscriptionEngine::fireSubscription($fDocumentID, SubscriptionConstants::subscriptionAlertType("MovedDocument"), | |
| 78 | + $count = SubscriptionEngine::fireSubscription($fDocumentIDs[$i], SubscriptionConstants::subscriptionAlertType("MovedDocument"), | |
| 71 | 79 | SubscriptionConstants::subscriptionType("DocumentSubscription"), |
| 72 | 80 | array( "folderID" => $iOldFolderID, |
| 73 | 81 | "modifiedDocumentName" => $oDocument->getName(), |
| ... | ... | @@ -76,82 +84,116 @@ if (checkSession()) { |
| 76 | 84 | $default->log->info("moveDocumentBL.php fired $count subscription alerts for moved document " . $oDocument->getName()); |
| 77 | 85 | |
| 78 | 86 | // fire folder subscriptions for the destination folder |
| 79 | - $count = SubscriptionEngine::fireSubscription($oDocument->getFolderID(), SubscriptionConstants::subscriptionAlertType("MovedDocument"), | |
| 87 | + $count = SubscriptionEngine::fireSubscription($fDocumentIDs[$i], SubscriptionConstants::subscriptionAlertType("MovedDocument"), | |
| 80 | 88 | SubscriptionConstants::subscriptionType("FolderSubscription"), |
| 81 | - array( "modifiedDocumentName" => $oDocument->getName(), | |
| 89 | + array( "folderID" => $iOldFolderID, | |
| 90 | + "modifiedDocumentName" => $oDocument->getName(), | |
| 82 | 91 | "oldFolderName" => Folder::getFolderName($iOldFolderID), |
| 83 | 92 | "newFolderName" => Folder::getFolderName($fFolderID) )); |
| 84 | 93 | $default->log->info("moveDocumentBL.php fired $count (folderID=$fFolderID) folder subscription alerts for moved document " . $oDocument->getName()); |
| 85 | - | |
| 86 | - | |
| 87 | - //redirect to the view path | |
| 88 | - redirect("$default->rootUrl/control.php?action=viewDocument&fDocumentID=$fDocumentID"); | |
| 89 | 94 | } else { |
| 90 | 95 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); |
| 91 | 96 | //we couldn't move the document on the file system |
| 92 | 97 | //so reset the database values |
| 93 | 98 | $oDocument->setFolderID($iOldFolderID); |
| 94 | 99 | $oDocument->update(); |
| 95 | - $oPatternCustom = & new PatternCustom(); | |
| 96 | - $oPatternCustom->setHtml(getPage($fFolderID, $fDocumentID)); | |
| 97 | - $main->setCentralPayload($oPatternCustom); | |
| 98 | - $main->setErrorMessage("Could not move document on file system"); | |
| 99 | - $main->setFormAction($_SERVER["PHP_SELF"] . "?fForMove=1"); | |
| 100 | - $main->render(); | |
| 100 | + | |
| 101 | + // Store the doc with problem | |
| 102 | + array_push($aUnmovedDocs, array($oDocument, "Could not move document on file system")); | |
| 101 | 103 | } |
| 102 | 104 | } else { |
| 103 | 105 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); |
| 104 | 106 | //had a problem with the database |
| 105 | - $oPatternCustom = & new PatternCustom(); | |
| 106 | - $oPatternCustom->setHtml(getPage($fFolderID, $fDocumentID)); | |
| 107 | - $main->setCentralPayload($oPatternCustom); | |
| 108 | - $main->setErrorMessage("Could not update document in database"); | |
| 109 | - $main->setFormAction($_SERVER["PHP_SELF"] . "?fForMove=1&fDocumentID=$fDocumentID&fFolderID=$fFolderID"); | |
| 110 | - $main->render(); | |
| 107 | + // Store the doc with problem | |
| 108 | + array_push($aUnmovedDocs, array($oDocument, "Could not update document in database")); | |
| 111 | 109 | } |
| 112 | 110 | } else { |
| 113 | 111 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); |
| 112 | + | |
| 113 | + // Permission problem | |
| 114 | + // Store the doc with problem | |
| 115 | + array_push($aUnmovedDocs, array($oDocument, "You do not have rights to move this document")); | |
| 116 | + } | |
| 117 | + | |
| 118 | + } else { | |
| 119 | + require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | |
| 120 | + | |
| 121 | + // Store the doc with problem | |
| 122 | + array_push($aUnmovedDocs, array($oDocument, "This folder already contains a document of the same name. Please choose another directory")); | |
| 123 | + } | |
| 124 | + | |
| 125 | + } | |
| 126 | + | |
| 127 | + // Move terminated | |
| 128 | + | |
| 129 | + // List undeleted documents | |
| 130 | + if (!empty($aUnmovedDocs) ) { | |
| 131 | + | |
| 132 | + require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | |
| 114 | 133 | $oPatternCustom = & new PatternCustom(); |
| 115 | - $oPatternCustom->setHtml(getPage($fFolderID, $fDocumentID)); | |
| 134 | + | |
| 135 | + $sError = "An error occured moving the following document(s): <br><br>"; | |
| 136 | + foreach ($aUnmovedDocs as $oDoc) { | |
| 137 | + $sError .= $oDoc[0]->getDisplayPath() . ": " .$oDoc[1] . "<br>"; | |
| 138 | + } | |
| 139 | + $sError .= "<br>The other documents are been moved."; | |
| 140 | + | |
| 141 | + $oPatternCustom = & new PatternCustom(); | |
| 142 | + $oPatternCustom->setHtml(renderErrorPage($sError)); | |
| 116 | 143 | $main->setCentralPayload($oPatternCustom); |
| 117 | - $main->setFormAction($_SERVER["PHP_SELF"] . "?fForMove=1&fDocumentID=$fDocumentID&fFolderID=$fFolderID"); | |
| 118 | - $main->setErrorMessage("You do not have rights to move this document"); | |
| 119 | 144 | $main->render(); |
| 120 | - } | |
| 145 | + | |
| 146 | + reset($aUnmovedDocs); | |
| 147 | + | |
| 121 | 148 | } else { |
| 149 | + // redirect to the browse folder page | |
| 150 | + redirect("$default->rootUrl/control.php?action=browse&fFolderID=" . $oDocument->getFolderID()); | |
| 151 | + } | |
| 152 | + | |
| 153 | + } else { // ($fConfirmed) | |
| 122 | 154 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); |
| 123 | 155 | $oPatternCustom = & new PatternCustom(); |
| 124 | 156 | |
| 125 | - $oDocument = Document::get($fDocumentID); | |
| 126 | - $oFolder = Folder::get($fFolderID); | |
| 157 | + // Check for all docs | |
| 158 | + for ($i = 0; $i < count($fDocumentIDs); $i++) { | |
| 159 | + | |
| 160 | + $oDocument = Document::get($fDocumentIDs[$i]); | |
| 161 | + | |
| 127 | 162 | // check if the selected folder has the same document type as the document we're moving |
| 128 | 163 | if (Folder::folderIsLinkedToDocType($fFolderID, $oDocument->getDocumentTypeID())) { |
| 129 | 164 | // check that there is no filename collision in the destination directory |
| 130 | 165 | $sNewDocumentFileSystemPath = Folder::getFolderPath($fFolderID) . $oDocument->getFileName(); |
| 131 | 166 | if (!file_exists($sNewDocumentFileSystemPath)) { |
| 132 | 167 | // display confirmation page |
| 133 | - $oPatternCustom->setHtml(getConfirmationPage($oFolder, $oDocument)); | |
| 168 | + $oPatternCustom->setHtml(getConfirmationPage($fFolderID, $fDocumentIDs)); | |
| 134 | 169 | } else { |
| 135 | 170 | // filename collision |
| 136 | - $oPatternCustom->setHtml(getPage($fFolderID, $fDocumentID, "This folder already contains a document of the same name. Please choose another directory")); | |
| 171 | + $oPatternCustom->setHtml(getPage($fFolderID, $fDocumentIDs, "This folder already contains a document of the same name ('" . | |
| 172 | + $oDocument->getFileName() . | |
| 173 | + "'). Please choose another directory")); | |
| 174 | + break; | |
| 137 | 175 | } |
| 138 | 176 | } else { |
| 139 | 177 | // the right document type isn't mapped |
| 140 | - $oPatternCustom->setHtml(getPage($fFolderID, $fDocumentID, "You can't move the document to this folder because it cannot store the document type of your document. Please choose another directory")); | |
| 178 | + $oPatternCustom->setHtml(getPage($fFolderID, $fDocumentIDs, "You can't move the document '" . | |
| 179 | + $oDocument->getFileName() . | |
| 180 | + "' to this folder because it cannot store the document type of your document. Please choose another directory")); | |
| 181 | + break; | |
| 182 | + } | |
| 141 | 183 | } |
| 142 | 184 | $main->setFormAction($_SERVER["PHP_SELF"] . "?fForMove=1&fDocumentID=$fDocumentID&fFolderID=$fFolderID"); |
| 143 | 185 | $main->setCentralPayload($oPatternCustom); |
| 144 | 186 | $main->render(); |
| 145 | 187 | } |
| 146 | - } else { | |
| 188 | + } else { // (isset($fForMove)) | |
| 147 | 189 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); |
| 148 | 190 | $oPatternCustom = & new PatternCustom(); |
| 149 | - $oPatternCustom->setHtml(getPage($fFolderID, $fDocumentID)); | |
| 191 | + $oPatternCustom->setHtml(getPage($fFolderID, $fDocumentIDs)); | |
| 150 | 192 | $main->setCentralPayload($oPatternCustom); |
| 151 | 193 | $main->setFormAction($_SERVER["PHP_SELF"] . "?fForMove=1&fDocumentID=$fDocumentID&fFolderID=$fFolderID"); |
| 152 | 194 | $main->render(); |
| 153 | 195 | } |
| 154 | - } else { | |
| 196 | + } else { // (isset($fDocumentIDs) && isset($fFolderID)) | |
| 155 | 197 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); |
| 156 | 198 | $oPatternCustom = & new PatternCustom(); |
| 157 | 199 | $oPatternCustom->setHtml(""); |
| ... | ... | @@ -160,4 +202,5 @@ if (checkSession()) { |
| 160 | 202 | $main->render(); |
| 161 | 203 | } |
| 162 | 204 | } |
| 163 | -?> | |
| 164 | 205 | \ No newline at end of file |
| 206 | + | |
| 207 | +?> | ... | ... |
presentation/lookAndFeel/knowledgeTree/documentmanagement/moveDocumentUI.inc
| ... | ... | @@ -25,46 +25,75 @@ |
| 25 | 25 | * @package documentmanagement |
| 26 | 26 | */ |
| 27 | 27 | |
| 28 | -function getConfirmationPage($oFolder, $oDocument) { | |
| 28 | +function getConfirmationPage($iFolderID, $iDocumentIDs) { | |
| 29 | 29 | global $default; |
| 30 | 30 | $sToRender = renderHeading(_("Move Document")); |
| 31 | 31 | $sToRender .= "<table>\n"; |
| 32 | 32 | $sToRender .= "<tr>\n<td>Are you sure you want to move </td></tr>"; |
| 33 | - $sToRender .= "<tr><td><strong>" . $oDocument->getDisplayPath() . "</strong> to </td></tr>\n"; | |
| 34 | - $sToRender .= "<tr><td><strong>" . Folder::getFolderDisplayPath($oFolder->getID()) . " > " . $oDocument->getFileName() . "</strong></td>\n"; | |
| 33 | + | |
| 34 | + for ($i = 0; $i < count($iDocumentIDs); $i++) { | |
| 35 | + | |
| 36 | + $oDocument = & Document::get($iDocumentIDs[$i]); | |
| 37 | + | |
| 38 | + $sToRender .= "<tr><td><strong>" . $oDocument->getDisplayPath() . "</strong> <td> to </td> </td>\n"; | |
| 39 | + $sToRender .= "<td><strong>" . Folder::getFolderDisplayPath($iFolderID) . " > " . $oDocument->getFileName() . "</strong></td>\n"; | |
| 40 | + $sQueryString .= "fDocumentIDs[]=$iDocumentIDs[$i]&"; | |
| 41 | + } | |
| 42 | + | |
| 35 | 43 | $sToRender .= "</tr>\n"; |
| 36 | - $sToRender .= "<tr><td><a href=\"$default->rootUrl/control.php?action=moveDocument&fDocumentID=" . | |
| 37 | - $oDocument->getID() . "&fFolderID=" . $oFolder->getID() . | |
| 44 | + $sToRender .= "<tr><td><a href=\"$default->rootUrl/control.php?action=moveDocument&" . $sQueryString . | |
| 45 | + "fFolderID=$iFolderID" . | |
| 38 | 46 | "&fForMove=1&fConfirmed=1\">" . |
| 39 | 47 | "<img src=\"$default->graphicsUrl/widgets/move.gif\" border=\"0\"/>" . |
| 40 | 48 | "</a> " . |
| 41 | - "<a href=\"$default->rootUrl/control.php?action=viewDocument&fDocumentID=" . $oDocument->getID() . "\">" . | |
| 42 | - "<img src=\"$default->graphicsUrl/widgets/cancel.gif\" border=\"0\"></a>" . | |
| 43 | - "</td></tr>\n"; | |
| 49 | + "<a href=\"$default->rootUrl/control.php?action=browse&fFolderID=$iFolderID\">" . | |
| 50 | + "<img src=\"$default->graphicsUrl/widgets/cancel.gif\" border=\"0\"></a></td></tr>\n"; | |
| 44 | 51 | $sToRender .= "</table>\n"; |
| 45 | 52 | return $sToRender; |
| 46 | 53 | } |
| 47 | 54 | |
| 48 | -// FIXME: change these to object references instead of IDs | |
| 49 | -function getPage($iFolderID, $iDocumentID, $sErrorMessage = "") { | |
| 55 | + | |
| 56 | +function getPage($iFolderID, $iDocumentIDs, $sErrorMessage = "") { | |
| 50 | 57 | global $default; |
| 51 | 58 | $sToRender = renderHeading(_("Move Document")); |
| 52 | 59 | $sToRender .= "<table>\n"; |
| 53 | 60 | if ($sErrorMessage) { |
| 54 | 61 | $sToRender .= "<tr><td><font color=\"red\">$sErrorMessage</font></td></tr>"; |
| 55 | 62 | } |
| 56 | - $sToRender .= "<tr><td>Move document " . Document::getDocumentDisplayPath($iDocumentID) . " to:</td></tr>"; | |
| 63 | + $sToRender .= "<tr><td>Move document(s): <br></td>\n"; | |
| 64 | + | |
| 65 | + for ($i = 0; $i < count($iDocumentIDs); $i++) { | |
| 66 | + $sToRender .= "<tr>\n"; | |
| 67 | + $sToRender .= "<td> '" . Document::getDocumentDisplayPath($iDocumentIDs[$i]) . "'</td>\n"; | |
| 68 | + $sQueryString .= "fDocumentIDs[]=$iDocumentIDs[$i]&"; | |
| 69 | + } | |
| 70 | + | |
| 71 | + $sToRender .= "<tr><td> to:</td></tr>"; | |
| 57 | 72 | $sToRender .= "<tr>\n"; |
| 58 | - $sToRender .= "<td>" . renderFolderPath($iFolderID, generateControllerUrl("moveDocument", "fDocumentID=$iDocumentID", false)) . "</td>\n"; | |
| 73 | + $sToRender .= "<td>" . renderFolderPath($iFolderID, "/control.php?action=moveDocument&" . $sQueryString) . "</td>\n"; | |
| 59 | 74 | $sToRender .= "</tr>\n"; |
| 60 | 75 | $sToRender .= "</table>\n"; |
| 61 | 76 | $sToRender .= "<table width=\"100%\">\n"; |
| 62 | 77 | $sToRender .= "<tr>\n"; |
| 63 | - $sToRender .= "<td>" . renderFolderList($iFolderID, generateControllerUrl("moveDocument", "fDocumentID=$iDocumentID", false)) . "</td>\n"; | |
| 78 | + $sToRender .= "<td>" . renderFolderList($iFolderID, "/control.php?action=moveDocument&" . $sQueryString) . "</td>\n"; | |
| 64 | 79 | $sToRender .= "</tr>\n"; |
| 65 | - $sToRender .= "<tr><td><table><tr><td><input type=\"image\" src=\"$default->graphicsUrl/widgets/movehere.gif\" border=\"0\"/></td><td><a href=\"$default->rootUrl/control.php?action=viewDocument&fDocumentID=" . $iDocumentID . "\"><img src=\"$default->graphicsUrl/widgets/cancel.gif\" border=\"0\"></a></td></tr></table></td>\n"; | |
| 80 | + $sToRender .= "<td><table><tr><td><a href=\"" . $_SERVER["PHP_SELF"] . "?$sQueryString&fFolderID=$iFolderID&fForMove=1\"><img src=\"$default->graphicsUrl/widgets/movehere.gif\" border=\"0\"></a></td> <td><a href=\"$default->rootUrl/control.php?action=browse&fFolderID=$iFolderID\"><img src=\"$default->graphicsUrl/widgets/cancel.gif\" border=\"0\"></a></td></tr></table></td>"; | |
| 81 | + | |
| 66 | 82 | $sToRender .= "</table>\n"; |
| 67 | 83 | return $sToRender; |
| 68 | 84 | } |
| 85 | +function renderErrorPage($sErrorMessage, $iDocumentID = "") { | |
| 86 | + global $default; | |
| 87 | + if ($iDocumentID) { | |
| 88 | + return statusPage("Delete Document", "", $sErrorMessage, "viewDocument", "fDocumentID=$iDocumentID"); | |
| 89 | + } else { | |
| 90 | + $sToRender = renderHeading("Delete Document"); | |
| 91 | + $sToRender .= "<table>\n"; | |
| 92 | + $sToRender .= "<tr><td><p class=\"errorText\">$sErrorMessage</p>\n" . | |
| 93 | + "<a href=\"javascript:history.go(-2)\"><img src=\"$default->graphicsUrl/widgets/back.gif\" border=\"0\"/></a>\n" . | |
| 94 | + "</p></td></tr></table>\n"; | |
| 95 | + return $sToRender; | |
| 96 | + } | |
| 97 | +} | |
| 69 | 98 | |
| 70 | 99 | ?> | ... | ... |
presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc
| ... | ... | @@ -441,7 +441,7 @@ function displayEmailButton($oDocument) { |
| 441 | 441 | |
| 442 | 442 | function displayDeleteButton($oDocument, $bEdit) { |
| 443 | 443 | if ($bEdit) { |
| 444 | - $sQueryString = "fDocumentID=" . $oDocument->getID(); | |
| 444 | + $sQueryString = "fDocumentIDs[]=" . $oDocument->getID(); | |
| 445 | 445 | if ($oDocument->getIsCheckedOut()) { |
| 446 | 446 | $sDisabledText = _("This document can't be deleted because its checked out"); |
| 447 | 447 | } |
| ... | ... | @@ -457,7 +457,7 @@ function displayHistoryButton($oDocument) { |
| 457 | 457 | } |
| 458 | 458 | function displayMoveButton($oDocument, $bEdit) { |
| 459 | 459 | if ($bEdit) { |
| 460 | - $sQueryString = "fFolderID=" . $oDocument->getFolderID() . "&fDocumentID=" . $oDocument->getID(); | |
| 460 | + $sQueryString = "fFolderID=" . $oDocument->getFolderID() . "&fDocumentIDs[]=" . $oDocument->getID(); | |
| 461 | 461 | // documents in collaboration and checked out documents can't be moved |
| 462 | 462 | if ($oDocument->getIsCheckedOut()) { |
| 463 | 463 | $sDisabledText = _("The document is checked out and cannot be moved."); | ... | ... |
presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc
| ... | ... | @@ -105,6 +105,13 @@ function renderFolderList($fFolderID, $sLinkURL) { |
| 105 | 105 | $aQueryStringVariableNames = array("fFolderID"); |
| 106 | 106 | $aLinkURLs = array("$sLinkURL"); |
| 107 | 107 | |
| 108 | + $aLinkURLs = array(); | |
| 109 | + if (strlen($default->rootUrl) > 0) { | |
| 110 | + $aLinkURLs = array("$default->rootUrl/$sLinkURL"); | |
| 111 | + } else { | |
| 112 | + $aLinkURLs = array("$sLinkURL"); | |
| 113 | + } | |
| 114 | + | |
| 108 | 115 | $oPatternTableSqlQuery = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnHeaderNames, "100%", $aLinkURLs, $aDBColumns, $aQueryStringVariableNames); |
| 109 | 116 | $oPatternTableSqlQuery->setImageURL("$default->graphicsUrl/widgets/dfolder.gif"); |
| 110 | 117 | $oPatternTableSqlQuery->setEmptyTableMessage("This folder contains no sub folders"); | ... | ... |