Commit 095b4ff0fb554d039e4f9fff4a5e2f6a153a04cd

Authored by rob
1 parent 24ac0ed6

Added new get/set functions for folderID


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@298 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/documentmanagement/Document.inc
@@ -7,12 +7,10 @@ @@ -7,12 +7,10 @@
7 * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa 7 * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa
8 * @date 15 January 2003 8 * @date 15 January 2003
9 * 9 *
10 -* @todo add in document change tracking functionality 10 +* @todo add in document change transaction functionality
11 * 11 *
12 */ 12 */
13 13
14 -require_once("$default->owl_fs_root/lib/foldermanagement/FolderLib.inc");  
15 -  
16 class Document { 14 class Document {
17 /** primary key */ 15 /** primary key */
18 var $iId; 16 var $iId;
@@ -52,7 +50,7 @@ class Document { @@ -52,7 +50,7 @@ class Document {
52 * @param $iFolderID Primary key of folder to which document belongs 50 * @param $iFolderID Primary key of folder to which document belongs
53 * 51 *
54 */ 52 */
55 - function Document($sNewName, $sNewFileName, $iNewSize, $iNewCreatorID, $sNewDescription, $iNewMimeID, $iNewFolderID) { 53 + function Document($sNewName, $sNewFileName, $iNewSize, $iNewCreatorID, $iNewMimeID, $iNewFolderID, $sNewDescription = "None") {
56 $this->iId = -1; //primary key not set as document is not stored yet 54 $this->iId = -1; //primary key not set as document is not stored yet
57 $this->sName = $sNewName; 55 $this->sName = $sNewName;
58 $this->iSize = $iNewSize; 56 $this->iSize = $iNewSize;
@@ -168,7 +166,7 @@ class Document { @@ -168,7 +166,7 @@ class Document {
168 $doc->setIsCheckedOut($sql->f("is_checked_out")); 166 $doc->setIsCheckedOut($sql->f("is_checked_out"));
169 return $doc; 167 return $doc;
170 } 168 }
171 - $_SESSION["errorMessage"] = $lang_err_object_not_exist . "id = " $iDocumentID . " table = documents"; 169 + $_SESSION["errorMessage"] = $lang_err_object_not_exist . "id = " . $iDocumentID . " table = documents";
172 return false; 170 return false;
173 } 171 }
174 172
@@ -207,6 +205,16 @@ class Document { @@ -207,6 +205,16 @@ class Document {
207 $this->sFileName = $sNewValue; 205 $this->sFileName = $sNewValue;
208 } 206 }
209 207
  208 + /** get the primary key of the folder in which the document is stored */
  209 + function getFolderID() {
  210 + return $this->iFolderID;
  211 + }
  212 +
  213 + /** set the primary key of the folder in which the document is stored */
  214 + function setFolderID($iNewValue) {
  215 + $this->iFolderID = $iNewValue;
  216 + }
  217 +
210 /** get the document file size in bytes */ 218 /** get the document file size in bytes */
211 function getFileSize() { 219 function getFileSize() {
212 return $this->iSize; 220 return $this->iSize;