forked from Wavyzz/dolibarr
New banner tab is available on all tab of user object
This commit is contained in:
@@ -218,26 +218,13 @@ if ($id > 0)
|
||||
$title = $langs->trans("User");
|
||||
dol_fiche_head($head, 'paidholidays', $title, 0, 'user');
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
dol_banner_tab($fuser,'id','',$user->rights->user->user->lire || $user->admin);
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td>';
|
||||
print '<td colspan="2">';
|
||||
print $form->showrefnav($fuser,'id','',$user->rights->user->user->lire || $user->admin);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// LastName
|
||||
print '<tr><td width="25%">'.$langs->trans("LastName").'</td>';
|
||||
print '<td colspan="2">'.$fuser->lastname.'</td>';
|
||||
print "</tr>\n";
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
// FirstName
|
||||
print '<tr><td width="25%">'.$langs->trans("FirstName").'</td>';
|
||||
print '<td colspan="2">'.$fuser->firstname.'</td>';
|
||||
print "</tr>\n";
|
||||
print '<br>';
|
||||
|
||||
print '</table><br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -489,6 +489,7 @@ div.confirmmessage {
|
||||
.maxwidth100 { max-width: 100px; }
|
||||
.maxwidth200 { max-width: 200px; }
|
||||
.maxwidth300 { max-width: 300px; }
|
||||
.titlefield { width: 25% }
|
||||
<?php if (! empty($dol_optimize_smallscreen)) { ?>
|
||||
.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; }
|
||||
<?php } ?>
|
||||
.linkobject { cursor: pointer; }
|
||||
<?php if (GETPOST("optioncss") == 'print') { ?>
|
||||
|
||||
@@ -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 '<form name="extsitesconfig" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||
|
||||
$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 '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print $langs->trans("AgendaExtSitesDesc")."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
@@ -177,15 +183,15 @@ while ($i <= $MAXAGENDA)
|
||||
// Nb
|
||||
print '<td width="180" class="nowrap">'.$langs->trans("AgendaExtNb",$key)."</td>";
|
||||
// Name
|
||||
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME_'.$id.'_'.$key.'" value="'. (GETPOST('AGENDA_EXT_NAME_'.$id.'_'.$key)?GETPOST('AGENDA_EXT_NAME_'.$id.'_'.$key):$fuser->conf->$name) . '" size="28"></td>';
|
||||
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME_'.$id.'_'.$key.'" value="'. (GETPOST('AGENDA_EXT_NAME_'.$id.'_'.$key)?GETPOST('AGENDA_EXT_NAME_'.$id.'_'.$key):$object->conf->$name) . '" size="28"></td>';
|
||||
// URL
|
||||
print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC_'.$id.'_'.$key.'" value="'. (GETPOST('AGENDA_EXT_SRC_'.$id.'_'.$key)?GETPOST('AGENDA_EXT_SRC_'.$id.'_'.$key):$fuser->conf->$src) . '" size="60"></td>';
|
||||
print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC_'.$id.'_'.$key.'" value="'. (GETPOST('AGENDA_EXT_SRC_'.$id.'_'.$key)?GETPOST('AGENDA_EXT_SRC_'.$id.'_'.$key):$object->conf->$src) . '" size="60"></td>';
|
||||
// Offset TZ
|
||||
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key.'" value="'. (GETPOST('AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key)?GETPOST('AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key):$fuser->conf->$offsettz) . '" size="2"></td>';
|
||||
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key.'" value="'. (GETPOST('AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key)?GETPOST('AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key):$object->conf->$offsettz) . '" size="2"></td>';
|
||||
// Color (Possible colors are limited by Google)
|
||||
print '<td class="nowrap" align="right">';
|
||||
//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 '</td>';
|
||||
print "</tr>";
|
||||
$i++;
|
||||
@@ -193,6 +199,7 @@ while ($i <= $MAXAGENDA)
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
|
||||
@@ -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 '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border tableforfield" width="100%">';
|
||||
|
||||
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 '<tr><td>'.$langs->trans("PostOrFunction").'</td>';
|
||||
print '<td>'.$object->job.'</td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
// Gender
|
||||
print '<tr><td>'.$langs->trans("Gender").'</td>';
|
||||
print '<td>';
|
||||
if ($object->gender) print $langs->trans("Gender".$object->gender);
|
||||
print '</td></tr>';
|
||||
|
||||
// Login
|
||||
print '<tr><td>'.$langs->trans("Login").'</td>';
|
||||
if (! empty($object->ldap_sid) && $object->statut==0)
|
||||
@@ -1266,13 +1245,24 @@ else
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
||||
// Position/Job
|
||||
print '<tr><td>'.$langs->trans("PostOrFunction").'</td>';
|
||||
print '<td>'.$object->job.'</td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
// Gender
|
||||
print '<tr><td>'.$langs->trans("Gender").'</td>';
|
||||
print '<td>';
|
||||
if ($object->gender) print $langs->trans("Gender".$object->gender);
|
||||
print '</td></tr>';
|
||||
|
||||
// API key
|
||||
if(! empty($conf->api->enabled) && $user->admin) {
|
||||
print '<tr><td>'.$langs->trans("ApiKey").'</td>';
|
||||
print '<td>';
|
||||
if (! empty($object->api_key))
|
||||
print $langs->trans("Hidden");
|
||||
print '<td>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Administrator
|
||||
@@ -1319,7 +1309,7 @@ else
|
||||
}
|
||||
|
||||
// Signature
|
||||
print '<tr><td class="tdtop">'.$langs->trans('Signature').'</td><td colspan="2">';
|
||||
print '<tr><td class="tdtop">'.$langs->trans('Signature').'</td><td>';
|
||||
print dol_htmlentitiesbr($object->signature);
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
@@ -121,6 +121,9 @@ 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 '<div class="underbanner clearboth"></div>';
|
||||
|
||||
// Construit liste des fichiers
|
||||
$filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
|
||||
@@ -133,20 +136,6 @@ if ($object->id)
|
||||
|
||||
print '<table class="border"width="100%">';
|
||||
|
||||
// Reference
|
||||
print '<tr><td width="20%">'.$langs->trans('Ref').'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Lastname
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur" colspan="3">'.$object->lastname.' </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Firstname
|
||||
print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur" colspan="3">'.$object->firstname.' </td></tr>';
|
||||
|
||||
// Login
|
||||
print '<tr><td>'.$langs->trans("Login").'</td><td class="valeur" colspan="3">'.$object->login.' </td></tr>';
|
||||
|
||||
|
||||
@@ -87,33 +87,21 @@ if ($id)
|
||||
$title = $langs->trans("User");
|
||||
dol_fiche_head($head, 'note', $title, 0, 'user');
|
||||
|
||||
if ($msg) print '<div class="error">'.$msg.'</div>';
|
||||
dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin);
|
||||
|
||||
print "<form method=\"post\" action=\"".$_SERVER['PHP_SELF']."\">";
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print "<form method=\"post\" action=\"".$_SERVER['PHP_SELF']."\">";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Reference
|
||||
print '<tr><td width="20%">'.$langs->trans('Ref').'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Lastname
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur" colspan="3">'.$object->lastname.' </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Firstname
|
||||
print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur" colspan="3">'.$object->firstname.' </td></tr>';
|
||||
|
||||
// Login
|
||||
print '<tr><td>'.$langs->trans("Login").'</td><td class="valeur" colspan="3">'.$object->login.' </td></tr>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Login").'</td><td class="valeur">'.$object->login.' </td></tr>';
|
||||
|
||||
// Note
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Note").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print '<td>';
|
||||
if ($action == 'edit' && $user->rights->user->user->creer)
|
||||
{
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
|
||||
|
||||
@@ -136,33 +136,18 @@ if ($action == 'edit')
|
||||
}
|
||||
|
||||
|
||||
dol_fiche_head($head, 'guisetup', $title, 0, 'user');
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td>';
|
||||
print '<td colspan="2">';
|
||||
print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// LastName
|
||||
print '<tr><td width="25%">'.$langs->trans("LastName").'</td>';
|
||||
print '<td colspan="2">'.$object->lastname.'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// FirstName
|
||||
print '<tr><td width="25%">'.$langs->trans("FirstName").'</td>';
|
||||
print '<td colspan="2">'.$object->firstname.'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '</table><br>';
|
||||
|
||||
|
||||
if ($action == 'edit')
|
||||
{
|
||||
dol_fiche_head($head, 'guisetup', $title, 0, 'user');
|
||||
|
||||
dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin);
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{/*
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
@@ -250,11 +235,18 @@ if ($action == 'edit')
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_fiche_head($head, 'guisetup', $title, 0, 'user');
|
||||
|
||||
dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin);
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
$var=true;
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
@@ -310,7 +302,10 @@ else
|
||||
|
||||
}
|
||||
|
||||
dol_fiche_end();
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -251,28 +251,13 @@ else
|
||||
|
||||
/*
|
||||
* Ecran ajout/suppression permission
|
||||
*/
|
||||
*/
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td>';
|
||||
print '<td>';
|
||||
print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin);
|
||||
print '</td>';
|
||||
print '</tr>'."\n";
|
||||
dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin);
|
||||
|
||||
// Lastname
|
||||
print '<tr><td width="25%">'.$langs->trans("Lastname").'</td>';
|
||||
print '<td>'.$object->lastname.'</td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
// Firstname
|
||||
print '<tr><td width="25%">'.$langs->trans("Firstname").'</td>';
|
||||
print '<td>'.$object->firstname.'</td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
print '</table><br>';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
if ($user->admin) print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules"));
|
||||
// Show warning about external users
|
||||
@@ -423,6 +408,7 @@ if ($result)
|
||||
else dol_print_error($db);
|
||||
print '</table>';
|
||||
|
||||
|
||||
// For multicompany transversal mode
|
||||
// TODO Place a hook here
|
||||
if (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode))
|
||||
|
||||
Reference in New Issue
Block a user