Skip to content

Commit

Permalink
Merge pull request #7145 from hregis/6.0_bug2
Browse files Browse the repository at this point in the history
Fix: missing group name with dol_banner_tab
  • Loading branch information
eldy committed Jul 13, 2017
2 parents 4ee70e4 + d63e15f commit 85d9a2f
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 81 deletions.
20 changes: 10 additions & 10 deletions htdocs/core/class/html.form.class.php
Expand Up @@ -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>
Expand Down Expand Up @@ -5845,11 +5845,11 @@ function select_export_model($selected='',$htmlname='exportmodelid',$type='',$us
* @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';

Expand Down Expand Up @@ -5880,10 +5880,10 @@ function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$f
// 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>';
Expand Down Expand Up @@ -5914,7 +5914,7 @@ function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$f
{
$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));
}
Expand Down
8 changes: 4 additions & 4 deletions 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>
*
Expand Down
132 changes: 65 additions & 67 deletions 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
Expand Down Expand Up @@ -82,7 +82,7 @@
}
else
{
$langs->load("errors");
$langs->load("errors");
setEventMessages($langs->trans('ErrorForbidden'), null, 'errors');
}
}
Expand Down Expand Up @@ -132,7 +132,7 @@
}
else
{
$langs->load("errors");
$langs->load("errors");
setEventMessages($langs->trans('ErrorForbidden'), null, 'errors');
}
}
Expand Down Expand Up @@ -165,7 +165,7 @@
}
else
{
$langs->load("errors");
$langs->load("errors");
setEventMessages($langs->trans('ErrorForbidden'), null, 'errors');
}
}
Expand Down Expand Up @@ -207,7 +207,7 @@
}
else
{
$langs->load("errors");
$langs->load("errors");
setEventMessages($langs->trans('ErrorForbidden'), null, 'mesgs');
}
}
Expand Down Expand Up @@ -275,7 +275,7 @@
print $hookmanager->resPrint;
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
print $object->showOptionals($extrafields,'edit');
print $object->showOptionals($extrafields,'edit');
}

print "</table>\n";
Expand Down Expand Up @@ -316,14 +316,14 @@

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>';
Expand All @@ -350,7 +350,7 @@

// 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>';
Expand Down Expand Up @@ -435,59 +435,57 @@
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">&nbsp;</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.'&amp;action=removeuser&amp;user='.$useringroup->id.'&amp;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.'&amp;action=removeuser&amp;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.'&amp;action=removeuser&amp;user='.$useringroup->id.'&amp;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.'&amp;action=removeuser&amp;user='.$useringroup->id.'">';
print img_delete($langs->trans("RemoveFromGroup"));
print '</a>';
}
else
{
print "-";
}
print "</td></tr>\n";
}
}
else
{
Expand Down Expand Up @@ -547,10 +545,10 @@
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>';
Expand All @@ -560,13 +558,13 @@
$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";
Expand Down

0 comments on commit 85d9a2f

Please sign in to comment.