Commit 22a53250e49b06352a4b4a61a5becf4e5447ee0a
1 parent
7f9a96be
Altered error messages so that they are now stored in a session variable
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@152 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
14 additions
and
14 deletions
lib/documentmanagement/documentManager.inc
| ... | ... | @@ -35,12 +35,12 @@ class DocumentManager { |
| 35 | 35 | $sql = new Owl_DB(); |
| 36 | 36 | $result = $sql->query("INSERT INTO " . $default->owl_document_types_table . " (name) values ('" . $sName . "')"); |
| 37 | 37 | if (!$result) { |
| 38 | - $default->errorMessage = "Database Error. Failed to insert document type " . $sName; | |
| 38 | + $_SESSION["errorMessage"] = "Database Error. Failed to insert document type " . $sName; | |
| 39 | 39 | return false; |
| 40 | 40 | } |
| 41 | 41 | return true; |
| 42 | 42 | } |
| 43 | - $default->errorMessage = "A document type with this name already exists"; | |
| 43 | + $_SESSION["errorMessage"] = "A document type with this name already exists"; | |
| 44 | 44 | return false; |
| 45 | 45 | } |
| 46 | 46 | |
| ... | ... | @@ -61,12 +61,12 @@ class DocumentManager { |
| 61 | 61 | $sql = new Owl_DB(); |
| 62 | 62 | $result = $sql->query("DELETE FROM " . $default->owl_document_types_table . " WHERE name = '" . $sName . "'"); |
| 63 | 63 | if (!$result) { |
| 64 | - $default->errorMessage = "Database Error. Failed to delete document type " . $sName; | |
| 64 | + $_SESSION["errorMessage"] = "Database Error. Failed to delete document type " . $sName; | |
| 65 | 65 | return false; |
| 66 | 66 | } |
| 67 | 67 | return true; |
| 68 | 68 | } |
| 69 | - $default->errorMessage = "There is no document type with this name"; | |
| 69 | + $_SESSION["errorMessage"] = "There is no document type with this name"; | |
| 70 | 70 | return false; |
| 71 | 71 | } |
| 72 | 72 | |
| ... | ... | @@ -101,7 +101,7 @@ class DocumentManager { |
| 101 | 101 | $sql->next_record(); |
| 102 | 102 | return $sql->f("ID"); |
| 103 | 103 | } |
| 104 | - $default->errorMessage = $lang_err_document_type_does_not_exist . $sName; | |
| 104 | + $_SESSION["errorMessage"] = $lang_err_document_type_does_not_exist . $sName; | |
| 105 | 105 | return false; |
| 106 | 106 | } |
| 107 | 107 | |
| ... | ... | @@ -140,12 +140,12 @@ class DocumentManager { |
| 140 | 140 | $sql = new Owl_DB(); |
| 141 | 141 | $result = $sql->query("INSERT INTO " . $default->owl_document_type_fields_table . " (document_type_id, field_id, is_mandatory) VALUES (" . $iDocumentTypeID . ", " . $iDocumentTypeFieldID . ", " . $bIsMandatory . ")"); |
| 142 | 142 | if (!$result) { |
| 143 | - $default->errorMessage = "Database Error. Failed to insert document field type with ID " . $iDocumentTypeFieldID; | |
| 143 | + $_SESSION["errorMessage"] = "Database Error. Failed to insert document field type with ID " . $iDocumentTypeFieldID; | |
| 144 | 144 | return false; |
| 145 | 145 | } |
| 146 | 146 | return true; |
| 147 | 147 | } |
| 148 | - $default->errorMessage = "This field type is already linked to this document type"; | |
| 148 | + $_SESSION["errorMessage"] = "This field type is already linked to this document type"; | |
| 149 | 149 | return false; |
| 150 | 150 | } |
| 151 | 151 | |
| ... | ... | @@ -163,12 +163,12 @@ class DocumentManager { |
| 163 | 163 | $sql = new Owl_DB(); |
| 164 | 164 | $result = $sql->query("DELETE FROM " . $default->owl_document_type_fields_table . " where document_type_id = " . $iDocumentTypeID . " AND field_id = " . $iDocumentTypeFieldID); |
| 165 | 165 | if (!result) { |
| 166 | - $default->errorMessage = "Database Error. Failed to deleted document type field with document_type_id " . $iDocumentTypeID . " and field_id " . $iDocumentTypeFieldID; | |
| 166 | + $_SESSION["errorMessage"] = "Database Error. Failed to deleted document type field with document_type_id " . $iDocumentTypeID . " and field_id " . $iDocumentTypeFieldID; | |
| 167 | 167 | return false; |
| 168 | 168 | } |
| 169 | 169 | return true; |
| 170 | 170 | } |
| 171 | - $default->errorMessage = "A dcoument field type with document_type_id " . $iDocumentTypeID . " and a document_id " . $iDocumentTypeID . " does not exist"; | |
| 171 | + $_SESSION["errorMessage"] = "A dcoument field type with document_type_id " . $iDocumentTypeID . " and a document_id " . $iDocumentTypeID . " does not exist"; | |
| 172 | 172 | return false; |
| 173 | 173 | } |
| 174 | 174 | |
| ... | ... | @@ -207,12 +207,12 @@ class DocumentManager { |
| 207 | 207 | $sql = new Owl_DB(); |
| 208 | 208 | $result = $sql->query("INSERT INTO " . $default->owl_fields_table . " (name, data_type) VALUES ('" . $sName . "', '" . $sDataType . "')"); |
| 209 | 209 | if (!$result) { |
| 210 | - $default->errorMessage = "Database Error. Could not insert document field " . $sName . " with data type " . $sDataType . " into table " . $default->owl_fields_table; | |
| 210 | + $_SESSION["errorMessage"] = "Database Error. Could not insert document field " . $sName . " with data type " . $sDataType . " into table " . $default->owl_fields_table; | |
| 211 | 211 | return false; |
| 212 | 212 | } |
| 213 | 213 | return true; |
| 214 | 214 | } |
| 215 | - $default->errorMessage = "A document type field with this name already exists"; | |
| 215 | + $_SESSION["errorMessage"] = "A document type field with this name already exists"; | |
| 216 | 216 | return false; |
| 217 | 217 | } |
| 218 | 218 | |
| ... | ... | @@ -232,12 +232,12 @@ class DocumentManager { |
| 232 | 232 | $sql = new Owl_DB(); |
| 233 | 233 | $result = $sql->query("DELETE FROM " . $default->owl_fields_table . " WHERE Name = '" . $sName . "'"); |
| 234 | 234 | if (!$result) { |
| 235 | - $default->errorMessage = "Database Error. Could not delete document type field " . $sName . " from table " . $default->owl_field_table; | |
| 235 | + $_SESSION["errorMessage"] = "Database Error. Could not delete document type field " . $sName . " from table " . $default->owl_field_table; | |
| 236 | 236 | return false; |
| 237 | 237 | } |
| 238 | 238 | return true; |
| 239 | 239 | } |
| 240 | - $default->errorMessage = "A document type field with the name " . $sName . " does not exist"; | |
| 240 | + $_SESSION["errorMessage"] = "A document type field with the name " . $sName . " does not exist"; | |
| 241 | 241 | return false; |
| 242 | 242 | } |
| 243 | 243 | |
| ... | ... | @@ -257,7 +257,7 @@ class DocumentManager { |
| 257 | 257 | $sql->next_record(); |
| 258 | 258 | return $sql->f("id"); |
| 259 | 259 | } |
| 260 | - $default->errorMessage = $lang_err_document_type_field_does_not_exist . $sName; | |
| 260 | + $_SESSION["errorMessage"] = $lang_err_document_type_field_does_not_exist . $sName; | |
| 261 | 261 | return false; |
| 262 | 262 | } |
| 263 | 263 | ... | ... |