diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 2c37bcd9e42..9ef2ff7c7e4 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -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 ''; + print ''; foreach ($fieldlist as $field => $value) { // Determine le nom du champ par rapport aux noms possibles diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index aa34c83523c..27841434f5a 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2014 Laurent Destailleur + * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005 Simon TOSSER * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2013 Juanjo Menent @@ -671,7 +671,7 @@ if ($action == 'create') } // Assigned to - print ''.$langs->trans("ActionAffectedTo").''; + print ''.$langs->trans("ActionAffectedTo").''; $listofuserid=array(); if (empty($donotclearsession)) { @@ -727,7 +727,7 @@ if ($action == 'create') print ''; print ''.$langs->trans("ActionOnContact").''; - $form->select_contacts(GETPOST('socid','int'),GETPOST('contactid'),'contactid',1); + $form->select_contacts(GETPOST('socid','int'), GETPOST('contactid'), 'contactid', 1, '', '', 0, 'minwidth200'); print ''; @@ -739,7 +739,7 @@ if ($action == 'create') // Projet associe $langs->load("projects"); - print ''.$langs->trans("Project").''; + print ''.$langs->trans("Project").''; $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 ''; // Description - print ''.$langs->trans("Description").''; + print ''.$langs->trans("Description").''; 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 ''.$langs->trans("ActionAssignedTo").''; + print ''.$langs->trans("ActionAssignedTo").''; $listofuserid=array(); if (empty($donotclearsession)) { @@ -968,7 +968,7 @@ if ($id > 0) // Contact print ''.$langs->trans("Contact").''; - $form->select_contacts($object->socid, $object->contactid,'contactid',1); + $form->select_contacts($object->socid, $object->contactid, 'contactid', 1, '', '', 0, 'minwidth200'); print ''; } @@ -981,7 +981,7 @@ if ($id > 0) // Projet associe $langs->load("project"); - print ''.$langs->trans("Project").''; + print ''.$langs->trans("Project").''; $numprojet=$formproject->select_projects($object->socid,$object->fk_project,'projectid'); if ($numprojet==0) { @@ -1004,7 +1004,7 @@ if ($id > 0) } // Description - print ''.$langs->trans("Description").''; + print ''.$langs->trans("Description").''; // 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 ''.$langs->trans("Project").''; + print ''.$langs->trans("Project").''; if ($object->fk_project) { $project=new Project($db); @@ -1192,7 +1192,7 @@ if ($id > 0) } // Description - print ''.$langs->trans("Description").''; + print ''.$langs->trans("Description").''; print dol_htmlentitiesbr($object->note); print ''; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 09c3fab6be7..74fdf4d9ad5 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1451,7 +1451,7 @@ class Form $out.=''; $out.=''; $out.=$this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); - $out.=''; + $out.=' '; } $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.=''; - $ret.=''; + $ret.=''; $ret.=''; } else if ($altfile && file_exists($dir."/".$altfile)) { $ret.=''; - $ret.=''; + $ret.=''; $ret.=''; } else @@ -4857,11 +4858,11 @@ class Form { global $dolibarr_main_url_root; $ret.=''; - $ret.='Photo found on Gravatar'; // gravatar need md5 hash + $ret.='Photo found on Gravatar'; // gravatar need md5 hash } else { - $ret.='No photo'; + $ret.='No photo'; } } diff --git a/htdocs/holiday/index.php b/htdocs/holiday/index.php index 86c4eca49eb..5b9e7d4c0ba 100644 --- a/htdocs/holiday/index.php +++ b/htdocs/holiday/index.php @@ -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 ''; // Ref - print ''; + print ''; print ''; print ''; // LastName - print ''; + print ''; print ''; print "\n"; // FirstName - print ''; + print ''; print ''; print "\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 '
'; -} -else { - dol_fiche_end(); -} +dol_fiche_end(); + +if ($id > 0) print '
'; + print ''."\n"; print '
'.$langs->trans("Ref").'
'.$langs->trans("Ref").''; print $form->showrefnav($fuser,'id','',$user->rights->user->user->lire || $user->admin); print '
'.$langs->trans("LastName").'
'.$langs->trans("LastName").''.$fuser->lastname.'
'.$langs->trans("FirstName").'
'.$langs->trans("FirstName").''.$fuser->firstname.'
'; @@ -387,7 +386,7 @@ if (! empty($holiday->holiday)) if($holiday_payes == '2') { print ''; - print ''; + print ''; print ''; } diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index d44d54fa72d..7c9b90a8737 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1439,7 +1439,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a // User photo $toprightmenu.='
'; $toprightmenu.='
'; - print ''; print ''; print ''; - + // Type print ''; print ''; - print ''; print ''; - print '
'.$langs->trans('None').''.$langs->trans('None').'
'; - print ''; print $langs->trans('ResourceFormLabel_'.$field); print ''; print ''; print '
'.$langs->trans("ResourceType").''; @@ -153,10 +152,8 @@ if (! $action) // Description $field = 'description'; print '
'; - print ''; print $langs->trans('ResourceFormLabel_'.$field); - print ''; print ''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php index 0863cad9c52..abb07820fa0 100644 --- a/htdocs/resource/card.php +++ b/htdocs/resource/card.php @@ -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 ''; print ''; + dol_fiche_head($head, 'resource', $langs->trans("ResourceSingular"),0,'resource@resource'); + print ''; // Ref - print ''; + print ''; print ''; // Type @@ -162,20 +163,28 @@ if ( $object->fetch($id) > 0 ) print ''; print ''; - print '
'.$langs->trans("ResourceFormLabel_ref").'
'.$langs->trans("ResourceFormLabel_ref").'
'; + print '
'; + + dol_fiche_end(); + + print '
'; print '   '; print '
'; + print ''; + print ''; } 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 '
'; $parameters = array(); $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index ab70bc9a338..fbe8df807c0 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -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 ''."\n"; print ''; @@ -139,7 +139,7 @@ else print ''; print ''; + print ''; print ''; @@ -1503,7 +1503,7 @@ else // Barcode if (! empty($conf->barcode->enabled)) { - print ''; + print ''; print ''; } @@ -1514,8 +1514,8 @@ else print ''; // Address - print ''; - print ''; @@ -1799,7 +1799,7 @@ else // Ref /* - print ''; + print ''; print ''; @@ -1885,14 +1885,14 @@ else print ''; // Address - print ""; + print ''; // Zip / Town print '"; + print ''; print ''; // Country @@ -2202,7 +2202,7 @@ else if (! empty($conf->adherent->enabled)) { $langs->load("members"); - print ''; + print ''; print ''; print ''; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 0f81a861a81..95215cc7d41 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -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.=''; - $result.=$form->showphoto('userphoto', $this, ($with?$with:16)); + $result.=Form::showphoto('userphoto', $this, $width, $height); $result.=''; return $result; diff --git a/htdocs/user/info.php b/htdocs/user/info.php index 454ac080cbc..646754668bd 100644 --- a/htdocs/user/info.php +++ b/htdocs/user/info.php @@ -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(); diff --git a/htdocs/user/note.php b/htdocs/user/note.php index 2fd827fb639..af96d8149e8 100644 --- a/htdocs/user/note.php +++ b/htdocs/user/note.php @@ -112,8 +112,8 @@ if ($id) print ''; // Note - print ''; - print ''; + print '
'; - print ''; + print ''; print img_edit(); print ''; print ' '; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index b26e6766a4e..6faa6aa5a2f 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1011,7 +1011,7 @@ else } // Address - print '
'; print '
'.$langs->trans("Ref").'
'.$langs->trans("Ref").''; print $fuser->id; print '
".$langs->trans('Address').''; + print '
'.$langs->trans('Address').''; dol_print_address($object->address,'gmap','thirdparty',$object->id); - print "
'.$langs->trans('Zip').' / '.$langs->trans("Town").''; print $object->zip.($object->zip && $object->town?" / ":"").$object->town; - print "
'.$langs->trans("LinkedToDolibarrMember").'
'.$langs->trans("LinkedToDolibarrMember").''; $adh=new Adherent($db); $result=$adh->fetch('','',$object->id); diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index c9ff2ac3f3f..dd304dae7c1 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -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 { diff --git a/htdocs/user/agenda_extsites.php b/htdocs/user/agenda_extsites.php index e46647f3b69..6699e30023b 100644 --- a/htdocs/user/agenda_extsites.php +++ b/htdocs/user/agenda_extsites.php @@ -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 diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 523474ea132..ace75333ba6 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1740,7 +1740,7 @@ else // Photo print ''; - print $form->showphoto('userphoto',$object,100,$caneditfield); + print $form->showphoto('userphoto',$object,100,0,$caneditfield); print '
'.$langs->trans("Login").''.$fuser->login.' 
'.$langs->trans("Note").''; + print '
'.$langs->trans("Note").''; if ($action == 'edit' && $user->rights->user->user->creer) { print ""; @@ -159,6 +159,6 @@ if ($id) print "\n"; } -$db->close(); - llxFooter(); + +$db->close(); diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index e749f2891fb..53b98b5be98 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2005-2015 Laurent Destailleur * Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2013 Florian Henry * @@ -131,19 +131,19 @@ dol_fiche_head($head, 'guisetup', $title, 0, 'user'); print ''; // Ref -print ''; +print ''; print ''; print ''; // LastName -print ''; +print ''; print ''; print "\n"; // FirstName -print ''; +print ''; print ''; print "\n"; diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index a1c7fbff5ea..2a5a8422231 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -1,24 +1,24 @@ * Copyright (C) 2002-2003 Jean-Louis Bergamo -* Copyright (C) 2004-2012 Laurent Destailleur -* Copyright (C) 2004 Eric Seigne -* Copyright (C) 2005-2012 Regis Houssin -* Copyright (C) 2012 Juanjo Menent -* -* 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 . -*/ + * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2004 Eric Seigne + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2012 Juanjo Menent + * + * 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 . + */ /** * \file htdocs/user/perms.php @@ -256,19 +256,19 @@ else print '
'.$langs->trans("Ref").'
'.$langs->trans("Ref").''; print $form->showrefnav($fuser,'id','',$user->rights->user->user->lire || $user->admin); print '
'.$langs->trans("LastName").'
'.$langs->trans("LastName").''.$fuser->lastname.'
'.$langs->trans("FirstName").'
'.$langs->trans("FirstName").''.$fuser->firstname.'
'; // Ref -print ''; +print ''; print ''; print ''."\n"; // Lastname -print ''; +print ''; print ''; print ''."\n"; // Firstname -print ''; +print ''; print ''; print ''."\n";
'.$langs->trans("Ref").'
'.$langs->trans("Ref").''; print $form->showrefnav($fuser,'id','',$user->rights->user->user->lire || $user->admin); print '
'.$langs->trans("Lastname").'
'.$langs->trans("Lastname").''.$fuser->lastname.'
'.$langs->trans("Firstname").'
'.$langs->trans("Firstname").''.$fuser->firstname.'