+
+function check_is_editable($trans_type, $trans_no, $msg=null)
+{
+ if (!$_SESSION['wa_current_user']->can_access('SA_EDITOTHERSTRANS'))
+ {
+ $audit = get_audit_trail_last($trans_type, $trans_no);
+
+ if ($_SESSION['wa_current_user']->user != $audit['user'])
+ {
+ if (!$msg)
+ $msg = '<b>'._("You have no edit access to transactions created by other users.").'</b>';
+ display_note($msg);
+ display_footer_exit();
+ }
+ }
+ if (!in_array($trans_type, array(ST_SALESORDER, ST_SALESQUOTE, ST_PURCHORDER, ST_WORKORDER)))
+ check_is_closed($trans_type, $trans_no, $msg);
+}
+