New: early development of multi-company module

This commit is contained in:
Regis Houssin 2009-05-04 15:42:04 +00:00
parent 9a8a953e47
commit d034282a53
11 changed files with 53 additions and 21 deletions

View File

@ -754,8 +754,11 @@ else
* Affichage onglets
*/
$head = user_prepare_head($fuser);
$title = $fuser->admin ? $langs->trans("Administrator") : $langs->trans("User");
$title = !$fuser->entity ? $langs->trans("SuperAdministrator") : $title;
dol_fiche_head($head, 'user', $langs->trans("User"));
dol_fiche_head($head, 'user', $title);
/*
@ -1299,13 +1302,15 @@ else
else
{
print '<td>';
if ($user->admin && ($fuser->entity!=0)) // On ne modifie pas le superadmin
if ($user->admin && $fuser->entity!=0) // On ne modifie pas le superadmin
{
print $form->selectyesno('admin',$fuser->admin,1);
}
else
{
print '<input type="hidden" name="admin" value="'.$fuser->admin.'">'.yn($fuser->admin);
$yn = yn($fuser->admin);
print '<input type="hidden" name="admin" value="'.$fuser->admin.'">';
print $html->textwithwarning($yn,$langs->trans("DontChangeSuperAdmin"));
}
print '</td></tr>';
}
@ -1321,13 +1326,14 @@ else
{
print $langs->trans("DomainUser");
}
else if ($fuser->entity!=0)
if ($fuser->admin && !$fuser->entity)
{
print $langs->trans("Internal");
print $langs->trans("SuperAdministrator");
print ' '.img_picto($langs->trans("SuperAdministrator"),"redstar");
}
else
{
print $langs->trans("SuperAdmin");
print $langs->trans("Internal");
}
print '</td></tr>';

View File

@ -251,8 +251,12 @@ else
// Nom
print '<tr><td width="25%" valign="top">'.$langs->trans("Name").'</td>';
print '<td width="75%" class="valeur">'.$group->nom.'</td>';
print "</tr>\n";
print '<td width="75%" class="valeur">'.$group->nom;
if (!$group->entity)
{
print img_redstar($langs->trans("GlobalGroup"));
}
print "</td></tr>\n";
// Note
print '<tr><td width="25%" valign="top">'.$langs->trans("Note").'</td>';
@ -369,7 +373,7 @@ else
print '<a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowUser"),"user").' '.$obj->login.'</a>';
if ($obj->admin && !$obj->entity)
{
print img_picto($langs->trans("SuperAdministrator"),'redstar');
print img_redstar($langs->trans("SuperAdministrator"));
}
else if ($obj->admin)
{
@ -417,8 +421,12 @@ else
print '<table class="border" width="100%">';
print '<tr><td width="25%" valign="top">'.$langs->trans("Name").'</td>';
print '<td width="75%" class="valeur"><input size="15" type="text" name="group" value="'.$group->nom.'"></td>';
print "</tr>\n";
print '<td width="75%" class="valeur"><input size="15" type="text" name="group" value="'.$group->nom.'">';
if (!$group->entity)
{
print img_redstar($langs->trans("GlobalGroup"));
}
print "</td></tr>\n";
print '<tr><td width="25%" valign="top">'.$langs->trans("Note").'</td>';
print '<td class="valeur">';
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_USER)

View File

@ -91,7 +91,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_picto($langs->trans("GlobalGroup"),'redstar');
print img_redstar($langs->trans("GlobalGroup"));
}
print "</td>";
print '<td width="100" align="center">'.dol_print_date($obj->datec,"day").'</td>';

View File

@ -154,8 +154,12 @@ if ($_GET["id"])
// Nom
print '<tr><td width="25%" valign="top">'.$langs->trans("Name").'</td>';
print '<td colspan="2">'.$fgroup->nom.'</td>';
print "</tr>\n";
print '<td colspan="2">'.$fgroup->nom.'';
if (!$obj->entity)
{
print img_redstar($langs->trans("GlobalGroup"));
}
print "</td></tr>\n";
// Note
print '<tr><td width="25%" valign="top">'.$langs->trans("Note").'</td>';

View File

@ -101,7 +101,7 @@ if ($resql)
print "<td><a href=\"".DOL_URL_ROOT."/user/fiche.php?id=$obj->rowid\">".img_object($langs->trans("ShowUser"),"user")." ".$obj->firstname." ".$obj->name."</a>";
if ($obj->admin && !$obj->entity)
{
print img_picto($langs->trans("SuperAdministrator"),'redstar');
print img_redstar($langs->trans("SuperAdministrator"));
}
else if ($obj->admin)
{

View File

@ -100,7 +100,7 @@ if ($result)
print '<td><a href="fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowUser"),"user").' '.$obj->login.'</a>';
if ($obj->admin && !$obj->entity)
{
print img_picto($langs->trans("SuperAdministrator"),'redstar');
print img_redstar($langs->trans("SuperAdministrator"));
}
else if ($obj->admin)
{

View File

@ -51,7 +51,10 @@ $fuser->info($_GET["id"]);
$head = user_prepare_head($fuser);
dol_fiche_head($head, 'info', $langs->trans("User"));
$title = $fuser->admin ? $langs->trans("Administrator") : $langs->trans("User");
$title = !$fuser->entity ? $langs->trans("SuperAdministrator") : $title;
dol_fiche_head($head, 'info', $title);
print '<table width="100%"><tr><td>';

View File

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

View File

@ -82,7 +82,10 @@ if ($id)
{
$head = user_prepare_head($fuser);
dol_fiche_head($head, 'note', $langs->trans("User"));
$title = $fuser->admin ? $langs->trans("Administrator") : $langs->trans("User");
$title = !$fuser->entity ? $langs->trans("SuperAdministrator") : $title;
dol_fiche_head($head, 'note', $title);
if ($msg) print '<div class="error">'.$msg.'</div>';

View File

@ -113,7 +113,10 @@ llxHeader();
*/
$head = user_prepare_head($fuser);
dol_fiche_head($head, 'guisetup', $langs->trans("User"));
$title = $fuser->admin ? $langs->trans("Administrator") : $langs->trans("User");
$title = !$fuser->entity ? $langs->trans("SuperAdministrator") : $title;
dol_fiche_head($head, 'guisetup', $title);
print '<table class="border" width="100%">';

View File

@ -94,7 +94,10 @@ $fuser->getrights();
*/
$head = user_prepare_head($fuser);
dol_fiche_head($head, 'rights', $langs->trans("User"));
$title = $fuser->admin ? $langs->trans("Administrator") : $langs->trans("User");
$title = !$fuser->entity ? $langs->trans("SuperAdministrator") : $title;
dol_fiche_head($head, 'rights', $title);
$db->begin();