mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Uniformize code
This commit is contained in:
parent
b554d81314
commit
ac4bd7d441
|
|
@ -413,8 +413,10 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
|
|||
{
|
||||
print '<div class="menu_contenu">'.$tabstring;
|
||||
if ($menu_array[$i]['url']) print '<a class="vsmenu" href="'.$url.'"'.($menu_array[$i]['target']?' target="'.$menu_array[$i]['target'].'"':'').'>';
|
||||
else print '<span class="vsmenu">';
|
||||
print $menu_array[$i]['titre'];
|
||||
if ($menu_array[$i]['url']) print '</a>';
|
||||
else print '</span>';
|
||||
// If title is not pure text and contains a table, no carriage return added
|
||||
if (! strstr($menu_array[$i]['titre'],'<table')) print '<br>';
|
||||
print '</div>'."\n";
|
||||
|
|
|
|||
|
|
@ -489,7 +489,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
|||
$newmenu->add("/admin/ihm.php?mainmenu=home", $langs->trans("GUISetup"),1);
|
||||
if (! in_array($langs->defaultlang,array('en_US','en_GB','en_NZ','en_AU','fr_FR','fr_BE','es_ES','ca_ES')))
|
||||
{
|
||||
if (empty($leftmenu) || $leftmenu=="setup") $newmenu->add("/admin/translation.php", $langs->trans("Translation"),1);
|
||||
$newmenu->add("/admin/translation.php", $langs->trans("Translation"),1);
|
||||
}
|
||||
$newmenu->add("/admin/boxes.php?mainmenu=home", $langs->trans("Boxes"),1);
|
||||
$newmenu->add("/admin/delais.php?mainmenu=home",$langs->trans("Alerts"),1);
|
||||
|
|
@ -546,12 +546,15 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
|||
}
|
||||
|
||||
$newmenu->add("/user/home.php?leftmenu=users", $langs->trans("MenuUsersAndGroups"), 0, 1, '', $mainmenu, 'users');
|
||||
if (empty($leftmenu) || $leftmenu=="users")
|
||||
if (empty($leftmenu) || $leftmenu == 'none' || $leftmenu=="users")
|
||||
{
|
||||
$newmenu->add("/user/index.php", $langs->trans("Users"), 1, $user->rights->user->user->lire || $user->admin);
|
||||
$newmenu->add("/user/card.php?action=create", $langs->trans("NewUser"),2, $user->rights->user->user->creer || $user->admin);
|
||||
$newmenu->add("/user/group/index.php", $langs->trans("Groups"), 1, ($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->read:$user->rights->user->user->lire) || $user->admin);
|
||||
$newmenu->add("", $langs->trans("Users"), 1, $user->rights->user->user->lire || $user->admin);
|
||||
$newmenu->add("/user/card.php?action=create", $langs->trans("NewUser"),2, $user->rights->user->user->creer || $user->admin, '', 'home');
|
||||
$newmenu->add("/user/index.php", $langs->trans("ListOfUsers"), 2, $user->rights->user->user->lire || $user->admin);
|
||||
$newmenu->add("/user/hierarchy.php", $langs->trans("HierarchicView"), 2, $user->rights->user->user->lire || $user->admin);
|
||||
$newmenu->add("", $langs->trans("Groups"), 1, $user->rights->user->user->lire || $user->admin);
|
||||
$newmenu->add("/user/group/card.php?action=create", $langs->trans("NewGroup"), 2, ($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->write:$user->rights->user->user->creer) || $user->admin);
|
||||
$newmenu->add("/user/group/index.php", $langs->trans("ListOfGroups"), 2, ($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->read:$user->rights->user->user->lire) || $user->admin);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1441,8 +1444,10 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
|||
{
|
||||
print '<div class="menu_contenu">'.$tabstring;
|
||||
if ($menu_array[$i]['url']) print '<a class="vsmenu" href="'.$url.'"'.($menu_array[$i]['target']?' target="'.$menu_array[$i]['target'].'"':'').'>';
|
||||
else print '<span class="vsmenu">';
|
||||
print $menu_array[$i]['titre'];
|
||||
if ($menu_array[$i]['url']) print '</a>';
|
||||
else print '</span>';
|
||||
// If title is not pure text and contains a table, no carriage return added
|
||||
if (! strstr($menu_array[$i]['titre'],'<table')) print '<br>';
|
||||
print '</div>'."\n";
|
||||
|
|
|
|||
|
|
@ -177,10 +177,20 @@ class MenuManager
|
|||
print '<div class="menu_contenu">';
|
||||
|
||||
if ($this->menu->liste[$i]['enabled'])
|
||||
print $tabstring.'<a class="vsmenu" href="'.dol_buildpath($this->menu->liste[$i]['url'],1).'">'.$this->menu->liste[$i]['titre'].'</a><br>';
|
||||
{
|
||||
print $tabstring;
|
||||
if ($this->menu->liste[$i]['url']) print '<a class="vsmenu" href="'.dol_buildpath($this->menu->liste[$i]['url'],1).'"'.($this->menu->liste[$i]['target']?' target="'.$this->menu->liste[$i]['target'].'"':'').'>';
|
||||
else print '<span class="vsmenu">';
|
||||
if ($this->menu->liste[$i]['url']) print $this->menu->liste[$i]['titre'].'</a>';
|
||||
else print '</span>';
|
||||
}
|
||||
else
|
||||
print $tabstring.'<font class="vsmenudisabled vsmenudisabledmargin">'.$this->menu->liste[$i]['titre'].'</font><br>';
|
||||
{
|
||||
print $tabstring.'<font class="vsmenudisabled vsmenudisabledmargin">'.$this->menu->liste[$i]['titre'].'</font>';
|
||||
}
|
||||
|
||||
// If title is not pure text and contains a table, no carriage return added
|
||||
if (! strstr($this->menu->liste[$i]['titre'],'<table')) print '<br>';
|
||||
print '</div>'."\n";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -998,7 +998,7 @@ a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active { font-size:<?php p
|
|||
font.vmenudisabled { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; color: #93a5aa; }
|
||||
a.vmenu:link, a.vmenu:visited { color: #<?php echo $colortextbackvmenu; ?>; }
|
||||
|
||||
a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: normal; color: #202020; margin: 1px 1px 1px 8px; }
|
||||
a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active, span.vsmenu { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: normal; color: #202020; margin: 1px 1px 1px 8px; }
|
||||
font.vsmenudisabled { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: normal; color: #93a5aa; }
|
||||
a.vsmenu:link, a.vsmenu:visited { color: #<?php echo $colortextbackvmenu; ?>; }
|
||||
font.vsmenudisabledmargin { margin: 1px 1px 1px 8px; }
|
||||
|
|
|
|||
|
|
@ -615,10 +615,10 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
|||
|
||||
print_fiche_titre($langs->trans("NewUser"));
|
||||
|
||||
print $langs->trans("CreateInternalUserDesc");
|
||||
print "<br>";
|
||||
print $langs->trans("CreateInternalUserDesc")."<br>\n";
|
||||
print "<br>";
|
||||
|
||||
|
||||
if (! empty($conf->ldap->enabled) && (isset($conf->global->LDAP_SYNCHRO_ACTIVE) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'ldap2dolibarr'))
|
||||
{
|
||||
/*
|
||||
|
|
@ -707,7 +707,6 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
|||
print '<br>';
|
||||
}
|
||||
|
||||
print dol_set_focus('#lastname');
|
||||
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'" method="POST" name="createuser">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
|
@ -715,6 +714,10 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
|||
if (! empty($ldap_sid)) print '<input type="hidden" name="ldap_sid" value="'.$ldap_sid.'">';
|
||||
print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
|
||||
|
||||
dol_fiche_head('', '', '', 0, '');
|
||||
|
||||
print dol_set_focus('#lastname');
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr>';
|
||||
|
|
@ -1025,7 +1028,9 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
|||
|
||||
print "</table>\n";
|
||||
|
||||
print '<br><div align="center"><input class="button" value="'.$langs->trans("CreateUser").'" name="create" type="submit"></div>';
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div align="center"><input class="button" value="'.$langs->trans("CreateUser").'" name="create" type="submit"></div>';
|
||||
|
||||
print "</form>";
|
||||
}
|
||||
|
|
@ -1090,9 +1095,7 @@ else
|
|||
|
||||
// Show tabs
|
||||
$head = user_prepare_head($object);
|
||||
|
||||
$title = $langs->trans("User");
|
||||
dol_fiche_head($head, 'user', $title, 0, 'user');
|
||||
|
||||
/*
|
||||
* Confirmation reinitialisation mot de passe
|
||||
|
|
@ -1139,6 +1142,8 @@ else
|
|||
*/
|
||||
if ($action != 'edit')
|
||||
{
|
||||
dol_fiche_head($head, 'user', $title, 0, 'user');
|
||||
|
||||
$rowspan=19;
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
|
@ -1451,7 +1456,7 @@ else
|
|||
|
||||
print "</table>\n";
|
||||
|
||||
print "</div>\n";
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -1669,7 +1674,14 @@ else
|
|||
*/
|
||||
if ($action == 'edit' && ($canedituser || $caneditfield || $caneditpassword || ($user->id == $object->id)))
|
||||
{
|
||||
$rowspan=16;
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'" method="POST" name="updateuser" enctype="multipart/form-data">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="entity" value="'.$object->entity.'">';
|
||||
|
||||
dol_fiche_head($head, 'user', $title, 0, 'user');
|
||||
|
||||
$rowspan=16;
|
||||
if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER)) $rowspan++;
|
||||
if (! empty($conf->societe->enabled)) $rowspan++;
|
||||
if (! empty($conf->adherent->enabled)) $rowspan++;
|
||||
|
|
@ -1677,13 +1689,9 @@ else
|
|||
if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) $rowspan = $rowspan+3;
|
||||
if (! empty($conf->agenda->enabled)) $rowspan++;
|
||||
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'" method="POST" name="updateuser" enctype="multipart/form-data">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="entity" value="'.$object->entity.'">';
|
||||
print '<table width="100%" class="border">';
|
||||
|
||||
print '<tr><td width="25%" valign="top">'.$langs->trans("Ref").'</td>';
|
||||
print '<tr><td width="25%" valign="top">'.$langs->trans("Ref").'</td>';
|
||||
print '<td colspan="2">';
|
||||
print $object->id;
|
||||
print '</td>';
|
||||
|
|
@ -2141,15 +2149,15 @@ else
|
|||
|
||||
print '</table>';
|
||||
|
||||
print '<br><div align="center">';
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div align="center">';
|
||||
print '<input value="'.$langs->trans("Save").'" class="button" type="submit" name="save">';
|
||||
print ' ';
|
||||
print ' ';
|
||||
print '<input value="'.$langs->trans("Cancel").'" class="button" type="submit" name="cancel">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
if (! empty($conf->ldap->enabled) && ! empty($object->ldap_sid)) $ldap->close;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 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>
|
||||
|
|
@ -230,9 +230,12 @@ if ($action == 'create')
|
|||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
|
||||
dol_fiche_head('', '', '', 0, '');
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print "<tr>".'<td valign="top" class="fieldrequired">'.$langs->trans("Name").'</td>';
|
||||
print "<tr>";
|
||||
print '<td valign="top" class="fieldrequired" width="15%">'.$langs->trans("Name").'</td>';
|
||||
print '<td class="valeur"><input size="30" type="text" id="nom" name="nom" value=""></td></tr>';
|
||||
|
||||
// Multicompany
|
||||
|
|
@ -250,7 +253,7 @@ if ($action == 'create')
|
|||
}
|
||||
}
|
||||
|
||||
print "<tr>".'<td valign="top">'.$langs->trans("Note").'</td><td>';
|
||||
print "<tr>".'<td valign="top">'.$langs->trans("Description").'</td><td>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor=new DolEditor('note','','',240,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,ROWS_8,90);
|
||||
$doleditor->Create();
|
||||
|
|
@ -266,7 +269,9 @@ if ($action == 'create')
|
|||
|
||||
print "</table>\n";
|
||||
|
||||
print '<br><div class="center"><input class="button" value="'.$langs->trans("CreateGroup").'" type="submit"></div>';
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center"><input class="button" value="'.$langs->trans("CreateGroup").'" type="submit"></div>';
|
||||
|
||||
print "</form>";
|
||||
}
|
||||
|
|
@ -283,12 +288,8 @@ else
|
|||
{
|
||||
$object->fetch($id);
|
||||
|
||||
/*
|
||||
* Affichage onglets
|
||||
*/
|
||||
$head = group_prepare_head($object);
|
||||
$title = $langs->trans("Group");
|
||||
dol_fiche_head($head, 'group', $title, 0, 'group');
|
||||
|
||||
/*
|
||||
* Confirmation suppression
|
||||
|
|
@ -304,6 +305,8 @@ else
|
|||
|
||||
if ($action != 'edit')
|
||||
{
|
||||
dol_fiche_head($head, 'group', $title, 0, 'group');
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
|
|
@ -332,7 +335,7 @@ else
|
|||
}
|
||||
|
||||
// Note
|
||||
print '<tr><td width="25%" valign="top">'.$langs->trans("Note").'</td>';
|
||||
print '<tr><td width="25%" valign="top">'.$langs->trans("Description").'</td>';
|
||||
print '<td class="valeur">'.dol_htmlentitiesbr($object->note).' </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
|
@ -346,7 +349,8 @@ else
|
|||
|
||||
print "</table>\n";
|
||||
|
||||
print '</div>';
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
/*
|
||||
* Barre d'actions
|
||||
|
|
@ -501,6 +505,8 @@ else
|
|||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
dol_fiche_head($head, 'group', $title, 0, 'group');
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td width="25%" valign="top" class="fieldrequired">'.$langs->trans("Name").'</td>';
|
||||
print '<td width="75%" class="valeur"><input size="15" type="text" name="group" value="'.$object->name.'">';
|
||||
|
|
@ -521,7 +527,7 @@ else
|
|||
}
|
||||
}
|
||||
|
||||
print '<tr><td width="25%" valign="top">'.$langs->trans("Note").'</td>';
|
||||
print '<tr><td width="25%" valign="top">'.$langs->trans("Description").'</td>';
|
||||
print '<td class="valeur">';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor=new DolEditor('note',$object->note,'',240,'dolibarr_notes','',true,false,$conf->global->FCKEDITOR_ENABLE_SOCIETE,ROWS_8,90);
|
||||
|
|
@ -538,11 +544,11 @@ else
|
|||
|
||||
print "</table>\n";
|
||||
|
||||
print '<br><div class="center"><input class="button" value="'.$langs->trans("Save").'" type="submit"></div>';
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center"><input class="button" value="'.$langs->trans("Save").'" type="submit"></div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,9 @@ $form = new Form($db);
|
|||
|
||||
llxHeader('',$langs->trans("ListOfUsers"));
|
||||
|
||||
print_fiche_titre($langs->trans("ListOfUsers"), '<form action="'.DOL_URL_ROOT.'/user/hierarchy.php" method="POST"><input type="submit" class="button" style="width:120px" name="viewcal" value="'.dol_escape_htmltag($langs->trans("HierarchicView")).'"></form>');
|
||||
$buttonviewhierarchy='<form action="'.DOL_URL_ROOT.'/user/hierarchy.php" method="POST"><input type="submit" class="button" style="width:120px" name="viewcal" value="'.dol_escape_htmltag($langs->trans("HierarchicView")).'"></form>';
|
||||
|
||||
print_fiche_titre($langs->trans("ListOfUsers"), $buttonviewhierarchy);
|
||||
|
||||
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.admin, u.fk_soc, u.login,";
|
||||
$sql.= " u.datec,";
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user