Cleanup in types.inc
[fa-stable.git] / includes / db / audit_trail_db.inc
index 6aa91d9833689c0fdfd4db3a70f2f653f747ab08..e297d2ba1f54d7983e27b9446c7a708dfbc8e0fe 100644 (file)
 
 function add_audit_trail($trans_type, $trans_no, $trans_date, $descr='')
 {
-       begin_transaction();
+       $descr = substr($descr, 0, 60);
+       begin_transaction(__FUNCTION__, func_get_args());
 
        $date = date2sql($trans_date);
        $sql = "INSERT INTO ".TB_PREF."audit_trail"
-               . " (type, trans_no, user, gl_date, description)
+               . " (type, trans_no, user, gl_date, description, stamp)
                        VALUES(".db_escape($trans_type).", ".db_escape($trans_no).","
                        . $_SESSION["wa_current_user"]->user . ","
-                       . "'$date',". db_escape($descr). ")";
+                       . "'$date',". db_escape($descr). ", CURRENT_TIMESTAMP)";
 
        db_query($sql, "Cannot add audit info");
        // all audit records beside just inserted one should have gl_seq set to NULL
@@ -62,7 +63,7 @@ function get_audit_trail_last($trans_type, $trans_no)
 */
 function close_transactions($todate) {
 
-       begin_transaction();
+       begin_transaction(__FUNCTION__, func_get_args());
 
        $errors = 0;
        // select only those audit trail records which produce any GL postings