X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fincludes%2Fsales_ui.inc;h=5da08723429a547eaa8d3527459f545e20ab0974;hb=refs%2Fheads%2Fmaster;hp=64045bb155e78faddc5b1d1c2604bc30a5549cf7;hpb=c09be0dad6b05131e240349a375af7a4b7bf3444;p=fa-stable.git diff --git a/sales/includes/sales_ui.inc b/sales/includes/sales_ui.inc index 64045bb1..5da08723 100644 --- a/sales/includes/sales_ui.inc +++ b/sales/includes/sales_ui.inc @@ -1,5 +1,14 @@ . +***********************************************************************/ include_once($path_to_root . "/includes/date_functions.inc"); include_once($path_to_root . "/includes/ui.inc"); @@ -10,12 +19,14 @@ include_once($path_to_root . "/includes/banking.inc"); // function processing_start() { + page_processing(false); processing_end(); $_SESSION['Processing'] = $_SERVER['PHP_SELF']; } function processing_end() { + page_processing(true); unset($_SESSION['Processing']); if ( isset($_SESSION['Items']) ) { unset($_SESSION['Items']->line_items); @@ -27,5 +38,18 @@ function processing_active() { return (isset($_SESSION['Processing']) && $_SESSION['Processing']==$_SERVER['PHP_SELF']); } +/* + Check if the cart was not destroyed during opening the edition page in + another browser tab. +*/ +function check_edit_conflicts($cart_id, $cartname='Items') +{ + global $Ajax, $SysPrefs; + + if ((!isset($SysPrefs->no_check_edit_conflicts) || $SysPrefs->no_check_edit_conflicts==0) && $cart_id && isset($_SESSION[$cartname]) && $cart_id != $_SESSION[$cartname]->cart_id) { + display_error(_('This edit session has been abandoned by opening sales document in another browser tab. You cannot edit more than one sales document at once.')); + $Ajax->activate('_page_body'); + display_footer_exit(); + } +} -?> \ No newline at end of file