diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1c453d49a8a..8a2ab3e0d42 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -609,22 +609,22 @@ class Form } /** - * Show a text and picto with tooltip on text or picto. + * Show a text and picto with tooltip on text or picto. * Can be called by an instancied $form->textwithtooltip or by a static call Form::textwithtooltip * - * @param string $text Text to show - * @param string $htmltext HTML content of tooltip. Must be HTML/UTF8 encoded. - * @param int $tooltipon 1=tooltip on text, 2=tooltip on image, 3=tooltip sur les 2 - * @param int $direction -1=image is before, 0=no image, 1=image is after - * @param string $img Html code for image (use img_xxx() function to get it) - * @param string $extracss Add a CSS style to td tags - * @param int $notabs 0=Include table and tr tags, 1=Do not include table and tr tags, 2=use div, 3=use span - * @param string $incbefore Include code before the text - * @param int $noencodehtmltext Do not encode into html entity the htmltext - * @param string $tooltiptrigger ''=Tooltip on hover, 'abc'=Tooltip on click (abc is a unique key) - * @param int $forcenowrap Force no wrap between text and picto (works with notabs=2 only) - * @return string Code html du tooltip (texte+picto) - * @see textwithpicto() Use thisfunction if you can. + * @param string $text Text to show + * @param string $htmltext HTML content of tooltip. Must be HTML/UTF8 encoded. + * @param int $tooltipon 1=tooltip on text, 2=tooltip on image, 3=tooltip sur les 2 + * @param int $direction -1=image is before, 0=no image, 1=image is after + * @param string $img Html code for image (use img_xxx() function to get it) + * @param string $extracss Add a CSS style to td tags + * @param int $notabs 0=Include table and tr tags, 1=Do not include table and tr tags, 2=use div, 3=use span + * @param string $incbefore Include code before the text + * @param int $noencodehtmltext Do not encode into html entity the htmltext + * @param string $tooltiptrigger ''=Tooltip on hover, 'abc'=Tooltip on click (abc is a unique key) + * @param int $forcenowrap Force no wrap between text and picto (works with notabs=2 only) + * @return string Code html du tooltip (texte+picto) + * @see textwithpicto() Use thisfunction if you can. */ public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0) { @@ -725,16 +725,16 @@ class Form /** * Show a text with a picto and a tooltip on picto * - * @param string $text Text to show - * @param string $htmltext Content of tooltip - * @param int $direction 1=Icon is after text, -1=Icon is before text, 0=no icon - * @param string $type Type of picto ('info', 'infoclickable', 'help', 'helpclickable', 'warning', 'superadmin', 'mypicto@mymodule', ...) or image filepath or 'none' - * @param string $extracss Add a CSS style to td, div or span tag - * @param int $noencodehtmltext Do not encode into html entity the htmltext - * @param int $notabs 0=Include table and tr tags, 1=Do not include table and tr tags, 2=use div, 3=use span - * @param string $tooltiptrigger ''=Tooltip on hover and hidden on smartphone, 'abconsmartphone'=Tooltip on hover and on click on smartphone, 'abc'=Tooltip on click (abc is a unique key, clickable link is on image or on link if param $type='none' or on both if $type='xxxclickable') - * @param int $forcenowrap Force no wrap between text and picto (works with notabs=2 only) - * @return string HTML code of text, picto, tooltip + * @param string $text Text to show + * @param string $htmltext Content of tooltip + * @param int $direction 1=Icon is after text, -1=Icon is before text, 0=no icon + * @param string $type Type of picto ('info', 'infoclickable', 'help', 'helpclickable', 'warning', 'superadmin', 'mypicto@mymodule', ...) or image filepath or 'none' + * @param string $extracss Add a CSS style to td, div or span tag + * @param int $noencodehtmltext Do not encode into html entity the htmltext + * @param int $notabs 0=Include table and tr tags, 1=Do not include table and tr tags, 2=use div, 3=use span + * @param string $tooltiptrigger ''=Tooltip on hover and hidden on smartphone, 'abconsmartphone'=Tooltip on hover and on click on smartphone, 'abc'=Tooltip on click (abc is a unique key, clickable link is on image or on link if param $type='none' or on both if $type='xxxclickable') + * @param int $forcenowrap Force no wrap between text and picto (works with notabs=2 only) + * @return string HTML code of text, picto, tooltip */ public function textwithpicto($text, $htmltext, $direction = 1, $type = 'help', $extracss = '', $noencodehtmltext = 0, $notabs = 3, $tooltiptrigger = '', $forcenowrap = 0) { diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 3e800760606..d8a25d06842 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -1003,27 +1003,6 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { print ''."\n"; print ''."\n"; - if (empty($conf->global->HOLIDAY_HIDE_BALANCE)) { - print dol_get_fiche_head('', '', '', -1); - - $out = ''; - $nb_holiday = 0; - $typeleaves = $object->getTypes(1, 1); - foreach ($typeleaves as $key => $val) { - $nb_type = $object->getCPforUser($user->id, $val['rowid']); - $nb_holiday += $nb_type; - - $out .= ' - '.($langs->trans($val['code']) != $val['code'] ? $langs->trans($val['code']) : $val['label']).': '.($nb_type ? price2num($nb_type) : 0).'
'; - //$out .= ' - '.$val['label'].': '.($nb_type ?price2num($nb_type) : 0).'
'; - } - print $langs->trans('SoldeCPUser', round($nb_holiday, 5)).'
'; - print $out; - - print dol_get_fiche_end(); - } elseif (!is_numeric($conf->global->HOLIDAY_HIDE_BALANCE)) { - print $langs->trans($conf->global->HOLIDAY_HIDE_BALANCE).'
'; - } - print dol_get_fiche_head(); //print ''.$langs->trans('DelayToRequestCP',$object->getConfCP('delayForRequest')).'

'; @@ -1033,14 +1012,57 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { // User for leave request print ''; - print ''.$langs->trans("User").''; - print ''; + print ''.$langs->trans("User").''; + print '
'; if ($cancreate && !$cancreateall) { - print img_picto('', 'user').$form->select_dolusers(($fuserid ? $fuserid : $user->id), 'fuserid', 0, '', 0, 'hierarchyme', '', '0,'.$conf->entity, 0, 0, $morefilter, 0, '', 'minwidth200 maxwidth500'); + print img_picto('', 'user').$form->select_dolusers(($fuserid ? $fuserid : $user->id), 'fuserid', 0, '', 0, 'hierarchyme', '', '0,'.$conf->entity, 0, 0, $morefilter, 0, '', 'minwidth200 maxwidth500 inline-block'); //print ''; } else { - print img_picto('', 'user').$form->select_dolusers($fuserid ? $fuserid : $user->id, 'fuserid', 0, '', 0, '', '', '0,'.$conf->entity, 0, 0, $morefilter, 0, '', 'minwidth200 maxwidth500'); + print img_picto('', 'user').$form->select_dolusers($fuserid ? $fuserid : $user->id, 'fuserid', 0, '', 0, '', '', '0,'.$conf->entity, 0, 0, $morefilter, 0, '', 'minwidth200 maxwidth500 inline-block'); } + print '
'; + + if (empty($conf->global->HOLIDAY_HIDE_BALANCE)) { + print '
'; + + $out = ''; + $nb_holiday = 0; + $typeleaves = $object->getTypes(1, 1); + foreach ($typeleaves as $key => $val) { + $nb_type = $object->getCPforUser(($fuserid ? $fuserid : $user->id), $val['rowid']); + $nb_holiday += $nb_type; + + $out .= ' - '.($langs->trans($val['code']) != $val['code'] ? $langs->trans($val['code']) : $val['label']).': '.($nb_type ? price2num($nb_type) : 0).'
'; + //$out .= ' - '.$val['label'].': '.($nb_type ?price2num($nb_type) : 0).'
'; + } + print '     '; + + $htmltooltip = $langs->trans("Detail").'
'; + $htmltooltip .= $out; + + print $form->textwithtooltip($langs->trans('SoldeCPUser', round($nb_holiday, 5)).' '.img_picto('', 'help'), $htmltooltip); + + print '
'; + if (!empty($conf->use_javascript_ajax)) { + print ''; + } + } elseif (!is_numeric($conf->global->HOLIDAY_HIDE_BALANCE)) { + print '
'; + print $langs->trans($conf->global->HOLIDAY_HIDE_BALANCE); + print '
'; + } + print ''; print ''; diff --git a/htdocs/langs/en_US/holiday.lang b/htdocs/langs/en_US/holiday.lang index 8290f14a765..0ec98d01a12 100644 --- a/htdocs/langs/en_US/holiday.lang +++ b/htdocs/langs/en_US/holiday.lang @@ -29,7 +29,7 @@ DescCP=Description SendRequestCP=Create leave request DelayToRequestCP=Leave requests must be made at least %s day(s) before them. MenuConfCP=Balance of leave -SoldeCPUser=Leave balance (in days) %s +SoldeCPUser=Leave balance (in days) : %s ErrorEndDateCP=You must select an end date greater than the start date. ErrorSQLCreateCP=An SQL error occurred during the creation: ErrorIDFicheCP=An error has occurred, the leave request does not exist. diff --git a/htdocs/langs/fr_FR/holiday.lang b/htdocs/langs/fr_FR/holiday.lang index 642a67cb11c..c95d5bf4e54 100644 --- a/htdocs/langs/fr_FR/holiday.lang +++ b/htdocs/langs/fr_FR/holiday.lang @@ -5,7 +5,7 @@ Holiday=Demande de congés CPTitreMenu=Demande de congés MenuReportMonth=État mensuel MenuAddCP=Créer demande de congés -MenuCollectiveAddCP=Nouvelle demande de congé collectif +MenuCollectiveAddCP=Demande de congé collectif NotActiveModCP=Vous devez activer le module Congés pour afficher cette page. AddCP=Créer une demande de congés DateDebCP=Date Début @@ -95,7 +95,7 @@ UseralreadyCPexist=Une demande de congé a déjà été faite pour cette périod groups=Groupes users=Utilisateurs AutoSendMail=Envoi automatique d'email -NewHolidayForGroup=Nouvelle demande de congé collectif +NewHolidayForGroup=Demande de congé collectif SendRequestCollectiveCP=Envoyer la demande de congé collectif AutoValidationOnCreate=Validation automatique FirstDayOfHoliday=Premier jour de congés diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 36dc47066e8..310d2899a37 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1744,6 +1744,8 @@ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-select .hideonsmartphone { display: none; } .hideonsmartphoneimp { display: none !important; } + .margintoponsmartphone { margin-top: 6px; } + span.pictotitle { margin-: 0 !important; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index ef8f97716b2..25843c8c407 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1968,6 +1968,8 @@ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-select .hideonsmartphone { display: none; } .hideonsmartphoneimp { display: none !important; } + .margintoponsmartphone { margin-top: 6px; } + select.minwidth100imp, select.minwidth100, select.minwidth200, select.minwidth200imp, select.minwidth300 { width: calc(100% - 40px) !important; display: inline-block; @@ -1988,13 +1990,13 @@ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-select .smallonsmartphone { font-size: 0.8em; } - + .nopaddingtoponsmartphone { padding-top: 0 !important; } .nopaddingbottomonsmartphone { padding-bottom: 0 !important; - } + } } /* Force values for small screen 570 */