Commit f0f5691eeb77328bc03af522c8afabf6011ca29b
1 parent
8b26d869
modified view history..to return an array
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@164 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
17 additions
and
3 deletions
lib/documentmanagement/documentManager.inc
| @@ -294,15 +294,29 @@ function viewDocumentHistory($DocumentID) | @@ -294,15 +294,29 @@ function viewDocumentHistory($DocumentID) | ||
| 294 | 294 | ||
| 295 | global $default; | 295 | global $default; |
| 296 | $db = new Owl_DB(); | 296 | $db = new Owl_DB(); |
| 297 | + $history = array(); | ||
| 297 | 298 | ||
| 298 | $Sql = "SELECT * FROM " . $default->owl_document_transactions_table . " WHERE document_id = $DocumentID"; | 299 | $Sql = "SELECT * FROM " . $default->owl_document_transactions_table . " WHERE document_id = $DocumentID"; |
| 299 | 300 | ||
| 300 | $result = $db->query($Sql); | 301 | $result = $db->query($Sql); |
| 301 | - $rows = $db->num_rows($result); | ||
| 302 | - | 302 | + //$rows = $db->num_rows($result); |
| 303 | + | ||
| 304 | + while($db->next_record()) | ||
| 305 | + { | ||
| 306 | + $history[0] = array("id" => $db->f("id"), | ||
| 307 | + "document_id" => $db->f("document_id"), | ||
| 308 | + "version" => $db->f("version"), | ||
| 309 | + "user_id" => $db->f("user_id"), | ||
| 310 | + "datetime" => $db->f("datetime"), | ||
| 311 | + "ip" => $db->f("ip"), | ||
| 312 | + "filename" => $db->f("filename"), | ||
| 313 | + "comment" => $db->f("comment"), | ||
| 314 | + "transaction_id" => $db->f("transaction_id")); | ||
| 315 | + } | ||
| 316 | + | ||
| 303 | 317 | ||
| 304 | // return the result set.. | 318 | // return the result set.. |
| 305 | - return $result; | 319 | + return $history; |
| 306 | 320 | ||
| 307 | } | 321 | } |
| 308 | 322 |