X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fincludes%2Fsales_ui.inc;h=8e2048cf21eb69d608da3b6c73d7b05c360c3b70;hb=2f85dd59adb080270e39d0e52edc8af9a60175b1;hp=a8abacab896ac79f81c51e770ccfeebcf4578bd3;hpb=da8311619dd73feae101d246a1957b972e00cbd2;p=fa-stable.git diff --git a/sales/includes/sales_ui.inc b/sales/includes/sales_ui.inc index a8abacab..8e2048cf 100644 --- a/sales/includes/sales_ui.inc +++ b/sales/includes/sales_ui.inc @@ -1,8 +1,56 @@ . +***********************************************************************/ include_once($path_to_root . "/includes/date_functions.inc"); include_once($path_to_root . "/includes/ui.inc"); include_once($path_to_root . "/includes/banking.inc"); +//---------------------------------------------------------------------------- +// helper functions for script execution control +// +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); + unset($_SESSION['Items']); + } +} + +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($cartname='Items') +{ + global $Ajax; + + if (isset($_POST['cart_id']) && $_POST['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