Work on finishing of style

This commit is contained in:
Laurent Destailleur 2015-05-31 01:06:51 +02:00
parent 7a0ec2d831
commit 5e773d4cb6
17 changed files with 126 additions and 113 deletions

View File

@ -70,7 +70,7 @@ $hookmanager->initHooks(array('admin'));
// Put here declaration of dictionaries properties
// Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this.
$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,0,6,0,10,23,12,13,0,14,0,7,17,0,22,20,18,21,0,15,0,24,0,25,0,26);
$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,0,6,0,10,23,12,13,0,14,0,7,17,24,0,22,20,18,21,0,15,0,25,0,26);
// Name of SQL tables of dictionaries
$tabname=array();
@ -832,7 +832,7 @@ if ($id)
$fieldlist=explode(',',$tabfield[$id]);
// Line for title
print '<tr class="liste_titre">';
print '<tr class="liste_titre nohover">';
foreach ($fieldlist as $field => $value)
{
// Determine le nom du champ par rapport aux noms possibles

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
@ -671,7 +671,7 @@ if ($action == 'create')
}
// Assigned to
print '<tr><td class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td>';
print '<tr><td class="tdtop nowrap">'.$langs->trans("ActionAffectedTo").'</td><td>';
$listofuserid=array();
if (empty($donotclearsession))
{
@ -727,7 +727,7 @@ if ($action == 'create')
print '</td></tr>';
print '<tr><td class="nowrap">'.$langs->trans("ActionOnContact").'</td><td>';
$form->select_contacts(GETPOST('socid','int'),GETPOST('contactid'),'contactid',1);
$form->select_contacts(GETPOST('socid','int'), GETPOST('contactid'), 'contactid', 1, '', '', 0, 'minwidth200');
print '</td></tr>';
@ -739,7 +739,7 @@ if ($action == 'create')
// Projet associe
$langs->load("projects");
print '<tr><td valign="top">'.$langs->trans("Project").'</td><td>';
print '<tr><td>'.$langs->trans("Project").'</td><td>';
$numproject=$formproject->select_projects((! empty($societe->id)?$societe->id:0),GETPOST("projectid")?GETPOST("projectid"):'','projectid');
if ($numproject==0)
@ -768,7 +768,7 @@ if ($action == 'create')
print '</td></tr>';
// Description
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor('note',(GETPOST('note')?GETPOST('note'):$object->note),'',180,'dolibarr_notes','In',true,true,$conf->fckeditor->enabled,ROWS_6,90);
$doleditor->Create();
@ -915,7 +915,7 @@ if ($id > 0)
}
// Assigned to
print '<tr><td class="nowrap">'.$langs->trans("ActionAssignedTo").'</td><td colspan="3">';
print '<tr><td class="tdtop nowrap">'.$langs->trans("ActionAssignedTo").'</td><td colspan="3">';
$listofuserid=array();
if (empty($donotclearsession))
{
@ -968,7 +968,7 @@ if ($id > 0)
// Contact
print '<td>'.$langs->trans("Contact").'</td><td width="30%">';
$form->select_contacts($object->socid, $object->contactid,'contactid',1);
$form->select_contacts($object->socid, $object->contactid, 'contactid', 1, '', '', 0, 'minwidth200');
print '</td></tr>';
}
@ -981,7 +981,7 @@ if ($id > 0)
// Projet associe
$langs->load("project");
print '<tr><td width="30%" valign="top">'.$langs->trans("Project").'</td><td colspan="3">';
print '<tr><td width="30%">'.$langs->trans("Project").'</td><td colspan="3">';
$numprojet=$formproject->select_projects($object->socid,$object->fk_project,'projectid');
if ($numprojet==0)
{
@ -1004,7 +1004,7 @@ if ($id > 0)
}
// Description
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td colspan="3">';
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td colspan="3">';
// Editeur wysiwyg
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor('note',$object->note,'',240,'dolibarr_notes','In',true,true,$conf->fckeditor->enabled,ROWS_5,90);
@ -1168,7 +1168,7 @@ if ($id > 0)
// Project
if (! empty($conf->projet->enabled))
{
print '<tr><td width="30%" valign="top">'.$langs->trans("Project").'</td><td colspan="3">';
print '<tr><td width="30%">'.$langs->trans("Project").'</td><td colspan="3">';
if ($object->fk_project)
{
$project=new Project($db);
@ -1192,7 +1192,7 @@ if ($id > 0)
}
// Description
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td colspan="3">';
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td colspan="3">';
print dol_htmlentitiesbr($object->note);
print '</td></tr>';

View File

@ -1451,7 +1451,7 @@ class Form
$out.='<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">';
$out.='<script type="text/javascript" language="javascript">jQuery(document).ready(function () { jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });})</script>';
$out.=$this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
$out.='<input type="submit" class="button" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
$out.=' <input type="submit" class="button" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
}
$assignedtouser=array();
if (!empty($_SESSION['assignedtouser']))
@ -4788,10 +4788,11 @@ class Form
* @param string $modulepart Key to define module concerned ('societe', 'userphoto', 'memberphoto')
* @param object $object Object containing data to retrieve file name
* @param int $width Width of photo
* @param int $height Height of photo (auto if 0)
* @param int $caneditfield Add edit fields
* @return string HTML code to output photo
*/
static function showphoto($modulepart,$object,$width=100,$caneditfield=0)
static function showphoto($modulepart,$object,$width=100,$height=0,$caneditfield=0)
{
global $conf,$langs;
@ -4834,13 +4835,13 @@ class Form
{
// TODO Link to large image
$ret.='<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
$ret.='<img alt="Photo" id="photologo'.(preg_replace('/[^a-z]/i','_',$file)).'" class="photologo" border="0"'.($width?' width="'.$width:'').'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
$ret.='<img alt="Photo" id="photologo'.(preg_replace('/[^a-z]/i','_',$file)).'" class="photologo" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
$ret.='</a>';
}
else if ($altfile && file_exists($dir."/".$altfile))
{
$ret.='<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
$ret.='<img alt="Photo alt" id="photologo'.(preg_replace('/[^a-z]/i','_',$file)).'" class="photologo" border="0"'.($width?' width="'.$width:'').'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($altfile).'&cache='.$cache.'">';
$ret.='<img alt="Photo alt" id="photologo'.(preg_replace('/[^a-z]/i','_',$file)).'" class="photologo" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($altfile).'&cache='.$cache.'">';
$ret.='</a>';
}
else
@ -4857,11 +4858,11 @@ class Form
{
global $dolibarr_main_url_root;
$ret.='<!-- Put link to gravatar -->';
$ret.='<img class="photo'.$modulepart.'" alt="Photo found on Gravatar" title="Photo Gravatar.com - email '.$email.'" border="0"'.($width?' width="'.$width:'').'" src="http://www.gravatar.com/avatar/'.dol_hash($email,3).'?s='.$width.'&d='.urlencode(dol_buildpath($nophoto,2)).'">'; // gravatar need md5 hash
$ret.='<img class="photo'.$modulepart.'" alt="Photo found on Gravatar" title="Photo Gravatar.com - email '.$email.'" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="http://www.gravatar.com/avatar/'.dol_hash($email,3).'?s='.$width.'&d='.urlencode(dol_buildpath($nophoto,2)).'">'; // gravatar need md5 hash
}
else
{
$ret.='<img class="photo'.$modulepart.'" alt="No photo" border="0"'.($width?' width="'.$width:'').'" src="'.DOL_URL_ROOT.$nophoto.'">';
$ret.='<img class="photo'.$modulepart.'" alt="No photo" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.DOL_URL_ROOT.$nophoto.'">';
}
}

