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,7 +33,6 @@ require_once("$default->fileSystemRoot/lib/security/Permission.inc"); | ||
| 33 | require_once("$default->fileSystemRoot/lib/users/User.inc"); | 33 | require_once("$default->fileSystemRoot/lib/users/User.inc"); |
| 34 | require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentTransaction.inc"); | 34 | require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentTransaction.inc"); |
| 35 | require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); | 35 | require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); |
| 36 | -require_once("$default->fileSystemRoot/lib/documentmanagement/PhysicalDocumentManager.inc"); | ||
| 37 | require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); | 36 | require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); |
| 38 | 37 | ||
| 39 | require_once("$default->fileSystemRoot/lib/subscriptions/SubscriptionEngine.inc"); | 38 | require_once("$default->fileSystemRoot/lib/subscriptions/SubscriptionEngine.inc"); |
| @@ -44,6 +43,8 @@ require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | @@ -44,6 +43,8 @@ require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | ||
| 44 | require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/documentmanagement/moveDocumentUI.inc"); | 43 | require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/documentmanagement/moveDocumentUI.inc"); |
| 45 | require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc"); | 44 | require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc"); |
| 46 | require_once("$default->fileSystemRoot/presentation/Html.inc"); | 45 | require_once("$default->fileSystemRoot/presentation/Html.inc"); |
| 46 | + | ||
| 47 | +require_once(KT_LIB_DIR . '/storage/storagemanager.inc.php'); | ||
| 47 | 48 | ||
| 48 | $aUnmovedDocs = array(); | 49 | $aUnmovedDocs = array(); |
| 49 | 50 | ||
| @@ -60,7 +61,7 @@ if (isset($fRememberDocumentID)) { | @@ -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 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | 65 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); |
| 65 | $oPatternCustom = & new PatternCustom(); | 66 | $oPatternCustom = & new PatternCustom(); |
| 66 | $oPatternCustom->setHtml(""); | 67 | $oPatternCustom->setHtml(""); |
| @@ -68,7 +69,7 @@ if (isset($fRememberDocumentID)) { | @@ -68,7 +69,7 @@ if (isset($fRememberDocumentID)) { | ||
| 68 | $main->setErrorMessage(_("No document/folder selected")); | 69 | $main->setErrorMessage(_("No document/folder selected")); |
| 69 | $main->render(); | 70 | $main->render(); |
| 70 | exit(0); | 71 | exit(0); |
| 71 | -} */ | 72 | +} |
| 72 | 73 | ||
| 73 | if (!isset($fForMove)) { | 74 | if (!isset($fForMove)) { |
| 74 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | 75 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); |
| @@ -110,7 +111,9 @@ if (!$fConfirmed) { | @@ -110,7 +111,9 @@ if (!$fConfirmed) { | ||
| 110 | $main->setCentralPayload($oPatternCustom); | 111 | $main->setCentralPayload($oPatternCustom); |
| 111 | $main->render(); | 112 | $main->render(); |
| 112 | exit(0); | 113 | exit(0); |
| 113 | -} | 114 | +} |
| 115 | + | ||
| 116 | +$oStorage =& KTStorageManagerUtil::getSingleton(); | ||
| 114 | 117 | ||
| 115 | for ($i = 0; $i < count($fDocumentIDs); $i++) { | 118 | for ($i = 0; $i < count($fDocumentIDs); $i++) { |
| 116 | 119 | ||
| @@ -147,9 +150,9 @@ for ($i = 0; $i < count($fDocumentIDs); $i++) { | @@ -147,9 +150,9 @@ for ($i = 0; $i < count($fDocumentIDs); $i++) { | ||
| 147 | //get the old document path | 150 | //get the old document path |
| 148 | $sOldDocumentFileSystemPath = Folder::getFolderPath($iOldFolderID) . $oDocument->getFileName(); | 151 | $sOldDocumentFileSystemPath = Folder::getFolderPath($iOldFolderID) . $oDocument->getFileName(); |
| 149 | //move the document on the file system | 152 | //move the document on the file system |
| 150 | - if (!PhysicalDocumentManager::moveDocument($sOldDocumentFileSystemPath, $oDocument, $oFolder)) { | 153 | + if (!$oStorage->moveDocument($sOldDocumentFileSystemPath, $oDocument, $oFolder)) { |
| 151 | $oDocument->setFolderID($iOldFolderID); | 154 | $oDocument->setFolderID($iOldFolderID); |
| 152 | - $oDocument->update(); | 155 | + $oDocument->update(true); |
| 153 | 156 | ||
| 154 | // Store the doc with problem | 157 | // Store the doc with problem |
| 155 | array_push($aUnmovedDocs, array($oDocument, _("Could not move document on file system"))); | 158 | array_push($aUnmovedDocs, array($oDocument, _("Could not move document on file system"))); |