56e4746e60f56caae919492fec9418a4f0000de2
[fa-stable.git] / sales / includes / sales_ui.inc
1 <?php
2
3 include_once($path_to_root . "/includes/date_functions.inc");
4
5 include_once($path_to_root . "/includes/ui.inc");
6 include_once($path_to_root . "/includes/banking.inc");
7
8 //----------------------------------------------------------------------------
9 // helper functions for script execution control
10 //
11 function processing_start()
12 {
13     processing_end();
14     $_SESSION['Processing'] = $_SERVER['PHP_SELF'];
15 }
16
17 function processing_end()
18 {
19     unset($_SESSION['Processing']);
20     if ( isset($_SESSION['Items']) ) {
21                 unset($_SESSION['Items']->line_items);
22                 unset($_SESSION['Items']);
23     }
24 }
25
26 function processing_active()
27 {
28     return (isset($_SESSION['Processing']) && $_SESSION['Processing']==$_SERVER['PHP_SELF']);
29 }
30 /*
31         Check if the cart was not destroyed during opening the edition page in
32         another browser tab.
33 */
34 function check_edit_conflicts($cartname='Items')
35 {
36         global $Ajax;
37         
38         if (isset($_POST['cart_id']) && $_POST['cart_id'] != $_SESSION[$cartname]->cart_id) {
39                 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.'));
40                 $Ajax->activate('_page_body');
41                 display_footer_exit();
42         }
43 }
44
45 ?>