View File

@ -78,12 +78,15 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
$search_statut="";
}
/*
* Actions
*/
// None
/*
* View
*/
@ -219,19 +222,19 @@ if ($id > 0)
print '<table class="border" width="100%">';
// Ref
print '<tr><td width="25%" valign="top">'.$langs->trans("Ref").'</td>';
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%" valign="top">'.$langs->trans("LastName").'</td>';
print '<tr><td width="25%">'.$langs->trans("LastName").'</td>';
print '<td colspan="2">'.$fuser->lastname.'</td>';
print "</tr>\n";
// FirstName
print '<tr><td width="25%" valign="top">'.$langs->trans("FirstName").'</td>';
print '<tr><td width="25%">'.$langs->trans("FirstName").'</td>';
print '<td colspan="2">'.$fuser->firstname.'</td>';
print "</tr>\n";
@ -250,14 +253,10 @@ $nbdeduced=$holiday->getConfCP('nbHolidayDeducted');
$nb_holiday = $nbaquis / $nbdeduced;
print $langs->trans('SoldeCPUser',round($nb_holiday,2)).($nbdeduced != 1 ? ' ('.$nbaquis.' / '.$nbdeduced.')' : '');
if ($id > 0)
{
dol_fiche_end();
print '</br>';
}
else {
dol_fiche_end();
}
dol_fiche_end();
if ($id > 0) print '</br>';
print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">'."\n";
print '<table class="noborder" width="100%;">';
@ -387,7 +386,7 @@ if (! empty($holiday->holiday))
if($holiday_payes == '2')
{
print '<tr>';
print '<td colspan="9" class="pair" style="text-align: center; padding: 5px;">'.$langs->trans('None').'</td>';
print '<td colspan="9" '.$bc[false].'">'.$langs->trans('None').'</td>';
print '</tr>';
}

