Commit a3e3aafd66647af7c5111dcdeef9db8d1fd7571f
1 parent
578bd5cf
Move over from PhysicalDocumentManager to the abstract StorageManager
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3621 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
9 additions
and
6 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/moveDocumentBL.php
| ... | ... | @@ -33,7 +33,6 @@ require_once("$default->fileSystemRoot/lib/security/Permission.inc"); |
| 33 | 33 | require_once("$default->fileSystemRoot/lib/users/User.inc"); |
| 34 | 34 | require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentTransaction.inc"); |
| 35 | 35 | require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); |
| 36 | -require_once("$default->fileSystemRoot/lib/documentmanagement/PhysicalDocumentManager.inc"); | |
| 37 | 36 | require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); |
| 38 | 37 | |
| 39 | 38 | require_once("$default->fileSystemRoot/lib/subscriptions/SubscriptionEngine.inc"); |
| ... | ... | @@ -44,6 +43,8 @@ require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); |
| 44 | 43 | require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/documentmanagement/moveDocumentUI.inc"); |
| 45 | 44 | require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc"); |
| 46 | 45 | require_once("$default->fileSystemRoot/presentation/Html.inc"); |
| 46 | + | |
| 47 | +require_once(KT_LIB_DIR . '/storage/storagemanager.inc.php'); | |
| 47 | 48 | |
| 48 | 49 | $aUnmovedDocs = array(); |
| 49 | 50 | |
| ... | ... | @@ -60,7 +61,7 @@ if (isset($fRememberDocumentID)) { |
| 60 | 61 | } |
| 61 | 62 | |
| 62 | 63 | |
| 63 | -/* if (!isset($fDocumentIDs) || !isset($fFolderID)) { | |
| 64 | +if (!isset($fDocumentIDs) || !isset($fFolderID)) { | |
| 64 | 65 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); |
| 65 | 66 | $oPatternCustom = & new PatternCustom(); |
| 66 | 67 | $oPatternCustom->setHtml(""); |
| ... | ... | @@ -68,7 +69,7 @@ if (isset($fRememberDocumentID)) { |
| 68 | 69 | $main->setErrorMessage(_("No document/folder selected")); |
| 69 | 70 | $main->render(); |
| 70 | 71 | exit(0); |
| 71 | -} */ | |
| 72 | +} | |
| 72 | 73 | |
| 73 | 74 | if (!isset($fForMove)) { |
| 74 | 75 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); |
| ... | ... | @@ -110,7 +111,9 @@ if (!$fConfirmed) { |
| 110 | 111 | $main->setCentralPayload($oPatternCustom); |
| 111 | 112 | $main->render(); |
| 112 | 113 | exit(0); |
| 113 | -} | |
| 114 | +} | |
| 115 | + | |
| 116 | +$oStorage =& KTStorageManagerUtil::getSingleton(); | |
| 114 | 117 | |
| 115 | 118 | for ($i = 0; $i < count($fDocumentIDs); $i++) { |
| 116 | 119 | |
| ... | ... | @@ -147,9 +150,9 @@ for ($i = 0; $i < count($fDocumentIDs); $i++) { |
| 147 | 150 | //get the old document path |
| 148 | 151 | $sOldDocumentFileSystemPath = Folder::getFolderPath($iOldFolderID) . $oDocument->getFileName(); |
| 149 | 152 | //move the document on the file system |
| 150 | - if (!PhysicalDocumentManager::moveDocument($sOldDocumentFileSystemPath, $oDocument, $oFolder)) { | |
| 153 | + if (!$oStorage->moveDocument($sOldDocumentFileSystemPath, $oDocument, $oFolder)) { | |
| 151 | 154 | $oDocument->setFolderID($iOldFolderID); |
| 152 | - $oDocument->update(); | |
| 155 | + $oDocument->update(true); | |
| 153 | 156 | |
| 154 | 157 | // Store the doc with problem |
| 155 | 158 | array_push($aUnmovedDocs, array($oDocument, _("Could not move document on file system"))); | ... | ... |