diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 089c156eb04..1c90f17a3f7 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -247,11 +247,10 @@ if ($resql) print ''; print ''; - $newcardbutton = '' . $langs->trans("Addanaccount").''; - $newcardbutton.= ''; - $newcardbutton.= ''; + $newcardbutton.= dolGetButtonTitle($langs->trans("New"), $langs->trans("Addanaccount"), 'fa fa-plus-circle', './card.php?action=create'); - print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit); + + print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit); // Box to select active chart of account print $langs->trans("Selectchartofaccounts") . " : "; diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 207ea3464d8..94afb5d9fbb 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -443,19 +443,18 @@ print ''; print ''; $listofformat=AccountancyExport::getType(); -$button = ''; -if (count($filter)) $button.= $langs->trans("ExportFilteredList"); -else $button.= $langs->trans("ExportList"); -//$button.=' ('.$listofformat[$conf->global->ACCOUNTING_EXPORT_MODELCSV].')'; -$button.= ''; + +if (count($filter)) $buttonLabel = $langs->trans("ExportFilteredList"); +else $buttonLabel = $langs->trans("ExportList"); + +$newcardbutton = dolGetButtonTitle($buttonLabel ,'', 'fa fa-file-export', $_SERVER["PHP_SELF"].'?action=export_file'.($param?'&'.$param:'')); + +$newcardbutton.= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'),'', 'fa fa-object-group', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param); + +$newcardbutton.= dolGetButtonTitle($langs->trans('NewAccountingMvt'),'', 'fa fa-plus-circle', './card.php?action=create'); -$groupby = ' ' . $langs->trans("GroupByAccountAccounting") . ''; -$newcardbutton = ''.$langs->trans("NewAccountingMvt").''; -$newcardbutton.= ''; -$newcardbutton.= ''; - -print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, $groupby.$newcardbutton, '', $limit); +print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $result, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit); $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 38dc49c5bf6..a2cf4864df8 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -256,10 +256,8 @@ if ($action == 'delbookkeepingyear') { print '
'; -$viewflat = ' ' . $langs->trans("ViewFlatList") . ''; -$newcardbutton = ''.$langs->trans("NewAccountingMvt").''; -$newcardbutton.= ''; -$newcardbutton.= ''; +$newcardbutton.= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param); +$newcardbutton.= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle', './card.php?action=create'); if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index 310322aa44c..d1b56d51cee 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -256,9 +256,7 @@ if ($action == 'delete') $newcardbutton=''; if ($user->admin) { - $newcardbutton=''.$langs->trans('New').''; - $newcardbutton.= ''; - $newcardbutton.= ''; + $newcardbutton.= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/admin/menus/edit.php?menuId=0&action=create&menu_handler='.urlencode($menu_handler).'&backtopage='.urlencode($_SERVER['PHP_SELF'])); } print ''; diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 9869248a760..28670604b9e 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -435,9 +435,7 @@ if ($resql) //$param='month='.$monthshown.'&year='.$year; $hourminsec='100000'; - $newcardbutton = ''.$langs->trans("AddAction").''; - $newcardbutton.= ''; - $newcardbutton.= ''; + $newcardbutton.= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam?'?'.$newparam:''))); } print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, $nav.$newcardbutton, '', $limit); diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 6afbccefe65..754cb736bc9 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -367,10 +367,7 @@ if ($user->rights->agenda->myactions->create || $user->rights->agenda->allaction //$param='month='.$monthshown.'&year='.$year; $hourminsec='100000'; - $newcardbutton = ''; - $newcardbutton.= ''; - $newcardbutton.= ''.$langs->trans("AddAction").''; - $newcardbutton.= ''; + $newcardbutton.= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam?'?'.$newparam:''))); } $link=''; diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index 54fdaef111b..7e058819771 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -156,9 +156,7 @@ if ($result) $newcardbutton=''; if ($user->rights->mailing->creer) { - $newcardbutton=''.$langs->trans('NewMailing').''; - $newcardbutton.= ''; - $newcardbutton.= ''; + $newcardbutton.= dolGetButtonTitle($langs->trans('NewMailing'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/mailing/card.php?action=create'); } $i = 0; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index a253b1e2eb1..c8b101ccbd6 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -438,10 +438,8 @@ if ($resql) $newcardbutton=''; if ($user->rights->propal->creer) { - $newcardbutton=''.$langs->trans('NewPropal').''; - $newcardbutton.= ''; - $newcardbutton.= ''; - } + $newcardbutton.= dolGetButtonTitle($langs->trans('NewPropal'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/propal/card.php?action=create'); + } // Lignes des champs de filtre print ''; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 13f9d2a2b1d..7eb6eb2480f 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -441,10 +441,8 @@ if ($resql) $newcardbutton=''; if ($contextpage == 'orderlist' && $user->rights->commande->creer) { - $newcardbutton=''.$langs->trans('NewOrder').''; - $newcardbutton.= ''; - $newcardbutton.= ''; - } + $newcardbutton.= dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/commande/card.php?action=create'); + } // Lines of title fields print ''; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 8515d3649f7..13c3e24428e 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -599,10 +599,7 @@ if ($resql) $newcardbutton=''; if($user->rights->facture->creer) { - $newcardbutton=''; - $newcardbutton.= ''; - $newcardbutton.= ''.$langs->trans('NewBill').''; - $newcardbutton.= ''; + $newcardbutton.= dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/facture/card.php?action=create'); } $i = 0; diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index 0107ba60383..401d12aec4b 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -138,9 +138,7 @@ if ($resql) $newcardbutton=''; if ($user->rights->banque->cheque) { - $newcardbutton = ''.$langs->trans('NewCheckDeposit').''; - $newcardbutton.= ''; - $newcardbutton.= ''; + $newcardbutton.= dolGetButtonTitle($langs->trans('NewCheckDeposit'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/paiement/cheque/card.php?action=new'); } print ''; diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php index 49f44af1702..9fcb77d9b42 100644 --- a/htdocs/compta/prelevement/bons.php +++ b/htdocs/compta/prelevement/bons.php @@ -108,9 +108,7 @@ if ($result) $newcardbutton=''; if ($user->rights->prelevement->bons->creer) { - $newcardbutton = ''.$langs->trans('NewStandingOrder').''; - $newcardbutton.= ''; - $newcardbutton.= ''; + $newcardbutton.= dolGetButtonTitle($langs->trans('NewStandingOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/prelevement/create.php'); } // Lines of title fields diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index c9c1bc3d782..31353ea3d10 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -205,9 +205,7 @@ class FormActions $newcardbutton=''; if (! empty($conf->agenda->enabled)) { - $newcardbutton = ''.$langs->trans("AddEvent").''; - $newcardbutton.= ''; - $newcardbutton.= ''; + $newcardbutton.= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.dol_print_date(dol_now(), 'dayhourlog').'&origin='.$typeelement.'&originid='.$object->id.($object->socid>0?'&socid='.$object->socid:($socid>0?'&socid='.$socid:'')).($projectid>0?'&projectid='.$projectid:'').'&backtopage='.urlencode($urlbacktopage)); } print ''."\n"; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index d6fe993aa2d..e080cc89796 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -730,9 +730,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel $newcardbutton=''; if (! empty($conf->projet->enabled) && $user->rights->projet->creer && empty($nocreatelink)) { - $newcardbutton=''.$langs->trans("AddProject").''; - $newcardbutton.= ''; - $newcardbutton.= ''; + $newcardbutton.= dolGetButtonTitle($langs->trans('AddProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage)); } print "\n"; @@ -934,9 +932,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') if ($user->rights->societe->contact->creer) { $addcontact = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress")); - $newcardbutton=''.$addcontact.''; - $newcardbutton.= ''; - $newcardbutton.= ''; + $newcardbutton.= dolGetButtonTitle($addcontact, '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage)); } print "\n"; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 35d29e15988..d3d546b0b90 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8135,3 +8135,88 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url = return '
<'.$tag.' '.$compiledAttributes.'>'.$html.'
'; } + + + +/** + * Function dolGetButtonTitle : this kind of buttons are used in title in list + * + * @param string $label label of button + * @param string $helpText optional : content for help tooltip + * @param string $iconClass class for icon element + * @param string $url the url for link + * @param string $id attribute id of button + * @param int $userRight user action right + * @param array $params various params for future : recommended rather than adding more function arguments + * @return string html button + */ +function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $url = '', $id = '', $userRight = 1, $params = array()) +{ + global $langs; + + $class = 'title-button' ; + + $attr=array( + 'class' => $class + ,'href' => empty($url)?'':$url + ); + + if(!empty($helpText)){ + $attr['title'] = dol_escape_htmltag($helpText); + } + + if(empty($userRight)){ + $attr['class'] .= ' title-button-refused'; + $attr['title'] = dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")); + $attr['href'] = ''; + } + + if(!empty($attr['title'])){ + $attr['class'] .= ' classfortooltip'; + } + + if(empty($id)){ + $attr['id'] = $id; + } + + // Override attr + if(!empty($params['attr']) && is_array($params['attr'])){ + foreach($params['attr'] as $key => $value){ + if($key == 'class'){ + $attr['class'].= ' '.$value; + } + elseif($key == 'classOverride'){ + $attr['class'] = $value; + } + else{ + $attr[$key] = $value; + } + } + } + + if(isset($attr['href']) && empty($attr['href'])){ + unset($attr['href']); + } + + // TODO : add a hook + + // escape all attribute + $attr = array_map('dol_escape_htmltag', $attr); + + $TCompiledAttr = array(); + foreach($attr as $key => $value){ + $TCompiledAttr[] = $key.'="'.$value.'"'; + } + + $compiledAttributes = !empty($TCompiledAttr)?implode(' ', $TCompiledAttr):''; + + $tag = !empty($attr['href'])?'a':'span'; + + + $button ='<'.$tag.' '.$compiledAttributes.' >'; + $button.= ''; + $button.= ''.$label.''; + $button.= ''; + + return $button; +} diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 1f10f333644..c141d272323 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -344,18 +344,8 @@ print ''; // Line with explanation and button new job $newcardbutton=''; -if ($user->rights->cron->create) -{ - $newcardbutton.=''.$langs->trans("CronCreateJob").''; - $newcardbutton.= ''; - $newcardbutton.= ''; -} -else -{ - $newcardbutton.=''.$langs->trans("CronCreateJob").''; - $newcardbutton.= ''; - $newcardbutton.= ''; -} +$newcardbutton.= dolGetButtonTitle($langs->trans('New'), $langs->trans('CronCreateJob'), 'fa fa-plus-circle', DOL_URL_ROOT.'/societe/card.php?action=create'.$typefilter, '',$user->rights->cron->create); + print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_setup', 0, $newcardbutton, '', $limit); diff --git a/htdocs/don/list.php b/htdocs/don/list.php index 6c27f48c415..f5cf23bceb7 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -142,10 +142,7 @@ if ($resql) $newcardbutton=''; if ($user->rights->don->creer) { - $newcardbutton=''; - $newcardbutton.= ''; - $newcardbutton.= ''.$langs->trans('NewDonation').''; - $newcardbutton.= ''; + $newcardbutton.= dolGetButtonTitle($langs->trans('NewDonation'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/don/card.php?action=create'); } print ''."\n"; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index c857fbddefa..644ed123f41 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -466,10 +466,7 @@ if ($resql) $newcardbutton=''; if ($user->rights->fournisseur->facture->creer) { - $newcardbutton =''; - $newcardbutton.= ''; - $newcardbutton.= ''.$langs->trans('NewBill').''; - $newcardbutton.= ''; + $newcardbutton.= dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/fourn/facture/card.php?action=create'); } $i = 0; diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php index 92171ba7188..800b6827f56 100644 --- a/htdocs/opensurvey/list.php +++ b/htdocs/opensurvey/list.php @@ -243,18 +243,7 @@ print ''; print ''; $newcardbutton=''; -if (! empty($user->rights->opensurvey->write)) -{ - $newcardbutton=''.$langs->trans('NewSurvey').''; - $newcardbutton.= ''; - $newcardbutton.= ''; -} -else -{ - $newcardbutton=''.$langs->trans('NewSurvey').''; - $newcardbutton.= ''; - $newcardbutton.= ''; -} +$newcardbutton.= dolGetButtonTitle($langs->trans('NewSurvey'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/opensurvey/wizard/index.php','',$user->rights->opensurvey->write); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic.png', 0, $newcardbutton, '', $limit); diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index 18e1890c485..2bf407ec88d 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -162,9 +162,7 @@ if ($socid > 0) { if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create)) { - $newcardbutton.=''.$langs->trans("AddAction").''; - $newcardbutton.= ''; - $newcardbutton.= ''; + $newcardbutton.= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); } } diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index c4a9ebf1b94..66346f77980 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -582,9 +582,7 @@ if ($user->rights->societe->creer && $contextpage != 'poslist') if($type == 'f') $label='NewSupplier'; } - $newcardbutton = ''.$langs->trans($label).''; - $newcardbutton.= ''; - $newcardbutton.= ''; + $newcardbutton.= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/societe/card.php?action=create'.$typefilter); } print ''; diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 0a5c62b9afb..7e5dded1375 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -224,13 +224,9 @@ dol_fiche_end(); $newcardbutton = ''; if (! empty($conf->website->enabled)) { if (! empty($user->rights->societe->lire)) { - $newcardbutton .= '' . $langs->trans("AddWebsiteAccount").''; - $newcardbutton.= ''; - $newcardbutton.= ''; - } else { - $newcardbutton .= ''.$langs->trans("AddAction").''; - $newcardbutton.= ''; - $newcardbutton.= ''; + $morehtmlright.= dolGetButtonTitle($langs->trans("AddWebsiteAccount"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/website/websiteaccount_card.php?action=create&fk_soc='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id)); + } else { + $morehtmlright.= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/website/websiteaccount_card.php?action=create&fk_soc='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id),'',0); } } diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index 0651e7aeff8..630ea3c6b14 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -143,9 +143,7 @@ if ($resql) $newcardbutton=''; if ($caneditperms) { - $newcardbutton=''.$langs->trans('NewGroup').''; - $newcardbutton.= ''; - $newcardbutton.= ''; + $newcardbutton.= dolGetButtonTitle($langs->trans('NewGroup'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/user/group/card.php?action=create&leftmenu='); } print ''."\n"; diff --git a/htdocs/user/hierarchy.php b/htdocs/user/hierarchy.php index b7c015e7146..a54e3070573 100644 --- a/htdocs/user/hierarchy.php +++ b/htdocs/user/hierarchy.php @@ -147,12 +147,10 @@ $param="search_statut=".urlencode($search_statut); $newcardbutton=''; if ($canadduser) { - $newcardbutton = ''.$langs->trans('NewUser').''; - $newcardbutton.= ''; - $newcardbutton.= ''; + $newcardbutton.= dolGetButtonTitle($langs->trans('NewUser'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/user/card.php?action=create'.($mode == 'employee' ? '&employee=1': '').'&leftmenu='); } -$morehtmlright = ''.$langs->trans("ViewList").''; +$morehtmlright.= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list', DOL_URL_ROOT.'/user/list.php'.(($search_statut != '' && $search_statut >= 0) ?'?search_statut='.$search_statut:'')); print load_fiche_titre($title, $morehtmlright.' '.$newcardbutton); diff --git a/htdocs/user/list.php b/htdocs/user/list.php index f3c00565f51..62d32bc1654 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -290,9 +290,7 @@ $text = $langs->trans("ListOfUsers"); $newcardbutton=''; if ($canadduser) { - $newcardbutton=''.$langs->trans('NewUser').''; - $newcardbutton.= ''; - $newcardbutton.= ''; + $newcardbutton.= dolGetButtonTitle($langs->trans('NewUser'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/user/card.php?action=create'.($mode == 'employee' ? '&employee=1': '').'&leftmenu='); } print ''."\n"; @@ -306,7 +304,8 @@ print ''; print ''; -$morehtmlright = ''.$langs->trans("HierarchicView").''; +$morehtmlright.= dolGetButtonTitle($langs->trans("HierarchicView"), '', 'fa fa-sitemap', DOL_URL_ROOT.'/user/hierarchy.php'.(($search_statut != '' && $search_statut >= 0) ?'?search_statut='.$search_statut:'')); + print_barre_liste($text, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num, $nbtotalofrecords, 'title_generic', 0, $morehtmlright.' '.$newcardbutton, '', $limit);