diff --git a/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php b/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php index e4cb9cfa..c5788f2c 100644 --- a/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php +++ b/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php @@ -266,10 +266,12 @@ $GLOBALS['LSobjects']['LSeepeople'] = array ( 'mail' => array ( 'label' => _('Adresse e-mail'), 'ldap_type' => 'ascii', - 'html_type' => 'mail', + 'html_type' => 'text', 'html_options' => array( - 'generate_value_format' => '%{uid}@ls.com', - 'autoGenerateOnModify' => true + 'generate_value_format' => '%{givenName}.%{sn}@ls.com', + 'withoutAccent' => 1, + 'replaceSpaces' => '.', + 'lowerCase' => 1 ), 'required' => 1, 'check_data' => array ( diff --git a/trunk/includes/js/LSformElement_text_field.js b/trunk/includes/js/LSformElement_text_field.js index b0502b3d..d0eff62b 100644 --- a/trunk/includes/js/LSformElement_text_field.js +++ b/trunk/includes/js/LSformElement_text_field.js @@ -51,11 +51,26 @@ var LSformElement_text_field = new Class({ refreshValue: function() { if (this._auto) { var val=getFData(this.format,this.parent,'getValue'); - if ($type(this.params['withoutAccents'])) { - if(this.params['withoutAccents']) { + if ($type(this.params['withoutAccent'])) { + if(this.params['withoutAccent']) { val = replaceAccents(val); } } + if ($type(this.params['replaceSpaces'])) { + if(this.params['replaceSpaces']) { + val = replaceSpaces(val,this.params['replaceSpaces']); + } + } + if ($type(this.params['upperCase'])) { + if(this.params['upperCase']) { + val = val.toUpperCase(); + } + } + if ($type(this.params['lowerCase'])) { + if(this.params['lowerCase']) { + val = val.toLowerCase(); + } + } this.input.value = val; this.fx.start(this.onChangeColor); (function() {this.fx.start(this.oldBg);}).delay(1000,this); diff --git a/trunk/includes/js/functions.js b/trunk/includes/js/functions.js index 95cda7fb..1a986120 100644 --- a/trunk/includes/js/functions.js +++ b/trunk/includes/js/functions.js @@ -95,3 +95,23 @@ function replaceAccents(str) { } return new_str; } + +/** +* Remplace les espaces ou les tabulations d'une chaine +* +* @param[in] $string La chaine originale +* @param[in] $string Le caractère à mettre à la place +* +* @retval string La chaine sans espace +*/ +function replaceSpaces(str,to) { + if (!$type(to)) { + to = ''; + } + var new_str = String(str); + if (str && str!= "") { + var reg_exp= RegExp('[ \t]', "gi"); + new_str = new_str.replace (reg_exp, to); + } + return new_str; +}