2005-02-04 14:30:38 +00:00
< ? php
2017-06-16 15:01:43 +00:00
/* Copyright ( C ) 2002 - 2005 Rodolphe Quiedeville < rodolphe @ quiedeville . org >
* Copyright ( C ) 2002 - 2003 Jean - Louis Bergamo < jlb @ j1b . org >
* Copyright ( C ) 2004 - 2015 Laurent Destailleur < eldy @ users . sourceforge . net >
* Copyright ( C ) 2004 Eric Seigne < eric . seigne @ ryxeo . com >
* Copyright ( C ) 2005 - 2017 Regis Houssin < regis . houssin @ capnetworks . com >
* Copyright ( C ) 2012 Juanjo Menent < jmenent @ 2 byte . es >
2005-02-04 14:30:38 +00:00
*
* 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
2013-01-16 14:36:08 +00:00
* the Free Software Foundation ; either version 3 of the License , or
2005-02-04 14:30:38 +00:00
* ( 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
2011-07-31 23:19:04 +00:00
* along with this program . If not , see < http :// www . gnu . org / licenses />.
2005-02-04 14:30:38 +00:00
*/
2005-03-06 15:39:32 +00:00
/**
2008-08-19 20:09:53 +00:00
* \file htdocs / user / perms . php
* \brief Onglet user et permissions de la fiche utilisateur
*/
2005-02-04 14:30:38 +00:00
2012-08-22 21:24:21 +00:00
require '../main.inc.php' ;
2012-08-22 21:11:24 +00:00
require_once DOL_DOCUMENT_ROOT . '/core/lib/usergroups.lib.php' ;
2013-01-10 07:27:12 +00:00
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php' ;
2005-02-04 14:30:38 +00:00
2018-05-26 14:24:54 +00:00
// Load translation files required by page
$langs -> loadLangs ( array ( 'users' , 'admin' ));
2005-02-04 14:30:38 +00:00
2012-01-11 14:07:17 +00:00
$id = GETPOST ( 'id' , 'int' );
$action = GETPOST ( 'action' , 'alpha' );
$confirm = GETPOST ( 'confirm' , 'alpha' );
2012-10-20 07:33:39 +00:00
$module = GETPOST ( 'module' , 'alpha' );
$rights = GETPOST ( 'rights' , 'int' );
2018-03-31 16:48:27 +00:00
$contextpage = GETPOST ( 'contextpage' , 'aZ' ) ? GETPOST ( 'contextpage' , 'aZ' ) : 'userperms' ; // To manage different context of search
2005-02-04 14:30:38 +00:00
2011-08-21 00:20:43 +00:00
if ( ! isset ( $id ) || empty ( $id )) accessforbidden ();
2006-11-26 19:19:46 +00:00
2010-10-28 19:31:11 +00:00
// Defini si peux lire les permissions
2010-11-08 11:40:52 +00:00
$canreaduser = ( $user -> admin || $user -> rights -> user -> user -> lire );
2010-10-28 19:31:11 +00:00
// Defini si peux modifier les autres utilisateurs et leurs permisssions
2005-10-22 13:48:19 +00:00
$caneditperms = ( $user -> admin || $user -> rights -> user -> user -> creer );
2010-11-08 11:40:52 +00:00
// Advanced permissions
if ( ! empty ( $conf -> global -> MAIN_USE_ADVANCED_PERMS ))
{
$canreaduser = ( $user -> admin || ( $user -> rights -> user -> user -> lire && $user -> rights -> user -> user_advance -> readperms ));
2011-08-21 00:20:43 +00:00
$caneditselfperms = ( $user -> id == $id && $user -> rights -> user -> self_advance -> writeperms );
2012-05-07 09:15:14 +00:00
$caneditperms = (( $caneditperms || $caneditselfperms ) ? 1 : 0 );
2010-11-08 11:40:52 +00:00
}
2010-10-28 19:31:11 +00:00
2009-08-06 13:07:25 +00:00
// Security check
$socid = 0 ;
2012-07-10 11:20:53 +00:00
if ( isset ( $user -> societe_id ) && $user -> societe_id > 0 ) $socid = $user -> societe_id ;
2009-08-06 13:07:25 +00:00
$feature2 = (( $socid && $user -> rights -> user -> self -> creer ) ? '' : 'user' );
2012-03-22 23:27:12 +00:00
if ( $user -> id == $id && ( empty ( $conf -> global -> MAIN_USE_ADVANCED_PERMS ) || $user -> rights -> user -> self_advance -> readperms )) // A user can always read its own card if not advanced perms enabled, or if he has advanced perms
2009-08-17 17:32:38 +00:00
{
$feature2 = '' ;
$canreaduser = 1 ;
}
2013-05-03 14:10:28 +00:00
2015-05-13 07:32:54 +00:00
$result = restrictedArea ( $user , 'user' , $id , 'user&user' , $feature2 );
2011-08-21 00:20:43 +00:00
if ( $user -> id <> $id && ! $canreaduser ) accessforbidden ();
2005-10-22 13:48:19 +00:00
2015-09-16 07:37:49 +00:00
$object = new User ( $db );
2017-05-06 10:43:45 +00:00
$object -> fetch ( $id , '' , '' , 1 );
2015-09-16 07:37:49 +00:00
$object -> getrights ();
2017-06-06 05:57:03 +00:00
$entity = $conf -> entity ;
2017-06-10 10:56:28 +00:00
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
2018-03-31 16:48:27 +00:00
$hookmanager -> initHooks ( array ( 'usercard' , 'userperms' , 'globalcard' ));
2005-02-04 14:30:38 +00:00
2016-05-30 18:50:49 +00:00
2005-02-04 14:30:38 +00:00
/**
* Actions
*/
2012-07-27 16:41:52 +00:00
2015-09-16 07:37:49 +00:00
$parameters = array ( 'id' => $socid );
$reshook = $hookmanager -> executeHooks ( 'doActions' , $parameters , $object , $action ); // Note that $action and $object may have been modified by some hooks
if ( $reshook < 0 ) setEventMessages ( $hookmanager -> error , $hookmanager -> errors , 'errors' );
if ( empty ( $reshook )) {
if ( $action == 'addrights' && $caneditperms ) {
$edituser = new User ( $db );
2017-06-06 05:57:03 +00:00
$edituser -> fetch ( $object -> id );
$edituser -> addrights ( $rights , $module , '' , $entity );
2015-09-16 07:37:49 +00:00
// Si on a touche a ses propres droits, on recharge
2017-06-06 05:57:03 +00:00
if ( $object -> id == $user -> id ) {
2015-09-16 07:37:49 +00:00
$user -> clearrights ();
$user -> getrights ();
$menumanager -> loadMenu ();
}
2006-11-26 19:19:46 +00:00
}
2005-02-04 14:30:38 +00:00
2015-09-16 07:37:49 +00:00
if ( $action == 'delrights' && $caneditperms ) {
$edituser = new User ( $db );
2017-06-06 05:57:03 +00:00
$edituser -> fetch ( $object -> id );
$edituser -> delrights ( $rights , $module , '' , $entity );
2015-09-16 07:37:49 +00:00
// Si on a touche a ses propres droits, on recharge
2017-06-06 05:57:03 +00:00
if ( $object -> id == $user -> id ) {
2015-09-16 07:37:49 +00:00
$user -> clearrights ();
$user -> getrights ();
$menumanager -> loadMenu ();
}
2006-11-26 19:19:46 +00:00
}
2005-02-04 14:30:38 +00:00
}
2012-07-27 16:41:52 +00:00
/**
* View
*/
2005-02-04 14:30:38 +00:00
2008-01-06 12:57:09 +00:00
llxHeader ( '' , $langs -> trans ( " Permissions " ));
$form = new Form ( $db );
2015-06-26 13:26:08 +00:00
$head = user_prepare_head ( $object );
2005-03-06 15:39:32 +00:00
2009-05-05 00:25:14 +00:00
$title = $langs -> trans ( " User " );
2017-04-14 11:00:39 +00:00
dol_fiche_head ( $head , 'rights' , $title , - 1 , 'user' );
2005-03-06 16:01:38 +00:00
2005-02-04 14:30:38 +00:00
2006-11-26 19:19:46 +00:00
$db -> begin ();
2005-04-09 17:52:38 +00:00
2010-07-15 08:42:05 +00:00
// Search all modules with permission and reload permissions def.
2006-11-26 19:19:46 +00:00
$modules = array ();
2012-05-08 20:49:03 +00:00
$modulesdir = dolGetModulesDirs ();
2009-05-05 00:25:14 +00:00
2011-08-01 13:15:53 +00:00
foreach ( $modulesdir as $dir )
{
2012-05-08 20:49:03 +00:00
$handle =@ opendir ( dol_osencode ( $dir ));
2015-03-09 20:20:56 +00:00
if ( is_resource ( $handle ))
{
while (( $file = readdir ( $handle )) !== false )
{
if ( is_readable ( $dir . $file ) && substr ( $file , 0 , 3 ) == 'mod' && substr ( $file , dol_strlen ( $file ) - 10 ) == '.class.php' )
{
$modName = substr ( $file , 0 , dol_strlen ( $file ) - 10 );
if ( $modName )
{
include_once $dir . $file ;
$objMod = new $modName ( $db );
2011-08-23 22:25:37 +00:00
2011-03-14 12:00:42 +00:00
// Load all lang files of module
if ( isset ( $objMod -> langfiles ) && is_array ( $objMod -> langfiles ))
{
foreach ( $objMod -> langfiles as $domain )
{
$langs -> load ( $domain );
}
}
// Load all permissions
2011-08-23 22:25:37 +00:00
if ( $objMod -> rights_class )
{
2017-06-06 05:57:03 +00:00
$ret = $objMod -> insert_permissions ( 0 , $entity );
2010-12-15 18:15:08 +00:00
$modules [ $objMod -> rights_class ] = $objMod ;
//print "modules[".$objMod->rights_class."]=$objMod;";
}
}
}
}
}
2006-11-26 19:19:46 +00:00
}
2005-04-09 17:52:38 +00:00
2006-11-26 19:19:46 +00:00
$db -> commit ();
2005-02-04 14:30:38 +00:00
2006-11-26 19:19:46 +00:00
// Lecture des droits utilisateurs
$permsuser = array ();
2005-03-06 15:39:32 +00:00
2018-03-05 07:45:40 +00:00
$sql = " SELECT DISTINCT ur.fk_id " ;
$sql .= " FROM " . MAIN_DB_PREFIX . " user_rights as ur " ;
$sql .= " WHERE ur.entity = " . $entity ;
2015-06-26 13:26:08 +00:00
$sql .= " AND ur.fk_user = " . $object -> id ;
2006-11-26 19:19:46 +00:00
2014-06-12 09:31:53 +00:00
dol_syslog ( " get user perms " , LOG_DEBUG );
2006-11-26 19:19:46 +00:00
$result = $db -> query ( $sql );
if ( $result )
{
2015-03-09 20:20:56 +00:00
$num = $db -> num_rows ( $result );
$i = 0 ;
while ( $i < $num )
{
$obj = $db -> fetch_object ( $result );
2018-03-05 07:45:40 +00:00
array_push ( $permsuser , $obj -> fk_id );
2015-03-09 20:20:56 +00:00
$i ++ ;
}
$db -> free ( $result );
2006-11-26 19:19:46 +00:00
}
else
{
2015-03-09 20:20:56 +00:00
dol_print_error ( $db );
2006-11-26 19:19:46 +00:00
}
2005-03-06 15:39:32 +00:00
2006-11-26 19:19:46 +00:00
// Lecture des droits groupes
2012-09-27 09:54:51 +00:00
$permsgroupbyentity = array ();
2005-02-04 14:30:38 +00:00
2018-03-05 07:45:40 +00:00
$sql = " SELECT DISTINCT gr.fk_id, gu.entity " ;
$sql .= " FROM " . MAIN_DB_PREFIX . " usergroup_rights as gr, " ;
2009-04-27 20:37:50 +00:00
$sql .= " " . MAIN_DB_PREFIX . " usergroup_user as gu " ;
2018-03-05 07:45:40 +00:00
$sql .= " WHERE gr.entity = " . $entity ;
2009-04-27 20:37:50 +00:00
$sql .= " AND gr.fk_usergroup = gu.fk_usergroup " ;
2015-06-26 13:26:08 +00:00
$sql .= " AND gu.fk_user = " . $object -> id ;
2005-02-04 14:30:38 +00:00
2014-06-12 09:31:53 +00:00
dol_syslog ( " get user perms " , LOG_DEBUG );
2006-11-26 19:19:46 +00:00
$result = $db -> query ( $sql );
if ( $result )
{
2015-03-09 20:20:56 +00:00
$num = $db -> num_rows ( $result );
$i = 0 ;
while ( $i < $num )
{
$obj = $db -> fetch_object ( $result );
if ( ! isset ( $permsgroupbyentity [ $obj -> entity ]))
$permsgroupbyentity [ $obj -> entity ] = array ();
2018-03-05 07:45:40 +00:00
array_push ( $permsgroupbyentity [ $obj -> entity ], $obj -> fk_id );
2015-03-09 20:20:56 +00:00
$i ++ ;
}
$db -> free ( $result );
2006-11-26 19:19:46 +00:00
}
else
{
2015-03-09 20:20:56 +00:00
dol_print_error ( $db );
2006-11-26 19:19:46 +00:00
}
2005-02-04 14:30:38 +00:00
2006-11-26 19:19:46 +00:00
/*
* Ecran ajout / suppression permission
2015-10-11 14:12:12 +00:00
*/
2007-08-31 22:06:14 +00:00
2017-04-09 12:09:33 +00:00
$linkback = '' ;
if ( $user -> rights -> user -> user -> lire || $user -> admin ) {
2018-04-05 22:36:52 +00:00
$linkback = '<a href="' . DOL_URL_ROOT . '/user/list.php">' . $langs -> trans ( " BackToList " ) . '</a>' ;
2017-04-09 12:09:33 +00:00
}
2007-08-31 22:06:14 +00:00
2015-11-04 14:45:35 +00:00
dol_banner_tab ( $object , 'id' , $linkback , $user -> rights -> user -> user -> lire || $user -> admin );
2007-08-31 22:06:14 +00:00
2016-05-30 18:50:49 +00:00
//print '<div class="underbanner clearboth"></div>';
2007-08-31 22:06:14 +00:00
2015-03-09 20:20:56 +00:00
if ( $user -> admin ) print info_admin ( $langs -> trans ( " WarningOnlyPermissionOfActivatedModules " ));
2013-06-05 14:12:07 +00:00
// Show warning about external users
2015-03-09 20:20:56 +00:00
if ( empty ( $user -> societe_id )) print info_admin ( showModulesExludedForExternal ( $modules )) . " \n " ;
2007-08-31 22:06:14 +00:00
2017-06-06 05:57:03 +00:00
$parameters = array ( 'permsgroupbyentity' => $permsgroupbyentity );
$reshook = $hookmanager -> executeHooks ( 'insertExtraHeader' , $parameters , $object , $action ); // Note that $action and $object may have been modified by some hooks
if ( $reshook < 0 ) setEventMessages ( $hookmanager -> error , $hookmanager -> errors , 'errors' );
2012-09-27 09:54:51 +00:00
2010-12-27 18:03:02 +00:00
print " \n " ;
2006-11-26 19:19:46 +00:00
print '<table width="100%" class="noborder">' ;
print '<tr class="liste_titre">' ;
print '<td>' . $langs -> trans ( " Module " ) . '</td>' ;
2018-07-03 19:46:20 +00:00
if ( $caneditperms && empty ( $objMod -> rights_admin_allowed ) || empty ( $object -> admin ))
{
print '<td align="center" class="nowrap">' ;
print '<a class="reposition" title="' . dol_escape_htmltag ( $langs -> trans ( " All " )) . '" alt="' . dol_escape_htmltag ( $langs -> trans ( " All " )) . '" href="' . $_SERVER [ " PHP_SELF " ] . '?id=' . $object -> id . '&action=addrights&entity=' . $entity . '&module=allmodules">' . $langs -> trans ( " All " ) . " </a> " ;
print '/' ;
print '<a class="reposition" title="' . dol_escape_htmltag ( $langs -> trans ( " None " )) . '" alt="' . dol_escape_htmltag ( $langs -> trans ( " None " )) . '" href="' . $_SERVER [ " PHP_SELF " ] . '?id=' . $object -> id . '&action=delrights&entity=' . $entity . '&module=allmodules">' . $langs -> trans ( " None " ) . " </a> " ;
print '</td>' ;
}
2006-11-26 19:19:46 +00:00
print '<td align="center" width="24"> </td>' ;
print '<td>' . $langs -> trans ( " Permissions " ) . '</td>' ;
2010-12-27 18:03:02 +00:00
print '</tr>' . " \n " ;
2006-11-26 19:19:46 +00:00
2011-05-05 07:02:22 +00:00
//print "xx".$conf->global->MAIN_USE_ADVANCED_PERMS;
2009-04-27 20:37:50 +00:00
$sql = " SELECT r.id, r.libelle, r.module " ;
$sql .= " FROM " . MAIN_DB_PREFIX . " rights_def as r " ;
$sql .= " WHERE r.libelle NOT LIKE 'tou%' " ; // On ignore droits "tous"
2017-06-06 05:57:03 +00:00
$sql .= " AND r.entity = " . $entity ;
2010-11-08 11:40:52 +00:00
if ( empty ( $conf -> global -> MAIN_USE_ADVANCED_PERMS )) $sql .= " AND r.perms NOT LIKE '%_advance' " ; // Hide advanced perms if option is disable
2009-04-27 20:37:50 +00:00
$sql .= " ORDER BY r.module, r.id " ;
2006-11-26 19:19:46 +00:00
$result = $db -> query ( $sql );
if ( $result )
{
2015-03-09 20:20:56 +00:00
$num = $db -> num_rows ( $result );
$i = 0 ;
$oldmod = '' ;
2011-08-23 22:25:37 +00:00
2015-03-09 20:20:56 +00:00
while ( $i < $num )
{
$obj = $db -> fetch_object ( $result );
2005-02-04 14:30:38 +00:00
2015-03-09 20:20:56 +00:00
// Si la ligne correspond a un module qui n'existe plus (absent de includes/module), on l'ignore
if ( empty ( $modules [ $obj -> module ]))
{
$i ++ ;
continue ;
}
if ( isset ( $obj -> module ) && ( $oldmod <> $obj -> module ))
{
$oldmod = $obj -> module ;
2012-09-30 19:26:58 +00:00
2017-12-15 14:15:14 +00:00
// Break detected, we get objMod
2015-03-09 20:20:56 +00:00
$objMod = $modules [ $obj -> module ];
$picto = ( $objMod -> picto ? $objMod -> picto : 'generic' );
2012-09-30 19:26:58 +00:00
2017-12-15 14:15:14 +00:00
// Show break line
print '<tr class="oddeven trforbreak">' ;
print '<td class="maxwidthonsmartphone tdoverflowonsmartphone">' . img_object ( '' , $picto , 'class="pictoobjectwidth"' ) . ' ' . $objMod -> getName ();
print '<a name="' . $objMod -> getName () . '"></a></td>' ;
print '<td align="center" class="nowrap">' ;
if ( $caneditperms && empty ( $objMod -> rights_admin_allowed ) || empty ( $object -> admin ))
{
print '<a class="reposition" title="' . dol_escape_htmltag ( $langs -> trans ( " All " )) . '" alt="' . dol_escape_htmltag ( $langs -> trans ( " All " )) . '" href="' . $_SERVER [ " PHP_SELF " ] . '?id=' . $object -> id . '&action=addrights&entity=' . $entity . '&module=' . $obj -> module . '">' . $langs -> trans ( " All " ) . " </a> " ;
print '/' ;
print '<a class="reposition" title="' . dol_escape_htmltag ( $langs -> trans ( " None " )) . '" alt="' . dol_escape_htmltag ( $langs -> trans ( " None " )) . '" href="' . $_SERVER [ " PHP_SELF " ] . '?id=' . $object -> id . '&action=delrights&entity=' . $entity . '&module=' . $obj -> module . '">' . $langs -> trans ( " None " ) . " </a> " ;
}
print '</td>' ;
print '<td colspan="2"> </td>' ;
print '</tr>' . " \n " ;
2006-11-26 19:19:46 +00:00
}
2005-03-06 15:39:32 +00:00
2017-12-15 14:15:14 +00:00
print '<tr class="oddeven">' ;
2005-04-01 22:30:25 +00:00
2015-03-09 20:20:56 +00:00
// Picto and label of permission
2017-06-09 09:31:08 +00:00
print '<td class="maxwidthonsmartphone tdoverflowonsmartphone">' . img_object ( '' , $picto , 'class="pictoobjectwidth"' ) . ' ' . $objMod -> getName () . '</td>' ;
2012-09-27 09:54:51 +00:00
2012-09-30 19:26:58 +00:00
// Permission and tick
2017-12-15 14:15:14 +00:00
if ( ! empty ( $object -> admin ) && ! empty ( $objMod -> rights_admin_allowed )) // Permission granted because admin
2012-09-30 19:26:58 +00:00
{
if ( $caneditperms )
{
print '<td align="center">' . img_picto ( $langs -> trans ( " Administrator " ), 'star' ) . '</td>' ;
}
2013-04-24 23:13:13 +00:00
print '<td align="center" class="nowrap">' ;
2012-09-30 19:26:58 +00:00
print img_picto ( $langs -> trans ( " Active " ), 'tick' );
print '</td>' ;
}
2017-12-15 14:15:14 +00:00
else if ( in_array ( $obj -> id , $permsuser )) // Permission granted by user
2012-09-30 19:26:58 +00:00
{
if ( $caneditperms )
{
2017-06-06 05:57:03 +00:00
print '<td align="center"><a class="reposition" href="' . $_SERVER [ " PHP_SELF " ] . '?id=' . $object -> id . '&action=delrights&entity=' . $entity . '&rights=' . $obj -> id . '">' . img_edit_remove ( $langs -> trans ( " Remove " )) . '</a></td>' ;
2012-09-30 19:26:58 +00:00
}
2013-04-24 23:13:13 +00:00
print '<td align="center" class="nowrap">' ;
2012-09-30 19:26:58 +00:00
print img_picto ( $langs -> trans ( " Active " ), 'tick' );
print '</td>' ;
}
2013-01-02 17:43:59 +00:00
2012-10-04 16:40:05 +00:00
else if ( is_array ( $permsgroupbyentity [ $entity ]))
2012-09-30 19:26:58 +00:00
{
2017-12-15 14:15:14 +00:00
if ( in_array ( $obj -> id , $permsgroupbyentity [ $entity ])) // Permission granted by group
2012-10-04 16:40:05 +00:00
{
if ( $caneditperms )
{
print '<td align="center">' ;
2016-03-25 14:24:57 +00:00
print $form -> textwithtooltip ( $langs -> trans ( " Inherited " ), $langs -> trans ( " PermissionInheritedFromAGroup " ));
2012-10-04 16:40:05 +00:00
print '</td>' ;
}
2013-04-24 23:13:13 +00:00
print '<td align="center" class="nowrap">' ;
2012-10-04 16:40:05 +00:00
print img_picto ( $langs -> trans ( " Active " ), 'tick' );
print '</td>' ;
}
2013-01-16 17:58:39 +00:00
else
{
// Do not own permission
if ( $caneditperms )
{
2017-06-06 05:57:03 +00:00
print '<td align="center"><a class="reposition" href="' . $_SERVER [ " PHP_SELF " ] . '?id=' . $object -> id . '&action=addrights&entity=' . $entity . '&rights=' . $obj -> id . '">' . img_edit_add ( $langs -> trans ( " Add " )) . '</a></td>' ;
2013-01-16 17:58:39 +00:00
}
print '<td> </td>' ;
}
2012-09-30 19:26:58 +00:00
}
else
{
// Do not own permission
if ( $caneditperms )
{
2017-06-06 05:57:03 +00:00
print '<td align="center"><a class="reposition" href="' . $_SERVER [ " PHP_SELF " ] . '?id=' . $object -> id . '&action=addrights&entity=' . $entity . '&rights=' . $obj -> id . '">' . img_edit_add ( $langs -> trans ( " Add " )) . '</a></td>' ;
2012-09-30 19:26:58 +00:00
}
print '<td> </td>' ;
2006-11-26 19:19:46 +00:00
}
2005-03-06 15:39:32 +00:00
2015-08-12 21:12:15 +00:00
$permlabel = ( $conf -> global -> MAIN_USE_ADVANCED_PERMS && ( $langs -> trans ( " PermissionAdvanced " . $obj -> id ) != ( " PermissionAdvanced " . $obj -> id )) ? $langs -> trans ( " PermissionAdvanced " . $obj -> id ) : (( $langs -> trans ( " Permission " . $obj -> id ) != ( " Permission " . $obj -> id )) ? $langs -> trans ( " Permission " . $obj -> id ) : $langs -> trans ( $obj -> libelle )));
2016-11-11 11:55:03 +00:00
print '<td class="maxwidthonsmartphone">' . $permlabel . '</td>' ;
2005-03-06 15:39:32 +00:00
2015-03-09 20:20:56 +00:00
print '</tr>' . " \n " ;
2005-03-06 15:39:32 +00:00
2015-03-09 20:20:56 +00:00
$i ++ ;
}
2005-02-04 14:30:38 +00:00
}
2011-08-23 22:25:37 +00:00
else dol_print_error ( $db );
2006-11-26 19:19:46 +00:00
print '</table>' ;
2005-03-06 15:39:32 +00:00
2017-06-06 05:57:03 +00:00
$parameters = array ();
$reshook = $hookmanager -> executeHooks ( 'insertExtraFooter' , $parameters , $object , $action ); // Note that $action and $object may have been modified by some hooks
if ( $reshook < 0 ) setEventMessages ( $hookmanager -> error , $hookmanager -> errors , 'errors' );
2015-10-11 14:12:12 +00:00
2005-02-04 14:30:38 +00:00
2012-07-27 16:41:52 +00:00
dol_fiche_end ();
2018-08-04 13:58:05 +00:00
// End of page
2011-08-27 14:24:16 +00:00
llxFooter ();
2012-03-22 23:27:12 +00:00
$db -> close ();