From b24d609ecceddca2bf942378698aef5ecda59ae1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Oct 2015 16:12:12 +0200 Subject: [PATCH] New banner tab is available on all tab of user object --- htdocs/holiday/list.php | 27 +++++------------ htdocs/theme/eldy/style.css.php | 2 ++ htdocs/user/agenda_extsites.php | 25 ++++++++++------ htdocs/user/card.php | 36 +++++++++-------------- htdocs/user/document.php | 21 ++++---------- htdocs/user/note.php | 26 +++++------------ htdocs/user/param_ihm.php | 51 +++++++++++++++------------------ htdocs/user/perms.php | 22 +++----------- 8 files changed, 77 insertions(+), 133 deletions(-) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index ee4465a4aee..419fabf9087 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -218,26 +218,13 @@ if ($id > 0) $title = $langs->trans("User"); dol_fiche_head($head, 'paidholidays', $title, 0, 'user'); - print ''; - - // Ref - print ''; - print ''; - print ''; - - // LastName - print ''; - print ''; - print "\n"; - - // FirstName - print ''; - print ''; - print "\n"; - - print '
'.$langs->trans("Ref").''; - print $form->showrefnav($fuser,'id','',$user->rights->user->user->lire || $user->admin); - print '
'.$langs->trans("LastName").''.$fuser->lastname.'
'.$langs->trans("FirstName").''.$fuser->firstname.'

