Commit e140cfceba403d992b8f937bef04b7a08c649b3e

Authored by rob
1 parent 8dd956a9

Updated table name


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1841 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/documentmanagement/DependantDocumentTemplate.inc
@@ -12,12 +12,12 @@ @@ -12,12 +12,12 @@
12 */ 12 */
13 13
14 14
15 -class DepandantDocument { 15 +class DependantDocumentTemplate {
16 16
17 /** primary key value */ 17 /** primary key value */
18 var $iId; 18 var $iId;
19 /** primary key of user responsible for creating document */ 19 /** primary key of user responsible for creating document */
20 - var $iUserID; 20 + var $iDefaultUserID;
21 /** document title name */ 21 /** document title name */
22 var $sDocumentTitle; 22 var $sDocumentTitle;
23 /** primary key of document to use as template */ 23 /** primary key of document to use as template */
@@ -30,11 +30,11 @@ class DepandantDocument { @@ -30,11 +30,11 @@ class DepandantDocument {
30 * @param Document field data type 30 * @param Document field data type
31 * 31 *
32 */ 32 */
33 - function DepandantDocument($sNewDocumentTitle, $iUserID, $iNewTemplateDocumentID) { 33 + function DependantDocumentTemplate($sNewDocumentTitle, $iNewDefaultUserID, $iNewTemplateDocumentID) {
34 //object not created yet 34 //object not created yet
35 global $default; 35 global $default;
36 $this->iID = -1; 36 $this->iID = -1;
37 - $this->iUserID = $iUserID; 37 + $this->iDefaultUserID = $iNewDefaultUserID;
38 $this->iTemplateDocumentID = $iNewTemplateDocumentID; 38 $this->iTemplateDocumentID = $iNewTemplateDocumentID;
39 39
40 40
@@ -54,7 +54,7 @@ class DepandantDocument { @@ -54,7 +54,7 @@ class DepandantDocument {
54 * Get the primary key of the user responsbile for new document creation 54 * Get the primary key of the user responsbile for new document creation
55 */ 55 */
56 function getUserID() { 56 function getUserID() {
57 - return $this->iUserID; 57 + return $this->iDefaultUserID;
58 } 58 }
59 59
60 /** 60 /**
@@ -108,7 +108,7 @@ class DepandantDocument { @@ -108,7 +108,7 @@ class DepandantDocument {
108 //if the object hasn't been created 108 //if the object hasn't been created
109 if ($this -> iId < 0) { 109 if ($this -> iId < 0) {
110 $sql = $default -> db; 110 $sql = $default -> db;
111 - $result = $sql -> query("INSERT INTO $default -> owl_dependant_documents_table (document_title, user_id,template_document_id) VALUES ('" . addslashes($this->sDocumentTitle) . "', $this->iUserID, $this->iTemplateDocumentID)"); 111 + $result = $sql -> query("INSERT INTO $default->owl_dependant_document_template_table (document_title, user_id,template_document_id) VALUES ('" . addslashes($this->sDocumentTitle) . "', $this->iDefaultUserID, $this->iTemplateDocumentID)");
112 if ($result) { 112 if ($result) {
113 $this -> iId = $sql -> insert_id(); 113 $this -> iId = $sql -> insert_id();
114 return true; 114 return true;
@@ -131,7 +131,7 @@ class DepandantDocument { @@ -131,7 +131,7 @@ class DepandantDocument {
131 //only update if the object has been stored 131 //only update if the object has been stored
132 if ($this -> iId > 0) { 132 if ($this -> iId > 0) {
133 $sql = $default -> db; 133 $sql = $default -> db;
134 - $result = $sql -> query("UPDATE $default -> owl_dependant_documents SET document_title = '".addslashes($this -> sDocumentTitle)."', user_id = $this->iUserID, template_document_id = $this->iTemplateDocumentID WHERE id = $this->iId"); 134 + $result = $sql -> query("UPDATE $default -> owl_dependant_documents SET document_title = '".addslashes($this -> sDocumentTitle)."', user_id = $this->iDefaultUserID, template_document_id = $this->iTemplateDocumentID WHERE id = $this->iId");
135 if ($result) { 135 if ($result) {
136 return true; 136 return true;
137 } 137 }
@@ -153,7 +153,7 @@ class DepandantDocument { @@ -153,7 +153,7 @@ class DepandantDocument {
153 //only delete the object if it exists in the database 153 //only delete the object if it exists in the database
154 if ($this -> iId >= 0) { 154 if ($this -> iId >= 0) {
155 $sql = $default -> db; 155 $sql = $default -> db;
156 - $result = $sql -> query("DELETE FROM $default->owl_dependant_documents_table WHERE id = $this->iId"); 156 + $result = $sql -> query("DELETE FROM $default->owl_dependant_document_template_table WHERE id = $this->iId");
157 if ($result) { 157 if ($result) {
158 return true; 158 return true;
159 } 159 }
@@ -175,14 +175,14 @@ class DepandantDocument { @@ -175,14 +175,14 @@ class DepandantDocument {
175 function & get($iDependantDocumentID) { 175 function & get($iDependantDocumentID) {
176 global $default; 176 global $default;
177 $sql = $default -> db; 177 $sql = $default -> db;
178 - $result = $sql -> query("SELECT * FROM $default->owl_dependant_documents_table WHERE id = $iDependantDocumentID"); 178 + $result = $sql -> query("SELECT * FROM $default->owl_dependant_document_template_table WHERE id = $iDependantDocumentID");
179 if ($result) { 179 if ($result) {
180 if ($sql -> next_record()) { 180 if ($sql -> next_record()) {
181 $oDependantDocument = & new DependantDocument(stripslashes($sql -> f("document_title")), $sql -> f("user_id"), $sql -> f("template_document_id")); 181 $oDependantDocument = & new DependantDocument(stripslashes($sql -> f("document_title")), $sql -> f("user_id"), $sql -> f("template_document_id"));
182 $oDependantDocument -> iId = $sql -> f("id"); 182 $oDependantDocument -> iId = $sql -> f("id");
183 return $oDependantDocument; 183 return $oDependantDocument;
184 } 184 }
185 - $_SESSION["errorMessage"] = $lang_err_object_not_exist."id = ".$iDependantDocumentID." table = $default->owl_dependant_documents_table"; 185 + $_SESSION["errorMessage"] = $lang_err_object_not_exist."id = ".$iDependantDocumentID." table = $default->owl_dependant_document_template_table";
186 return false; 186 return false;
187 } 187 }
188 $_SESSION["errorMessage"] = $lang_err_database; 188 $_SESSION["errorMessage"] = $lang_err_database;