diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 013d853d73b2e..4f7d6b44ea241 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -38,10 +38,16 @@ $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'); +$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(23, 59, 59, GETPOST('search_endmonth'), GETPOST('search_endday'), GETPOST('search_endyear')); +$search_ref = GETPOST('search_ref', 'alpha'); +$search_amount = GETPOST('search_amount', 'alpha'); + + // Load variable for pagination $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST('sortfield','alpha'); @@ -55,11 +61,6 @@ 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(23, 59, 59, GETPOST('search_endmonth'), GETPOST('search_endday'), GETPOST('search_endyear')); @@ -75,6 +76,8 @@ { $search_start = -1; $search_end = -1; + $search_ref = ''; + $search_amount = ''; $toselect=''; $search_array_options=array(); } @@ -153,10 +156,15 @@ $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")); +$blocks = $block_static->getLog('all', 0, GETPOST('all','alpha') ? 0 : 50, $sortfield, $sortorder, $search_start, $search_end, $search_ref, $search_amount); +if (! is_array($blocks)) +{ + dol_print_error($block_static->db); + exit; +} + $linkback=''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ModuleSetup").' '.$langs->trans('BlockedLog'),$linkback); @@ -173,10 +181,6 @@ 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'; @@ -196,6 +200,7 @@ print ''; print ''; + print ''; print ''; -print ''; +print ''; +print ''; + +// Ref +print ''; + +print ''; + +// Amount +print ''; + +print ''; +print ''; // Action column print ''; $loweridinerror=0; @@ -261,7 +278,7 @@ print $form->textwithpicto(dol_trunc($block->signature, '12'), $block->signature); print ''; - print '
 '; @@ -203,7 +208,19 @@ print $form->select_date($search_end,'search_end'); print ' '; @@ -223,7 +240,7 @@ print getTitleFieldOfList($langs->trans('Amount'), 0, $_SERVER["PHP_SELF"],'','',$param,'align="right"',$sortfield,$sortorder,'')."\n"; print getTitleFieldOfList($langs->trans('DataOfArchivedEvent'), 0, $_SERVER["PHP_SELF"],'','',$param,'align="center"',$sortfield,$sortorder,'')."\n"; print getTitleFieldOfList($langs->trans('Fingerprint'), 0, $_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder,'')."\n"; -print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder,'')."\n"; +print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"],'','',$param,'align="center"',$sortfield,$sortorder,'')."\n"; print '
'; + print ''; if (! $checkresult[$block->id] || ($loweridinerror && $block->id >= $loweridinerror)) // If error { if ($checkresult[$block->id]) print img_picto($langs->trans('OkCheckFingerprintValidityButChainIsKo'), 'statut1'); diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index bee4601c7c910..621ee254a484f 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -582,9 +582,11 @@ private function getPreviousHash($withlock=0, $beforeid=0) * @param string $sortorder sort order * @param int $search_start start time limit * @param int $search_end end time limit + * @param string $search_ref search ref + * @param string $search_amount search amount * @return array array of object log */ - public function getLog($element, $fk_object, $limit = 0, $sortfield = '', $sortorder = '', $search_start = -1, $search_end = -1) + public function getLog($element, $fk_object, $limit = 0, $sortfield = '', $sortorder = '', $search_start = -1, $search_end = -1, $search_ref='', $search_amount='') { global $conf, $cachedlogs; @@ -612,8 +614,10 @@ public function getLog($element, $fk_object, $limit = 0, $sortfield = '', $sorto WHERE element='".$element."' AND fk_object=".(int) $fk_object; } - if($search_start > 0) $sql.=" AND date_creation >= '".$this->db->idate($search_start)."'"; - if($search_end > 0) $sql.=" AND date_creation <= '".$this->db->idate($search_end)."'"; + if ($search_start > 0) $sql.=" AND date_creation >= '".$this->db->idate($search_start)."'"; + if ($search_end > 0) $sql.=" AND date_creation <= '".$this->db->idate($search_end)."'"; + if ($search_ref != '') $sql.=natural_search("ref_object", $search_ref); + if ($search_amount != '') $sql.=natural_search("amounts", $search_amount, 1); $sql.=$this->db->order($sortfield, $sortorder); diff --git a/htdocs/core/modules/modBlockedLog.class.php b/htdocs/core/modules/modBlockedLog.class.php index a0f53755981f8..95d1933cc893a 100644 --- a/htdocs/core/modules/modBlockedLog.class.php +++ b/htdocs/core/modules/modBlockedLog.class.php @@ -48,7 +48,7 @@ function __construct($db) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Enable a log on some business events into a non reversible log. This module may be mandatory for some countries."; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version - $this->version = 'experimental'; + $this->version = 'dolibarr'; // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) @@ -134,7 +134,7 @@ function remove($options = '') { $object->id = 1; $object->element = 'module'; $object->ref = 'module'; - $object->date = time(); + $object->date = dol_now(); $b=new BlockedLog($this->db); $b->setObjectData($object, 'MODULE_RESET', -1); diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index d2fce0bd362f1..1971e7bcfecf7 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -2731,10 +2731,10 @@ } table.dataTable td { - padding: 5px 2px 5px 3px !important; + padding: 5px 8px 5px 8px !important; } tr.pair td, tr.impair td, form.impair div.tagtd, form.pair div.tagtd, div.impair div.tagtd, div.pair div.tagtd, div.liste_titre div.tagtd { - padding: 7px 2px 7px 3px; + padding: 7px 8px 7px 8px; border-bottom: 1px solid #ddd; } form.pair, form.impair {