Commit d81048fe2ed10a4af45b019ec7cb2a12b6511b87
1 parent
7597ace8
Initial revision. Contains miscellaneous helper functions for working with documents
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@182 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
33 additions
and
0 deletions
lib/documentmanagement/documentLib.php
0 → 100644
| 1 | +<?php | |
| 2 | + | |
| 3 | +/** | |
| 4 | +* Class DocumentLib | |
| 5 | +* | |
| 6 | +* Contains miscellaneous static helper functions concerned with | |
| 7 | +* document management | |
| 8 | +*/ | |
| 9 | + | |
| 10 | +class DocumentLib { | |
| 11 | + | |
| 12 | + /** | |
| 13 | + * Gets the folder id for a document | |
| 14 | + * | |
| 15 | + * @param $iDocumentID Document primary key | |
| 16 | + * | |
| 17 | + * @return int (folder id) on success, false otherwise and set $_SESSION["errorMessage"] | |
| 18 | + */ | |
| 19 | + function getDocumentFolderID($iDocumentID) { | |
| 20 | + global $lang_err_doc_no_folder; | |
| 21 | + $sql = new Owl_DB(); | |
| 22 | + $sql->query("SELECT folder_id from " . $default->owl_documents_table . " WHERE id = " . $iDocumentID); | |
| 23 | + if (sql->next_record()) { | |
| 24 | + return sql->f("folder_id"); | |
| 25 | + } | |
| 26 | + $_SESSION["errorMessage"] = $lang_err_doc_no_folder | |
| 27 | + return false; | |
| 28 | + } | |
| 29 | + | |
| 30 | + | |
| 31 | +} | |
| 32 | + | |
| 33 | +?> | ... | ... |