Commit e140cfceba403d992b8f937bef04b7a08c649b3e
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
Showing
1 changed file
with
10 additions
and
10 deletions
lib/documentmanagement/DependantDocumentTemplate.inc
| ... | ... | @@ -12,12 +12,12 @@ |
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | 14 | |
| 15 | -class DepandantDocument { | |
| 15 | +class DependantDocumentTemplate { | |
| 16 | 16 | |
| 17 | 17 | /** primary key value */ |
| 18 | 18 | var $iId; |
| 19 | 19 | /** primary key of user responsible for creating document */ |
| 20 | - var $iUserID; | |
| 20 | + var $iDefaultUserID; | |
| 21 | 21 | /** document title name */ |
| 22 | 22 | var $sDocumentTitle; |
| 23 | 23 | /** primary key of document to use as template */ |
| ... | ... | @@ -30,11 +30,11 @@ class DepandantDocument { |
| 30 | 30 | * @param Document field data type |
| 31 | 31 | * |
| 32 | 32 | */ |
| 33 | - function DepandantDocument($sNewDocumentTitle, $iUserID, $iNewTemplateDocumentID) { | |
| 33 | + function DependantDocumentTemplate($sNewDocumentTitle, $iNewDefaultUserID, $iNewTemplateDocumentID) { | |
| 34 | 34 | //object not created yet |
| 35 | 35 | global $default; |
| 36 | 36 | $this->iID = -1; |
| 37 | - $this->iUserID = $iUserID; | |
| 37 | + $this->iDefaultUserID = $iNewDefaultUserID; | |
| 38 | 38 | $this->iTemplateDocumentID = $iNewTemplateDocumentID; |
| 39 | 39 | |
| 40 | 40 | |
| ... | ... | @@ -54,7 +54,7 @@ class DepandantDocument { |
| 54 | 54 | * Get the primary key of the user responsbile for new document creation |
| 55 | 55 | */ |
| 56 | 56 | function getUserID() { |
| 57 | - return $this->iUserID; | |
| 57 | + return $this->iDefaultUserID; | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /** |
| ... | ... | @@ -108,7 +108,7 @@ class DepandantDocument { |
| 108 | 108 | //if the object hasn't been created |
| 109 | 109 | if ($this -> iId < 0) { |
| 110 | 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 | 112 | if ($result) { |
| 113 | 113 | $this -> iId = $sql -> insert_id(); |
| 114 | 114 | return true; |
| ... | ... | @@ -131,7 +131,7 @@ class DepandantDocument { |
| 131 | 131 | //only update if the object has been stored |
| 132 | 132 | if ($this -> iId > 0) { |
| 133 | 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 | 135 | if ($result) { |
| 136 | 136 | return true; |
| 137 | 137 | } |
| ... | ... | @@ -153,7 +153,7 @@ class DepandantDocument { |
| 153 | 153 | //only delete the object if it exists in the database |
| 154 | 154 | if ($this -> iId >= 0) { |
| 155 | 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 | 157 | if ($result) { |
| 158 | 158 | return true; |
| 159 | 159 | } |
| ... | ... | @@ -175,14 +175,14 @@ class DepandantDocument { |
| 175 | 175 | function & get($iDependantDocumentID) { |
| 176 | 176 | global $default; |
| 177 | 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 | 179 | if ($result) { |
| 180 | 180 | if ($sql -> next_record()) { |
| 181 | 181 | $oDependantDocument = & new DependantDocument(stripslashes($sql -> f("document_title")), $sql -> f("user_id"), $sql -> f("template_document_id")); |
| 182 | 182 | $oDependantDocument -> iId = $sql -> f("id"); |
| 183 | 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 | 186 | return false; |
| 187 | 187 | } |
| 188 | 188 | $_SESSION["errorMessage"] = $lang_err_database; | ... | ... |