From 9f097b1a0894904ae84f0ee14b4a40d2ed94c120 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Feb 2020 15:41:46 +0100 Subject: [PATCH] FIX #13146 #13198 --- htdocs/accountancy/admin/account.php | 29 ++++++++++------------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index d75d61e347f..47786e62eb2 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -46,6 +46,8 @@ $search_accountparent = GETPOST('search_accountparent', 'alpha'); $search_pcgtype = GETPOST('search_pcgtype', 'alpha'); $search_pcgsubtype = GETPOST('search_pcgsubtype', 'alpha'); +$chartofaccounts = GETPOST('chartofaccounts', 'int'); + // Security check if ($user->socid > 0) accessforbidden(); if (! $user->rights->accounting->chartofaccount) accessforbidden(); @@ -101,11 +103,9 @@ if (empty($reshook)) $search_pcgsubtype = ""; $search_array_options = array(); } - - if (GETPOST('change_chart', 'alpha') && (GETPOST('valid_change_chart', 'int') || empty($conf->use_javascript_ajax))) + if ((GETPOST('valid_change_chart', 'alpha') && GETPOST('chartofaccounts', 'int') > 0) // explicit click on button 'Change and load' with js on + || (GETPOST('chartofaccounts', 'int') > 0 && GETPOST('chartofaccounts', 'int') != $conf->global->CHARTOFACCOUNTS)) // a submit of form is done and chartofaccounts combo has been modified { - $chartofaccounts = GETPOST('chartofaccounts', 'int'); - if ($chartofaccounts > 0) { // Get language code for this $chartofaccounts @@ -274,21 +274,13 @@ if ($resql) if (!empty($conf->use_javascript_ajax)) { - print ' + print ' '; @@ -335,8 +327,7 @@ if ($resql) else dol_print_error($db); print ""; print ajax_combobox("chartofaccounts"); - print ''; - print ''; + print ''; print '
'; print '
';