diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 8f73678a532..0c7fb86a02d 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -68,7 +68,7 @@ function user_prepare_head($object) if ($canreadperms) { $head[$h][0] = DOL_URL_ROOT.'/user/perms.php?id='.$object->id; - $head[$h][1] = $langs->trans("UserRights"). ' '.($object->nb_rights).''; + $head[$h][1] = $langs->trans("Rights"). ' '.($object->nb_rights).''; $head[$h][2] = 'rights'; $h++; } diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php index 087828b6cc4..f068247248a 100644 --- a/htdocs/core/modules/modExpenseReport.class.php +++ b/htdocs/core/modules/modExpenseReport.class.php @@ -102,7 +102,7 @@ class modExpenseReport extends DolibarrModules $r++; // Array to add new pages in new tabs - $this->tabs = array(); + $this->tabs = array('user:+expensereport:ExpenseReport:expensereport:$user->rights->expensereport->lire:/expensereport/list.php?mainmenu=hrm&id=__ID__'); // Boxes $this->boxes = array(); // List of boxes diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index 5f0e2f863d1..6ad9f0d80d8 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; $langs->load("companies"); $langs->load("users"); @@ -62,6 +63,7 @@ $pagenext = $page + 1; if (!$sortorder) $sortorder="DESC"; if (!$sortfield) $sortfield="d.date_debut"; +$id = GETPOST('id', 'int'); $sall = GETPOST('sall', 'alphanohtml'); $search_ref = GETPOST('search_ref'); @@ -181,12 +183,26 @@ $form = new Form($db); $formother = new FormOther($db); $formfile = new FormFile($db); +$fuser = new User($db); + $title = $langs->trans("ListOfTrips"); llxHeader('', $title); $max_year = 5; $min_year = 5; +// Récupération de l'ID de l'utilisateur +$user_id = $user->id; + +if ($id > 0) +{ + // Charge utilisateur edite + $fuser->fetch($id, '', '', 1); + $fuser->getrights(); + $user_id = $fuser->id; + + $search_user = $user_id; +} $sql = "SELECT d.rowid, d.ref, d.fk_user_author, d.total_ht, d.total_tva, d.total_ttc, d.fk_statut as status,"; $sql.= " d.date_debut, d.date_fin, d.date_create, d.tms as date_modif, d.date_valid, d.date_approve, d.note_private, d.note_public,"; @@ -327,9 +343,50 @@ if ($resql) print ''; print ''; print ''; + if ($id > 0) print ''; - $title = $langs->trans("ListTripsAndExpenses"); - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic.png', 0, '', '', $limit); + if ($id > 0) // For user tab + { + $title = $langs->trans("User"); + $linkback = ''.$langs->trans("BackToList").''; + $head = user_prepare_head($fuser); + + dol_fiche_head($head, 'expensereport', $title, -1, 'user'); + + dol_banner_tab($fuser,'id',$linkback,$user->rights->user->user->lire || $user->admin); + + print '
'; + + print '
'; + + /*if (empty($conf->global->HOLIDAY_HIDE_BALANCE)) + { + print '
'; + + print '
'; + + showMyBalance($holiday, $user_id); + }*/ + + dol_fiche_end(); + + print '
'; + + $canedit=(($user->id == $user_id && $user->rights->expensereport->creer) || ($user->id != $user_id)); + + // Boutons d'actions + if ($canedit) + { + print ''.$langs->trans("AddTrip").''; + } + + print '
'; + } + else + { + $title = $langs->trans("ListTripsAndExpenses"); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic.png', 0, '', '', $limit); + } if ($massaction == 'presend') { @@ -743,22 +800,24 @@ if ($resql) print ''."\n"; - - if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) + if (empty($id)) { - // Show list of available documents - $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; - $urlsource.=str_replace('&','&',$param); + if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) + { + // Show list of available documents + $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; + $urlsource.=str_replace('&','&',$param); - $filedir=$diroutputmassaction; - $genallowed=$user->rights->expensereport->lire; - $delallowed=$user->rights->expensereport->creer; + $filedir=$diroutputmassaction; + $genallowed=$user->rights->expensereport->lire; + $delallowed=$user->rights->expensereport->creer; - print $formfile->showdocuments('massfilesarea_expensereport','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,''); - } - else - { - print '
'.$langs->trans("ShowTempMassFilesArea").''; + print $formfile->showdocuments('massfilesarea_expensereport','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,''); + } + else + { + print '
'.$langs->trans("ShowTempMassFilesArea").''; + } } } else diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index f25dcb9e227..efe1c87820e 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -259,6 +259,8 @@ if ($id > 0) $fuser->fetch($id, '', '', 1); $fuser->getrights(); $user_id = $fuser->id; + + $search_employee = $user_id; } // Récupération des congés payés de l'utilisateur ou de tous les users diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 82cc7ca3874..b748f44a124 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1038,11 +1038,11 @@ td.showDragHandle { height: calc(100% - 50px);*/ } -global->THEME_TOPMENU_STICKY_POSITION)) { ?> +global->THEME_DISABLE_STICKY_TOPMENU)) { ?> .side-nav-vert { position: sticky; top: 0px; - z-index: 90; + z-index: 210; } @@ -4875,10 +4875,12 @@ div.tabsElem a.tab { } div.login_block { browser->layout == 'phone' && ((GETPOST('testmenuhider','int') || ! empty($conf->global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))) { ?> + /* Style when phone layout or when using the menuhider */ display: none; padding-top: 20px; padding-left: 20px; padding-right: 20px; + padding-bottom: 16px; padding-top: 10px; padding-left: 5px; diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 420b6d233f2..6677e240a04 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -288,16 +288,16 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco { print '
'.$langs->trans("RIBControlError").'
'; } - + print '
'; - + // Nbre max d'elements des petites listes $MAXLIST=$conf->global->MAIN_SIZE_SHORTLIST_LIMIT; - + /* * Last salaries */ - if (! empty($conf->salaries->enabled) && + if (! empty($conf->salaries->enabled) && ($user->rights->salaries->read || ($user->rights->salaries->read && $object->id == $user->id)) ) { @@ -334,7 +334,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco print ''; $salary->id = $objp->rowid; $salary->ref = $objp->rowid; - + print $salary->getNomUrl(1); print ''.dol_print_date($db->jdate($objp->datesp),'day')."\n"; print ''.dol_print_date($db->jdate($objp->dateep),'day')."\n"; @@ -350,11 +350,11 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco dol_print_error($db); } } - + /* * Last holidays */ - if (! empty($conf->holiday->enabled) && + if (! empty($conf->holiday->enabled) && ($user->rights->holiday->read_all || ($user->rights->holiday->read && $object->id == $user->id)) ) { @@ -393,7 +393,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco $holiday->ref = $objp->rowid; $holiday->fk_type = $objp->fk_type; $nbopenedday=num_open_day($db->jdate($objp->date_debut), $db->jdate($objp->date_fin), 0, 1, $objp->halfday); - + print $holiday->getNomUrl(1); print ''.dol_print_date($db->jdate($objp->date_debut),'day')."\n"; print ''.$nbopenedday.' '.$langs->trans('DurationDays').''; @@ -413,7 +413,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco /* * Last expense report */ - if (! empty($conf->expensereport->enabled) && + if (! empty($conf->expensereport->enabled) && ($user->rights->expensereport->readall || ($user->rights->expensereport->lire && $object->id == $user->id)) ) { @@ -436,7 +436,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco print ''; print ''; - print '
'; + print ''; print ''; } @@ -451,7 +451,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco $exp->id = $objp->rowid; $exp->ref = $objp->ref; $exp->fk_type = $objp->fk_type; - + print $exp->getNomUrl(1); print '\n"; print '';
'.$langs->trans("LastExpenseReports",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllExpenseReports").' '.$num.''; print '
'.$langs->trans("LastExpenseReports",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllExpenseReports").' '.$num.'
'.dol_print_date($db->jdate($objp->date_debut),'day')."'.price($objp->total_ttc).'