diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index 16c5b508b1c..eff97098812 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -111,14 +111,9 @@ if ($result) $i = 0; - if (! empty($user->rights->accounting->fiscalyear)) - { - $addbutton = '' . $langs->trans("NewFiscalYear") .''; - } - else - { - $addbutton = '' . $langs->trans("NewFiscalYear") .''; - } + + $addbutton.= dolGetButtonTitle($langs->trans('NewFiscalYear'), '', 'fa fa-plus-circle', 'fiscalyear_card.php?action=create', '', $user->rights->accounting->fiscalyear); + $title = $langs->trans('AccountingPeriods'); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $addbutton, '', $limit, 1); diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index c8014e900b9..5770128dfc6 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -453,9 +453,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions); $newcardbutton=''; if ($user->rights->societe->contact->creer) { - $newcardbutton=''.$langs->trans('NewContactAddress').''; - $newcardbutton.= ''; - $newcardbutton.= ''; + $newcardbutton.= dolGetButtonTitle($langs->trans('NewContactAddress'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?action=create'); } print '
'; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 410973bb5b7..73c5d044fe4 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -376,9 +376,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions); $newcardbutton=''; if ($user->rights->contrat->creer) { - $newcardbutton=''.$langs->trans('NewContractSubscription').''; - $newcardbutton.= ''; - $newcardbutton.= ''; + $newcardbutton.= dolGetButtonTitle($langs->trans('NewContractSubscription'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contrat/card.php?action=create'); } print ''; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d3d546b0b90..b644223df66 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8215,7 +8215,7 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u $button ='<'.$tag.' '.$compiledAttributes.' >'; $button.= ''; - $button.= ''.$label.''; + $button.= ''.$label.''; $button.= ''; return $button; diff --git a/htdocs/exports/index.php b/htdocs/exports/index.php index 83208ffa020..be0853587ce 100644 --- a/htdocs/exports/index.php +++ b/htdocs/exports/index.php @@ -50,14 +50,7 @@ print '
'; print '
'; if (count($export->array_export_code)) { - if ($user->rights->export->creer) - { - print ''.$langs->trans("NewExport").''; - } - else - { - print ''.$langs->trans("NewExport").''; - } + print dolGetButtonTitle($langs->trans('NewExport'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/exports/export.php?leftmenu=export', '',$user->rights->export->creer); } print '
'; print '
'; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 10eace0fe57..a6a12dd21a9 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -314,12 +314,7 @@ if ($resql) $massactionbutton=$form->selectMassAction('', $arrayofmassactions); $newcardbutton=''; - if ($user->rights->ficheinter->creer) - { - $newcardbutton=''.$langs->trans('NewIntervention').''; - $newcardbutton.= ''; - $newcardbutton.= ''; - } + $morehtmlcenter.= dolGetButtonTitle($langs->trans('NewIntervention'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/fichinter/card.php?action=create', '', $user->rights->ficheinter->creer); // Lines of title fields print ''."\n"; diff --git a/htdocs/loan/list.php b/htdocs/loan/list.php index e4b51c2429a..80d8645293b 100644 --- a/htdocs/loan/list.php +++ b/htdocs/loan/list.php @@ -116,9 +116,7 @@ if ($resql) $newcardbutton=''; if ($user->rights->loan->write) { - $newcardbutton=''.$langs->trans('NewLoan').''; - $newcardbutton.= ''; - $newcardbutton.= ''; + $newcardbutton.= dolGetButtonTitle($langs->trans('NewLoan'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/loan/card.php?action=create'); } print ''."\n"; diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index 18bb2931823..0e897497f62 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -194,23 +194,19 @@ if (($id > 0 && is_numeric($id)) || ! empty($ref)) } // Link to create task -if ($user->rights->projet->all->creer || $user->rights->projet->creer) -{ - if ($object->public || $userWrite > 0) - { - $linktocreatetask = ''.$langs->trans('AddTask').''; +$linktocreatetaskParam = array(); +$linktocreatetaskUserRight = false; +if ($user->rights->projet->all->creer || $user->rights->projet->creer) { + if ($object->public || $userWrite > 0){ + $linktocreatetaskUserRight = true; + }else{ + $linktocreatetaskParam['attr']['title'] = $langs->trans("NotOwnerOfProject"); } - else - { - $linktocreatetask = ''.$langs->trans('AddTask').''; - } -} -else -{ - $linktocreatetask = ''.$langs->trans('AddTask').''; } -$linktolist=''.$langs->trans("GoToListOfTasks").''; +$linktocreatetask = dolGetButtonTitle($langs->trans('AddTask'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id.'&action=create'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id), '', $linktocreatetaskUserRight, $linktocreatetaskParam ); + +$linktolist = dolGetButtonTitle($langs->trans('GoToListOfTasks'), '', 'fa fa-tasks', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id); //print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'title_generic.png', 0, '', '', 0, 1); print load_fiche_titre($title, $linktolist.'   '.$linktocreatetask, 'title_generic.png'); diff --git a/htdocs/projet/info.php b/htdocs/projet/info.php index eb6498a220f..d2b95726aea 100644 --- a/htdocs/projet/info.php +++ b/htdocs/projet/info.php @@ -161,16 +161,8 @@ if ($permok) $morehtmlcenter=''; if (! empty($conf->agenda->enabled)) { - if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create)) - { - $morehtmlcenter.=''.$langs->trans("AddAction").''; - $morehtmlcenter.=''; - $morehtmlcenter.=''; - } - else - { - $morehtmlcenter.=''.$langs->trans("AddAction").''; - } + $addActionBtnRight = ! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create); + $morehtmlcenter.= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $addActionBtnRight); } //print ''; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 1375a7a4844..f7278a7b296 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -642,23 +642,18 @@ elseif ($id > 0 || ! empty($ref)) print '
'; - // Link to create task - if ($user->rights->projet->all->creer || $user->rights->projet->creer) - { - if ($object->public || $userWrite > 0) - { - $linktocreatetask = ''.$langs->trans('AddTask').''; - } - else - { - $linktocreatetask = ''.$langs->trans('AddTask').''; - } - } - else - { - $linktocreatetask = ''.$langs->trans('AddTask').''; - } +// Link to create task + $linktocreatetaskParam = array(); + $linktocreatetaskUserRight = false; + if ($user->rights->projet->all->creer || $user->rights->projet->creer) { + if ($object->public || $userWrite > 0){ + $linktocreatetaskUserRight = true; + }else{ + $linktocreatetaskParam['attr']['title'] = $langs->trans("NotOwnerOfProject"); + } + } + $linktocreatetask = dolGetButtonTitle($langs->trans('AddTask'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id.'&action=create'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id), '', $linktocreatetaskUserRight, $linktocreatetaskParam ); print ''; @@ -672,7 +667,7 @@ elseif ($id > 0 || ! empty($ref)) print ''; $title=$langs->trans("ListOfTasks"); - $linktotasks=''.$langs->trans("GoToGanttView").''; + $linktotasks = dolGetButtonTitle($langs->trans('GoToGanttView'), '', 'fa fa-calendar-minus-o', DOL_URL_ROOT.'/projet/ganttview.php?id='.$object->id.'&withproject=1'); //print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'title_generic.png', 0, '', '', 0, 1); print load_fiche_titre($title, $linktotasks.'   '.$linktocreatetask, 'title_generic.png'); diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 1279a5191fd..190b194ecf9 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -425,9 +425,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions); $newcardbutton=''; if ($user->rights->projet->creer) { - $newcardbutton = ''.$langs->trans('NewTask').''; - $newcardbutton.= ''; - $newcardbutton.= ''; + $newcardbutton.= dolGetButtonTitle($langs->trans('NewTask'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/tasks.php?action=create'); } print ''; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 885d699b096..82d356b77ed 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2709,9 +2709,7 @@ else $MAXEVENT = 10; - $morehtmlright = ''; - $morehtmlright.= $langs->trans("SeeAll"); - $morehtmlright.= ''; + $morehtmlright.= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt', DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 24bdedc946f..608530d0d63 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -800,7 +800,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' $morehtmlright=''; if (! empty($conf->global->STRIPE_ALLOW_LOCAL_CARD)) { - $morehtmlright=''.$langs->trans("Add").''; + $morehtmlright.= dolGetButtonTitle($langs->trans('Add'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=createcard'); } print load_fiche_titre($langs->trans('StripePaymentModes').($stripeacc?' (Stripe connection with StripeConnect account '.$stripeacc.')':' (Stripe connection with keys from Stripe module setup)'), $morehtmlright, ''); diff --git a/htdocs/theme/eldy/btn.inc.php b/htdocs/theme/eldy/btn.inc.php index 818fcd13c15..8655136512b 100644 --- a/htdocs/theme/eldy/btn.inc.php +++ b/htdocs/theme/eldy/btn.inc.php @@ -171,11 +171,11 @@ a.butActionNewRefused>span.fa-plus-circle, a.butActionNewRefused>span.fa-plus-ci background-color: #fbfbfb; } -.title-button-icon{ +.title-button > .title-button-icon{ } -.title-button-label{ +.title-button > .title-button-label{ color: #666666; } @@ -191,10 +191,30 @@ a.butActionNewRefused>span.fa-plus-circle, a.butActionNewRefused>span.fa-plus-ci box-shadow: none; } +.title-button.title-button-refused, a.title-button.title-button-refused, .title-button.title-button-refused:hover, a.title-button.title-button-refused:hover { + color: #8a8a8a; + cursor: not-allowed; + background-color: #fbfbfb; + background: repeating-linear-gradient( + 45deg, + #ffffff, + #f1f1f1 4px, + #f1f1f1 4px, + #f1f1f1 4px + ); +} + + + .title-button:hover .title-button-label{ color: #ffffff; } + .title-button.title-button-refused .title-button-label, .title-button.title-button-refused:hover .title-button-label{ + color: #8a8a8a; +} + + .title-button>.fa { font-size: 20px; display: block;