Commit 8518749f113e9cf6c788071043d342a5aa32af0a
1 parent
dc8c7523
Added function to return lookup count
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2146 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
16 additions
and
0 deletions
lib/documentmanagement/DocumentField.inc
| ... | ... | @@ -324,6 +324,22 @@ class DocumentField { |
| 324 | 324 | $_SESSION["errorMessage"] = $lang_err_database; |
| 325 | 325 | return false; |
| 326 | 326 | } |
| 327 | + | |
| 328 | + function getLookupCount($iDocumentFieldID){ | |
| 329 | + global $default, $lang_err_database; | |
| 330 | + | |
| 331 | + $sql = $default->db; | |
| 332 | + $result = $sql->query("SELECT * FROM " . $default->owl_metadata_table . " WHERE document_field_id = " . $iDocumentFieldID); | |
| 333 | + if ($result) { | |
| 334 | + $iCount = 0; | |
| 335 | + while ($sql->next_record()) { | |
| 336 | + $iCount++; | |
| 337 | + } | |
| 338 | + return $iCount; | |
| 339 | + } | |
| 340 | + $_SESSION["errorMessage"] = $lang_err_database; | |
| 341 | + return false; | |
| 342 | + } | |
| 327 | 343 | } |
| 328 | 344 | |
| 329 | 345 | /** | ... | ... |