Fix: Title of tabs must be the name of king of object. No properties must be included in title. Properties must be shown as a field in list the tab.

This commit is contained in:
Laurent Destailleur 2009-05-05 00:25:14 +00:00
parent 0ce46f52bf
commit aa967dc3e0
6 changed files with 23 additions and 35 deletions

View File

@ -219,8 +219,6 @@ else
*/ */
$head = group_prepare_head($group); $head = group_prepare_head($group);
$title = $langs->trans("Group"); $title = $langs->trans("Group");
if (! $group->entity) $title = $langs->trans("GlobalGroup");
dol_fiche_head($head, 'group', $title); dol_fiche_head($head, 'group', $title);
@ -296,24 +294,24 @@ else
// On salectionne les users qui ne sont pas deja dans le groupe // On salectionne les users qui ne sont pas deja dans le groupe
$userlistid = array(); $userlistid = array();
$uss = array(); $uss = array();
$sql = "SELECT ug.fk_user"; $sql = "SELECT ug.fk_user";
$sql.= " FROM ".MAIN_DB_PREFIX."usergroup_user as ug"; $sql.= " FROM ".MAIN_DB_PREFIX."usergroup_user as ug";
$sql.= ", ".MAIN_DB_PREFIX."user as u"; $sql.= ", ".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE ug.fk_usergroup = ".$group->id; $sql.= " WHERE ug.fk_usergroup = ".$group->id;
$sql.= " AND ug.fk_user = u.rowid"; $sql.= " AND ug.fk_user = u.rowid";
$sql.= " AND u.entity IN (0,".$conf->entity.")"; $sql.= " AND u.entity IN (0,".$conf->entity.")";
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result)
{ {
$num = $db->num_rows($result); $num = $db->num_rows($result);
$i = 0; $i = 0;
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
$userlistid[]=$obj->fk_user; $userlistid[]=$obj->fk_user;
$i++; $i++;
} }
@ -321,9 +319,9 @@ else
else { else {
dol_print_error($db); dol_print_error($db);
} }
$idList = implode(",",$userlistid); $idList = implode(",",$userlistid);
if (!empty($idList)) if (!empty($idList))
{ {
$sql = "SELECT u.rowid, u.login, u.name, u.firstname, u.admin"; $sql = "SELECT u.rowid, u.login, u.name, u.firstname, u.admin";
@ -331,7 +329,7 @@ else
$sql.= " WHERE u.entity IN (0,".$conf->entity.")"; $sql.= " WHERE u.entity IN (0,".$conf->entity.")";
$sql.= " AND u.rowid NOT IN (".$idList.")"; $sql.= " AND u.rowid NOT IN (".$idList.")";
$sql.= " ORDER BY u.name"; $sql.= " ORDER BY u.name";
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result)
{ {
@ -357,7 +355,7 @@ else
$sql.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE u.entity IN (0,".$conf->entity.")"; $sql.= " WHERE u.entity IN (0,".$conf->entity.")";
$sql.= " ORDER BY u.name"; $sql.= " ORDER BY u.name";
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result)
{ {

View File

@ -74,8 +74,6 @@ if ($_GET["id"])
*/ */
$head = group_prepare_head($fgroup); $head = group_prepare_head($fgroup);
$title = $langs->trans("Group"); $title = $langs->trans("Group");
if (!$fgroup->entity) $title = $langs->trans("GlobalGroup");
dol_fiche_head($head, 'rights', $title); dol_fiche_head($head, 'rights', $title);

View File

@ -51,9 +51,7 @@ $fuser->info($_GET["id"]);
$head = user_prepare_head($fuser); $head = user_prepare_head($fuser);
$title = $fuser->admin ? $langs->trans("Administrator") : $langs->trans("User"); $title = $langs->trans("User");
$title = !$fuser->entity ? $langs->trans("SuperAdministrator") : $title;
dol_fiche_head($head, 'info', $title); dol_fiche_head($head, 'info', $title);

View File

@ -92,9 +92,7 @@ $form = new Form($db);
*/ */
$head = user_prepare_head($fuser); $head = user_prepare_head($fuser);
$title = $fuser->admin ? $langs->trans("Administrator") : $langs->trans("User"); $title = $langs->trans("User");
$title = !$fuser->entity ? $langs->trans("SuperAdministrator") : $title;
dol_fiche_head($head, 'ldap', $title); dol_fiche_head($head, 'ldap', $title);

View File

@ -55,7 +55,7 @@ if (($fuser->id != $user->id) && (! $user->rights->user->user->lire))
if ($_POST["action"] == 'update' && $user->rights->user->user->creer && ! $_POST["cancel"]) if ($_POST["action"] == 'update' && $user->rights->user->user->creer && ! $_POST["cancel"])
{ {
$db->begin(); $db->begin();
$res=$fuser->update_note($_POST["note"],$user); $res=$fuser->update_note($_POST["note"],$user);
if ($res < 0) if ($res < 0)
{ {
@ -81,16 +81,14 @@ $html = new Form($db);
if ($id) if ($id)
{ {
$head = user_prepare_head($fuser); $head = user_prepare_head($fuser);
$title = $fuser->admin ? $langs->trans("Administrator") : $langs->trans("User");
$title = !$fuser->entity ? $langs->trans("SuperAdministrator") : $title;
$title = $langs->trans("User");
dol_fiche_head($head, 'note', $title); dol_fiche_head($head, 'note', $title);
if ($msg) print '<div class="error">'.$msg.'</div>'; if ($msg) print '<div class="error">'.$msg.'</div>';
print "<form method=\"post\" action=\"note.php\">"; print "<form method=\"post\" action=\"note.php\">";
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Reference // Reference
@ -147,7 +145,7 @@ if ($id)
print "</table>"; print "</table>";
print "</form>\n"; print "</form>\n";
/* /*
* Actions * Actions
*/ */

View File

@ -94,9 +94,7 @@ $fuser->getrights();
*/ */
$head = user_prepare_head($fuser); $head = user_prepare_head($fuser);
$title = $fuser->admin ? $langs->trans("Administrator") : $langs->trans("User"); $title = $langs->trans("User");
$title = !$fuser->entity ? $langs->trans("SuperAdministrator") : $title;
dol_fiche_head($head, 'rights', $title); dol_fiche_head($head, 'rights', $title);
@ -109,22 +107,22 @@ $listdir=$conf->dol_document_root;
foreach($listdir as $dirroot) foreach($listdir as $dirroot)
{ {
$dir=$dirroot."/includes/modules/"; $dir=$dirroot."/includes/modules/";
$handle=opendir($dir); $handle=opendir($dir);
while (($file = readdir($handle))!==false) while (($file = readdir($handle))!==false)
{ {
if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, strlen($file) - 10) == '.class.php') if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, strlen($file) - 10) == '.class.php')
{ {
$modName = substr($file, 0, strlen($file) - 10); $modName = substr($file, 0, strlen($file) - 10);
if ($modName) if ($modName)
{ {
include_once($dir.$file); include_once($dir.$file);
$objMod = new $modName($db); $objMod = new $modName($db);
if ($objMod->rights_class) { if ($objMod->rights_class) {
$ret=$objMod->insert_permissions(); $ret=$objMod->insert_permissions();
$modules[$objMod->rights_class]=$objMod; $modules[$objMod->rights_class]=$objMod;
//print "modules[".$objMod->rights_class."]=$objMod;"; //print "modules[".$objMod->rights_class."]=$objMod;";
} }
@ -246,7 +244,7 @@ if ($result)
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
// Si la ligne correspond a un module qui n'existe plus (absent de includes/module), on l'ignore // Si la ligne correspond a un module qui n'existe plus (absent de includes/module), on l'ignore
if (! $modules[$obj->module]) if (! $modules[$obj->module])
{ {
$i++; $i++;
continue; continue;
@ -266,7 +264,7 @@ if ($result)
// On affiche ligne pour modifier droits // On affiche ligne pour modifier droits
print '<tr '. $bc[$var].'>'; print '<tr '. $bc[$var].'>';
print '<td nowrap="nowrap">'.img_object('',$picto).' '.$objMod->getName(); print '<td nowrap="nowrap">'.img_object('',$picto).' '.$objMod->getName();
print '<a name="'.$objMod->getName().'">&nbsp;</a></td>'; print '<a name="'.$objMod->getName().'">&nbsp;</a></td>';
print '<td align="center" nowrap>'; print '<td align="center" nowrap>';
print '<a title='.$langs->trans("All").' alt='.$langs->trans("All").' href="perms.php?id='.$fuser->id.'&amp;action=addrights&amp;module='.$obj->module.'#'.$objMod->getName().'">'.$langs->trans("All")."</a>"; print '<a title='.$langs->trans("All").' alt='.$langs->trans("All").' href="perms.php?id='.$fuser->id.'&amp;action=addrights&amp;module='.$obj->module.'#'.$objMod->getName().'">'.$langs->trans("All")."</a>";
print '/'; print '/';
@ -280,7 +278,7 @@ if ($result)
print '<tr '. $bc[$var].'>'; print '<tr '. $bc[$var].'>';
print '<td>'.img_object('',$picto).' '.$objMod->getName(); print '<td>'.img_object('',$picto).' '.$objMod->getName();
print '</td>'; print '</td>';
if ($fuser->admin && $objMod->rights_admin_allowed) if ($fuser->admin && $objMod->rights_admin_allowed)
{ {
@ -306,7 +304,7 @@ if ($result)
} }
else if (in_array($obj->id, $permsgroup)) { else if (in_array($obj->id, $permsgroup)) {
// Permission own by group // Permission own by group
if ($caneditperms) if ($caneditperms)
{ {
print '<td align="center">'; print '<td align="center">';
print $form->textwithtooltip($langs->trans("Group"),$langs->trans("PermissionInheritedFromAGroup")); print $form->textwithtooltip($langs->trans("Group"),$langs->trans("PermissionInheritedFromAGroup"));