diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php
index b1afdd1279d..013d853d73b 100644
--- a/htdocs/blockedlog/admin/blockedlog_list.php
+++ b/htdocs/blockedlog/admin/blockedlog_list.php
@@ -34,6 +34,12 @@ $langs->load("blockedlog");
if (! $user->admin) accessforbidden();
$action = GETPOST('action','alpha');
+$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'myobjectlist'; // To manage different context of search
+$backtopage = GETPOST('backtopage','alpha'); // Go back to a dedicated page
+$optioncss = GETPOST('optioncss','aZ'); // Option for the css output (always '' except when 'print')
+
+$search=array();
+
$showonlyerrors = GETPOST('showonlyerrors','int');
// Load variable for pagination
@@ -46,15 +52,16 @@ $offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
+if (empty($sortfield)) $sortfield='rowid';
+if (empty($sortorder)) $sortorder='DESC';
+
$search_start = -1;
if(GETPOST('search_startyear')!='') $search_start = dol_mktime(0, 0, 0, GETPOST('search_startmonth'), GETPOST('search_startday'), GETPOST('search_startyear'));
$search_end = -1;
-if(GETPOST('search_endyear')!='') $search_end= dol_mktime(0, 0, 0, GETPOST('search_endmonth'), GETPOST('search_endday'), GETPOST('search_endyear'));
+if(GETPOST('search_endyear')!='') $search_end= dol_mktime(23, 59, 59, GETPOST('search_endmonth'), GETPOST('search_endday'), GETPOST('search_endyear'));
-if (empty($sortfield)) $sortfield='rowid';
-if (empty($sortorder)) $sortorder='DESC';
$block_static = new BlockedLog($db);
@@ -63,7 +70,16 @@ $block_static = new BlockedLog($db);
* Actions
*/
-if($action === 'downloadblockchain') {
+// Purge search criteria
+if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
+{
+ $search_start = -1;
+ $search_end = -1;
+ $toselect='';
+ $search_array_options=array();
+}
+
+if ($action === 'downloadblockchain') {
$auth = new BlockedLogAuthority($db);
@@ -135,10 +151,10 @@ else if($action === 'downloadcsv') {
* View
*/
-$blocks = $block_static->getLog('all', 0, GETPOST('all','alpha') ? 0 : 50, $sortfield, $sortorder, $search_start, $search_end);
-
$form=new Form($db);
+$blocks = $block_static->getLog('all', 0, GETPOST('all','alpha') ? 0 : 50, $sortfield, $sortorder, $search_start, $search_end);
+
llxHeader('',$langs->trans("BlockedLogSetup"));
$linkback=''.$langs->trans("BackToModuleList").'';
@@ -152,6 +168,20 @@ print $langs->trans("FingerprintsDesc")."
\n";
print '
';
+$param='';
+if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
+if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
+if ($search_start > 0) $param.='&search_startyear='.urlencode(GETPOST('search_startyear','int')).'&search_startmonth='.urlencode(GETPOST('search_startmonth','int')).'&search_startday='.urlencode(GETPOST('search_startday','int'));
+if ($search_end > 0) $param.='&search_endyear='.urlencode(GETPOST('search_endyear','int')).'&search_endmonth='.urlencode(GETPOST('search_endmonth','int')).'&search_endday='.urlencode(GETPOST('search_endday','int'));
+foreach($search as $key => $val)
+{
+ $param.= '&search_'.$key.'='.urlencode($search[$key]);
+}
+if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
+// Add $param from extra fields
+//include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
+
+
print '