Commit f413aa90a44ff3069636eba9763ed96bdd3404e9

Authored by rob
1 parent 3d94b9bd

Added group_folder_approval_id column to class


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1843 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/documentmanagement/DependantDocumentTemplate.inc
... ... @@ -22,6 +22,8 @@ class DependantDocumentTemplate {
22 22 var $sDocumentTitle;
23 23 /** primary key of document to use as template */
24 24 var $iTemplateDocumentID;
  25 + /** primary key of folder collaboration step that template belongs to */
  26 + var $iGroupFolderApprovalLinkID;
25 27  
26 28 /**
27 29 * Default constructor
... ... @@ -30,12 +32,13 @@ class DependantDocumentTemplate {
30 32 * @param Document field data type
31 33 *
32 34 */
33   - function DependantDocumentTemplate($sNewDocumentTitle, $iNewDefaultUserID, $iNewTemplateDocumentID) {
  35 + function DependantDocumentTemplate($sNewDocumentTitle, $iNewDefaultUserID, $iNewTemplateDocumentID, $iNewGroupFolderApprovalLinkID) {
34 36 //object not created yet
35 37 global $default;
36 38 $this->iID = -1;
37 39 $this->iDefaultUserID = $iNewDefaultUserID;
38 40 $this->iTemplateDocumentID = $iNewTemplateDocumentID;
  41 + $this->iGroupFolderApprovalLinkID = $iNewGroupFolderApprovalLinkID;
39 42  
40 43  
41 44 }
... ... @@ -93,8 +96,16 @@ class DependantDocumentTemplate {
93 96 * @param Template document's primary key
94 97 *
95 98 */
96   - function setHasLookup($sNewValue) {
97   - $this -> iTemplateDocumentID = $sNewValue;
  99 + function setTemplateDocumentID($iNewValue) {
  100 + $this -> iTemplateDocumentID = $iNewValue;
  101 + }
  102 +
  103 + function getGroupFolderApprovalLinkID() {
  104 + return $this->iGroupFolderApprovalLinkID;
  105 + }
  106 +
  107 + function setGroupFolderApprovalLinkID($iNewValue) {
  108 + $this->iGroupFolderApprovalLinkID = $iNewValue;
98 109 }
99 110  
100 111 /**
... ... @@ -108,7 +119,7 @@ class DependantDocumentTemplate {
108 119 //if the object hasn't been created
109 120 if ($this -> iId < 0) {
110 121 $sql = $default -> db;
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)");
  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)");
112 123 if ($result) {
113 124 $this -> iId = $sql -> insert_id();
114 125 return true;
... ... @@ -131,7 +142,7 @@ class DependantDocumentTemplate {
131 142 //only update if the object has been stored
132 143 if ($this -> iId > 0) {
133 144 $sql = $default -> db;
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");
  145 + $result = $sql -> query("UPDATE $default -> owl_dependant_documents SET document_title = '".addslashes($this -> sDocumentTitle)."', user_id = $this->iDefaultUserID, template_document_id = $this->iTemplateDocumentID, group_folder_approval_link_id = $this->iGroupFolderApprovalLinkID WHERE id = $this->iId");
135 146 if ($result) {
136 147 return true;
137 148 }
... ... @@ -178,7 +189,7 @@ class DependantDocumentTemplate {
178 189 $result = $sql -> query("SELECT * FROM $default->owl_dependant_document_template_table WHERE id = $iDependantDocumentID");
179 190 if ($result) {
180 191 if ($sql -> next_record()) {
181   - $oDependantDocument = & new DependantDocument(stripslashes($sql -> f("document_title")), $sql -> f("user_id"), $sql -> f("template_document_id"));
  192 + $oDependantDocument = & new DependantDocument(stripslashes($sql -> f("document_title")), $sql -> f("user_id"), $sql -> f("template_document_id"), $sql->f("group_folder_approval_link_id"));
182 193 $oDependantDocument -> iId = $sql -> f("id");
183 194 return $oDependantDocument;
184 195 }
... ...