Commit b5d9ff6ab1839e57e9597511db2c3f13df581a4c
1 parent
cb6d43f8
added datatype linkage
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1440 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
24 additions
and
0 deletions
lib/documentmanagement/DocumentField.inc
| ... | ... | @@ -300,6 +300,30 @@ class DocumentField { |
| 300 | 300 | $_SESSION["errorMessage"] = $lang_err_database; |
| 301 | 301 | return false; |
| 302 | 302 | } |
| 303 | + | |
| 304 | + /* Static function. Given a documenttype...will find all fields belongin to it | |
| 305 | + * | |
| 306 | + * @return DocumentFieldLink populated DocumentFieldLink object on success, false otherwise and set $_SESSION["errorMessage"] | |
| 307 | + */ | |
| 308 | + function getAllDataTypes() { | |
| 309 | + global $default, $lang_err_database; | |
| 310 | + $aDataTypes; | |
| 311 | + settype($aDataTypes, "array"); | |
| 312 | + $sql = $default->db; | |
| 313 | + $result = $sql->query("SELECT id, name FROM " . $default->owl_data_types_table ); | |
| 314 | + if ($result) { | |
| 315 | + $iCount = 0; | |
| 316 | + while ($sql->next_record()) { | |
| 317 | + | |
| 318 | + $aDataTypes[$iCount]["id"] = $sql->f("id"); | |
| 319 | + $aDataTypes[$iCount]["name"] = $sql->f("name"); | |
| 320 | + $iCount++; | |
| 321 | + } | |
| 322 | + return $aDataTypes; | |
| 323 | + } | |
| 324 | + $_SESSION["errorMessage"] = $lang_err_database; | |
| 325 | + return false; | |
| 326 | + } | |
| 303 | 327 | } |
| 304 | 328 | |
| 305 | 329 | /** | ... | ... |