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