Commit 2b0855905ceebf7886d51e409a702152aece1ae9

Authored by Michael Joseph
1 parent 7d550ba1

moved archiving type id field to settings table


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2232 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/archiving/DocumentArchiving.inc
@@ -22,10 +22,7 @@ class DocumentArchiving { @@ -22,10 +22,7 @@ class DocumentArchiving {
22 * The document ID 22 * The document ID
23 */ 23 */
24 var $iDocumentID; 24 var $iDocumentID;
25 - /**  
26 - * The archiving method- date or utilisation  
27 - */  
28 - var $iArchivingTypeID; 25 +
29 /** 26 /**
30 * The archiving settings 27 * The archiving settings
31 */ 28 */
@@ -38,13 +35,12 @@ class DocumentArchiving { @@ -38,13 +35,12 @@ class DocumentArchiving {
38 * @param integer the archiving type id 35 * @param integer the archiving type id
39 * @param integer the archiving settings id 36 * @param integer the archiving settings id
40 */ 37 */
41 - function DocumentArchiving($iNewDocumentID, $iNewArchivingTypeID, $iNewArchivingSettingsID) { 38 + function DocumentArchiving($iNewDocumentID, $iNewArchivingSettingsID) {
42 global $default; 39 global $default;
43 40
44 // primary key not set as this is not stored yet 41 // primary key not set as this is not stored yet
45 $this->iId = -1; 42 $this->iId = -1;
46 $this->iDocumentID = $iNewDocumentID; 43 $this->iDocumentID = $iNewDocumentID;
47 - $this->iArchivingTypeID = $iNewArchivingTypeID;  
48 $this->iArchivingSettingsID = $iNewArchivingSettingsID; 44 $this->iArchivingSettingsID = $iNewArchivingSettingsID;
49 } 45 }
50 46
@@ -70,22 +66,6 @@ class DocumentArchiving { @@ -70,22 +66,6 @@ class DocumentArchiving {
70 function setDocumentID($iNewDocumentID){ 66 function setDocumentID($iNewDocumentID){
71 $this->iDocumentID = $iNewDocumentID; 67 $this->iDocumentID = $iNewDocumentID;
72 } 68 }
73 -  
74 - /**  
75 - * Gets the archiving type  
76 - */  
77 - function getArchivingTypeID(){  
78 - return $this->iArchivingTypeID;  
79 - }  
80 -  
81 - /**  
82 - * Sets the archiving type  
83 - *  
84 - * @param integer the new archiving type  
85 - */  
86 - function setArchivingTypeID($iNewArchivingTypeID){  
87 - $this->iArchivingTypeID = $iNewArchivingTypeID;  
88 - }  
89 69
90 /** 70 /**
91 * Gets the archiving settings 71 * Gets the archiving settings
@@ -113,8 +93,8 @@ class DocumentArchiving { @@ -113,8 +93,8 @@ class DocumentArchiving {
113 //if the id >= 0, then the object has already been created 93 //if the id >= 0, then the object has already been created
114 if ($this->iId < 0) { 94 if ($this->iId < 0) {
115 $sql = $default->db; 95 $sql = $default->db;
116 - $result = $sql->query("INSERT INTO $default->owl_document_archiving_table (document_id, archiving_type_id, archiving_settings_id) " .  
117 - "VALUES ($this->iDocumentID, $this->iArchivingTypeID, $this->iArchivingSettingsID)"); 96 + $result = $sql->query("INSERT INTO $default->owl_document_archiving_table (document_id, archiving_settings_id) " .
  97 + "VALUES ($this->iDocumentID, $this->iArchivingSettingsID)");
118 if ($result) { 98 if ($result) {
119 //set the current primary key 99 //set the current primary key
120 $this->iId = $sql->insert_id(); 100 $this->iId = $sql->insert_id();
@@ -136,7 +116,6 @@ class DocumentArchiving { @@ -136,7 +116,6 @@ class DocumentArchiving {
136 $sql = $default->db; 116 $sql = $default->db;
137 $sQuery = "UPDATE $default->owl_document_archiving_table SET " . 117 $sQuery = "UPDATE $default->owl_document_archiving_table SET " .
138 "document_id = $this->iDocumentID, " . 118 "document_id = $this->iDocumentID, " .
139 - "archiving_type_id = $this->iArchivingTypeID, " .  
140 "archiving_settings_id = $this->iArchivingSettingsID " . 119 "archiving_settings_id = $this->iArchivingSettingsID " .
141 "WHERE id = $this->iId"; 120 "WHERE id = $this->iId";
142 $result = $sql->query($sQuery); 121 $result = $sql->query($sQuery);
@@ -180,7 +159,7 @@ class DocumentArchiving { @@ -180,7 +159,7 @@ class DocumentArchiving {
180 $sql = $default->db; 159 $sql = $default->db;
181 $sql->query("SELECT * FROM $default->owl_document_archiving_table WHERE document_id = $iDocumentID"); 160 $sql->query("SELECT * FROM $default->owl_document_archiving_table WHERE document_id = $iDocumentID");
182 if ($sql->next_record()) { 161 if ($sql->next_record()) {
183 - $oDocumentArchiving = & new DocumentArchiving($sql->f("document_id"), $sql->f("archiving_type_id"), $sql->f("archiving_settings_id")); 162 + $oDocumentArchiving = & new DocumentArchiving($sql->f("document_id"), $sql->f("archiving_settings_id"));
184 $oDocumentArchiving->iId = $sql->f("id"); 163 $oDocumentArchiving->iId = $sql->f("id");
185 return $oDocumentArchiving; 164 return $oDocumentArchiving;
186 } 165 }
@@ -199,7 +178,7 @@ class DocumentArchiving { @@ -199,7 +178,7 @@ class DocumentArchiving {
199 $sql = $default->db; 178 $sql = $default->db;
200 $sql->query("SELECT * FROM $default->owl_document_archiving_table WHERE id = $iDocumentArchivingID"); 179 $sql->query("SELECT * FROM $default->owl_document_archiving_table WHERE id = $iDocumentArchivingID");
201 if ($sql->next_record()) { 180 if ($sql->next_record()) {
202 - $oDocumentArchiving = & new DocumentArchiving($sql->f("document_id"), $sql->f("archiving_type_id"), $sql->f("archiving_settings_id")); 181 + $oDocumentArchiving = & new DocumentArchiving($sql->f("document_id"), $sql->f("archiving_settings_id"));
203 $oDocumentArchiving->iId = $iDocumentArchivingID; 182 $oDocumentArchiving->iId = $iDocumentArchivingID;
204 return $oDocumentArchiving; 183 return $oDocumentArchiving;
205 } 184 }