From 56b27a3a11d9c51db36da8e6b20065aaed39d902 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jan 2018 19:03:01 +0100 Subject: [PATCH] Fix: do no lose filter when deleting a bookeeping transaction --- htdocs/accountancy/bookkeeping/list.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 9b294e76d38..fd319932ca0 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -99,8 +99,7 @@ $formaccounting = new FormAccounting($db); $formother = new FormOther($db); $form = new Form($db); - -if ($action != 'export_file' && ! isset($_POST['begin']) && ! isset($_GET['begin']) && ! isset($_POST['formfilteraction']) && empty($page)) +if (! in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && ! isset($_POST['begin']) && ! isset($_GET['begin']) && ! isset($_POST['formfilteraction']) && empty($page) && ! GETPOST('noreset','int')) { $month_start= ($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1); $year_start = dol_print_date(dol_now(), '%Y'); @@ -115,6 +114,7 @@ if ($action != 'export_file' && ! isset($_POST['begin']) && ! isset($_GET['begin $search_date_end = dol_get_last_day($year_end, $month_end); } + $arrayfields=array( 't.piece_num'=>array('label'=>$langs->trans("TransactionNumShort"), 'checked'=>1), 't.doc_date'=>array('label'=>$langs->trans("Docdate"), 'checked'=>1), @@ -316,7 +316,8 @@ if ($action == 'delmouvconfirm') { { setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); } - Header("Location: list.php"); + + Header("Location: list.php?noreset=1".($param?'&'.$param:'')); exit; } } @@ -368,7 +369,7 @@ if ($result < 0) { $num=count($object->lines); if ($action == 'delmouv') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?mvt_num=' . GETPOST('mvt_num'), $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvtPartial'), 'delmouvconfirm', '', 0, 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?mvt_num='.GETPOST('mvt_num').$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvtPartial'), 'delmouvconfirm', '', 0, 1); print $formconfirm; } if ($action == 'delbookkeepingyear') { @@ -448,11 +449,11 @@ if (! empty($arrayfields['t.doc_date']['checked'])) print ''; print '
'; print $langs->trans('From') . ' '; - print $form->select_date($search_date_start, 'date_start', 0, 0, 1); + print $form->select_date($search_date_start?$search_date_start:-1, 'date_start', 0, 0, 1); print '
'; print '
'; print $langs->trans('to') . ' '; - print $form->select_date($search_date_end, 'date_end', 0, 0, 1); + print $form->select_date($search_date_end?$search_date_end:-1, 'date_end', 0, 0, 1); print '
'; print ''; }