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 22 * The document ID
23 23 */
24 24 var $iDocumentID;
25   - /**
26   - * The archiving method- date or utilisation
27   - */
28   - var $iArchivingTypeID;
  25 +
29 26 /**
30 27 * The archiving settings
31 28 */
... ... @@ -38,13 +35,12 @@ class DocumentArchiving {
38 35 * @param integer the archiving type id
39 36 * @param integer the archiving settings id
40 37 */
41   - function DocumentArchiving($iNewDocumentID, $iNewArchivingTypeID, $iNewArchivingSettingsID) {
  38 + function DocumentArchiving($iNewDocumentID, $iNewArchivingSettingsID) {
42 39 global $default;
43 40  
44 41 // primary key not set as this is not stored yet
45 42 $this->iId = -1;
46 43 $this->iDocumentID = $iNewDocumentID;
47   - $this->iArchivingTypeID = $iNewArchivingTypeID;
48 44 $this->iArchivingSettingsID = $iNewArchivingSettingsID;
49 45 }
50 46  
... ... @@ -70,22 +66,6 @@ class DocumentArchiving {
70 66 function setDocumentID($iNewDocumentID){
71 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 71 * Gets the archiving settings
... ... @@ -113,8 +93,8 @@ class DocumentArchiving {
113 93 //if the id >= 0, then the object has already been created
114 94 if ($this->iId < 0) {
115 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 98 if ($result) {
119 99 //set the current primary key
120 100 $this->iId = $sql->insert_id();
... ... @@ -136,7 +116,6 @@ class DocumentArchiving {
136 116 $sql = $default->db;
137 117 $sQuery = "UPDATE $default->owl_document_archiving_table SET " .
138 118 "document_id = $this->iDocumentID, " .
139   - "archiving_type_id = $this->iArchivingTypeID, " .
140 119 "archiving_settings_id = $this->iArchivingSettingsID " .
141 120 "WHERE id = $this->iId";
142 121 $result = $sql->query($sQuery);
... ... @@ -180,7 +159,7 @@ class DocumentArchiving {
180 159 $sql = $default->db;
181 160 $sql->query("SELECT * FROM $default->owl_document_archiving_table WHERE document_id = $iDocumentID");
182 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 163 $oDocumentArchiving->iId = $sql->f("id");
185 164 return $oDocumentArchiving;
186 165 }
... ... @@ -199,7 +178,7 @@ class DocumentArchiving {
199 178 $sql = $default->db;
200 179 $sql->query("SELECT * FROM $default->owl_document_archiving_table WHERE id = $iDocumentArchivingID");
201 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 182 $oDocumentArchiving->iId = $iDocumentArchivingID;
204 183 return $oDocumentArchiving;
205 184 }
... ...