mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-26 11:52:59 +01:00
- LSldapObjet :
-> méthode getDisplayAttributes() devient getDisplayNameFormat() -> méthode getDisplayValue() devient getDisplayName() -> config : select_display_attrs devient display_name_format
This commit is contained in:
parent
c3c2177901
commit
4777789c95
9 changed files with 16 additions and 16 deletions
|
@ -28,7 +28,7 @@ $GLOBALS['LSobjects']['LSeecompany'] = array (
|
|||
'rdn' => 'ou',
|
||||
'orderby' => 'displayValue', // Valeurs possibles : 'displayValue' ou 'subDn'
|
||||
'container_dn' => 'ou=companies',
|
||||
'select_display_attrs' => '%{ou}',
|
||||
'display_name_format' => '%{ou}',
|
||||
'label' => _('Sociétés'),
|
||||
|
||||
'attrs' => array (
|
||||
|
|
|
@ -37,7 +37,7 @@ $GLOBALS['LSobjects']['LSeegroup'] = array (
|
|||
'ou' => 'groups'
|
||||
)
|
||||
),
|
||||
'select_display_attrs' => '%{cn}',
|
||||
'display_name_format' => '%{cn}',
|
||||
'label' => _('Groupes'),
|
||||
'attrs' => array (
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ $GLOBALS['LSobjects']['LSeepeople'] = array (
|
|||
'after_modify' => 'valid',
|
||||
//'after_create' => 'createMaildirByFTP',
|
||||
//'after_delete' => 'removeMaildirByFTP',
|
||||
'select_display_attrs' => '%{cn}',
|
||||
'display_name_format' => '%{cn}',
|
||||
'label' => _('Utilisateurs'),
|
||||
|
||||
// LSrelation
|
||||
|
|
|
@ -143,7 +143,7 @@ class LSattr_html_select_object extends LSattr_html{
|
|||
$obj = new $conf['object_type']();
|
||||
foreach($DNs as $dn) {
|
||||
if($obj -> loadData($dn)) {
|
||||
$retInfos[$dn] = $obj -> getDisplayValue($conf['display_attribute']);
|
||||
$retInfos[$dn] = $obj -> getDisplayName($conf['display_attribute']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -124,8 +124,8 @@ class LSldapObject {
|
|||
*
|
||||
* @retval string Format d'affichage de l'objet.
|
||||
*/
|
||||
function getDisplayAttributes() {
|
||||
return $this -> config['select_display_attrs'];
|
||||
function getDisplayNameFormat() {
|
||||
return $this -> config['display_name_format'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -142,9 +142,9 @@ class LSldapObject {
|
|||
*
|
||||
* @retval string Valeur descriptive d'affichage de l'objet
|
||||
*/
|
||||
function getDisplayValue($spe='',$full=false) {
|
||||
function getDisplayName($spe='',$full=false) {
|
||||
if ($spe=='') {
|
||||
$spe = $this -> getDisplayAttributes();
|
||||
$spe = $this -> getDisplayNameFormat();
|
||||
}
|
||||
$val = $this -> getFData($spe,&$this -> attrs,'getDisplayValue');
|
||||
if ($GLOBALS['LSsession'] -> haveSubDn() && $full) {
|
||||
|
@ -873,7 +873,7 @@ class LSldapObject {
|
|||
$retInfos=array();
|
||||
|
||||
if (!$displayFormat) {
|
||||
$displayFormat = $this -> getDisplayAttributes();
|
||||
$displayFormat = $this -> getDisplayNameFormat();
|
||||
}
|
||||
// Attributes
|
||||
$attrs = getFieldInFormat($displayFormat);
|
||||
|
|
|
@ -196,7 +196,7 @@ if (!isset($_ERRORS)) {
|
|||
$list = $objRel -> $relationConf['list_function']($object);
|
||||
if (is_array($list)&&(!empty($list))) {
|
||||
foreach($list as $o) {
|
||||
$data['html'].= "<li class='LSrelation'><a href='view.php?LSobject=".$relationConf['LSobject']."&dn=".$o -> getDn()."' class='LSrelation' id='".$o -> getDn()."'>".$o -> getDisplayValue(NULL,true)."</a></li>\n";
|
||||
$data['html'].= "<li class='LSrelation'><a href='view.php?LSobject=".$relationConf['LSobject']."&dn=".$o -> getDn()."' class='LSrelation' id='".$o -> getDn()."'>".$o -> getDisplayName(NULL,true)."</a></li>\n";
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -48,7 +48,7 @@ if($LSsession -> startLSsession()) {
|
|||
$object = new $LSobject();
|
||||
if ($object -> loadData($dn)) {
|
||||
// Définition du Titre de la page
|
||||
$GLOBALS['Smarty'] -> assign('pagetitle',_('Modifier').' : '.$object -> getDisplayValue());
|
||||
$GLOBALS['Smarty'] -> assign('pagetitle',_('Modifier').' : '.$object -> getDisplayName());
|
||||
$form = $object -> getForm('modify');
|
||||
if ($form->validate()) {
|
||||
// MàJ des données de l'objet LDAP
|
||||
|
|
|
@ -34,7 +34,7 @@ if($LSsession -> startLSsession()) {
|
|||
$object = new $_GET['LSobject']();
|
||||
if ($object -> loadData($_GET['dn'])) {
|
||||
if (isset($_GET['valid'])) {
|
||||
$objectname=$object -> getDisplayValue();
|
||||
$objectname=$object -> getDisplayName();
|
||||
$GLOBALS['Smarty'] -> assign('pagetitle',_('Suppression').' : '.$objectname);
|
||||
if ($object -> remove()) {
|
||||
$GLOBALS['LSsession'] -> addInfo($objectname.' '._('a bien été supprimé').'.');
|
||||
|
@ -46,8 +46,8 @@ if($LSsession -> startLSsession()) {
|
|||
}
|
||||
else {
|
||||
// Définition du Titre de la page
|
||||
$GLOBALS['Smarty'] -> assign('pagetitle',_('Suppresion').' : '.$object -> getDisplayValue());
|
||||
$GLOBALS['Smarty'] -> assign('question',_('Voulez-vous vraiment supprimer').' <strong>'.$object -> getDisplayValue().'</strong> ?');
|
||||
$GLOBALS['Smarty'] -> assign('pagetitle',_('Suppresion').' : '.$object -> getDisplayName());
|
||||
$GLOBALS['Smarty'] -> assign('question',_('Voulez-vous vraiment supprimer').' <strong>'.$object -> getDisplayName().'</strong> ?');
|
||||
$GLOBALS['Smarty'] -> assign('validation_url','remove.php?LSobject='.$_GET['LSobject'].'&dn='.$_GET['dn'].'&valid');
|
||||
$GLOBALS['Smarty'] -> assign('validation_txt',_('Valider'));
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ if($LSsession -> startLSsession()) {
|
|||
if ($GLOBALS['LSsession']-> LSuserObject -> getValue('dn') != $dn) {
|
||||
$object = new $LSobject();
|
||||
$object -> loadData($dn);
|
||||
$GLOBALS['Smarty'] -> assign('pagetitle',$object -> getDisplayValue());
|
||||
$GLOBALS['Smarty'] -> assign('pagetitle',$object -> getDisplayName());
|
||||
}
|
||||
else {
|
||||
$object = &$GLOBALS['LSsession']-> LSuserObject;
|
||||
|
@ -131,7 +131,7 @@ if($LSsession -> startLSsession()) {
|
|||
if (is_array($list)) {
|
||||
foreach($list as $o) {
|
||||
$o_infos = array(
|
||||
'text' => $o -> getDisplayValue(NULL,true),
|
||||
'text' => $o -> getDisplayName(NULL,true),
|
||||
'dn' => $o -> getDn()
|
||||
);
|
||||
$return['objectList'][] = $o_infos;
|
||||
|
|
Loading…
Reference in a new issue