Commit 8385c0c10aab5672d740a9fe9cb51bc324105885

Authored by nbm
1 parent 66c0db18

Use the abstract storage manager and KTMime rather than

PhysicalDocumentManager


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3592 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/documentmanagement/bulkUploadBL.php
... ... @@ -52,6 +52,11 @@ require_once("$default->fileSystemRoot/presentation/Html.inc");
52 52 require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");
53 53 require_once("bulkUploadUI.inc");
54 54  
  55 +require_once(KT_LIB_DIR . '/storage/storagemanager.inc.php');
  56 +require_once(KT_LIB_DIR . '/mime.inc.php');
  57 +
  58 +$oStorage =& KTStorageManagerUtil::getSingleton();
  59 +
55 60 $oPatternCustom = & new PatternCustom();
56 61  
57 62 /* CHECK: system has required features to handle bulk upload */
... ... @@ -192,7 +197,7 @@ while ($aIndividualFiles) {
192 197 $sBasename = basename($oFile->sFilename);
193 198 $aFileFake = array(
194 199 'name' => $sBasename,
195   - 'type' => PhysicalDocumentManager::getMimeTypeFromFile($oFile->sFilename),
  200 + 'type' => KTMime::getMimeTypeFromFile($oFile->sFilename),
196 201 'tmp_name' => $oFile->sFilename,
197 202 'error' => 0,
198 203 'size' => $oFile->iSize,
... ... @@ -219,12 +224,14 @@ while ($aIndividualFiles) {
219 224 }
220 225  
221 226 // if the document was successfully created in the db, store it on the file system
222   - if (!PhysicalDocumentManager::uploadPhysicalDocument($oDocument, $fFolderID, "None", $oFile->sFilename)) {
  227 + if (!$oStorage->upload($oDocument, $oFile->sFilename)) {
223 228 $default->log->error("bulkUploadBL.php DB error storing document in folder $sFolderPath id=$fFolderID");
224 229 $aFileStatus[$sBasename] = _("An error occured while storing the document in the database, please try again") . ".";
225 230 continue;
226 231 }
227 232  
  233 + $oDocument->update();
  234 +
228 235 // create the web document link
229 236 $oWebDocument = & new WebDocument($oDocument->getID(), -1, 1, NOT_PUBLISHED, getCurrentDateTime());
230 237 if ($oWebDocument->create()) {
... ...