NEW Filter "active" by default on user list.

Fix label of permission of project module
This commit is contained in:
Laurent Destailleur 2015-06-20 20:35:57 +02:00
parent 40d17add22
commit 2c5ef858d0
7 changed files with 34 additions and 21 deletions

View File

@ -832,7 +832,7 @@ if ($id)
$fieldlist=explode(',',$tabfield[$id]);
// Line for title
print '<tr class="liste_titre nohover">';
print '<tr class="liste_titre">';
foreach ($fieldlist as $field => $value)
{
// Determine le nom du champ par rapport aux noms possibles
@ -906,7 +906,7 @@ if ($id)
print '</tr>';
// Line to enter new values
print "<tr ".$bc[$var].">";
print "<tr ".$bcnd[$var].">";
$obj = new stdClass();
// If data was already input, we define them in obj to populate input fields.

View File

@ -3218,7 +3218,8 @@ class Form
$formconfirm.= '<script type="text/javascript">'."\n";
$formconfirm.= 'jQuery(document).ready(function() {
$(function() {
$( "#'.$dialogconfirm.'" ).dialog({
$( "#'.$dialogconfirm.'" ).dialog(
{
autoOpen: '.($autoOpen ? "true" : "false").',';
if ($newselectedchoice == 'no')
{
@ -3272,7 +3273,8 @@ class Form
$(this).dialog("close");
}
}
});
}
);
var button = "'.$button.'";
if (button.length > 0) {

View File

@ -130,35 +130,35 @@ class modProjet extends DolibarrModules
$r++;
$this->rights[$r][0] = 41; // id de la permission
$this->rights[$r][1] = "Lire les projets et tâches (partagés ou dont je suis contact)"; // libelle de la permission
$this->rights[$r][1] = "Read projects and tasks (shared projects or projects I am contact for). Can also enter time consumed on assigned tasks (timesheet)"; // libelle de la permission
$this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 1; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'lire';
$r++;
$this->rights[$r][0] = 42; // id de la permission
$this->rights[$r][1] = "Creer/modifier les projets et tâches (partagés ou dont je suis contact)"; // libelle de la permission
$this->rights[$r][1] = "Create/modify projects and tasks (shared projects or projects I am contact for)"; // libelle de la permission
$this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'creer';
$r++;
$this->rights[$r][0] = 44; // id de la permission
$this->rights[$r][1] = "Supprimer les projets et tâches (partagés ou dont je suis contact)"; // libelle de la permission
$this->rights[$r][1] = "Delete project and tasks (shared projects or projects I am contact for)"; // libelle de la permission
$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'supprimer';
$r++;
$this->rights[$r][0] = 45; // id de la permission
$this->rights[$r][1] = "Exporter les projets"; // libelle de la permission
$this->rights[$r][1] = "Export projects"; // libelle de la permission
$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'export';
$r++;
$this->rights[$r][0] = 141; // id de la permission
$this->rights[$r][1] = "Lire tous les projets et tâches (y compris prives qui ne me sont pas affectes)"; // libelle de la permission
$this->rights[$r][1] = "Read all projects and tasks (also private projects I am not contact for)"; // libelle de la permission
$this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'all';
@ -166,7 +166,7 @@ class modProjet extends DolibarrModules
$r++;
$this->rights[$r][0] = 142; // id de la permission
$this->rights[$r][1] = "Creer/modifier tous les projets et tâches (y compris prives qui ne me sont pas affectes)"; // libelle de la permission
$this->rights[$r][1] = "Create/modify all projects and tasks (also private projects I am not contact for)"; // libelle de la permission
$this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'all';
@ -174,7 +174,7 @@ class modProjet extends DolibarrModules
$r++;
$this->rights[$r][0] = 144; // id de la permission
$this->rights[$r][1] = "Supprimer tous les projets et tâches (y compris prives qui ne me sont pas affectes)"; // libelle de la permission
$this->rights[$r][1] = "Delete all projects and tasks (also private projects I am not contact for)"; // libelle de la permission
$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'all';

View File

@ -429,8 +429,8 @@ Module20Name=Proposals
Module20Desc=Commercial proposal management
Module22Name=Mass E-mailings
Module22Desc=Mass E-mailing management
Module23Name= Energy
Module23Desc= Monitoring the consumption of energies
Module23Name=Energy
Module23Desc=Monitoring the consumption of energies
Module25Name=Customer Orders
Module25Desc=Customer order management
Module30Name=Invoices
@ -579,7 +579,7 @@ Permission32=Create/modify products
Permission34=Delete products
Permission36=See/manage hidden products
Permission38=Export products
Permission41=Read projects (shared project and projects i'm contact for)
Permission41=Read projects and tasks (shared project and projects i'm contact for). Can also enter time consumed on assigned tasks (timesheet)
Permission42=Create/modify projects (shared project and projects i'm contact for)
Permission44=Delete projects (shared project and projects i'm contact for)
Permission61=Read interventions
@ -621,9 +621,9 @@ Permission121=Read third parties linked to user
Permission122=Create/modify third parties linked to user
Permission125=Delete third parties linked to user
Permission126=Export third parties
Permission141=Read projects (also private i am not contact for)
Permission142=Create/modify projects (also private i am not contact for)
Permission144=Delete projects (also private i am not contact for)
Permission141=Read all projects and tasks (also private projects i am not contact for)
Permission142=Create/modify all projects and tasks (also private projects i am not contact for)
Permission144=Delete all projects and tasks (also private projects i am not contact for)
Permission146=Read providers
Permission147=Read stats
Permission151=Read standing orders

View File

@ -2329,9 +2329,10 @@ class User extends CommonObject
* fullpath = chemin complet compose des id: "_grandparentid_parentid_id"
*
* @param int $deleteafterid Removed all users including the leaf $deleteafterid (and all its child) in user tree.
* @param string $filter SQL filter on users
* @return array Array of users $this->users. Note: $this->parentof is also set.
*/
function get_full_tree($deleteafterid=0)
function get_full_tree($deleteafterid=0, $filter='')
{
global $conf,$user;
@ -2351,6 +2352,8 @@ class User extends CommonObject
{
$sql.= " WHERE u.entity IN (".getEntity('user',1).")";
}
if ($filter) $sql.=" AND ".$filter;
dol_syslog(get_class($this)."::get_full_tree get user list", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)

View File

@ -44,6 +44,7 @@ $search_user=GETPOST('search_user','alpha');
$userstatic=new User($db);
$companystatic = new Societe($db);
$search_statut=GETPOST('search_statut','int');
@ -58,12 +59,12 @@ $arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css')
llxHeader('',$langs->trans("ListOfUsers"). ' ('.$langs->trans("HierarchicView").')','','',0,0,$arrayofjs,$arrayofcss);
print_fiche_titre($langs->trans("ListOfUsers"). ' ('.$langs->trans("HierarchicView").')', '<form action="'.DOL_URL_ROOT.'/user/index.php" method="POST"><input type="submit" class="button" style="width:120px" name="viewcal" value="'.dol_escape_htmltag($langs->trans("ViewList")).'"></form>');
print_fiche_titre($langs->trans("ListOfUsers"). ' ('.$langs->trans("HierarchicView").')', '<form action="'.DOL_URL_ROOT.'/user/index.php'.(($search_statut != '' && $search_statut >= 0) ?'?search_statut='.$search_statut:'').'" method="POST"><input type="submit" class="button" style="width:120px" name="viewcal" value="'.dol_escape_htmltag($langs->trans("ViewList")).'"></form>');
// Load hierarchy of users
$user_arbo = $userstatic->get_full_tree();
$user_arbo = $userstatic->get_full_tree(0, ($search_statut != '' && $search_statut >= 0) ? "statut = ".$search_statut : '');
// Define fulltree array
$fulltree=$user_arbo;
@ -111,6 +112,10 @@ foreach($fulltree as $key => $val)
}
/*print $langs->trans("Status").': ';
print $form->selectarray('search_statut', array('-1'=>'','0'=>$langs->trans('Disabled'),'1'=>$langs->trans('Enabled')),$search_statut);
*/
print '<table class="liste nohover" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("HierarchicView").'</td><td></td><td align="right"><div id="iddivjstreecontrol"><a href="#">'.img_picto('','object_category').' '.$langs->trans("UndoExpandAll").'</a>';
print ' | <a href="#">'.img_picto('','object_category-expanded').' '.$langs->trans("ExpandAll").'</a></div></td></tr>';

View File

@ -48,6 +48,8 @@ $search_firstname=GETPOST('search_firstname','alpha');
$search_statut=GETPOST('search_statut','alpha');
$search_thirdparty=GETPOST('search_thirdparty','alpha');
if ($search_statut == '') $search_statut='1';
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int');
@ -73,13 +75,14 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
$search_thirdparty="";
}
/*
* View
*/
llxHeader('',$langs->trans("ListOfUsers"));
$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>';
$buttonviewhierarchy='<form action="'.DOL_URL_ROOT.'/user/hierarchy.php'.(($search_statut != '' && $search_statut >= 0) ? '?search_statut='.$search_statut : '').'" 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);