From 1228e42fc7a6626c20f1f9be8f197d4da9667aaf Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Mon, 28 Jul 2008 16:30:40 +0000 Subject: [PATCH] =?UTF-8?q?-=20function.js=20:=20=20=20->=20cr=C3=A9ation?= =?UTF-8?q?=20d'un=20fichier=20functions.js=20pour=20extraire=20la=20parti?= =?UTF-8?q?e=20LSdebug=20de=20=20=20LSdefault.js.=20=20=20->=20cr=C3=A9ati?= =?UTF-8?q?on=20d'une=20m=C3=A9thode=20getFData()=20sensiblement=20la=20m?= =?UTF-8?q?=C3=AAme=20quand=20PHP=20-=20LSformElement=5Ftext=20:=20Cr?= =?UTF-8?q?=C3=A9ation=20d'une=20possibilit=C3=A9=20d'auto-g=C3=A9n=C3=A9r?= =?UTF-8?q?ation=20en=20JS=20de=20la=20=20=20valeur=20=C3=A0=20partir=20de?= =?UTF-8?q?s=20autres=20champs=20du=20formulaire.=20-=20LSconfirmBox=20&&?= =?UTF-8?q?=20LSsmoothbox=20:=20=20=20->=20ajout=20d'une=20m=C3=A9thode=20?= =?UTF-8?q?positionWhenScrolling()=20pour=20le=20placement=20de=20la=20box?= =?UTF-8?q?=20=20=20lors=20du=20scroll=20-=20LSconfirmBox=20:=20Correction?= =?UTF-8?q?=20d'un=20bug=20IE=20=C3=A0=20la=20fermeture?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LSobjects/config.LSobjects.LSeepeople.php | 43 ++++++----- trunk/conf/config.inc.php | 1 + .../class/class.LSformElement_text.php | 17 +++-- trunk/includes/js/LSconfirmBox.js | 30 +++++--- trunk/includes/js/LSdefault.js | 9 +-- trunk/includes/js/LSformElement_text.js | 56 ++++++++++++++ trunk/includes/js/LSformElement_text_field.js | 53 +++++++++++++ trunk/includes/js/LSsmoothbox.js | 16 ++++ trunk/includes/js/functions.js | 75 +++++++++++++++++++ 9 files changed, 258 insertions(+), 42 deletions(-) create mode 100644 trunk/includes/js/LSformElement_text.js create mode 100644 trunk/includes/js/LSformElement_text_field.js create mode 100644 trunk/includes/js/functions.js diff --git a/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php b/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php index f5f6dc8f..f28cce64 100644 --- a/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php +++ b/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php @@ -103,24 +103,6 @@ $GLOBALS['LSobjects']['LSeepeople'] = array ( 'modify' => 0, ) ), - 'cn' => array ( - 'label' => _('Nom complet'), - 'ldap_type' => 'ascii', - 'html_type' => 'text', - 'required' => 1, - 'default_value' => 'titi', - 'validation' => 'valid', - 'rights' => array( - 'self' => 'w', - 'user' => 'r', - 'admin' => 'w' - ), - 'view' => 1, - 'form' => array ( - 'modify' => 1, - 'create' => 1 - ) - ), 'givenName' => array ( 'label' => _('Prenom'), 'ldap_type' => 'ascii', @@ -160,6 +142,27 @@ $GLOBALS['LSobjects']['LSeepeople'] = array ( 'create' => 1 ) ), + 'cn' => array ( + 'label' => _('Nom complet'), + 'ldap_type' => 'ascii', + 'html_type' => 'text', + 'html_options' => array( + 'generate_value_format' => '%{givenName} %{sn}', + 'autoGenerateOnModify' => false // default : false + ), + 'required' => 1, + 'validation' => 'valid', + 'rights' => array( + 'self' => 'w', + 'user' => 'r', + 'admin' => 'w' + ), + 'view' => 1, + 'form' => array ( + 'modify' => 1, + 'create' => 1 + ) + ), 'gidNumber' => array ( 'label' => _('Groupe principal'), 'ldap_type' => 'numeric', @@ -254,6 +257,10 @@ $GLOBALS['LSobjects']['LSeepeople'] = array ( 'label' => _('Adresse e-mail'), 'ldap_type' => 'ascii', 'html_type' => 'text', + 'html_options' => array( + 'generate_value_format' => '%{uid}@ls.com', + 'autoGenerateOnModify' => true + ), 'required' => 1, 'check_data' => array ( 'email' => array( diff --git a/trunk/conf/config.inc.php b/trunk/conf/config.inc.php index 4b33bd41..a5847339 100644 --- a/trunk/conf/config.inc.php +++ b/trunk/conf/config.inc.php @@ -110,6 +110,7 @@ define('LS_CSS_DIR', 'templates/css/'); $GLOBALS['defaultJSscipts']=array( 'mootools-core.js', 'mootools-more.js', + 'functions.js', 'LSdefault.js' ); diff --git a/trunk/includes/class/class.LSformElement_text.php b/trunk/includes/class/class.LSformElement_text.php index ca362ddb..76475a52 100644 --- a/trunk/includes/class/class.LSformElement_text.php +++ b/trunk/includes/class/class.LSformElement_text.php @@ -43,7 +43,10 @@ class LSformElement_text extends LSformElement { $return = $this -> getLabelInfos(); // value if (!$this -> isFreeze()) { - $return['html'] = "