Rollback of Session Abondoned Error and new variable, $no_check_edit_conflicts in...
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 15 Nov 2012 15:38:47 +0000 (16:38 +0100)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 15 Nov 2012 15:38:47 +0000 (16:38 +0100)
config.default.php
includes/session.inc
sales/includes/sales_ui.inc

index 4948695794a091d13162e520a195052cb52740bf..21c0cb990143901e9b6425b51b1fa3d11bad85fe 100644 (file)
@@ -68,6 +68,9 @@ if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_
        $power_by               = "FrontAccounting";
        $power_url              = "http://frontaccounting.com";
 
+       /* No check on edit conflicts. Maybe needed to be set to 1 in certains Windows Servers */
+       $no_check_edit_conflicts = 0;
+       
        /* Do not print zero lines amount of 0.00 in Sales Documents if service item. 1 = do not */
        $no_zero_lines_amount = 1;
 
index ed5f5c0312e1da7773c34f1676a4407c233898bd..9eb70019807a98852d6cb28a5aa76cc687d331fc 100644 (file)
@@ -76,8 +76,7 @@ class SessionManager
                $_SESSION['EXPIRES'] = time() + 10;
 
                // Create new session without destroying the old one
-               session_regenerate_id(version_compare(PHP_VERSION, '5.1.0') >= 0 && (substr(strtoupper(PHP_OS),0,3) == "WIN"));
+               session_regenerate_id();
                // Grab current session ID and close both sessions to allow other scripts to use them
                $newSession = session_id();
                session_write_close();
index 49232d81a8a3ca926f89ad1b3dcf1b2920a74a7a..8c56d4d3fea02ffa1fba2fcd29d07608f8afc9f0 100644 (file)
@@ -44,9 +44,9 @@ function processing_active()
 */
 function check_edit_conflicts($cartname='Items')
 {
-       global $Ajax;
+       global $Ajax, $no_check_edit_conflicts;
 
-       if (get_post('cart_id') && $_POST['cart_id'] != $_SESSION[$cartname]->cart_id) {
+       if ((!isset($no_check_edit_conflicts) || $no_check_edit_conflicts==0) && get_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();