2
0
forked from Wavyzz/dolibarr

Qual: Mutualize a lot of duplicate functions into functions.lib.php

This commit is contained in:
Laurent Destailleur
2011-08-17 15:56:22 +00:00
parent 20e520d6d8
commit 0adbca4625
25 changed files with 158 additions and 216 deletions

View File

@@ -20,7 +20,7 @@
/**
* \file htdocs/user/group/fiche.php
* \brief Onglet groupes utilisateurs
* \version $Id: fiche.php,v 1.69 2011/07/31 23:21:25 eldy Exp $
* \version $Id: fiche.php,v 1.70 2011/08/17 15:56:24 eldy Exp $
*/
require("../../main.inc.php");
@@ -293,7 +293,7 @@ else
print '<td width="75%" class="valeur">'.$object->nom;
if (empty($object->entity))
{
print img_redstar($langs->trans("GlobalGroup"));
print img_picto($langs->trans("GlobalGroup"),'redstar');
}
print "</td></tr>\n";
@@ -386,7 +386,7 @@ else
print "<tr $bc[$var]>";
print '<td>';
print '<a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$useringroup->id.'">'.img_object($langs->trans("ShowUser"),"user").' '.$useringroup->login.'</a>';
if ($useringroup->admin && ! $useringroup->entity) print img_redstar($langs->trans("SuperAdministrator"));
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>'.ucfirst(stripslashes($useringroup->lastname)).'</td>';
@@ -473,5 +473,5 @@ else
$db->close();
llxFooter('$Date: 2011/07/31 23:21:25 $ - $Revision: 1.69 $');
llxFooter('$Date: 2011/08/17 15:56:24 $ - $Revision: 1.70 $');
?>

View File

@@ -21,7 +21,7 @@
* \file htdocs/user/group/index.php
* \ingroup core
* \brief Page of user groups
* \version $Id: index.php,v 1.24 2011/07/31 23:21:25 eldy Exp $
* \version $Id: index.php,v 1.25 2011/08/17 15:56:24 eldy Exp $
*/
require("../../main.inc.php");
@@ -90,7 +90,7 @@ if ($resql)
print '<td><a href="fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowGroup"),"group").' '.$obj->nom.'</a>';
if (!$obj->entity)
{
print img_redstar($langs->trans("GlobalGroup"));
print img_picto($langs->trans("GlobalGroup"),'redstar');
}
print "</td>";
print '<td align="center">'.$obj->nb.'</td>';
@@ -108,6 +108,6 @@ else
$db->close();
llxFooter('$Date: 2011/07/31 23:21:25 $ - $Revision: 1.24 $');
llxFooter('$Date: 2011/08/17 15:56:24 $ - $Revision: 1.25 $');
?>

View File

@@ -20,7 +20,7 @@
* \file htdocs/user/group/ldap.php
* \ingroup ldap
* \brief Page fiche LDAP groupe
* \version $Id: ldap.php,v 1.26 2011/07/31 23:21:25 eldy Exp $
* \version $Id: ldap.php,v 1.27 2011/08/17 15:56:24 eldy Exp $
*/
require("../../main.inc.php");
@@ -115,7 +115,7 @@ print '<tr><td width="25%" valign="top">'.$langs->trans("Name").'</td>';
print '<td width="75%" class="valeur">'.$fgroup->nom;
if (!$fgroup->entity)
{
print img_redstar($langs->trans("GlobalGroup"));
print img_picto($langs->trans("GlobalGroup"),'redstar');
}
print "</td></tr>\n";
@@ -215,5 +215,5 @@ print '</table>';
$db->close();
llxFooter('$Date: 2011/07/31 23:21:25 $ - $Revision: 1.26 $');
llxFooter('$Date: 2011/08/17 15:56:24 $ - $Revision: 1.27 $');
?>

View File

@@ -22,7 +22,7 @@
/**
* \file htdocs/user/group/perms.php
* \brief Onglet user et permissions de la fiche utilisateur
* \version $Id: perms.php,v 1.40 2011/08/01 13:15:53 hregis Exp $
* \version $Id: perms.php,v 1.41 2011/08/17 15:56:24 eldy Exp $
*/
require("../../main.inc.php");
@@ -94,13 +94,13 @@ if ($_GET["id"])
// Charge les modules soumis a permissions
$modules = array();
$modulesdir = array();
foreach ($conf->file->dol_document_root as $type => $dirroot)
{
$modulesdir[] = $dirroot . "/includes/modules/";
if ($type == 'alt')
{
{
$handle=@opendir($dirroot);
if (is_resource($handle))
{
@@ -118,7 +118,7 @@ if ($_GET["id"])
}
}
}
foreach ($modulesdir as $dir)
{
// Load modules attributes in arrays (name, numero, orders) from dir directory
@@ -208,7 +208,7 @@ if ($_GET["id"])
print '<td colspan="2">'.$fgroup->nom.'';
if (! $fgroup->entity)
{
print img_redstar($langs->trans("GlobalGroup"));
print img_picto($langs->trans("GlobalGroup"),'redstar');
}
print "</td></tr>\n";
@@ -290,7 +290,7 @@ if ($_GET["id"])
print '<td align="center"><a href="perms.php?id='.$fgroup->id.'&amp;action=delrights&amp;rights='.$obj->id.'#'.$objMod->getName().'">'.img_edit_remove($langs->trans("Remove")).'</a></td>';
}
print '<td align="center">';
print img_tick();
print img_picto($langs->trans("Active"),'tick');
print '</td>';
}
else
@@ -316,5 +316,5 @@ if ($_GET["id"])
$db->close();
llxFooter('$Date: 2011/08/01 13:15:53 $ - $Revision: 1.40 $');
llxFooter('$Date: 2011/08/17 15:56:24 $ - $Revision: 1.41 $');
?>