'; + dol_banner_tab($fuser,'id','',$user->rights->user->user->lire || $user->admin); + + + print '
'; + + print '
'; + } else { diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 5457a6690df..425cb84bdb9 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -489,6 +489,7 @@ div.confirmmessage { .maxwidth100 { max-width: 100px; } .maxwidth200 { max-width: 200px; } .maxwidth300 { max-width: 300px; } +.titlefield { width: 25% } .hideonsmartphone { display: none; } .noenlargeonsmartphone { width : 50px !important; display: inline !important; } @@ -496,6 +497,7 @@ div.confirmmessage { .maxwidth100onsmartphone { max-width: 100px; } .maxwidth200onsmartphone { max-width: 200px; } .maxwidth300onsmartphone { max-width: 300px; } +.titlefield { width: auto; } .linkobject { cursor: pointer; } diff --git a/htdocs/user/agenda_extsites.php b/htdocs/user/agenda_extsites.php index cd38d7a2965..ea8c1978677 100644 --- a/htdocs/user/agenda_extsites.php +++ b/htdocs/user/agenda_extsites.php @@ -49,8 +49,8 @@ $colorlist=array('BECEDD','DDBECE','BFDDBE','F598B4','F68654','CBF654','A4A4A5') // Security check $id = GETPOST('id','int'); -$fuser = new User($db); -$fuser->fetch($id); +$object = new User($db); +$object->fetch($id); // Security check $socid=0; @@ -63,7 +63,7 @@ if ($user->id == $id) // A user can always read its own card $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); // If user is not user that read and no permission to read other users, we stop -if (($fuser->id != $user->id) && (! $user->rights->user->user->lire)) +if (($object->id != $user->id) && (! $user->rights->user->user->lire)) accessforbidden(); @@ -108,7 +108,7 @@ if ($actionsave) if (! $error) { - $result=dol_set_user_param($db, $conf, $fuser, $tabparam); + $result=dol_set_user_param($db, $conf, $object, $tabparam); if (! $result > 0) $error++; } @@ -141,10 +141,16 @@ llxHeader('',$langs->trans("UserSetup"),'','',0,0,$arrayofjs,$arrayofcss); print '
'; print ''; -$head=user_prepare_head($fuser); +$head=user_prepare_head($object); dol_fiche_head($head, 'extsites', $langs->trans("User"), 0, 'user'); +dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin); + +print '
'; + +print '
'; + print $langs->trans("AgendaExtSitesDesc")."
\n"; print "
\n"; @@ -177,15 +183,15 @@ while ($i <= $MAXAGENDA) // Nb print ''.$langs->trans("AgendaExtNb",$key).""; // Name - print ''; + print ''; // URL - print ''; + print ''; // Offset TZ - print ''; + print ''; // Color (Possible colors are limited by Google) print ''; //print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist); - print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR_".$id.'_'.$key)?GETPOST("AGENDA_EXT_COLOR_".$id.'_'.$key):$fuser->conf->$color), "AGENDA_EXT_COLOR_".$id.'_'.$key, 'extsitesconfig', 1, '', 'hideifnotset'); + print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR_".$id.'_'.$key)?GETPOST("AGENDA_EXT_COLOR_".$id.'_'.$key):$object->conf->$color), "AGENDA_EXT_COLOR_".$id.'_'.$key, 'extsitesconfig', 1, '', 'hideifnotset'); print ''; print ""; $i++; @@ -193,6 +199,7 @@ while ($i <= $MAXAGENDA) print ''; + dol_fiche_end(); print '
'; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 35f504c334f..25167d1fd94 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1190,9 +1190,6 @@ else { dol_fiche_head($head, 'user', $title, 0, 'user'); - $rowspan=19; - - dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin); @@ -1202,24 +1199,6 @@ else print '
'; print ''; - if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER)) $rowspan++; - if (! empty($conf->societe->enabled)) $rowspan++; - if (! empty($conf->adherent->enabled)) $rowspan++; - if (! empty($conf->skype->enabled)) $rowspan++; - if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) $rowspan = $rowspan+3; - if (! empty($conf->agenda->enabled)) $rowspan++; - - // Position/Job - print ''; - print ''; - print ''."\n"; - - // Gender - print ''; - print ''; - // Login print ''; if (! empty($object->ldap_sid) && $object->statut==0) @@ -1266,13 +1245,24 @@ else } print ''."\n"; + // Position/Job + print ''; + print ''; + print ''."\n"; + + // Gender + print ''; + print ''; + // API key if(! empty($conf->api->enabled) && $user->admin) { print ''; print ''; } // Administrator @@ -1319,7 +1309,7 @@ else } // Signature - print '\n"; diff --git a/htdocs/user/document.php b/htdocs/user/document.php index 25dea7eb398..46ceb72330c 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2010 Juanjo Menent * Copyright (C) 2013 Cédric Salvador @@ -121,7 +121,10 @@ if ($object->id) dol_fiche_head($head, 'document', $langs->trans("User"),0,'user'); - + dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin); + + print '
'; + // Construit liste des fichiers $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); $totalsize=0; @@ -133,20 +136,6 @@ if ($object->id) print '
'.$langs->trans("PostOrFunction").''.$object->job.'
'.$langs->trans("Gender").''; - if ($object->gender) print $langs->trans("Gender".$object->gender); - print '
'.$langs->trans("Login").'
'.$langs->trans("PostOrFunction").''.$object->job.'
'.$langs->trans("Gender").''; + if ($object->gender) print $langs->trans("Gender".$object->gender); + print '
'.$langs->trans("ApiKey").''; if (! empty($object->api_key)) print $langs->trans("Hidden"); - print ''; + print '
'.$langs->trans('Signature').''; + print '
'.$langs->trans('Signature').''; print dol_htmlentitiesbr($object->signature); print "
'; - // Reference - print ''; - print ''; - print ''; - - // Lastname - print ''; - print ''; - - // Firstname - print ''; - // Login print ''; diff --git a/htdocs/user/note.php b/htdocs/user/note.php index 7fe5766cd3a..3aec8502ac1 100644 --- a/htdocs/user/note.php +++ b/htdocs/user/note.php @@ -87,33 +87,21 @@ if ($id) $title = $langs->trans("User"); dol_fiche_head($head, 'note', $title, 0, 'user'); - if ($msg) print '
'.$msg.'
'; - - print ""; + dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin); + + print '
'; + + print ""; print ''; print '
'.$langs->trans('Ref').''; - print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin); - print '
'.$langs->trans("Lastname").''.$object->lastname.' 
'.$langs->trans("Firstname").''.$object->firstname.' 
'.$langs->trans("Login").''.$object->login.' 
'; - // Reference - print ''; - print ''; - print ''; - - // Lastname - print ''; - print ''; - - // Firstname - print ''; - // Login - print ''; + print ''; // Note print ''; - print '
'.$langs->trans('Ref').''; - print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin); - print '
'.$langs->trans("Lastname").''.$object->lastname.' 
'.$langs->trans("Firstname").''.$object->firstname.' 
'.$langs->trans("Login").''.$object->login.' 
'.$langs->trans("Login").''.$object->login.' 
'.$langs->trans("Note").''; + print ''; if ($action == 'edit' && $user->rights->user->user->creer) { print ""; diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 9e67a1015c7..ef803992d00 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -136,33 +136,18 @@ if ($action == 'edit') } -dol_fiche_head($head, 'guisetup', $title, 0, 'user'); - - -print ''; - -// Ref -print ''; -print ''; -print ''; - -// LastName -print ''; -print ''; -print "\n"; - -// FirstName -print ''; -print ''; -print "\n"; - -print '
'.$langs->trans("Ref").''; -print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin); -print '
'.$langs->trans("LastName").''.$object->lastname.'
'.$langs->trans("FirstName").''.$object->firstname.'

'; - - if ($action == 'edit') { + dol_fiche_head($head, 'guisetup', $title, 0, 'user'); + + dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin); + + + print '
'; + + print '
'; + + if (! empty($conf->use_javascript_ajax)) {/* print '