From 7e7485302127dcefd933e5364acf4b5c22256f63 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 9 Sep 2020 18:40:44 +0200 Subject: [PATCH] LSattr_html::date & LSformRule::date: add special_values parameter --- .../LSattr_html/LSattr_html_date.docbook | 25 +- .../LSattr_ldap/LSattr_ldap_date.docbook | 21 +- doc/conf/LSattribute/check_data/date.docbook | 11 +- .../LSobjects/config.LSobjects.LSpeople.php | 229 ++++++++++++++---- src/includes/class/class.LSattr_html_date.php | 12 +- .../class/class.LSformElement_date.php | 96 +++++++- src/includes/class/class.LSformRule_date.php | 4 + src/includes/class/class.LSlang.php | 3 + src/includes/js/LSformElement_date.js | 11 +- src/includes/js/LSformElement_date_field.js | 28 +++ src/lang/fr_FR.UTF8/lang.php | 45 ++++ .../default/LSformElement_date_field.tpl | 7 +- 12 files changed, 428 insertions(+), 64 deletions(-) diff --git a/doc/conf/LSattribute/LSattr_html/LSattr_html_date.docbook b/doc/conf/LSattribute/LSattr_html/LSattr_html_date.docbook index db1edf65..c9ec4679 100644 --- a/doc/conf/LSattribute/LSattr_html/LSattr_html_date.docbook +++ b/doc/conf/LSattribute/LSattr_html/LSattr_html_date.docbook @@ -5,7 +5,7 @@ MooTools-DatePicker est utilisé pour la sélection graphique de la date et de l'heure. - + Structure... array ( @@ -14,7 +14,11 @@ 'manual' => '[Booleen pour l edition manuelle ou non]', 'showNowButton' => '[Booleen]', 'showTodayButton' => '[Booleen]', - 'style' => '[Nom du style utilise]' + 'style' => '[Nom du style utilise]', + 'special_values' => array ( + '[value]' => '[label]', + [...] + ), ),]]> ... @@ -212,7 +216,20 @@ + + special_values + + Tableau listant les valeurs spéciales que peut prendre l'attribut. Dans ce tableau + associatif, la clé doit correspondre à la valeur de l'attribut (telle que fournie par + l'attribut LDAP) et la valeur associée au + label associé. + Ces valeurs spéciales seront proposées à l'utilisateur sous la forme de cases à cocher + dans le formulaire. Elles peuvent permettre par exemple de données une signification + particulière au zéro pour un attribut LDAP stockant un timestamp. + + + - - + + diff --git a/doc/conf/LSattribute/LSattr_ldap/LSattr_ldap_date.docbook b/doc/conf/LSattribute/LSattr_ldap/LSattr_ldap_date.docbook index 3c9ebc67..a8f76ac4 100644 --- a/doc/conf/LSattribute/LSattr_ldap/LSattr_ldap_date.docbook +++ b/doc/conf/LSattribute/LSattr_ldap/LSattr_ldap_date.docbook @@ -2,7 +2,18 @@ LSattr_ldap_date Ce type est utilisé pour la gestion des attributs dont la valeur est une date. - + + + Au sein d'LdapSaisie, les dates manipulées au travers ce type + d'attribut LDAP, sont au format timestamp. Il s'agit + donc de nombres entiers correpondants au nombre de secondes depuis le 1 janvier + 1970. + Le type d'attribut HTML utilisé conjointement avec ce type d'attribut LDAP + devra être prévu pour recevoir et fournir des dates au format timestamp + , comme c'est le cas pour le + type d'attribut HTML date. + + Structure... array ( @@ -32,7 +43,7 @@ Format de stockage de la date dans l'annuaire. Ce format est composé à partir des motifs clés gérés par la fonction date() - de &php;. Pour plus d'information, consulter + de &php;. Pour plus d'information, consulter la documentation officielle. La valeur par défaut est YmdHisO, correspondant à la syntaxe Generalized Time telle que @@ -53,11 +64,11 @@ possibles sont documentées dans la documentation officielle de PHP. (Par défaut : UTC) - + - - + + diff --git a/doc/conf/LSattribute/check_data/date.docbook b/doc/conf/LSattribute/check_data/date.docbook index 8d8a3314..56ce7f14 100644 --- a/doc/conf/LSattribute/check_data/date.docbook +++ b/doc/conf/LSattribute/check_data/date.docbook @@ -2,7 +2,7 @@ date Cette règle vérifie que la valeur saisie est bien une date et qu'elle respecte un format précis. - + Paramètres de configuration @@ -16,6 +16,15 @@ + + special_values + + Tableau listant les valeurs spéciales que peut prendre l'attribut. Dans ce tableau, + seules les valeurs sont utilisées et les clés n'ont pas d'importance. Ces valeurs spéciales + n'auront pas forcément besoin de respecter le format attendu. + + + diff --git a/src/conf/LSobjects/config.LSobjects.LSpeople.php b/src/conf/LSobjects/config.LSobjects.LSpeople.php index af1b102b..d8cefcdd 100644 --- a/src/conf/LSobjects/config.LSobjects.LSpeople.php +++ b/src/conf/LSobjects/config.LSobjects.LSpeople.php @@ -144,8 +144,13 @@ $GLOBALS['LSobjects']['LSpeople'] = array ( 'label' => 'Samba', 'args' => array ( 'sambaSID', + 'sambaLogonTime', + 'sambaLogoffTime', + 'sambaKickoffTime', 'sambaLMPassword', - 'sambaNTPassword' + 'sambaNTPassword', + 'sambaPwdMustChange', + 'sambaPwdCanChange', ) ) ), // fin Layout @@ -433,22 +438,6 @@ $GLOBALS['LSobjects']['LSpeople'] = array ( ), /* ----------- end -----------*/ - /* ----------- start -----------*/ - 'sambaSID' => array ( - 'label' => 'Samba Identifier', - 'ldap_type' => 'ascii', - 'html_type' => 'text', - 'required' => 1, - 'generate_function' => 'generate_sambaUserSID', - 'rights' => array( - 'admin' => 'r' - ), - 'form' => array ( - 'modify' => 0 - ) - ), - /* ----------- end -----------*/ - /* ----------- start -----------*/ 'homeDirectory' => array ( 'label' => 'Home Directory', @@ -625,32 +614,6 @@ $GLOBALS['LSobjects']['LSpeople'] = array ( ), /* ----------- end -----------*/ - /* ----------- start -----------*/ - 'sambaLMPassword' => array ( - 'label' => 'Samba Password (LM)', - 'ldap_type' => 'ascii', - 'html_type' => 'text', - 'required' => 1, - 'generate_function' => 'generate_sambaLMPassword', - 'form' => array ( - 'modify' => 0 - ) - ), - /* ----------- end -----------*/ - - /* ----------- start -----------*/ - 'sambaNTPassword' => array ( - 'label' => 'Samba Password (NT)', - 'ldap_type' => 'ascii', - 'html_type' => 'text', - 'required' => 1, - 'generate_function' => 'generate_sambaNTPassword', - 'form' => array ( - 'modify' => 0 - ) - ), - /* ----------- end -----------*/ - /* ----------- start -----------*/ 'jpegPhoto' => array ( 'label' => 'Picture', @@ -717,5 +680,185 @@ $GLOBALS['LSobjects']['LSpeople'] = array ( ), /* ----------- end -----------*/ + /************************************************ + * Samba Attributres + ************************************************/ + + /* ----------- start -----------*/ + 'sambaSID' => array ( + 'label' => 'Samba Identifier', + 'ldap_type' => 'ascii', + 'html_type' => 'text', + 'required' => 1, + 'generate_function' => 'generate_user_sambaSID', + 'rights' => array( + 'admin' => 'r' + ), + 'view' => 1, + 'form' => array ( + 'modify' => 0 + ) + ), + /* ----------- end -----------*/ + + /* ----------- start -----------*/ + 'sambaLogonTime' => array ( + 'label' => 'Samba last logon time', + 'ldap_type' => 'date', + 'ldap_options' => array( + 'timestamp' => True, + ), + 'html_type' => 'date', + 'html_options' => array( + 'time' => True, + 'showTodayButton' => False, + 'special_values' => array( + '0' => 'Never', + ), + ), + 'rights' => array( + 'admin' => 'w' + ), + 'view' => 1, + 'form' => array ( + 'modify' => 1 + ) + ), + /* ----------- end -----------*/ + + /* ----------- start -----------*/ + 'sambaLogoffTime' => array ( + 'label' => 'Samba last logoff time', + 'ldap_type' => 'date', + 'ldap_options' => array( + 'timestamp' => True, + ), + 'html_type' => 'date', + 'html_options' => array( + 'time' => True, + 'showTodayButton' => False, + 'special_values' => array( + '0' => 'Never', + ), + ), + 'rights' => array( + 'admin' => 'w' + ), + 'view' => 1, + 'form' => array ( + 'modify' => 1 + ) + ), + /* ----------- end -----------*/ + + /* ----------- start -----------*/ + 'sambaKickoffTime' => array ( + 'label' => 'Samba expiration time', + 'help_info' => 'Specifies the time when the user will be locked down and cannot login any longer.', + 'ldap_type' => 'date', + 'ldap_options' => array( + 'timestamp' => True, + ), + 'html_type' => 'date', + 'html_options' => array( + 'time' => True, + 'showTodayButton' => False, + 'special_values' => array( + LS_SAMBA_INFINITY_TIME => 'Never', + ), + ), + 'no_value_label' => 'Never', + 'rights' => array( + 'admin' => 'w' + ), + 'view' => 1, + 'form' => array ( + 'modify' => 1 + ) + ), + /* ----------- end -----------*/ + + /* ----------- start -----------*/ + 'sambaLMPassword' => array ( + 'label' => 'Samba Password (LM)', + 'ldap_type' => 'ascii', + 'html_type' => 'text', + 'required' => 1, + 'generate_function' => 'generate_sambaLMPassword', + 'form' => array ( + 'modify' => 0 + ) + ), + /* ----------- end -----------*/ + + /* ----------- start -----------*/ + 'sambaNTPassword' => array ( + 'label' => 'Samba Password (NT)', + 'ldap_type' => 'ascii', + 'html_type' => 'text', + 'required' => 1, + 'generate_function' => 'generate_sambaNTPassword', + 'form' => array ( + 'modify' => 0 + ) + ), + /* ----------- end -----------*/ + + /* ----------- start -----------*/ + 'sambaPwdMustChange' => array ( + 'label' => 'Samba password must change', + 'ldap_type' => 'date', + 'ldap_options' => array( + 'timestamp' => True, + ), + 'html_type' => 'date', + 'html_options' => array( + 'time' => True, + 'showTodayButton' => False, + 'special_values' => array( + '0' => 'At first login', + LS_SAMBA_INFINITY_TIME => 'Never', + ), + ), + 'no_value_label' => 'Never', + 'rights' => array( + 'admin' => 'w' + ), + 'view' => 1, + 'form' => array ( + 'modify' => 0 + ) + ), + /* ----------- end -----------*/ + + /* ----------- start -----------*/ + 'sambaPwdCanChange' => array ( + 'label' => 'Samba password can change', + 'help_info' => 'If not set, the user will be free to change his password whenever he wants.', + 'ldap_type' => 'date', + 'ldap_options' => array( + 'timestamp' => True, + ), + 'html_type' => 'date', + 'html_options' => array( + 'time' => True, + 'showTodayButton' => False, + 'special_values' => array( + LS_SAMBA_INFINITY_TIME => 'Never', + 0 => 'Whenever', + ), + ), + 'no_value_label' => 'Whenever', + 'multiple' => true, + 'rights' => array( + 'admin' => 'w' + ), + 'view' => 1, + 'form' => array ( + 'modify' => 1 + ) + ), + /* ----------- end -----------*/ + ) // Fin args ); diff --git a/src/includes/class/class.LSattr_html_date.php b/src/includes/class/class.LSattr_html_date.php index e9823b09..98811935 100644 --- a/src/includes/class/class.LSattr_html_date.php +++ b/src/includes/class/class.LSattr_html_date.php @@ -40,7 +40,17 @@ class LSattr_html_date extends LSattr_html { */ function addToForm (&$form,$idForm,$data=NULL) { $element = parent::addToForm($form,$idForm,$data); - $form -> addRule($this -> name, 'date', array('msg' => _('Invalid value'), 'params' => array('format' => $element -> getFormat())) ); + $form -> addRule( + $this -> name, + 'date', + array( + 'msg' => _('Invalid value'), + 'params' => array( + 'format' => $element -> getFormat(), + 'special_values' => array_keys($element -> getSpecialValues()), + ) + ) + ); return $element; } diff --git a/src/includes/class/class.LSformElement_date.php b/src/includes/class/class.LSformElement_date.php index 729c6419..6c728fdb 100644 --- a/src/includes/class/class.LSformElement_date.php +++ b/src/includes/class/class.LSformElement_date.php @@ -77,17 +77,23 @@ class LSformElement_date extends LSformElement { if (!is_array($data)) { $data=array($data); } - - for($i=0;$i getFormat(),$data[$i]); + $special_values = $this -> getSpecialValues(); + $values = array(); + foreach ($data as $value) { + if(is_numeric($value)) { + if (array_key_exists($value, $special_values)) { + $values[] = $special_values[$value]; + continue; + } + $values[] = strftime($this -> getFormat(), $value); } else { $this -> form -> setElementError($this -> attr_html); + return false; } } - - $this -> values = $data; + self :: log_trace("$this -> setValue():".varDump($data)." => ".varDump($values)); + $this -> values = $values; return true; } @@ -99,13 +105,22 @@ class LSformElement_date extends LSformElement { public function exportValues(){ $retval=array(); if (is_array($this -> values)) { + $special_values = $this -> getSpecialValues(); foreach($this -> values as $val) { - $date = strptime($val,$this -> getFormat()); + if (array_key_exists($val, $special_values)) { + $retval[] = $val; + continue; + } + $date = strptime($val, $this -> getFormat()); if (is_array($date)) { $retval[] = mktime($date['tm_hour'],$date['tm_min'],$date['tm_sec'],$date['tm_mon']+1,$date['tm_mday'],$date['tm_year']+1900); } + else { + self :: log_warning("exportValues($val): Fail to parse value from form."); + } } } + self :: log_trace("$this -> exportValues():".varDump($this -> values)." => ".varDump($retval)); return $retval; } @@ -175,10 +190,77 @@ class LSformElement_date extends LSformElement { LStemplate :: addJSscript('LSformElement_date_field.js'); LStemplate :: addJSscript('LSformElement_date.js'); } + $return['html'] = $this -> fetchTemplate(); return $return; } + /** + * Retournne un template Smarty compilé dans le contexte d'un LSformElement + * + * @param[in] string $template Le template à retourner + * @param[in] array $variables Variables Smarty à assigner avant l'affichage + * + * @retval string Le HTML compilé du template + */ + public function fetchTemplate($template=NULL, $variables=array()) { + $variables['special_values'] = $this -> getSpecialValues(); + return parent :: fetchTemplate($template, $variables); + } + + /** + * Recupère la valeur de l'élement passée en POST + * + * Cette méthode vérifie la présence en POST de la valeur de l'élément et la récupère + * pour la mettre dans le tableau passer en paramètre avec en clef le nom de l'élément + * + * @param[in] &$return array Reference of the array for retreived values + * @param[in] $onlyIfPresent boolean If true and data of this element is not present in POST data, + * just ignore it. + * + * @retval boolean true si la valeur est présente en POST, false sinon + */ + public function getPostData(&$return, $onlyIfPresent=false) { + if($this -> isFreeze()) { + return true; + } + $values = self :: getData($_POST, $this -> name); + $special_values = self :: getData($_POST, $this -> name.'__special_value'); + self :: log_trace($this." -> getPostData(): values=".varDump($values)); + self :: log_trace($this." -> getPostData(): special_values=".varDump($special_values)); + if (!is_array($values) && !is_array($special_values)) { + self :: log_trace($this." -> getPostData(): not in POST data"); + if ($onlyIfPresent) { + self :: log_debug($this -> name.": not in POST data => ignore it"); + } + else { + $return[$this -> name] = array(); + } + } + else { + if(!is_array($values)) + $values = array(); + if(!is_array($special_values)) + $special_values = array(); + $return[$this -> name] = $special_values + $values; + self :: log_trace($this." -> merged values=".varDump($return[$this -> name])); + } + return true; + } + + /** + * Retrieve list of special values with translated labels + * + * @return array Associative array with special values as keys and corresponding translated labels as values + */ + public function getSpecialValues() { + $special_values = array(); + foreach ($this -> getParam('html_options.special_values', array()) as $value => $label) + $special_values[strval($value)] = __($label); + self :: log_trace("getSpecialValues(): ".varDump($special_values)); + return $special_values; + } + /** * Convertis un format de date Php (strftime) en JS (jscalendar) * diff --git a/src/includes/class/class.LSformRule_date.php b/src/includes/class/class.LSformRule_date.php index 5ec8f0a3..31e793bd 100644 --- a/src/includes/class/class.LSformRule_date.php +++ b/src/includes/class/class.LSformRule_date.php @@ -33,11 +33,15 @@ class LSformRule_date extends LSformRule { * @param mixed $value Données à valider * @param array $options Options de validation * $options['params']['format']: le format de la date + * $options['params']['special_values']: array of special allowed values * @param object $formElement L'objet formElement attaché * * @return boolean True si les données sont valide, False sinon. */ public static function validate($value, $options=array(), &$formElement) { + $special_values = LSconfig :: get('params.special_values', array(), null, $options); + if (in_array($value, $special_values)) + return true; $format = LSconfig :: get('params.format', null, 'string', $options); if (is_null($format)) { LSerror :: addErrorCode('LSformRule_date_01'); diff --git a/src/includes/class/class.LSlang.php b/src/includes/class/class.LSlang.php index 0be11133..1681e3b5 100644 --- a/src/includes/class/class.LSlang.php +++ b/src/includes/class/class.LSlang.php @@ -636,6 +636,9 @@ function cli_generate_lang_file($command_args) { case 'valueWithUnit': addFromLSconfig("LSobjects.$obj.attrs.$attr.html_options.units.*"); break; + case 'date': + addFromLSconfig("LSobjects.$obj.attrs.$attr.html_options.special_values.*"); + break; } } } diff --git a/src/includes/js/LSformElement_date.js b/src/includes/js/LSformElement_date.js index d3868aa9..423f4bff 100644 --- a/src/includes/js/LSformElement_date.js +++ b/src/includes/js/LSformElement_date.js @@ -11,15 +11,22 @@ var LSformElement_date = new Class({ if (!$type(el)) { el = document; } - var getName = /^(.*)\[\]$/ - el.getElements('input.LSformElement_date').each(function(input) { + var getName = /^(.*)\[[0-9]*\]$/; + el.getElements('input.LSformElement_date[type=text]').each(function(input) { var name = getName.exec(input.name)[1]; this.fields[name] = new LSformElement_date_field(name,input); + varLSform.addField(name, this.fields[name]); }, this); }, reinitialize: function(el) { this.initialiseLSformElement_date(el); + }, + + clearValue: function() { + this.fields.each(function(field) { + field.clearValue(); + }, this); } }); window.addEvent(window.ie ? 'load' : 'domready', function() { diff --git a/src/includes/js/LSformElement_date_field.js b/src/includes/js/LSformElement_date_field.js index d6c9a3a1..4eaad768 100644 --- a/src/includes/js/LSformElement_date_field.js +++ b/src/includes/js/LSformElement_date_field.js @@ -2,6 +2,12 @@ var LSformElement_date_field = new Class({ initialize: function(name,input){ this.name = name; this.input = input; + this.specialValueInputs = $$(input.getAllNext('input.LSformElement_date[type=radio]')); + + this.input.addEvent('change', this.onInputChange.bind(this)); + this.specialValueInputs.each(function(input) { + input.addEvent('click', this.onSpecialValueInputClick.bind(this)); + }, this); this.params = varLSdefault.LSjsConfig[this.name]; if (!$type(this.params)) { @@ -41,6 +47,7 @@ var LSformElement_date_field = new Class({ useFadeInOut: !Browser.ie } ); + this.calendar.addEvent('onSelect', this.onInputChange.bind(this)); if (this.params.showNowButton) { this.nowBtn = new Element('img'); @@ -66,8 +73,21 @@ var LSformElement_date_field = new Class({ } }, + onInputChange: function() { + if (!this.input.value) + return true; + this.specialValueInputs.each(function(input) { + input.removeProperty('checked'); + }, this); + }, + + onSpecialValueInputClick: function() { + this.input.value=""; + }, + onNowBtnClick: function() { this.input.value = new Date().format(this.params.format); + this.input.fireEvent('change'); }, onTodayBtnClick: function() { @@ -85,7 +105,15 @@ var LSformElement_date_field = new Class({ date: now.get('date') }); this.input.value = today.format(this.params.format); + this.input.fireEvent('change'); } } + }, + + clearValue: function() { + this.input.value=""; + this.specialValueInputs.each(function(input) { + input.removeProperty('checked'); + }, this); } }); diff --git a/src/lang/fr_FR.UTF8/lang.php b/src/lang/fr_FR.UTF8/lang.php index 2f134000..2903fdf1 100644 --- a/src/lang/fr_FR.UTF8/lang.php +++ b/src/lang/fr_FR.UTF8/lang.php @@ -16,6 +16,10 @@ $GLOBALS['LSlang'] = array ( "Allow user to connect a POSIX system." => "Autorisie l'utilisateur à se connecter aux systèmes POSIX.", +# LSobjects.LSpeople.attrs.sambaPwdMustChange.html_options.special_values.0 +"At first login" => + "À la première connexion", + # LSobjects.LSpeople.LSrelation.groups.label # LSobjects.LSsysaccount.LSrelation.groups.label "Belongs to groups ..." => @@ -111,6 +115,10 @@ $GLOBALS['LSlang'] = array ( "Identifier must contain alphanumeric values, dots (.) and dashes (-) only." => "L'identifiant doit contenir uniquement des valeurs alpha-numériques, avec eventuellement des points (.) et des tirets (-).", +# LSobjects.LSpeople.attrs.sambaPwdCanChange.help_info +"If not set, the user will be free to change his password whenever he wants." => + "Si non défini, l'utilisateur pourra changer son mot de passe quand il le veut.", + # LSobjects.LSpeople.attrs.gidNumber.html_options.possible_values.1.label "LDAP Groups" => "Groupes LDAP", @@ -175,6 +183,16 @@ $GLOBALS['LSlang'] = array ( "Nb / page :" => "Nb / page :", +# LSobjects.LSpeople.attrs.sambaLogonTime.html_options.special_values.0 +# LSobjects.LSpeople.attrs.sambaLogoffTime.html_options.special_values.0 +# LSobjects.LSpeople.attrs.sambaKickoffTime.no_value_label +# LSobjects.LSpeople.attrs.sambaKickoffTime.html_options.special_values.2147483647 +# LSobjects.LSpeople.attrs.sambaPwdMustChange.no_value_label +# LSobjects.LSpeople.attrs.sambaPwdMustChange.html_options.special_values.2147483647 +# LSobjects.LSpeople.attrs.sambaPwdCanChange.html_options.special_values.2147483647 +"Never" => + "Jamais", + # LSobjects.LSpeople.attrs.uidNumber.label "Numeric identifier" => "Identifiant numérique", @@ -220,10 +238,32 @@ $GLOBALS['LSlang'] = array ( "Samba Password (NT)" => "Mot de passe Samba (NT)", +# LSobjects.LSpeople.attrs.sambaKickoffTime.label +"Samba expiration time" => + "Date d'expiration Samba", + +# LSobjects.LSpeople.attrs.sambaLogoffTime.label +"Samba last logoff time" => + "Date de dernière déconnexion Samba", + +# LSobjects.LSpeople.attrs.sambaLogonTime.label +"Samba last logon time" => + "Date de dernière connexion Samba", +# LSobjects.LSpeople.attrs.sambaPwdCanChange.label +"Samba password can change" => + "Date de prochaine modification possible du mot de passe Samba", +# LSobjects.LSpeople.attrs.sambaPwdMustChange.label +"Samba password must change" => + "Date de prochaine modification obligatoire du mot de passe Samba", + # LSobjects.LSpeople.LSform.dataEntryForm.simple.label "Simple" => "Simple", +# LSobjects.LSpeople.attrs.sambaKickoffTime.help_info +"Specifies the time when the user will be locked down and cannot login any longer." => + "Détermine la date à partir de laquelle l'utilisateur sera bloqué et ne pourra plus se connecter.", + # LSobjects.LSsysaccount.label "System accounts" => "Comptes systèmes", @@ -264,6 +304,11 @@ $GLOBALS['LSlang'] = array ( "Users" => "Utilisateurs", +# LSobjects.LSpeople.attrs.sambaPwdCanChange.no_value_label +# LSobjects.LSpeople.attrs.sambaPwdCanChange.html_options.special_values.0 +"Whenever" => + "N'importe quand", + # LSobjects.LSpeople.LSsearch.predefinedFilters.(jpegPhoto=*) "With photo" => "Avec photo", diff --git a/src/templates/default/LSformElement_date_field.tpl b/src/templates/default/LSformElement_date_field.tpl index f66b8bbb..2ee533ac 100644 --- a/src/templates/default/LSformElement_date_field.tpl +++ b/src/templates/default/LSformElement_date_field.tpl @@ -1,5 +1,10 @@ {if $freeze} {if $value}{$value|escape:"htmlall"}{else}{$noValueTxt|escape:"htmlall"}{/if} {else} - + + {foreach from=$special_values item=special_value_label key=special_value name=LSformElement_date_special_value} + + + {/foreach} {/if}