From 4777789c959d311ebafe13e98ae608e2c0be3c54 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 7 Jan 2009 19:24:14 +0000 Subject: [PATCH] =?UTF-8?q?-=20LSldapObjet=20:=20=09->=20m=C3=A9thode=20ge?= =?UTF-8?q?tDisplayAttributes()=20devient=20getDisplayNameFormat()=20=09->?= =?UTF-8?q?=20m=C3=A9thode=20getDisplayValue()=20devient=20getDisplayName(?= =?UTF-8?q?)=20=09->=20config=20:=20select=5Fdisplay=5Fattrs=20devient=20d?= =?UTF-8?q?isplay=5Fname=5Fformat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trunk/conf/LSobjects/config.LSobjects.LSeecompany.php | 2 +- trunk/conf/LSobjects/config.LSobjects.LSeegroup.php | 2 +- trunk/conf/LSobjects/config.LSobjects.LSeepeople.php | 2 +- .../includes/class/class.LSattr_html_select_object.php | 2 +- trunk/includes/class/class.LSldapObject.php | 10 +++++----- trunk/index_ajax.php | 2 +- trunk/modify.php | 2 +- trunk/remove.php | 6 +++--- trunk/view.php | 4 ++-- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/trunk/conf/LSobjects/config.LSobjects.LSeecompany.php b/trunk/conf/LSobjects/config.LSobjects.LSeecompany.php index d14fba73..b7abe92c 100644 --- a/trunk/conf/LSobjects/config.LSobjects.LSeecompany.php +++ b/trunk/conf/LSobjects/config.LSobjects.LSeecompany.php @@ -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 ( diff --git a/trunk/conf/LSobjects/config.LSobjects.LSeegroup.php b/trunk/conf/LSobjects/config.LSobjects.LSeegroup.php index adc57bfc..eefc0c72 100644 --- a/trunk/conf/LSobjects/config.LSobjects.LSeegroup.php +++ b/trunk/conf/LSobjects/config.LSobjects.LSeegroup.php @@ -37,7 +37,7 @@ $GLOBALS['LSobjects']['LSeegroup'] = array ( 'ou' => 'groups' ) ), - 'select_display_attrs' => '%{cn}', + 'display_name_format' => '%{cn}', 'label' => _('Groupes'), 'attrs' => array ( diff --git a/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php b/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php index d4ae7c3b..6e4ed4f9 100644 --- a/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php +++ b/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php @@ -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 diff --git a/trunk/includes/class/class.LSattr_html_select_object.php b/trunk/includes/class/class.LSattr_html_select_object.php index e54b0d48..24c7ca65 100644 --- a/trunk/includes/class/class.LSattr_html_select_object.php +++ b/trunk/includes/class/class.LSattr_html_select_object.php @@ -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']); } } } diff --git a/trunk/includes/class/class.LSldapObject.php b/trunk/includes/class/class.LSldapObject.php index 32d431e3..251e0135 100644 --- a/trunk/includes/class/class.LSldapObject.php +++ b/trunk/includes/class/class.LSldapObject.php @@ -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); diff --git a/trunk/index_ajax.php b/trunk/index_ajax.php index e3dd7c99..31954844 100644 --- a/trunk/index_ajax.php +++ b/trunk/index_ajax.php @@ -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'].= "
  • ".$o -> getDisplayValue(NULL,true)."
  • \n"; + $data['html'].= "
  • ".$o -> getDisplayName(NULL,true)."
  • \n"; } } else { diff --git a/trunk/modify.php b/trunk/modify.php index 354299ee..59540e75 100644 --- a/trunk/modify.php +++ b/trunk/modify.php @@ -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 diff --git a/trunk/remove.php b/trunk/remove.php index 128565f0..d55d12d7 100644 --- a/trunk/remove.php +++ b/trunk/remove.php @@ -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').' '.$object -> getDisplayValue().' ?'); + $GLOBALS['Smarty'] -> assign('pagetitle',_('Suppresion').' : '.$object -> getDisplayName()); + $GLOBALS['Smarty'] -> assign('question',_('Voulez-vous vraiment supprimer').' '.$object -> getDisplayName().' ?'); $GLOBALS['Smarty'] -> assign('validation_url','remove.php?LSobject='.$_GET['LSobject'].'&dn='.$_GET['dn'].'&valid'); $GLOBALS['Smarty'] -> assign('validation_txt',_('Valider')); } diff --git a/trunk/view.php b/trunk/view.php index 77cb8909..9cfe9e96 100644 --- a/trunk/view.php +++ b/trunk/view.php @@ -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;