Commit d4fb159bbcb04e23151860e590e43f1e6546ca21
1 parent
b9fb1567
Corrected errors
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@358 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
8 changed files
with
15 additions
and
16 deletions
lib/documentmanagement/Document.inc
| ... | ... | @@ -59,7 +59,7 @@ class Document { |
| 59 | 59 | $this->sDescription = $sNewDescription; |
| 60 | 60 | $this->iMimeTypeID = $iNewMimeID; |
| 61 | 61 | $this->iFolderID = $iNewFolderID; |
| 62 | - $this->iDocumentTypeID = FolderLib::getFolderDocumentType($this->iFolderID); | |
| 62 | + $this->iDocumentTypeID = Folder::getFolderDocumentType($this->iFolderID); | |
| 63 | 63 | $this->iMajorVersion = 0; |
| 64 | 64 | $this->iMinorVersion = 1; |
| 65 | 65 | $this->bIsCheckedOut = false; |
| ... | ... | @@ -282,15 +282,15 @@ class Document { |
| 282 | 282 | function & get($iDocumentID) { |
| 283 | 283 | global $default, $lang_err_doc_not_exist; |
| 284 | 284 | $sql = new Owl_DB(); |
| 285 | - $sql->query("SELECT * FROM " . $default->owl_documents_table . " WHERE id = " . $iDocumentID); | |
| 286 | - if ($sql->next_record()) { | |
| 285 | + $sql->query("SELECT * FROM $default->owl_documents_table WHERE id = $iDocumentID"); | |
| 286 | + if ($sql->next_record()) { | |
| 287 | 287 | $oDocument = & new Document(stripslashes($sql->f("name")), $sql->f("filename"), $sql->f("size"), stripslashes($sql->f("creator_id")), $sql->f("mime_id"), $sql->f("folder_id"), $sql->f("description")); |
| 288 | 288 | $oDocument->setDocumentTypeID($sql->f("document_type_id")); |
| 289 | 289 | $oDocument->setMajorVersionNumber($sql->f("major_version")); |
| 290 | 290 | $oDocument->setMinorVersionNumber($sql->f("minor_version")); |
| 291 | 291 | $oDocument->setIsCheckedOut($sql->f("is_checked_out")); |
| 292 | 292 | $oDocument->iId = $iDocumentID; |
| 293 | - return $doc; | |
| 293 | + return $oDocument; | |
| 294 | 294 | } |
| 295 | 295 | $_SESSION["errorMessage"] = $lang_err_object_not_exist . "id = " . $iDocumentID . " table = documents"; |
| 296 | 296 | return false; |
| ... | ... | @@ -364,7 +364,7 @@ class Document { |
| 364 | 364 | function documentExists($sName, $iFolderID) { |
| 365 | 365 | global $default, $lang_err_doc_not_exist; |
| 366 | 366 | $sql = new Owl_DB(); |
| 367 | - $sql->query("SELECT * FROM " . $default->owl_documents_table . " WHERE name = '" . $sName "' AND folder_id = " . $iFolderID); | |
| 367 | + $sql->query("SELECT * FROM $default->owl_documents_table WHERE name = '" . addslashes($sName) . "' AND folder_id = $iFolderID"); | |
| 368 | 368 | if ($sql->next_record()) { |
| 369 | 369 | return true; |
| 370 | 370 | } | ... | ... |
lib/documentmanagement/DocumentTransaction.inc
| ... | ... | @@ -58,7 +58,7 @@ class DocumentTransaction { |
| 58 | 58 | $this->iUserID = $_SESSION["userID"]; |
| 59 | 59 | $this->dDateTime = getCurrentDateTime(); |
| 60 | 60 | $this->sIP = $_SERVER["REMOTE_ADDR"]; |
| 61 | - $this->sFileName = FolderLib::getFolderPath($oDocument->getFolderID()) . "/" . $oDocument->getName(); | |
| 61 | + $this->sFileName = Folder::getFolderPath($oDocument->getFolderID()) . "/" . $oDocument->getName(); | |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /** | ... | ... |
lib/documentmanagement/PhysicalDocumentManager.inc
| ... | ... | @@ -38,7 +38,7 @@ class PhysicalDocumentManager { |
| 38 | 38 | $oDocument = & PhysicalDocumentManager::createDocumentFromUploadedFile($aFileArray, $iFolderID); |
| 39 | 39 | $oDocument->setDescription($sDescription); |
| 40 | 40 | //find the path on the system where the document should be stored |
| 41 | - $sDocumentFileSystemPath = FolderLib::getFolderPath($oDocument->getFolderID()) . "/" . $oDocument->getName(); | |
| 41 | + $sDocumentFileSystemPath = Folder::getFolderPath($oDocument->getFolderID()) . "/" . $oDocument->getName(); | |
| 42 | 42 | var_dump($sDocumentFileSystemPath); |
| 43 | 43 | //copy the file accross |
| 44 | 44 | if (copy($sTmpFilePath, $sDocumentFileSystemPath)) { |
| ... | ... | @@ -73,8 +73,8 @@ class PhysicalDocumentManager { |
| 73 | 73 | function downloadPhysicalDocument($iDocumentID) { |
| 74 | 74 | //get the document |
| 75 | 75 | $oDocument = & Document::get($iDocumentID); |
| 76 | - //get the path to the document on the server | |
| 77 | - $sDocumentFileSystemPath = FolderLib::getFolderPath($oDocument->getFolderID()) . "/" . $oDocument->getName(); | |
| 76 | + //get the path to the document on the server | |
| 77 | + $sDocumentFileSystemPath = Folder::getFolderPath($oDocument->getFolderID()) . "/" . $oDocument->getName(); | |
| 78 | 78 | //set the correct headers |
| 79 | 79 | if (strstr($_SERVER["HTTP_USER_AGENT"], "MSIE")) { |
| 80 | 80 | Header ("Content-type: application/" . PhysicalDocumentManager::getMimeTypeName($oDocument->getMimeTypeID())); |
| ... | ... | @@ -103,7 +103,7 @@ class PhysicalDocumentManager { |
| 103 | 103 | //get the document |
| 104 | 104 | $oDocument = & Document::get($iDocumentID); |
| 105 | 105 | //get the path to the document on the server |
| 106 | - $sDocumentFileSystemPath = FolderLib::getFolderPath($oDocument->getFolderID()) . "/" . $oDocument->getName(); | |
| 106 | + $sDocumentFileSystemPath = Folder::getFolderPath($oDocument->getFolderID()) . "/" . $oDocument->getName(); | |
| 107 | 107 | $total=$url . $files[$i]; |
| 108 | 108 | |
| 109 | 109 | if (strstr($_SERVER["HTTP_USER_AGENT"], "MSIE")) { | ... | ... |
tests/documentmanagement/documentDownload.php
| ... | ... | @@ -12,7 +12,7 @@ require_once("../../config/dmsDefaults.php"); |
| 12 | 12 | if (checkSession()) { |
| 13 | 13 | require_once("$default->owl_fs_root/lib/documentmanagement/PhysicalDocumentManager.inc"); |
| 14 | 14 | require_once("$default->owl_fs_root/lib/documentmanagement/Document.inc"); |
| 15 | - require_once("$default->owl_fs_root/lib/folderManagement/FolderLib.inc"); | |
| 15 | + require_once("$default->owl_fs_root/lib/folderManagement/Folder.inc"); | |
| 16 | 16 | require_once("$default->owl_fs_root/lib/folderManagement/FolderManager.inc"); |
| 17 | 17 | |
| 18 | 18 | echo "<html><head></head><body>\n"; | ... | ... |
tests/documentmanagement/documentDownload2.php
| ... | ... | @@ -4,8 +4,7 @@ require_once("../../config/dmsDefaults.php"); |
| 4 | 4 | if (checkSession()) { |
| 5 | 5 | require_once("$default->owl_fs_root/lib/documentmanagement/PhysicalDocumentManager.inc"); |
| 6 | 6 | require_once("$default->owl_fs_root/lib/documentmanagement/Document.inc"); |
| 7 | - require_once("$default->owl_fs_root/lib/folderManagement/FolderLib.inc"); | |
| 8 | - require_once("$default->owl_fs_root/lib/folderManagement/FolderManager.inc"); | |
| 7 | + require_once("$default->owl_fs_root/lib/foldermanagement/Folder.inc"); | |
| 9 | 8 | |
| 10 | 9 | if (isset($documentID)) { |
| 11 | 10 | PhysicalDocumentManager::downloadPhysicalDocument($documentID); | ... | ... |
tests/documentmanagement/documentTransactions.php
| ... | ... | @@ -11,7 +11,7 @@ require_once("../../config/dmsDefaults.php"); |
| 11 | 11 | if (checkSession()) { |
| 12 | 12 | require_once("$default->owl_fs_root/lib/documentmanagement/Document.inc"); |
| 13 | 13 | require_once("$default->owl_fs_root/lib/documentmanagement/DocumentTransaction.inc"); |
| 14 | - require_once("$default->owl_fs_root/lib/foldermanagement/FolderLib.inc"); | |
| 14 | + require_once("$default->owl_fs_root/lib/foldermanagement/Folder.inc"); | |
| 15 | 15 | require_once("$default->owl_fs_root/lib/foldermanagement/FolderManager.inc"); |
| 16 | 16 | |
| 17 | 17 | $oDocTransaction = & new DocumentTransaction(11, 'Test transaction', 1); | ... | ... |
tests/documentmanagement/documentUpload.php
| ... | ... | @@ -12,7 +12,7 @@ require_once("../../config/dmsDefaults.php"); |
| 12 | 12 | |
| 13 | 13 | if (checkSession()) { |
| 14 | 14 | require_once("$default->owl_fs_root/lib/documentmanagement/PhysicalDocumentManager.inc"); |
| 15 | - require_once("$default->owl_fs_root/lib/folderManagement/FolderLib.inc"); | |
| 15 | + require_once("$default->owl_fs_root/lib/folderManagement/Folder.inc"); | |
| 16 | 16 | require_once("$default->owl_fs_root/lib/visualpatterns/PatternListBox.inc"); |
| 17 | 17 | |
| 18 | 18 | ... | ... |
tests/documentmanagement/documentUpload2.php
| ... | ... | @@ -12,7 +12,7 @@ require_once("../../config/dmsDefaults.php"); |
| 12 | 12 | if (checkSession()) { |
| 13 | 13 | require_once("$default->owl_fs_root/lib/documentmanagement/PhysicalDocumentManager.inc"); |
| 14 | 14 | require_once("$default->owl_fs_root/lib/documentmanagement/Document.inc"); |
| 15 | - require_once("$default->owl_fs_root/lib/folderManagement/FolderLib.inc"); | |
| 15 | + require_once("$default->owl_fs_root/lib/folderManagement/Folder.inc"); | |
| 16 | 16 | require_once("$default->owl_fs_root/lib/folderManagement/FolderManager.inc"); |
| 17 | 17 | |
| 18 | 18 | echo "Document upload succeeded: " . (PhysicalDocumentManager::uploadPhysicalDocument($_FILES, $folderDropDown, "None", $_FILES['upfile']['tmp_name']) ? "Yes" : "No"); | ... | ... |