diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 675f5748842..3682088b552 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1716,8 +1716,6 @@ else */ if (! empty($groupslist)) { - $var=true; - foreach($groupslist as $group) { @@ -2360,8 +2358,6 @@ else $genallowed = $user->rights->user->user->creer; $delallowed = $user->rights->user->user->supprimer; - $var = true; - $somethingshown = $formfile->show_documents('user', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang); // Show links to link elements diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 907c0cef40d..cd9a16ea2b9 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -37,8 +37,9 @@ class UserGroup extends CommonObject public $element='usergroup'; public $table_element='usergroup'; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - + public $picto='group'; public $entity; // Entity of group + /** * @deprecated * @see name @@ -744,6 +745,31 @@ class UserGroup extends CommonObject } + /** + * Return label of status of user (active, inactive) + * + * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @return string Label of status + */ + function getLibStatut($mode=0) + { + return $this->LibStatut(0,$mode); + } + + /** + * Renvoi le libelle d'un statut donne + * + * @param int $statut Id statut + * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @return string Label of status + */ + function LibStatut($statut,$mode=0) + { + global $langs; + $langs->load('users'); + return ''; + } + /** * Retourne chaine DN complete dans l'annuaire LDAP pour l'objet * diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index eacb954e007..bbcbd38c168 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -314,19 +314,17 @@ else if ($action != 'edit') { - dol_fiche_head($head, 'group', $title, 0, 'group'); + dol_fiche_head($head, 'group', $title, -1, 'group'); - print ''; - - // Ref - print ''; - print ''; - print ''; + dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin); + + print '
'; + print '
'; + + print '
'.$langs->trans("Ref").''; - print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin); - print '
'; // Name - print ''; + print ''; print '
'.$langs->trans("Name").'
'.$langs->trans("Name").''.$object->name; if (empty($object->entity)) { @@ -357,7 +355,8 @@ else } print "
\n"; - + print ''; + dol_fiche_end(); @@ -377,11 +376,8 @@ else } print "\n"; - print "
\n"; - /* - * Liste des utilisateurs dans le groupe - */ + // List users in group print load_fiche_titre($langs->trans("ListOfUsersInGroup"),'',''); @@ -450,8 +446,6 @@ else if (! empty($object->members)) { - $var=True; - foreach($object->members as $useringroup) { @@ -513,17 +507,11 @@ else $genallowed = $user->rights->user->user->creer; $delallowed = $user->rights->user->user->supprimer; - $var = true; - $somethingshown = $formfile->show_documents('usergroup', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang); - // Linked object block - $somethingshown = $form->showLinkedObjectBlock($object); - - // Show links to link elements - $linktoelem = $form->showLinkToObjectBlock($object); - if ($linktoelem) print '
'.$linktoelem; - + // Show links to link elements + $linktoelem = $form->showLinkToObjectBlock($object, null, null); + $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); print '
'; diff --git a/htdocs/user/group/ldap.php b/htdocs/user/group/ldap.php index bf39a128137..2ced8e11d4b 100644 --- a/htdocs/user/group/ldap.php +++ b/htdocs/user/group/ldap.php @@ -45,9 +45,9 @@ $action = GETPOST('action', 'alpha'); $socid=0; if ($user->societe_id > 0) $socid = $user->societe_id; -$fgroup = new Usergroup($db); -$fgroup->fetch($id); -$fgroup->getrights(); +$object = new Usergroup($db); +$object->fetch($id); +$object->getrights(); /* @@ -61,12 +61,12 @@ if ($action == 'dolibarr2ldap') $ldap=new Ldap(); $result=$ldap->connect_bind(); - $info=$fgroup->_load_ldap_info(); + $info=$object->_load_ldap_info(); // Get a gid number for objectclass PosixGroup if(in_array('posixGroup',$info['objectclass'])) $info['gidNumber'] = $ldap->getNextGroupGid(); - $dn=$fgroup->_load_ldap_dn($info); + $dn=$object->_load_ldap_dn($info); $olddn=$dn; // We can say that old dn = dn as we force synchro $result=$ldap->update($dn,$info,$user,$olddn); @@ -93,23 +93,21 @@ llxHeader(); $form = new Form($db); -$head = group_prepare_head($fgroup); +$head = group_prepare_head($object); -dol_fiche_head($head, 'ldap', $langs->trans("Group"), 0, 'group'); +dol_fiche_head($head, 'ldap', $langs->trans("Group"), -1, 'group'); + +dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin); + +print '
'; +print '
'; print ''; -// Ref -print ''; -print ''; -print ''; - // Name -print ''; -print ''; +print '\n"; // Note print ''; -print ''; +print ''; print "\n"; $langs->load("admin"); @@ -137,6 +135,9 @@ print "
'.$langs->trans("Ref").''; -print $form->showrefnav($fgroup,'id','',$canreadperms); -print '
'.$langs->trans("Name").''.$fgroup->name; -if (!$fgroup->entity) +print '
'.$langs->trans("Name").''.$object->name; +if (!$object->entity) { print img_picto($langs->trans("GlobalGroup"),'redstar'); } @@ -117,7 +115,7 @@ print "
'.$langs->trans("Note").''.nl2br($fgroup->note).' '.nl2br($object->note).' 
\n"; print '
'; +dol_fiche_end(); + + /* * Barre d'actions */ @@ -145,7 +146,7 @@ print '
'; if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') { - print ''.$langs->trans("ForceSynchronize").''; + print ''.$langs->trans("ForceSynchronize").''; } print "
\n"; @@ -169,9 +170,9 @@ $ldap=new Ldap(); $result=$ldap->connect_bind(); if ($result > 0) { - $info=$fgroup->_load_ldap_info(); - $dn=$fgroup->_load_ldap_dn($info,1); - $search = "(".$fgroup->_load_ldap_dn($info,2).")"; + $info=$object->_load_ldap_info(); + $dn=$object->_load_ldap_dn($info,1); + $search = "(".$object->_load_ldap_dn($info,2).")"; $records = $ldap->getAttribute($dn,$search); //var_dump($records); diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index 50b1bc56c5e..5262857afb2 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -82,16 +82,16 @@ llxHeader('',$langs->trans("Permissions")); if ($id) { - $fgroup = new Usergroup($db); - $fgroup->fetch($id); - $fgroup->getrights(); + $object = new Usergroup($db); + $object->fetch($id); + $object->getrights(); /* * Affichage onglets */ - $head = group_prepare_head($fgroup); + $head = group_prepare_head($object); $title = $langs->trans("Group"); - dol_fiche_head($head, 'rights', $title, 0, 'group'); + dol_fiche_head($head, 'rights', $title, -1, 'group'); // Charge les modules soumis a permissions $modules = array(); @@ -127,7 +127,7 @@ if ($id) // Load all permissions if ($objMod->rights_class) { - $entity=((! empty($conf->multicompany->enabled) && ! empty($fgroup->entity)) ? $fgroup->entity : null); + $entity=((! empty($conf->multicompany->enabled) && ! empty($object->entity)) ? $object->entity : null); $ret=$objMod->insert_permissions(0, $entity); $modules[$objMod->rights_class]=$objMod; } @@ -150,7 +150,7 @@ if ($id) { if (empty($conf->multicompany->transverse_mode)) { - $sql.= " AND r.entity = ".$fgroup->entity; + $sql.= " AND r.entity = ".$object->entity; } else { @@ -162,7 +162,7 @@ if ($id) $sql.= " AND r.entity IN (0,".$conf->entity.")"; } - $sql.= " AND ugr.fk_usergroup = ".$fgroup->id; + $sql.= " AND ugr.fk_usergroup = ".$object->id; $result=$db->query($sql); @@ -183,32 +183,31 @@ if ($id) dol_print_error($db); } - + + + dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin); + + print '
'; + print '
'; + /* * Ecran ajout/suppression permission */ print ''; - // Ref - print ''; - print ''; - print ''; - // Nom - print ''; - print ''; + print '\n"; // Note - print ''; - print ''; + print ''; + print ''; print "\n"; print '
'.$langs->trans("Ref").''; - print $form->showrefnav($fgroup,'id','',$user->rights->user->user->lire || $user->admin); - print '
'.$langs->trans("Name").''.$fgroup->name.''; - if (! $fgroup->entity) + print '
'.$langs->trans("Name").''.$object->name.''; + if (! $object->entity) { print img_picto($langs->trans("GlobalGroup"),'redstar'); } print "
'.$langs->trans("Note").''.dol_htmlentitiesbr($fgroup->note).'
'.$langs->trans("Description").''.dol_htmlentitiesbr($object->note).'

'; @@ -230,7 +229,7 @@ if ($id) { if (empty($conf->multicompany->transverse_mode)) { - $sql.= " AND r.entity = ".$fgroup->entity; + $sql.= " AND r.entity = ".$object->entity; } else { @@ -280,9 +279,9 @@ if ($id) print ''.img_object('',$picto).' '.$objMod->getName(); print ' '; print ''; - print ''.$langs->trans("All").""; + print ''.$langs->trans("All").""; print '/'; - print ''.$langs->trans("None").""; + print ''.$langs->trans("None").""; print ''; print ' '; print ''; @@ -299,7 +298,7 @@ if ($id) // Own permission by group if ($caneditperms) { - print ''.img_edit_remove($langs->trans("Remove")).''; + print ''.img_edit_remove($langs->trans("Remove")).''; } print ''; print img_picto($langs->trans("Active"),'tick'); @@ -310,7 +309,7 @@ if ($id) // Do not own permission if ($caneditperms) { - print ''.img_edit_add($langs->trans("Add")).''; + print ''.img_edit_add($langs->trans("Add")).''; } print ' '; } @@ -324,6 +323,10 @@ if ($id) } } print ''; + + print '
'; + + dol_fiche_end(); } llxFooter();