diff --git a/htdocs/core/class/listview.class.php b/htdocs/core/class/listview.class.php index d276853a362..6b57fd36a21 100644 --- a/htdocs/core/class/listview.class.php +++ b/htdocs/core/class/listview.class.php @@ -40,7 +40,7 @@ class Listview { if(!isset($TParam['link']))$TParam['link']=array(); if(!isset($TParam['type']))$TParam['type']=array(); if(!isset($TParam['orderby']['noOrder']))$TParam['orderby']['noOrder']=array(); - if(!isset($TParam['no-select'])) $TParam['no-select'] = 1; + if(!isset($TParam['allow-fields-select'])) $TParam['allow-fields-select'] = 0; if(!isset($TParam['list']))$TParam['list']=array(); $TParam['list'] = array_merge(array( @@ -53,7 +53,7 @@ class Listview { ,'orderUp'=>'' ,'id'=>$this->id ,'head_search'=>'' - ,'export'=>array() + ,'export'=>array() //TODO include native export ,'view_type'=>'' //TODO to include graph or kanban instead of list ),$TParam['list']); @@ -133,7 +133,7 @@ class Listview { } } - private function addSqlFromOther(&$TSQLMore, &$value, &$TParam, $sKey, $sBindKey, $key) + private function addSqlFromOther(&$TSQLMore, &$value, &$TParam, $sKey, $key) { if(isset($TParam['operator'][$key])) @@ -272,38 +272,40 @@ class Listview { //$fsearch=$form->calendrier('','Listview['.$this->id.'][search]['.$key.']',$value,10,10,' listviewtbs="calendar" '); } else if($typeRecherche==='calendars') { - $fsearch=$form->calendrier('','Listview['.$this->id.'][search]['.$key.'][start]',isset($value['start'])?$value['start']:'',10,10,' listviewtbs="calendars" ') - .' '.$form->calendrier('','Listview['.$this->id.'][search]['.$key.'][end]',isset($value['end'])?$value['end']:'',10,10,' listviewtbs="calendars" '); + + $fsearch = $form->select_date(isset($value['start'])?$value['start']:'', 'Listview['.$this->id.'][search]['.$key.'][start]',0, 0, 1, "", 1, 0, 1) + . $form->select_date(isset($value['end'])?$value['end']:'', 'Listview['.$this->id.'][search]['.$key.'][end]',0, 0, 1, "", 1, 0, 1); + } else if(is_string($typeRecherche)) { $fsearch=$TParam['search'][$key]; } else { - $fsearch=$form->texte('','Listview['.$this->id.'][search]['.$key.']',$value,15,255,' listviewtbs="input" '); + $fsearch=''; } if(!empty($param_search['allow_is_null'])) { - $valueNull = isset($_REQUEST['Listview'][$this->id]['search_on_null'][$key]) ? 1 : 0; + $valueNull = isset($ListPOST[$this->id]['search_on_null'][$key]) ? 1 : 0; $fsearch.=' '.$form->checkbox1('', 'Listview['.$this->id.'][search_on_null]['.$key.']',1, $valueNull,' onclick=" if($(this).is(\':checked\')){ $(this).prev().val(\'\'); }" ').img_help(1, $langs->trans('SearchOnNUllValue')); } - if(!empty($THeader[$key]) || $this->getViewType($TParam) == 'chart') { + if(!empty($THeader[$key])) { $TSearch[$key] = $fsearch; $nb_search_in_bar++; } else { - $libelle = !empty($TParam['title'][$key]) ? $TParam['title'][$key] : $key ; - $TParam['liste']['head_search'].='
'.$libelle.' '.$fsearch.'
'; + $label = !empty($TParam['title'][$key]) ? $TParam['title'][$key] : $key ; + $TParam['list']['head_search'].='
'.$libelle.' '.$fsearch.'
'; } } - $search_button = ' '.$TParam['liste']['picto_search'].''; + $search_button = ' '.img_search().''; - if(!empty($TParam['liste']['head_search'])) { - $TParam['liste']['head_search'].='
'.$langs->trans('Search').' '.$search_button.'
'; + if(!empty($TParam['list']['head_search'])) { + $TParam['list']['head_search']='
'.$search_button.'
'.$TParam['list']['head_search']; } if($nb_search_in_bar>0) { @@ -364,7 +366,7 @@ class Listview { return array($TTotal,$TTotalGroup); } - private function getJS(&$TParam) { + private function getJS() { $javaScript = '