Commit f5a17a6c6196427cfa114f00f94ca4dd8e9361b1
1 parent
f713cd7d
Corrected display error when moving a document. Also implemented more efficient…
… object instead of id passing. git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2917 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
14 additions
and
7 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/moveDocumentBL.php
| ... | ... | @@ -123,14 +123,14 @@ if (checkSession()) { |
| 123 | 123 | $oPatternCustom = & new PatternCustom(); |
| 124 | 124 | |
| 125 | 125 | $oDocument = Document::get($fDocumentID); |
| 126 | - | |
| 126 | + $oFolder = Folder::get($fFolderID); | |
| 127 | 127 | // check if the selected folder has the same document type as the document we're moving |
| 128 | 128 | if (Folder::folderIsLinkedToDocType($fFolderID, $oDocument->getDocumentTypeID())) { |
| 129 | 129 | // check that there is no filename collision in the destination directory |
| 130 | 130 | $sNewDocumentFileSystemPath = Folder::getFolderPath($fFolderID) . $oDocument->getFileName(); |
| 131 | 131 | if (!file_exists($sNewDocumentFileSystemPath)) { |
| 132 | 132 | // display confirmation page |
| 133 | - $oPatternCustom->setHtml(getConfirmationPage($fFolderID, $fDocumentID)); | |
| 133 | + $oPatternCustom->setHtml(getConfirmationPage($oFolder, $oDocument)); | |
| 134 | 134 | } else { |
| 135 | 135 | // filename collision |
| 136 | 136 | $oPatternCustom->setHtml(getPage($fFolderID, $fDocumentID, "This folder already contains a document of the same name. Please choose another directory")); | ... | ... |
presentation/lookAndFeel/knowledgeTree/documentmanagement/moveDocumentUI.inc
| ... | ... | @@ -25,20 +25,27 @@ |
| 25 | 25 | * @package documentmanagement |
| 26 | 26 | */ |
| 27 | 27 | |
| 28 | -function getConfirmationPage($iFolderID, $iDocumentID) { | |
| 28 | +function getConfirmationPage($oFolder, $oDocument) { | |
| 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>" . Document::getDocumentDisplayPath($iDocumentID) . "</strong> to </td></tr>\n"; | |
| 34 | - $sToRender .= "<tr><td><strong>" . Folder::getFolderDisplayPath($iFolderID) . " > " . Document::getDocumentName($iDocumentID) . "</strong></td>\n"; | |
| 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"; | |
| 35 | 35 | $sToRender .= "</tr>\n"; |
| 36 | - $sToRender .= "<tr><td><a href=\"$default->rootUrl/control.php?action=moveDocument&fDocumentID=$iDocumentID&fFolderID=$iFolderID&fForMove=1&fConfirmed=1\"><img src=\"$default->graphicsUrl/widgets/move.gif\" border=\"0\"/></a> <a href=\"$default->rootUrl/control.php?action=viewDocument&fDocumentID=" . $iDocumentID . "\"><img src=\"$default->graphicsUrl/widgets/cancel.gif\" border=\"0\"></a></td></tr>\n"; | |
| 36 | + $sToRender .= "<tr><td><a href=\"$default->rootUrl/control.php?action=moveDocument&fDocumentID=" . | |
| 37 | + $oDocument->getID() . "&fFolderID=" . $oFolder->getID() . | |
| 38 | + "&fForMove=1&fConfirmed=1\">" . | |
| 39 | + "<img src=\"$default->graphicsUrl/widgets/move.gif\" border=\"0\"/>" . | |
| 40 | + "</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"; | |
| 37 | 44 | $sToRender .= "</table>\n"; |
| 38 | 45 | return $sToRender; |
| 39 | 46 | } |
| 40 | 47 | |
| 41 | - | |
| 48 | +// FIXME: change these to object references instead of IDs | |
| 42 | 49 | function getPage($iFolderID, $iDocumentID, $sErrorMessage = "") { |
| 43 | 50 | global $default; |
| 44 | 51 | $sToRender = renderHeading("Move Document"); | ... | ... |