diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 9ef2ff7c7e47b2cea34882a8913c9bdd23590169..bac9c99a0135cf7537f6ddb44d851f9cfaa06826 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -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. diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 82a448e0c384e9b5405332e6032d5a330c98a273..1200d674ccd7282740616164cc595a67db53b966 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -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) { diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index e11e801a77bf6d3bcaa3a39b313b2a26f5b556ab..1174c47d83188080d0b8c7804011eeacdc12a28f 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -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'; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 7c9a4b85a9a200f4e734192342a7ed4d91216baa..4547093cc06212043a32487cc76a1380b4198d99 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -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 diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 88f682d38dc6241775e0f707e3f0041c009af498..9d29659bb681c265197d48c1b761cb0c7711c86c 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -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) diff --git a/htdocs/user/hierarchy.php b/htdocs/user/hierarchy.php index a4b82bd5ccf3d70bd316d505b5d4de601bde586f..3c8aff5b1b2b7b9b9100e6e2df801c83a202f359 100644 --- a/htdocs/user/hierarchy.php +++ b/htdocs/user/hierarchy.php @@ -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>'; diff --git a/htdocs/user/index.php b/htdocs/user/index.php index cb2e5617f08ef652dd3998aa071faf496450c6a1..80a5c52a2327dfc436d0391b454ebea8b625b804 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -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);