- LSldapObjet :

-> méthode getDisplayAttributes() devient getDisplayNameFormat()
	-> méthode getDisplayValue() devient getDisplayName()
	-> config : select_display_attrs devient display_name_format
This commit is contained in:
Benjamin Renard 2009-01-07 19:24:14 +00:00
parent c3c2177901
commit 4777789c95
9 changed files with 16 additions and 16 deletions

View file

@ -28,7 +28,7 @@ $GLOBALS['LSobjects']['LSeecompany'] = array (
'rdn' => 'ou', 'rdn' => 'ou',
'orderby' => 'displayValue', // Valeurs possibles : 'displayValue' ou 'subDn' 'orderby' => 'displayValue', // Valeurs possibles : 'displayValue' ou 'subDn'
'container_dn' => 'ou=companies', 'container_dn' => 'ou=companies',
'select_display_attrs' => '%{ou}', 'display_name_format' => '%{ou}',
'label' => _('Sociétés'), 'label' => _('Sociétés'),
'attrs' => array ( 'attrs' => array (

View file

@ -37,7 +37,7 @@ $GLOBALS['LSobjects']['LSeegroup'] = array (
'ou' => 'groups' 'ou' => 'groups'
) )
), ),
'select_display_attrs' => '%{cn}', 'display_name_format' => '%{cn}',
'label' => _('Groupes'), 'label' => _('Groupes'),
'attrs' => array ( 'attrs' => array (

View file

@ -45,7 +45,7 @@ $GLOBALS['LSobjects']['LSeepeople'] = array (
'after_modify' => 'valid', 'after_modify' => 'valid',
//'after_create' => 'createMaildirByFTP', //'after_create' => 'createMaildirByFTP',
//'after_delete' => 'removeMaildirByFTP', //'after_delete' => 'removeMaildirByFTP',
'select_display_attrs' => '%{cn}', 'display_name_format' => '%{cn}',
'label' => _('Utilisateurs'), 'label' => _('Utilisateurs'),
// LSrelation // LSrelation

View file

@ -143,7 +143,7 @@ class LSattr_html_select_object extends LSattr_html{
$obj = new $conf['object_type'](); $obj = new $conf['object_type']();
foreach($DNs as $dn) { foreach($DNs as $dn) {
if($obj -> loadData($dn)) { if($obj -> loadData($dn)) {
$retInfos[$dn] = $obj -> getDisplayValue($conf['display_attribute']); $retInfos[$dn] = $obj -> getDisplayName($conf['display_attribute']);
} }
} }
} }

View file

@ -124,8 +124,8 @@ class LSldapObject {
* *
* @retval string Format d'affichage de l'objet. * @retval string Format d'affichage de l'objet.
*/ */
function getDisplayAttributes() { function getDisplayNameFormat() {
return $this -> config['select_display_attrs']; return $this -> config['display_name_format'];
} }
/** /**
@ -142,9 +142,9 @@ class LSldapObject {
* *
* @retval string Valeur descriptive d'affichage de l'objet * @retval string Valeur descriptive d'affichage de l'objet
*/ */
function getDisplayValue($spe='',$full=false) { function getDisplayName($spe='',$full=false) {
if ($spe=='') { if ($spe=='') {
$spe = $this -> getDisplayAttributes(); $spe = $this -> getDisplayNameFormat();
} }
$val = $this -> getFData($spe,&$this -> attrs,'getDisplayValue'); $val = $this -> getFData($spe,&$this -> attrs,'getDisplayValue');
if ($GLOBALS['LSsession'] -> haveSubDn() && $full) { if ($GLOBALS['LSsession'] -> haveSubDn() && $full) {
@ -873,7 +873,7 @@ class LSldapObject {
$retInfos=array(); $retInfos=array();
if (!$displayFormat) { if (!$displayFormat) {
$displayFormat = $this -> getDisplayAttributes(); $displayFormat = $this -> getDisplayNameFormat();
} }
// Attributes // Attributes
$attrs = getFieldInFormat($displayFormat); $attrs = getFieldInFormat($displayFormat);

View file

@ -196,7 +196,7 @@ if (!isset($_ERRORS)) {
$list = $objRel -> $relationConf['list_function']($object); $list = $objRel -> $relationConf['list_function']($object);
if (is_array($list)&&(!empty($list))) { if (is_array($list)&&(!empty($list))) {
foreach($list as $o) { foreach($list as $o) {
$data['html'].= "<li class='LSrelation'><a href='view.php?LSobject=".$relationConf['LSobject']."&amp;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']."&amp;dn=".$o -> getDn()."' class='LSrelation' id='".$o -> getDn()."'>".$o -> getDisplayName(NULL,true)."</a></li>\n";
} }
} }
else { else {

View file

@ -48,7 +48,7 @@ if($LSsession -> startLSsession()) {
$object = new $LSobject(); $object = new $LSobject();
if ($object -> loadData($dn)) { if ($object -> loadData($dn)) {
// Définition du Titre de la page // 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'); $form = $object -> getForm('modify');
if ($form->validate()) { if ($form->validate()) {
// MàJ des données de l'objet LDAP // MàJ des données de l'objet LDAP

View file

@ -34,7 +34,7 @@ if($LSsession -> startLSsession()) {
$object = new $_GET['LSobject'](); $object = new $_GET['LSobject']();
if ($object -> loadData($_GET['dn'])) { if ($object -> loadData($_GET['dn'])) {
if (isset($_GET['valid'])) { if (isset($_GET['valid'])) {
$objectname=$object -> getDisplayValue(); $objectname=$object -> getDisplayName();
$GLOBALS['Smarty'] -> assign('pagetitle',_('Suppression').' : '.$objectname); $GLOBALS['Smarty'] -> assign('pagetitle',_('Suppression').' : '.$objectname);
if ($object -> remove()) { if ($object -> remove()) {
$GLOBALS['LSsession'] -> addInfo($objectname.' '._('a bien été supprimé').'.'); $GLOBALS['LSsession'] -> addInfo($objectname.' '._('a bien été supprimé').'.');
@ -46,8 +46,8 @@ if($LSsession -> startLSsession()) {
} }
else { else {
// Définition du Titre de la page // Définition du Titre de la page
$GLOBALS['Smarty'] -> assign('pagetitle',_('Suppresion').' : '.$object -> getDisplayValue()); $GLOBALS['Smarty'] -> assign('pagetitle',_('Suppresion').' : '.$object -> getDisplayName());
$GLOBALS['Smarty'] -> assign('question',_('Voulez-vous vraiment supprimer').' <strong>'.$object -> getDisplayValue().'</strong> ?'); $GLOBALS['Smarty'] -> assign('question',_('Voulez-vous vraiment supprimer').' <strong>'.$object -> getDisplayName().'</strong> ?');
$GLOBALS['Smarty'] -> assign('validation_url','remove.php?LSobject='.$_GET['LSobject'].'&amp;dn='.$_GET['dn'].'&amp;valid'); $GLOBALS['Smarty'] -> assign('validation_url','remove.php?LSobject='.$_GET['LSobject'].'&amp;dn='.$_GET['dn'].'&amp;valid');
$GLOBALS['Smarty'] -> assign('validation_txt',_('Valider')); $GLOBALS['Smarty'] -> assign('validation_txt',_('Valider'));
} }

View file

@ -68,7 +68,7 @@ if($LSsession -> startLSsession()) {
if ($GLOBALS['LSsession']-> LSuserObject -> getValue('dn') != $dn) { if ($GLOBALS['LSsession']-> LSuserObject -> getValue('dn') != $dn) {
$object = new $LSobject(); $object = new $LSobject();
$object -> loadData($dn); $object -> loadData($dn);
$GLOBALS['Smarty'] -> assign('pagetitle',$object -> getDisplayValue()); $GLOBALS['Smarty'] -> assign('pagetitle',$object -> getDisplayName());
} }
else { else {
$object = &$GLOBALS['LSsession']-> LSuserObject; $object = &$GLOBALS['LSsession']-> LSuserObject;
@ -131,7 +131,7 @@ if($LSsession -> startLSsession()) {
if (is_array($list)) { if (is_array($list)) {
foreach($list as $o) { foreach($list as $o) {
$o_infos = array( $o_infos = array(
'text' => $o -> getDisplayValue(NULL,true), 'text' => $o -> getDisplayName(NULL,true),
'dn' => $o -> getDn() 'dn' => $o -> getDn()
); );
$return['objectList'][] = $o_infos; $return['objectList'][] = $o_infos;