diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index ab64fad57dc8bf8cfa65de86680ee28fb35ce517..0f16a25c43ff56c423b42e273fc55352a2796917 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> - * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com> + * Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Marc Barilley/Ocebo <marc@ocebo.com> * Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerker@telenet.be> @@ -5845,11 +5845,11 @@ class Form * @param string $morehtmlright More html code to show after ref. * @return string Portion HTML with ref + navigation buttons */ - function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0,$morehtmlleft='',$morehtmlstatus='',$morehtmlright='') - { - global $langs,$conf,$hookmanager; + function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0,$morehtmlleft='',$morehtmlstatus='',$morehtmlright='') + { + global $langs,$conf,$hookmanager; - $ret=''; + $ret=''; if (empty($fieldid)) $fieldid='rowid'; if (empty($fieldref)) $fieldref='ref'; @@ -5880,10 +5880,10 @@ class Form // Right part of banner if ($morehtmlright) $ret.='<div class="inline-block floatleft">'.$morehtmlright.'</div>'; - if ($previous_ref || $next_ref || $morehtml) - { - $ret.='<div class="pagination"><ul>'; - } + if ($previous_ref || $next_ref || $morehtml) + { + $ret.='<div class="pagination"><ul>'; + } if ($morehtml) { $ret.='<li class="noborder litext">'.$morehtml.'</li>'; @@ -5914,7 +5914,7 @@ class Form { $ret.=dol_htmlentities($object->name); } - else if (in_array($object->element, array('contact', 'user', 'member'))) + else if (in_array($object->element, array('contact', 'user', 'usergroup', 'member'))) { $ret.=dol_htmlentities($object->getFullName($langs)); } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index ca1f1c77df41c642ea9a176106e557d6874a3fa8..737c61cfda996f73b3a82b8900d5988c31d6984c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1,16 +1,16 @@ <?php -/* Copyright (C) 2000-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> +/* Copyright (C) 2000-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org> * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> - * Copyright (C) 2004 Christophe Combelles <ccomb@free.fr> - * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> + * Copyright (C) 2004 Christophe Combelles <ccomb@free.fr> + * Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr> * Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com> - * Copyright (C) 2014 Cédric GROSS <c.gross@kreiz-it.fr> + * Copyright (C) 2014 Cédric GROSS <c.gross@kreiz-it.fr> * Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index e53080cea73c993f760e1dd172161a24aa3cacd8..6dad90a19aed430a6ecb35554a61bdc87c58b875 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -1,9 +1,9 @@ <?php -/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> - * Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.net> - * Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com> - * Copyright (C) 2011 Herve Prot <herve.prot@symeos.com> - * Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro> +/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> + * Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.net> + * Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com> + * Copyright (C) 2011 Herve Prot <herve.prot@symeos.com> + * Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro> * * 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 @@ -82,7 +82,7 @@ if ($action == 'confirm_delete' && $confirm == "yes") } else { - $langs->load("errors"); + $langs->load("errors"); setEventMessages($langs->trans('ErrorForbidden'), null, 'errors'); } } @@ -132,7 +132,7 @@ if ($action == 'add') } else { - $langs->load("errors"); + $langs->load("errors"); setEventMessages($langs->trans('ErrorForbidden'), null, 'errors'); } } @@ -165,7 +165,7 @@ if ($action == 'adduser' || $action =='removeuser') } else { - $langs->load("errors"); + $langs->load("errors"); setEventMessages($langs->trans('ErrorForbidden'), null, 'errors'); } } @@ -207,7 +207,7 @@ if ($action == 'update') } else { - $langs->load("errors"); + $langs->load("errors"); setEventMessages($langs->trans('ErrorForbidden'), null, 'mesgs'); } } @@ -275,7 +275,7 @@ if ($action == 'create') print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { - print $object->showOptionals($extrafields,'edit'); + print $object->showOptionals($extrafields,'edit'); } print "</table>\n"; @@ -316,14 +316,14 @@ else if ($action != 'edit') { - dol_fiche_head($head, 'group', $title, -1, 'group'); + dol_fiche_head($head, 'group', $title, -1, 'group'); dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin); print '<div class="fichecenter">'; print '<div class="underbanner clearboth"></div>'; - print '<table class="border" width="100%">'; + print '<table class="border" width="100%">'; // Name print '<tr><td class="titlefield">'.$langs->trans("Name").'</td>'; @@ -350,7 +350,7 @@ else // Other attributes $parameters=array('colspan' => ' colspan="2"'); - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; print "</table>\n"; print '</div>'; @@ -435,59 +435,57 @@ else print '<td class="liste_titre">'.$langs->trans("Lastname").'</td>'; print '<td class="liste_titre">'.$langs->trans("Firstname").'</td>'; if (! empty($conf->multicompany->enabled) && $conf->entity == 1) - { - print '<td class="liste_titre">'.$langs->trans("Entity").'</td>'; + { + print '<td class="liste_titre">'.$langs->trans("Entity").'</td>'; } print '<td class="liste_titre" width="5" align="center">'.$langs->trans("Status").'</td>'; print '<td class="liste_titre" width="5" align="right"> </td>'; print "</tr>\n"; - if (! empty($object->members)) - { - foreach($object->members as $useringroup) - { - - - print '<tr class="oddeven">'; - print '<td>'; - print $useringroup->getNomUrl(-1, '', 0, 0, 24, 0, 'login'); - if ($useringroup->admin && ! $useringroup->entity) print img_picto($langs->trans("SuperAdministrator"),'redstar'); - else if ($useringroup->admin) print img_picto($langs->trans("Administrator"),'star'); - print '</td>'; - print '<td>'.$useringroup->lastname.'</td>'; - print '<td>'.$useringroup->firstname.'</td>'; - if (! empty($conf->multicompany->enabled) && is_object($mc) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity) - { - print '<td class="valeur">'; - if (! empty($useringroup->usergroup_entity)) - { - $nb=0; - foreach($useringroup->usergroup_entity as $group_entity) - { - $mc->getInfo($group_entity); - print ($nb > 0 ? ', ' : '').$mc->label; - print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=removeuser&user='.$useringroup->id.'&entity='.$group_entity.'">'; - print img_delete($langs->trans("RemoveFromGroup")); - print '</a>'; - $nb++; - } - } - print '</td>'; - } - print '<td align="center">'.$useringroup->getLibStatut(3).'</td>'; - print '<td align="right">'; - if (! empty($user->admin) && empty($conf->multicompany->enabled)) - { - print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=removeuser&user='.$useringroup->id.'">'; - print img_delete($langs->trans("RemoveFromGroup")); - print '</a>'; - } - else - { - print "-"; - } - print "</td></tr>\n"; - } + if (! empty($object->members)) + { + foreach($object->members as $useringroup) + { + print '<tr class="oddeven">'; + print '<td>'; + print $useringroup->getNomUrl(-1, '', 0, 0, 24, 0, 'login'); + if ($useringroup->admin && ! $useringroup->entity) print img_picto($langs->trans("SuperAdministrator"),'redstar'); + else if ($useringroup->admin) print img_picto($langs->trans("Administrator"),'star'); + print '</td>'; + print '<td>'.$useringroup->lastname.'</td>'; + print '<td>'.$useringroup->firstname.'</td>'; + if (! empty($conf->multicompany->enabled) && is_object($mc) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity) + { + print '<td class="valeur">'; + if (! empty($useringroup->usergroup_entity)) + { + $nb=0; + foreach($useringroup->usergroup_entity as $group_entity) + { + $mc->getInfo($group_entity); + print ($nb > 0 ? ', ' : '').$mc->label; + print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=removeuser&user='.$useringroup->id.'&entity='.$group_entity.'">'; + print img_delete($langs->trans("RemoveFromGroup")); + print '</a>'; + $nb++; + } + } + print '</td>'; + } + print '<td align="center">'.$useringroup->getLibStatut(3).'</td>'; + print '<td align="right">'; + if (! empty($user->admin) && empty($conf->multicompany->enabled)) + { + print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=removeuser&user='.$useringroup->id.'">'; + print img_delete($langs->trans("RemoveFromGroup")); + print '</a>'; + } + else + { + print "-"; + } + print "</td></tr>\n"; + } } else { @@ -547,10 +545,10 @@ else print "<td>".$mc->select_entities($object->entity); print "</td></tr>\n"; } - else - { - print '<input type="hidden" name="entity" value="'.$conf->entity.'" />'; - } + else + { + print '<input type="hidden" name="entity" value="'.$conf->entity.'" />'; + } } print '<tr><td class="tdtop">'.$langs->trans("Description").'</td>'; @@ -560,13 +558,13 @@ else $doleditor->Create(); print '</td>'; print "</tr>\n"; - // Other attributes + // Other attributes $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { - print $object->showOptionals($extrafields,'edit'); + print $object->showOptionals($extrafields,'edit'); } print "</table>\n";