View File

@ -1439,7 +1439,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
// User photo
$toprightmenu.='<div class="inline-block nowrap"><div class="inline-block login_block_elem" style="padding: 0px;">';
$toprightmenu.=$user->getPhotoUrl();
$toprightmenu.=$user->getPhotoUrl(16,16);
$toprightmenu.='</div></div>';
$toprightmenu.='<div class="inline-block nowrap"><div class="inline-block login_block_elem" style="padding: 0px;">';

View File

@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/resource/class/html.formresource.class.php';
$langs->load("resource");
$langs->load("companies");
$langs->load("other");
$langs->load("resource@resource");
$langs->load("resource");
// Get parameters
$id = GETPOST('id','int');
@ -65,25 +65,25 @@ if ($action == 'confirm_add_resource')
if (! $cancel)
{
$error='';
$ref=GETPOST('ref','alpha');
$description=GETPOST('description','alpha');
$fk_code_type_resource=GETPOST('fk_code_type_resource','alpha');
if (empty($ref))
{
$mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref"));
setEventMessage($mesg, 'errors');
$error++;
}
if (! $error)
{
$object=new Resource($db);
$object->ref=$ref;
$object->description=$description;
$object->fk_code_type_resource=$fk_code_type_resource;
$result=$object->create($user);
if ($result > 0)
{
@ -119,11 +119,11 @@ if ($action == 'confirm_add_resource')
$form=new Form($db);
$formresource = new FormResource($db);
if (! $action)
if (! $action)
{
$pagetitle=$langs->trans('AddResource');
llxHeader('',$pagetitle,'');
print_fiche_titre($pagetitle,'','resource.png@resource');
print_fiche_titre($pagetitle,'','title_generic');
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" name="add_resource">';
print '<input type="hidden" name="action" value="confirm_add_resource" />';
@ -135,15 +135,14 @@ if (! $action)
// Ref / label
$field = 'ref';
print '<tr>';
print '<td>';
print '<label for="'.$field.'" class="fieldrequired">';
print '<td class="fieldrequired">';
print $langs->trans('ResourceFormLabel_'.$field);
print '</td>';
print '<td>';
print '<input type="text" name="'.$field.'" value="'.$$field.'" />';
print '</td>';
print '</tr>';
// Type
print '<tr><td width="20%">'.$langs->trans("ResourceType").'</td>';
print '<td>';
@ -153,10 +152,8 @@ if (! $action)
// Description
$field = 'description';
print '<tr>';
print '<td>';
print '<label for="'.$field.'">';
print '<td class="tdtop">';
print $langs->trans('ResourceFormLabel_'.$field);
print '</label>';
print '</td>';
print '<td>';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';

View File

@ -68,7 +68,7 @@ if (empty($reshook))
* ACTIONS
********************************************************************/
if ($action == 'update' && ! $_POST["cancel"] && $user->rights->resource->write )
if ($action == 'update' && ! $_POST["cancel"] && $user->rights->resource->write)
{
$error=0;
@ -113,6 +113,7 @@ if (empty($reshook))
}
}
/***************************************************
* VIEW
*
@ -127,12 +128,10 @@ $formresource = new FormResource($db);
if ( $object->fetch($id) > 0 )
{
$head=resourcePrepareHead($object);
dol_fiche_head($head, 'resource', $langs->trans("ResourceSingular"),0,'resource@resource');
if ($action == 'edit' )
{
if ( ! $user->rights->resource->write )
accessforbidden('',0);
@ -144,10 +143,12 @@ if ( $object->fetch($id) > 0 )
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
dol_fiche_head($head, 'resource', $langs->trans("ResourceSingular"),0,'resource@resource');
print '<table class="border" width="100%">';
// Ref
print '<tr><td width="20%">'.$langs->trans("ResourceFormLabel_ref").'</td>';
print '<tr><td width="20%" class="fieldrequired">'.$langs->trans("ResourceFormLabel_ref").'</td>';
print '<td><input size="12" name="ref" value="'.(GETPOST('ref') ? GETPOST('ref') : $object->ref).'"></td></tr>';
// Type
@ -162,20 +163,28 @@ if ( $object->fetch($id) > 0 )
print '<textarea name="description" cols="80" rows="'.ROWS_3.'">'.($_POST['description'] ? GETPOST('description','alpha') : $object->description).'</textarea>';
print '</td></tr>';
print '<tr><td align="center" colspan="2">';
print '</table>';
dol_fiche_end();
print '<div class="center">';
print '<input name="update" class="button" type="submit" value="'.$langs->trans("Modify").'"> &nbsp; ';
print '<input type="submit" class="button" name="cancel" Value="'.$langs->trans("Cancel").'"></td></tr>';
print '</table>';
print '</div>';
print '</form>';
}
else
{
// Confirm deleting resource line
dol_fiche_head($head, 'resource', $langs->trans("ResourceSingular"),0,'resource@resource');
// Confirm deleting resource line
if ($action == 'delete')
{
print $form->formconfirm("card.php?&id=".$id,$langs->trans("DeleteResource"),$langs->trans("ConfirmDeleteResource"),"confirm_delete_resource",'','',1);
}
/*---------------------------------------
* View object
*/
@ -210,7 +219,7 @@ if ( $object->fetch($id) > 0 )
/*
* Boutons actions
*/
*/
print '<div class="tabsAction">';
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been

View File

@ -89,7 +89,7 @@ llxHeader('',$pagetitle,'');
$form=new Form($db);
print_fiche_titre($pagetitle,'','resource.png@resource');
print_fiche_titre($pagetitle,'','title_generic');
// Confirmation suppression resource line
if ($action == 'delete_resource')
@ -108,7 +108,7 @@ if(!$ret) {
}
else
{
$var=false;
$var=true;
print '<table class="noborder" width="100%">'."\n";
print '<tr class="liste_titre">';
@ -139,7 +139,7 @@ else
print '</td>';
print '<td align="center">';
print '<a href="./card.php?action=update&id='.$resource->id.'">';
print '<a href="./card.php?action=edit&id='.$resource->id.'">';
print img_edit();
print '</a>';
print '&nbsp;';

View File

@ -1011,7 +1011,7 @@ else
}
// Address
print '<tr><td valign="top"><label for="address">'.$langs->trans('Address').'</label></td>';
print '<tr><td class="tdtop"><label for="address">'.$langs->trans('Address').'</label></td>';
print '<td colspan="3"><textarea name="address" id="address" cols="80" rows="'._ROWS_2.'" wrap="soft">';
print $object->address;
print '</textarea></td></tr>';
@ -1503,7 +1503,7 @@ else
// Barcode
if (! empty($conf->barcode->enabled))
{
print '<tr><td valign="top"><label for="barcode">'.$langs->trans('Gencod').'</label></td>';
print '<tr><td class="tdtop"><label for="barcode">'.$langs->trans('Gencod').'</label></td>';
print '<td colspan="3"><input type="text" name="barcode" id="barcode" value="'.$object->barcode.'">';
print '</td></tr>';
}
@ -1514,8 +1514,8 @@ else
print '</td></tr>';
// Address
print '<tr><td valign="top"><label for="address">'.$langs->trans('Address').'</label></td>';
print '<td colspan="3"><textarea name="address" id="address" cols="40" rows="3" wrap="soft">';
print '<tr><td class="tdtop"><label for="address">'.$langs->trans('Address').'</label></td>';
print '<td colspan="3"><textarea name="address" id="address" cols="80" rows="3" wrap="soft">';
print $object->address;
print '</textarea></td></tr>';
@ -1799,7 +1799,7 @@ else
// Ref
/*
print '<tr><td width="25%" valign="top">'.$langs->trans("Ref").'</td>';
print '<tr><td width="25%">'.$langs->trans("Ref").'</td>';
print '<td colspan="2">';
print $fuser->id;
print '</td>';
@ -1885,14 +1885,14 @@ else
print '</tr>';
// Address
print "<tr><td valign=\"top\">".$langs->trans('Address').'</td><td colspan="'.(2+(($showlogo || $showbarcode)?0:1)).'">';
print '<tr><td class="tdtop">'.$langs->trans('Address').'</td><td colspan="'.(2+(($showlogo || $showbarcode)?0:1)).'">';
dol_print_address($object->address,'gmap','thirdparty',$object->id);
print "</td></tr>";
print '</td></tr>';
// Zip / Town
print '<tr><td width="25%">'.$langs->trans('Zip').' / '.$langs->trans("Town").'</td><td colspan="'.(2+(($showlogo || $showbarcode)?0:1)).'">';
print $object->zip.($object->zip && $object->town?" / ":"").$object->town;
print "</td>";
print '</td>';
print '</tr>';
// Country
@ -2202,7 +2202,7 @@ else
if (! empty($conf->adherent->enabled))
{
$langs->load("members");
print '<tr><td width="25%" valign="top">'.$langs->trans("LinkedToDolibarrMember").'</td>';
print '<tr><td width="25%" class="tdtop">'.$langs->trans("LinkedToDolibarrMember").'</td>';
print '<td colspan="3">';
$adh=new Adherent($db);
$result=$adh->fetch('','',$object->id);

View File

@ -1813,7 +1813,8 @@ div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border
}
div.tabBar .tdtop {
vertical-align: top;
padding-top: 6px;
padding-top: 5px;
padding-bottom: 0px;
}
table.border td, div.border div div.tagtd {

View File

@ -33,8 +33,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
if (!$user->admin) accessforbidden();
$langs->load("agenda");
$langs->load("admin");
$langs->load("other");
@ -54,6 +52,21 @@ $id = GETPOST('id','int');
$fuser = new User($db);
$fuser->fetch($id);
// Security check
$socid=0;
if ($user->societe_id > 0) $socid = $user->societe_id;
$feature2 = (($socid && $user->rights->user->self->creer)?'':'user');
if ($user->id == $id) // A user can always read its own card
{
$feature2='';
}
$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))
accessforbidden();
/*
* Actions

View File

@ -1740,7 +1740,7 @@ else
// Photo
print '<td align="center" valign="middle" width="25%" rowspan="'.$rowspan.'">';
print $form->showphoto('userphoto',$object,100,$caneditfield);
print $form->showphoto('userphoto',$object,100,0,$caneditfield);
print '</td>';
print '</tr>';

View File

@ -1781,26 +1781,19 @@ class User extends CommonObject
/**
* Return a link to the user card (with optionaly the picto)
* Use this->id,this->lastname, this->firstname
* Return a link with photo
* Use this->id,this->photo
*
* @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
* @param string $option On what the link point to
* @param integer $infologin Add connection info to the tooltip
* @param integer $notooltip 1=Disable tooltip
* @param int $maxlen Max length of visible user name
* @return string String with URL
* @param int $width Width of image
* @param int $height Height of image
* @return string String with URL link
*/
function getPhotoUrl($with=0)
function getPhotoUrl($width, $height)
{
global $form;
if (! is_object($form)) $form=new Form($this->db);
$result='';
$result.='<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$this->id.'">';
$result.=$form->showphoto('userphoto', $this, ($with?$with:16));
$result.=Form::showphoto('userphoto', $this, $width, $height);
$result.='</a>';
return $result;

View File

@ -44,7 +44,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 read and no permission to read other users, we stop
// 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))
accessforbidden();

View File

@ -112,8 +112,8 @@ if ($id)
print '<tr><td>'.$langs->trans("Login").'</td><td class="valeur" colspan="3">'.$fuser->login.'&nbsp;</td></tr>';
// Note
print '<tr><td valign="top">'.$langs->trans("Note").'</td>';
print '<td valign="top" colspan="3">';
print '<tr><td class="tdtop">'.$langs->trans("Note").'</td>';
print '<td colspan="3">';
if ($action == 'edit' && $user->rights->user->user->creer)
{
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
@ -159,6 +159,6 @@ if ($id)
print "</form>\n";
}
$db->close();
llxFooter();
$db->close();

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2005-2014 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro.com>
*
@ -131,19 +131,19 @@ dol_fiche_head($head, 'guisetup', $title, 0, 'user');
print '<table class="border" width="100%">';
// Ref
print '<tr><td width="25%" valign="top">'.$langs->trans("Ref").'</td>';
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%" valign="top">'.$langs->trans("LastName").'</td>';
print '<tr><td width="25%">'.$langs->trans("LastName").'</td>';
print '<td colspan="2">'.$fuser->lastname.'</td>';
print "</tr>\n";
// FirstName
print '<tr><td width="25%" valign="top">'.$langs->trans("FirstName").'</td>';
print '<tr><td width="25%">'.$langs->trans("FirstName").'</td>';
print '<td colspan="2">'.$fuser->firstname.'</td>';
print "</tr>\n";

View File

@ -1,24 +1,24 @@
<?php
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/user/perms.php
@ -256,19 +256,19 @@ else
print '<table class="border" width="100%">';
// Ref
print '<tr><td width="25%" valign="top">'.$langs->trans("Ref").'</td>';
print '<tr><td width="25%">'.$langs->trans("Ref").'</td>';
print '<td>';
print $form->showrefnav($fuser,'id','',$user->rights->user->user->lire || $user->admin);
print '</td>';
print '</tr>'."\n";
// Lastname
print '<tr><td width="25%" valign="top">'.$langs->trans("Lastname").'</td>';
print '<tr><td width="25%">'.$langs->trans("Lastname").'</td>';
print '<td>'.$fuser->lastname.'</td>';
print '</tr>'."\n";
// Firstname
print '<tr><td width="25%" valign="top">'.$langs->trans("Firstname").'</td>';
print '<tr><td width="25%">'.$langs->trans("Firstname").'</td>';
print '<td>'.$fuser->firstname.'</td>';
print '</tr>'."\n";