Look and feel v18

This commit is contained in:
Laurent Destailleur 2023-03-30 19:46:01 +02:00
parent d684204bed
commit 1be9364971
6 changed files with 80 additions and 54 deletions

View File

@ -1003,27 +1003,6 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
print '<input type="hidden" name="token" value="'.newToken().'" />'."\n"; print '<input type="hidden" name="token" value="'.newToken().'" />'."\n";
print '<input type="hidden" name="action" value="add" />'."\n"; print '<input type="hidden" name="action" value="add" />'."\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']).': <strong>'.($nb_type ? price2num($nb_type) : 0).'</strong><br>';
//$out .= ' - '.$val['label'].': <strong>'.($nb_type ?price2num($nb_type) : 0).'</strong><br>';
}
print $langs->trans('SoldeCPUser', round($nb_holiday, 5)).'<br>';
print $out;
print dol_get_fiche_end();
} elseif (!is_numeric($conf->global->HOLIDAY_HIDE_BALANCE)) {
print $langs->trans($conf->global->HOLIDAY_HIDE_BALANCE).'<br>';
}
print dol_get_fiche_head(); print dol_get_fiche_head();
//print '<span>'.$langs->trans('DelayToRequestCP',$object->getConfCP('delayForRequest')).'</span><br><br>'; //print '<span>'.$langs->trans('DelayToRequestCP',$object->getConfCP('delayForRequest')).'</span><br><br>';
@ -1033,14 +1012,57 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
// User for leave request // User for leave request
print '<tr>'; print '<tr>';
print '<td class="titlefield fieldrequired">'.$langs->trans("User").'</td>'; print '<td class="titlefield fieldrequired tdtop">'.$langs->trans("User").'</td>';
print '<td>'; print '<td><div class="inline-block">';
if ($cancreate && !$cancreateall) { 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 '<input type="hidden" name="fuserid" value="'.($fuserid?$fuserid:$user->id).'">'; //print '<input type="hidden" name="fuserid" value="'.($fuserid?$fuserid:$user->id).'">';
} else { } 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 '</div>';
if (empty($conf->global->HOLIDAY_HIDE_BALANCE)) {
print '<div class="leaveuserbalance paddingtop inline-block floatright badge badge-status0 badge-status margintoponsmartphone">';
$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']).': <strong>'.($nb_type ? price2num($nb_type) : 0).'</strong><br>';
//$out .= ' - '.$val['label'].': <strong>'.($nb_type ?price2num($nb_type) : 0).'</strong><br>';
}
print ' &nbsp; &nbsp; ';
$htmltooltip = $langs->trans("Detail").'<br>';
$htmltooltip .= $out;
print $form->textwithtooltip($langs->trans('SoldeCPUser', round($nb_holiday, 5)).' '.img_picto('', 'help'), $htmltooltip);
print '</div>';
if (!empty($conf->use_javascript_ajax)) {
print '<script>';
print '$( document ).ready(function() {
jQuery("#fuserid").change(function() {
console.log("We change to user id "+jQuery("#fuserid").val());
if (jQuery("#fuserid").val() == '.((int) $user->id).') {
jQuery(".leaveuserbalance").show();
} else {
jQuery(".leaveuserbalance").hide();
}
});
});';
print '</script>';
}
} elseif (!is_numeric($conf->global->HOLIDAY_HIDE_BALANCE)) {
print '<div class="leaveuserbalance paddingtop">';
print $langs->trans($conf->global->HOLIDAY_HIDE_BALANCE);
print '</div>';
}
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';

View File

@ -29,7 +29,7 @@ DescCP=Description
SendRequestCP=Create leave request SendRequestCP=Create leave request
DelayToRequestCP=Leave requests must be made at least <b>%s day(s)</b> before them. DelayToRequestCP=Leave requests must be made at least <b>%s day(s)</b> before them.
MenuConfCP=Balance of leave MenuConfCP=Balance of leave
SoldeCPUser=Leave balance (in days) <b>%s</b> SoldeCPUser=Leave balance (in days) : <b>%s</b>
ErrorEndDateCP=You must select an end date greater than the start date. ErrorEndDateCP=You must select an end date greater than the start date.
ErrorSQLCreateCP=An SQL error occurred during the creation: ErrorSQLCreateCP=An SQL error occurred during the creation:
ErrorIDFicheCP=An error has occurred, the leave request does not exist. ErrorIDFicheCP=An error has occurred, the leave request does not exist.

View File

@ -5,7 +5,7 @@ Holiday=Demande de congés
CPTitreMenu=Demande de congés CPTitreMenu=Demande de congés
MenuReportMonth=État mensuel MenuReportMonth=État mensuel
MenuAddCP=Créer demande de congés 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. NotActiveModCP=Vous devez activer le module Congés pour afficher cette page.
AddCP=Créer une demande de congés AddCP=Créer une demande de congés
DateDebCP=Date Début DateDebCP=Date Début
@ -95,7 +95,7 @@ UseralreadyCPexist=Une demande de congé a déjà été faite pour cette périod
groups=Groupes groups=Groupes
users=Utilisateurs users=Utilisateurs
AutoSendMail=Envoi automatique d'email AutoSendMail=Envoi automatique d'email
NewHolidayForGroup=Nouvelle demande de congé collectif NewHolidayForGroup=Demande de congé collectif
SendRequestCollectiveCP=Envoyer la demande de congé collectif SendRequestCollectiveCP=Envoyer la demande de congé collectif
AutoValidationOnCreate=Validation automatique AutoValidationOnCreate=Validation automatique
FirstDayOfHoliday=Premier jour de congés FirstDayOfHoliday=Premier jour de congés

View File

@ -1744,6 +1744,8 @@ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-select
.hideonsmartphone { display: none; } .hideonsmartphone { display: none; }
.hideonsmartphoneimp { display: none !important; } .hideonsmartphoneimp { display: none !important; }
.margintoponsmartphone { margin-top: 6px; }
span.pictotitle { span.pictotitle {
margin-<?php echo $left; ?>: 0 !important; margin-<?php echo $left; ?>: 0 !important;
} }

View File

@ -1968,6 +1968,8 @@ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-select
.hideonsmartphone { display: none; } .hideonsmartphone { display: none; }
.hideonsmartphoneimp { display: none !important; } .hideonsmartphoneimp { display: none !important; }
.margintoponsmartphone { margin-top: 6px; }
select.minwidth100imp, select.minwidth100, select.minwidth200, select.minwidth200imp, select.minwidth300 { select.minwidth100imp, select.minwidth100, select.minwidth200, select.minwidth200imp, select.minwidth300 {
width: calc(100% - 40px) !important; width: calc(100% - 40px) !important;
display: inline-block; display: inline-block;