From 15aac509d24d371841aa66dac99c442778c831ee Mon Sep 17 00:00:00 2001 From: aspangaro Date: Mon, 23 Feb 2015 22:36:26 +0100 Subject: [PATCH] NEW: Add button to purge search criteria into list --- htdocs/expensereport/list.php | 39 +++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index d71a9410c9f..e24674b6760 100755 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -37,8 +37,24 @@ $socid = $_GET["socid"]?$_GET["socid"]:''; if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'expensereport','',''); -$search_ref=GETPOST('search_ref'); +$search_ref = GETPOST('search_ref'); +$search_user = GETPOST('search_user','int'); +$search_state = GETPOST('search_state','int'); +$month_start = GETPOST("month_start","int"); +$year_start = GETPOST("year_start","int"); +$month_end = GETPOST("month_end","int"); +$year_end = GETPOST("year_end","int"); +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test must be present to be compatible with all browsers +{ + $search_ref=""; + $search_user=""; + $search_state=""; + $month_start=""; + $year_start=""; + $month_end=""; + $year_end=""; +} /* * View @@ -53,15 +69,6 @@ llxHeader('', $langs->trans("ListOfExpenseReports")); $max_year = 5; $min_year = 5; -$month_start = $_GET['month_start']; -$year_start = $_GET['year_start']; -$month_end = $_GET['month_end']; -$year_end = $_GET['year_end']; - -$search_ref = GETPOST('search_ref'); -$search_user = GETPOST('search_user','int'); -$search_state = GETPOST('search_state','int'); - $sortorder = $_GET["sortorder"]; $sortfield = $_GET["sortfield"]; $page = $_GET["page"]; @@ -183,10 +190,10 @@ if ($resql) print_liste_field_titre($langs->trans("TotalVAT"),$_SERVER["PHP_SELF"],"d.total_tva","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("TotalTTC"),$_SERVER["PHP_SELF"],"d.total_ttc","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Statut"),$_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre(); + print ' '; print "\n"; - // FILTRES + // Filters print ''; print ''; print ''; @@ -224,9 +231,11 @@ if ($resql) print ''; select_expensereport_statut($search_state,'search_state'); print ''; - print ''; - print ' '; - print ""; + + print ''; + print ''; + print ''; + print ''; print "\n";