From 53510ac660503c9c5b71ea70def46c43e53334b0 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 29 Jun 2017 10:14:48 +0200 Subject: [PATCH 1/2] NEW : filter on extrafield on product list (as in company list) --- htdocs/product/list.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 8a8eda5b65a..ab56a9e044b 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -593,7 +593,26 @@ else { foreach($extrafields->attribute_label as $key => $val) { - if (! empty($arrayfields["ef.".$key]['checked'])) print ''; + if (! empty($arrayfields["ef.".$key]['checked'])) { + $align=$extrafields->getAlignFlag($key); + $typeofextrafield=$extrafields->attribute_type[$key]; + print ''; + if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attribute_computed[$key])) + { + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $searchclass=''; + if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; + if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum'; + print ''; + } + else + { + // for the type as 'checkbox', 'chkbxlst', 'sellist' we should use code instead of id (example: I declare a 'chkbxlst' to have a link with dictionnairy, I have to extend it with the 'code' instead 'rowid') + echo $extrafields->showInputField($key, $search_array_options['search_options_'.$key], '', '', 'search_'); + } + print ''; + } } } // Fields from hook From 3a89591fb46953e6d3b3ad3eb2cde6239daba333 Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Thu, 6 Jul 2017 15:48:22 +0200 Subject: [PATCH 2/2] Adding Hook for tooltip on project --- htdocs/projet/class/project.class.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index b22ea32f646..cfb6c45437d 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -991,7 +991,7 @@ class Project extends CommonObject } $linkclose=''; - if (empty($notooltip) && $user->rights->propal->lire) + if (empty($notooltip)) { if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { @@ -1000,6 +1000,17 @@ class Project extends CommonObject } $linkclose.=' title="'.dol_escape_htmltag($label, 1).'"'; $linkclose.=' class="classfortooltip"'; + + if (! is_object($hookmanager)) { + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + $hookmanager=new HookManager($this->db); + } + $hookmanager->initHooks(array('projectdao')); + $parameters=array('id'=>$this->id); + // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); + if ($reshook > 0) + $linkclose = $hookmanager->resPrint; } $picto = 'projectpub';