Commit ee4c0cfae132a0ce3563b90974c881deb67d638d

Authored by rob
1 parent 761734ff

Fixed typo


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1867 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/documentmanagement/DependantDocumentTemplate.inc
@@ -32,10 +32,11 @@ class DependantDocumentTemplate { @@ -32,10 +32,11 @@ class DependantDocumentTemplate {
32 * @param Document field data type 32 * @param Document field data type
33 * 33 *
34 */ 34 */
35 - function DependantDocumentTemplate($sNewDocumentTitle, $iNewDefaultUserID, $iNewTemplateDocumentID, $iNewGroupFolderApprovalLinkID) { 35 + function DependantDocumentTemplate($sNewDocumentTitle, $iNewDefaultUserID, $iNewGroupFolderApprovalLinkID, $iNewTemplateDocumentID = null) {
36 //object not created yet 36 //object not created yet
37 global $default; 37 global $default;
38 - $this->iID = -1; 38 + $this->iId = -1;
  39 + $this->sDocumentTitle = $sNewDocumentTitle;
39 $this->iDefaultUserID = $iNewDefaultUserID; 40 $this->iDefaultUserID = $iNewDefaultUserID;
40 $this->iTemplateDocumentID = $iNewTemplateDocumentID; 41 $this->iTemplateDocumentID = $iNewTemplateDocumentID;
41 $this->iGroupFolderApprovalLinkID = $iNewGroupFolderApprovalLinkID; 42 $this->iGroupFolderApprovalLinkID = $iNewGroupFolderApprovalLinkID;
@@ -116,10 +117,10 @@ class DependantDocumentTemplate { @@ -116,10 +117,10 @@ class DependantDocumentTemplate {
116 */ 117 */
117 function create() { 118 function create() {
118 global $default, $lang_err_database, $lang_err_object_exists; 119 global $default, $lang_err_database, $lang_err_object_exists;
119 - //if the object hasn't been created 120 + //if the object hasn't been created
120 if ($this -> iId < 0) { 121 if ($this -> iId < 0) {
121 - $sql = $default -> db;  
122 - $result = $sql -> query("INSERT INTO $default->owl_dependant_document_template_table (document_title, user_id,template_document_id, group_folder_approval_link_id) VALUES ('" . addslashes($this->sDocumentTitle) . "', $this->iDefaultUserID, $this->iTemplateDocumentID, $this->iGroupFolderApprovalLinkID)"); 122 + $sql = $default -> db;
  123 + $result = $sql -> query("INSERT INTO $default->owl_dependant_document_template_table (document_title, default_user_id,template_document_id, group_folder_approval_link_id) VALUES ('" . addslashes($this->sDocumentTitle) . "', $this->iDefaultUserID, " . (isset($this->iTemplateDocumentID) ? $this->iTemplateDocumentID : "'NULL'") . ", $this->iGroupFolderApprovalLinkID)");
123 if ($result) { 124 if ($result) {
124 $this -> iId = $sql -> insert_id(); 125 $this -> iId = $sql -> insert_id();
125 return true; 126 return true;
@@ -127,7 +128,7 @@ class DependantDocumentTemplate { @@ -127,7 +128,7 @@ class DependantDocumentTemplate {
127 $_SESSION["errorMessage"] = $lang_err_database; 128 $_SESSION["errorMessage"] = $lang_err_database;
128 return false; 129 return false;
129 } 130 }
130 - $_SESSION["errorMessage"] = $lang_err_object_exists."id = ".$this -> iId." table = document_fields"; 131 + $_SESSION["errorMessage"] = $lang_err_object_exists."id = ".$this->iId." Table = $default->owl_dependant_document_template_table";
131 return false; 132 return false;
132 } 133 }
133 134