From 2e9459598f012d4199ed9ba7927b39ecc4bf4201 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 26 Apr 2018 11:06:10 +0200 Subject: [PATCH 01/19] LSdefault : encode LSjsConfig data in Base64 --- .../includes/class/class.LSsession.php | 2 +- public_html/includes/js/LSdefault.js | 2 +- public_html/includes/js/functions.js | 90 +++++++++++++++++++ public_html/templates/default/LSdefault.tpl | 4 +- 4 files changed, 93 insertions(+), 5 deletions(-) diff --git a/public_html/includes/class/class.LSsession.php b/public_html/includes/class/class.LSsession.php index 304e4c48..5b5af697 100644 --- a/public_html/includes/class/class.LSsession.php +++ b/public_html/includes/class/class.LSsession.php @@ -1364,7 +1364,7 @@ class LSsession { self :: addJSconfigParam('keepLSsessionActive',ini_get('session.gc_maxlifetime')); } - LStemplate :: assign('LSjsConfig',json_encode(self :: $_JSconfigParams)); + LStemplate :: assign('LSjsConfig',base64_encode(json_encode(self :: $_JSconfigParams))); if (LSdebug) { $JSscript_txt.="\n"; diff --git a/public_html/includes/js/LSdefault.js b/public_html/includes/js/LSdefault.js index 3a1b6478..2d42b180 100644 --- a/public_html/includes/js/LSdefault.js +++ b/public_html/includes/js/LSdefault.js @@ -24,7 +24,7 @@ var LSdefault = new Class({ // LSjsConfig this.LSjsConfigEl = $('LSjsConfig'); if ($type(this.LSjsConfigEl)) { - this.LSjsConfig = JSON.decode(this.LSjsConfigEl.innerHTML); + this.LSjsConfig = JSON.decode(atob(this.LSjsConfigEl.innerHTML)); } else { this.LSjsConfig = []; diff --git a/public_html/includes/js/functions.js b/public_html/includes/js/functions.js index 3ba04543..a3d1fa72 100644 --- a/public_html/includes/js/functions.js +++ b/public_html/includes/js/functions.js @@ -244,3 +244,93 @@ function urlAddVar(url,name,value) { } return url; } + +/* + * Base64 compatibility + * + * Source : http://ntt.cc/2008/01/19/base64-encoder-decoder-with-javascript.html + */ +if ($type(atob) != 'function') { + B64keyStr = "ABCDEFGHIJKLMNOP" + + "QRSTUVWXYZabcdef" + + "ghijklmnopqrstuv" + + "wxyz0123456789+/" + + "="; + + function btoa(input) { + input = escape(input); + var output = ""; + var chr1, chr2, chr3 = ""; + var enc1, enc2, enc3, enc4 = ""; + var i = 0; + + do { + chr1 = input.charCodeAt(i++); + chr2 = input.charCodeAt(i++); + chr3 = input.charCodeAt(i++); + + enc1 = chr1 >> 2; + enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); + enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); + enc4 = chr3 & 63; + + if (isNaN(chr2)) { + enc3 = enc4 = 64; + } else if (isNaN(chr3)) { + enc4 = 64; + } + + output = output + + B64keyStr.charAt(enc1) + + B64keyStr.charAt(enc2) + + B64keyStr.charAt(enc3) + + B64keyStr.charAt(enc4); + chr1 = chr2 = chr3 = ""; + enc1 = enc2 = enc3 = enc4 = ""; + } while (i < input.length); + + return output; + } + + function atob(input) { + var output = ""; + var chr1, chr2, chr3 = ""; + var enc1, enc2, enc3, enc4 = ""; + var i = 0; + + // remove all characters that are not A-Z, a-z, 0-9, +, /, or = + var base64test = /[^A-Za-z0-9\+\/\=]/g; + if (base64test.exec(input)) { + alert("There were invalid base64 characters in the input text.\n" + + "Valid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\n" + + "Expect errors in decoding."); + } + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); + + do { + enc1 = B64keyStr.indexOf(input.charAt(i++)); + enc2 = B64keyStr.indexOf(input.charAt(i++)); + enc3 = B64keyStr.indexOf(input.charAt(i++)); + enc4 = B64keyStr.indexOf(input.charAt(i++)); + + chr1 = (enc1 << 2) | (enc2 >> 4); + chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); + chr3 = ((enc3 & 3) << 6) | enc4; + + output = output + String.fromCharCode(chr1); + + if (enc3 != 64) { + output = output + String.fromCharCode(chr2); + } + if (enc4 != 64) { + output = output + String.fromCharCode(chr3); + } + + chr1 = chr2 = chr3 = ""; + enc1 = enc2 = enc3 = enc4 = ""; + + } while (i < input.length); + + return unescape(output); + } +} diff --git a/public_html/templates/default/LSdefault.tpl b/public_html/templates/default/LSdefault.tpl index 881ee909..44eecf06 100644 --- a/public_html/templates/default/LSdefault.tpl +++ b/public_html/templates/default/LSdefault.tpl @@ -1,6 +1,4 @@ -
-{$LSjsConfig} -
+
{$LSjsConfig}
{$LSinfos}
From 5335ca477c488a4780133d1aa52a3c8363fc2e4b Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 26 Apr 2018 11:12:38 +0200 Subject: [PATCH 02/19] LSformElement.js : do not handle sub li elements during initialization --- public_html/includes/js/LSformElement.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public_html/includes/js/LSformElement.js b/public_html/includes/js/LSformElement.js index 1ed6e758..59f52743 100644 --- a/public_html/includes/js/LSformElement.js +++ b/public_html/includes/js/LSformElement.js @@ -10,7 +10,7 @@ var LSformElement = new Class({ initializeLSformElement: function(li) { if (typeof(li) == 'undefined') { - var elements = this.ul.getElements('li'); + var elements = this.ul.getChildren('li'); } else { var elements = [li]; From 9cb3bb8e184dd0b1dddd7199e13adbbedae209c2 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 26 Apr 2018 11:23:00 +0200 Subject: [PATCH 03/19] LSattr_html :: jsonCompositeAttribute : Add help_info and multiple parameters on components --- ...LSattr_html_jsonCompositeAttribute.docbook | 26 ++++ .../LSformElement_jsonCompositeAttribute.css | 23 ++- ...s.LSformElement_jsonCompositeAttribute.php | 137 +++++++++++------- .../includes/class/class.LStemplate.php | 7 + .../LSformElement_jsonCompositeAttribute.js | 18 +++ ...ormElement_jsonCompositeAttribute_field.js | 32 ++++ ...ment_jsonCompositeAttribute_field_value.js | 31 ++++ ...ompositeAttribute_field_value_component.js | 62 ++++++++ ...ribute_field_value_component_text_value.js | 30 ++++ public_html/includes/js/functions.js | 12 ++ .../lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.mo | Bin 42925 -> 43251 bytes .../lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.po | 23 ++- public_html/lang/ldapsaisie.pot | 21 ++- ...rmElement_jsonCompositeAttribute_field.tpl | 60 ++++++-- 14 files changed, 406 insertions(+), 76 deletions(-) create mode 100644 public_html/includes/js/LSformElement_jsonCompositeAttribute.js create mode 100644 public_html/includes/js/LSformElement_jsonCompositeAttribute_field.js create mode 100644 public_html/includes/js/LSformElement_jsonCompositeAttribute_field_value.js create mode 100644 public_html/includes/js/LSformElement_jsonCompositeAttribute_field_value_component.js create mode 100644 public_html/includes/js/LSformElement_jsonCompositeAttribute_field_value_component_text_value.js diff --git a/doc/conf/LSattribute/LSattr_html/LSattr_html_jsonCompositeAttribute.docbook b/doc/conf/LSattribute/LSattr_html/LSattr_html_jsonCompositeAttribute.docbook index 09fe1097..1eeb58a8 100644 --- a/doc/conf/LSattribute/LSattr_html/LSattr_html_jsonCompositeAttribute.docbook +++ b/doc/conf/LSattribute/LSattr_html/LSattr_html_jsonCompositeAttribute.docbook @@ -19,8 +19,10 @@ 'components' => array ( '[clé composant 1]' => array ( 'label' => '[Label du composant]', + 'help_info' => '[Message d'aide sur le composant]', 'type' => '[Type de la valeur stocké]', 'required' => [Booléen], + 'multiple' => [Booléen], 'check_data' => => array ( // Régle de vérification syntaxique des données saisies ), @@ -57,6 +59,14 @@ + + help_info + + Message d'aide sur le composant (affiché uniquement en mode édition). + + + + type @@ -77,6 +87,22 @@ + + multiple + + Booléen définissant si ce composant peut stocker plusieurs valeurs (Défaut : + Faux). + + + + + required + + Booléen définissant si ce composant doit obligatoirement être défini (Défaut : + Faux). + + + check_data diff --git a/public_html/css/default/LSformElement_jsonCompositeAttribute.css b/public_html/css/default/LSformElement_jsonCompositeAttribute.css index 28b641f3..cae1b0ca 100644 --- a/public_html/css/default/LSformElement_jsonCompositeAttribute.css +++ b/public_html/css/default/LSformElement_jsonCompositeAttribute.css @@ -7,12 +7,29 @@ ul.LSformElement_jsonCompositeAttribute li.noValue { border: none; } -ul.LSformElement_jsonCompositeAttribute p { +ul.LSformElement_jsonCompositeAttribute div { + margin: 0; + margin-bottom: 2px; +} + +ul.LSformElement_jsonCompositeAttribute div label { + display: inline-block; + height: 100%; + vertical-align: top; + width: 10em; + font-weight: bold; +} + +ul.LSformElement_jsonCompositeAttribute div ul { + display: inline-block; + list-style-type: none; + padding: 0; margin: 0; } -ul.LSformElement_jsonCompositeAttribute p label { - font-weight: bold; +ul.LSformElement_jsonCompositeAttribute div ul li { + margin-bottom: 2px; + border: none; } div.jsonCompositeAttribute_possibleValues ul { diff --git a/public_html/includes/class/class.LSformElement_jsonCompositeAttribute.php b/public_html/includes/class/class.LSformElement_jsonCompositeAttribute.php index 2a480939..578cc7fe 100644 --- a/public_html/includes/class/class.LSformElement_jsonCompositeAttribute.php +++ b/public_html/includes/class/class.LSformElement_jsonCompositeAttribute.php @@ -100,6 +100,20 @@ class LSformElement_jsonCompositeAttribute extends LSformElement { ) ); LSsession :: addCssFile('LSformElement_jsonCompositeAttribute.css'); + if (!$this -> isFreeze()) { + LSsession :: addJSconfigParam( + $this -> name, + array ( + 'components' => $this -> components, + ) + ); + LSsession :: addJSscript('LSformElement_jsonCompositeAttribute_field_value_component_text_value.js'); + LSsession :: addJSscript('LSformElement_jsonCompositeAttribute_field_value_component.js'); + LSsession :: addJSscript('LSformElement_jsonCompositeAttribute_field_value.js'); + LSsession :: addJSscript('LSformElement_jsonCompositeAttribute_field.js'); + LSsession :: addJSscript('LSformElement_jsonCompositeAttribute.js'); + } + return $return; } @@ -132,19 +146,29 @@ class LSformElement_jsonCompositeAttribute extends LSformElement { * * @param[in] $c string The component name * @param[in] $value string The value + * @param[in] $inLoop boolean Internal param to control recursion * * @retval array **/ - function translateComponentValue($c,$value) { - $retval = array ( - 'translated' => $value, - 'value' => $value, - ); - if (isset($this -> components[$c])) { - if ($this -> components[$c]['type']=='select_list') { - $retval['translated'] = $this -> getSelectListComponentValueLabel($c,$value); + function translateComponentValue($c,$value,$inLoop=false) { + if (!$inLoop && isset($this -> components[$c]['multiple']) && $this -> components[$c]['multiple']) { + $retval = array(); + if (!is_array($value)) + $value = array($value); + foreach($value as $val) + $retval[] = $this -> translateComponentValue($c, $val, true); + } + else { + $retval = array ( + 'translated' => $value, + 'value' => $value, + ); + if (isset($this -> components[$c])) { + if ($this -> components[$c]['type']=='select_list') { + $retval['translated'] = $this -> getSelectListComponentValueLabel($c,$value); + } + //elseif type == 'text' => no transformation } - //elseif type == 'text' => no transformation } return $retval; } @@ -202,66 +226,73 @@ class LSformElement_jsonCompositeAttribute extends LSformElement { return true; } - $count=0; - $end=false; $return[$this -> name]=array(); - while ($end==false) { - $value=array(); - $parseValue=array(); - $errors=array(); - $unemptyComponents=array(); - foreach ($this -> components as $c => $cconf) { - if (isset($_POST[$this -> name.'__'.$c][$count])) { - $parseValue[$c]=$_POST[$this -> name.'__'.$c][$count]; - if ($cconf['required'] && empty($parseValue[$c])) { - $errors[]=getFData(__('Component %{c} must be defined'),__($cconf['label'])); - continue; - } - if (empty($parseValue[$c])) { - continue; - } - $unemptyComponents[]=$c; - if ($cconf['type']=='select_list') { - if (!$this -> getSelectListComponentValueLabel($c, $parseValue[$c])) { - $errors[]=getFData(__('Invalid value for component %{c}.'),__($cconf['label'])); - } - } - if (is_array($cconf['check_data'])) { - foreach($cconf['check_data'] as $ruleType => $rconf) { - $className='LSformRule_'.$ruleType; - if (LSsession::loadLSclass($className)) { - $r=new $className(); - if (!$r -> validate($parseValue[$c],$rconf,$this)) { - if (isset($rconf['msg'])) { - $errors[]=getFData(__($rconf['msg']),__($cconf['label'])); + if (is_array($_POST[$this -> name.'__values_uuid'])) { + foreach ($_POST[$this -> name.'__values_uuid'] as $uuid) { + $value=array(); + $parseValue=array(); + $errors=array(); + $unemptyComponents=array(); + + foreach ($this -> components as $c => $cconf) { + if (isset($_POST[$this -> name.'__'.$c.'__'.$uuid])) { + if (!is_array($_POST[$this -> name.'__'.$c.'__'.$uuid])) + $_POST[$this -> name.'__'.$c.'__'.$uuid] = array($_POST[$this -> name.'__'.$c.'__'.$uuid]); + + $parseValue[$c]=array(); + foreach($_POST[$this -> name.'__'.$c.'__'.$uuid] as $val) { + if (empty($val)) + continue; + $parseValue[$c][] = $val; + if ($cconf['type']=='select_list') { + if (!$this -> getSelectListComponentValueLabel($c, $val)) { + $errors[]=getFData(_('Invalid value "%{value}" for component %{component}.'),array('value' => $val, 'component' => __($cconf['label']))); + } + } + if (is_array($cconf['check_data'])) { + foreach($cconf['check_data'] as $ruleType => $rconf) { + $className='LSformRule_'.$ruleType; + if (LSsession::loadLSclass($className)) { + $r=new $className(); + if (!$r -> validate($val,$rconf,$this)) { + if (isset($rconf['msg'])) { + $errors[]=getFData(__($rconf['msg']),__($cconf['label'])); + } + else { + $errors[]=getFData(_('Invalid value "%{value}" for component %{component}.'),array('value' => $val, 'component' => __($cconf['label']))); + } + } } else { - $errors[]=getFData(__('Invalid value for component %{c}.'),__($cconf['label'])); + $errors[]=getFData(_("Can't validate value of component %{c}."),__($cconf['label'])); } } } - else { - $errors[]=getFData(__("Can't validate value of component %{c}."),__($cconf['label'])); - } } + + if (!isset($cconf['multiple']) || !$cconf['multiple']) { + if (count($parseValue[$c])>=1) + $parseValue[$c] = $parseValue[$c][0]; + else + $parseValue[$c] = ''; + } + + if ($cconf['required'] && empty($parseValue[$c])) { + $errors[]=getFData(_('Component %{c} must be defined'),__($cconf['label'])); + continue; + } + $unemptyComponents[]=$c; + + $value[$c]=$parseValue[$c]; } - $value[$c]=$parseValue[$c]; - } - else { - // end of value break - $end=true; - break; } - } - if (!$end) { if (!empty($unemptyComponents)) { foreach($errors as $e) { $this -> form -> setElementError($this -> attr_html,$e); } $return[$this -> name][]=json_encode($value); } - $count++; } } return true; diff --git a/public_html/includes/class/class.LStemplate.php b/public_html/includes/class/class.LStemplate.php index 9f816f38..de5d97aa 100644 --- a/public_html/includes/class/class.LStemplate.php +++ b/public_html/includes/class/class.LStemplate.php @@ -122,6 +122,7 @@ class LStemplate { self :: registerFunction("tr", "LStemplate_smarty_tr"); self :: registerFunction("img", "LStemplate_smarty_img"); self :: registerFunction("css", "LStemplate_smarty_css"); + self :: registerFunction("uniqid", "LStemplate_smarty_uniqid"); return True; } @@ -297,6 +298,12 @@ function LStemplate_smarty_css($params) { echo LStemplate :: getCSSPath($name); } +function LStemplate_smarty_uniqid($params, &$smarty) { + if (!isset($params['var'])) + $params['var'] = 'uniqid'; + $smarty -> assign($params['var'], uniqid()); +} + // Errors LSerror :: defineError('LStemplate_01', _("LStemplate : Template %{file} not found.") diff --git a/public_html/includes/js/LSformElement_jsonCompositeAttribute.js b/public_html/includes/js/LSformElement_jsonCompositeAttribute.js new file mode 100644 index 00000000..637f4c3c --- /dev/null +++ b/public_html/includes/js/LSformElement_jsonCompositeAttribute.js @@ -0,0 +1,18 @@ +var LSformElement_jsonCompositeAttribute = new Class({ + initialize: function(){ + this.fields = []; + this.initialiseLSformElement_jsonCompositeAttribute(); + }, + + initialiseLSformElement_jsonCompositeAttribute: function(el) { + if (!$type(el)) { + el = document; + } + el.getElements('ul.LSformElement_jsonCompositeAttribute').each(function(ul) { + this.fields[ul.id] = new LSformElement_jsonCompositeAttribute_field(ul); + }, this); + } +}); +window.addEvent(window.ie ? 'load' : 'domready', function() { + varLSformElement_jsonCompositeAttribute = new LSformElement_jsonCompositeAttribute(); +}); diff --git a/public_html/includes/js/LSformElement_jsonCompositeAttribute_field.js b/public_html/includes/js/LSformElement_jsonCompositeAttribute_field.js new file mode 100644 index 00000000..2cfedc5d --- /dev/null +++ b/public_html/includes/js/LSformElement_jsonCompositeAttribute_field.js @@ -0,0 +1,32 @@ +var LSformElement_jsonCompositeAttribute_field = new Class({ + initialize: function(ul){ + this.ul=ul; + this.dd=ul.getParent(); + this.name = ul.id; + this.values = []; + this.field_type = ul.get('data-fieldType'); + this.initializeLSformElement_jsonCompositeAttribute_field(); + varLSform.addField(this.name,this); + }, + + initializeLSformElement_jsonCompositeAttribute_field: function(el) { + if (!$type(el)) { + el = this.ul; + } + el.getChildren('li').each(function(li) { + this.values.push(new LSformElement_jsonCompositeAttribute_field_value(li,this.name,this.field_type)); + }, this); + }, + + clearValue: function() { + if (this.values.length>1) { + for(var i=1; i<=this.values.length; i++) { + $(this.values[i].li).dispose(); + } + this.values[0].clear(); + } + else if (this.values.length==1) { + this.values[0].clear(); + } + } +}); diff --git a/public_html/includes/js/LSformElement_jsonCompositeAttribute_field_value.js b/public_html/includes/js/LSformElement_jsonCompositeAttribute_field_value.js new file mode 100644 index 00000000..6277b4c7 --- /dev/null +++ b/public_html/includes/js/LSformElement_jsonCompositeAttribute_field_value.js @@ -0,0 +1,31 @@ +var LSformElement_jsonCompositeAttribute_field_value = new Class({ + initialize: function(li,name,field_type){ + this.li=li; + this.name = name; + this.input_uuid = li.getElement('input[name='+name+'__values_uuid[]]'); + this.uuid = this.input_uuid.get('value'); + this.components = {}; + this.field_type = field_type; + this.initializeLSformElement_jsonCompositeAttribute_field_value(); + varLSform.addModule(field_type,this); + }, + + initializeLSformElement_jsonCompositeAttribute_field_value: function(el) { + if (!$type(el)) { + el = this.li; + } + el.getElements('div').each(function(div) { + this.components[div.get('data-component')]=new LSformElement_jsonCompositeAttribute_field_value_component(div,div.get('data-component'),this.name,this.uuid); + }, this); + }, + + reinitialize: function(el) { + this.initializeLSformElement_jsonCompositeAttribute_field_value(el); + }, + + clear: function() { + for (c in this.components) { + this.components[c].clear(); + } + } +}); diff --git a/public_html/includes/js/LSformElement_jsonCompositeAttribute_field_value_component.js b/public_html/includes/js/LSformElement_jsonCompositeAttribute_field_value_component.js new file mode 100644 index 00000000..ba72ca50 --- /dev/null +++ b/public_html/includes/js/LSformElement_jsonCompositeAttribute_field_value_component.js @@ -0,0 +1,62 @@ +var LSformElement_jsonCompositeAttribute_field_value_component = new Class({ + initialize: function(div,name,field_name,field_uuid){ + this.div = div; + + this.field_name = field_name; + this.field_uuid = field_uuid; + this.field_params = varLSdefault.LSjsConfig[this.field_name]; + + this.name = name; + this.params = this.field_params['components'][this.name]; + + this.label = div.getElement('label'); + if (this.params.type == 'select_list') { + this.select = div.getElement('select'); + } + else { + // Type text + this.ul = div.getElement('ul'); + this.lis = {}; + this.values = {}; + this.ul.getElements('li').each(function(li) { + this.initTextComponentValue(li); + }, this); + } + }, + + initTextComponentValue: function(li) { + var uuid = generate_uuid(); + this.lis[uuid] = li; + this.values[uuid] = new LSformElement_jsonCompositeAttribute_field_value_component_text_value(this,li); + }, + + onAddTextValueBtnClick: function(after) { + var li = new Element('li'); + var input = new Element('input'); + input.type='text'; + input.name=this.field_name+'__'+this.name+'__'+this.field_uuid+'[]'; + input.injectInside(li); + li.injectAfter(after.li); + this.initTextComponentValue(li); + }, + + onRemoveTextValueBtnClick: function(value) { + if (this.ul.getElements('li').length == 1) { + value.clear.bind(value)(); + } + else { + value.remove.bind(value)(); + } + }, + + clear: function() { + if (this.params.type == 'select_list') { + this.select.selectedIndex=-1; + } + else { + this.values.each(function(value) { + value.clear(); + }, this); + } + } +}); diff --git a/public_html/includes/js/LSformElement_jsonCompositeAttribute_field_value_component_text_value.js b/public_html/includes/js/LSformElement_jsonCompositeAttribute_field_value_component_text_value.js new file mode 100644 index 00000000..29f2dfa9 --- /dev/null +++ b/public_html/includes/js/LSformElement_jsonCompositeAttribute_field_value_component_text_value.js @@ -0,0 +1,30 @@ +var LSformElement_jsonCompositeAttribute_field_value_component_text_value = new Class({ + initialize: function(component,li) { + this.component = component; + this.li = li; + + this.input = li.getElement('input'); + + if (this.component.params.multiple) { + this.addValueBtn = new Element('img'); + this.addValueBtn.src = varLSdefault.imagePath('add'); + this.addValueBtn.addClass('btn'); + this.addValueBtn.addEvent('click',this.component.onAddTextValueBtnClick.bind(this.component,this)); + this.addValueBtn.injectInside(this.li); + + this.removeValueBtn = new Element('img'); + this.removeValueBtn.src = varLSdefault.imagePath('remove'); + this.removeValueBtn.addClass('btn'); + this.removeValueBtn.addEvent('click',this.component.onRemoveTextValueBtnClick.bind(this.component,this)); + this.removeValueBtn.injectInside(this.li); + } + }, + + clear: function() { + this.input.value = ''; + }, + + remove: function() { + this.li.destroy(); + } +}); diff --git a/public_html/includes/js/functions.js b/public_html/includes/js/functions.js index a3d1fa72..923056cf 100644 --- a/public_html/includes/js/functions.js +++ b/public_html/includes/js/functions.js @@ -245,6 +245,18 @@ function urlAddVar(url,name,value) { return url; } +/* + * Generate UUID + */ +function generate_uuid() { + function s4() { + return Math.floor((1 + Math.random()) * 0x10000) + .toString(16) + .substring(1); + } + return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); +} + /* * Base64 compatibility * diff --git a/public_html/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.mo b/public_html/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.mo index 50ad200d410933d684ce97facabf712446cb98d5..f7cd32a6d867caf3d6dc031c2917862b08b3e403 100644 GIT binary patch delta 7333 zcmZA533yId9>?($2_d#5lGuV5i9~D>36h9JL}Q7))+$MO5weiQ+PKw4m9}c@qO=U! z8dW7#Ejqf;>Vm4ST3Z*oYOAddQ##+@d#*la&f}lYIp^N@?DxKjZAYv9daRmrDl}lV zA!Yd)6Nx>7jM+hcT$pN&@ia9i8e3vB%*H_UVk<1dmiQp{!=0Fff1;X5pwSG>#-X?v z$Kna>WsGBzXtg^Pv#}OFhXJ?;V{kv#!1Jh%FJJ^-!s=MJxgB@|%%L2QAy|prVwNHQ z%r<`1!FN&ZeCjJZ#+)U?q|F6X$Ct4#Uc>rWr-dCrB!*IMjWw|=s-bjL!`Y~gZ${lW z8QbGrY=lp`*Y{&MHb8An6lyC{QDLOf=8!?E{&ctVN8hT>w=a=GO%HPF0cE%}8FPVz_P&0l5wH2Xp zww&j>4YR1fj2c+acJ{QFp_Xglf; zX_R;10Q?EHcc~q1!zGxn>&QnUt$IH^*!vqf`4Cj>gM45{Gp)rUbX37aMo8Gjd$t#eu5lf3yWZm z<1nn<+YWF%W>dbyEx(OAV;4|c(SQTN17fn#QKp!TPXB6DLr1YGwxU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AqPwqpyzpU<@*;)pin z$;5A3e;qFqy@^3eIQ}9A5+4vx6F(6Lh|Ty=`M$ zNZyOkx5A@GJrZBe2N6@<69JSDQcfrQh)6;Y_Pd0RF~lgMj)%KQAtcQS9fycjB_$qG zZd7{sQV1kpjBgWP67|W8P{(Q_-Mzjs43{6(BWcu>}Busxw;C=sC-Rwjj4h*V-8 z@hj1g_>ri~hu&wNf(m~P@^U_>CZ3vKFcx)G!8dKugi@|TxfVX<)`^cFDR-f~fVfNa zbn8!GEHRgeBJ_nhi_r0a@F9BGuOA*!ZthLA)>-$cgv&}3*G1Tz>+;Y(3XGTBlYBlA zLs`dGOUbKs`TvIc6}2_pD|S-;gZP$smWZUj20lS-BmP5NAZokUdtm|jc%lsDeYk?C zL#!c^sf#8yQ-1XDcav(`7XKu%o#|SSXP65{NlOHDWNK;}mgHt5Jy_dXu!oT>O)`Pw2=eE)!FTaF61!TAMu!uZDh5 z{ApNZ+2V%v&!qS##U(VUo!F#VVp2>(VxeEZTK}(UOigiOzj\n" "Language-Team: LdapSaisie \n" @@ -435,7 +435,7 @@ msgstr "Affichier la clé en entier." msgid "Unknown type" msgstr "Type inconnu" -#: includes/class/class.LSformElement_valueWithUnit.php:190 +#: includes/class/class.LSformElement_valueWithUnit.php:200 msgid "" "LSformElement_valueWithUnit : Units configuration data are missing for the " "attribute %{attr}." @@ -490,12 +490,12 @@ msgstr "LStemplate : Impossible de charger le fichier de support de Smarty 3." msgid "LStemplate : Smarty version not recognized." msgstr "LStemplate : Version de Smarty non reconnue." -#: includes/class/class.LStemplate.php:129 +#: includes/class/class.LStemplate.php:130 msgid "LStemplate : Can't load Smarty." msgstr "" "LStemplate : Impossible de charger le moteur de gestion de template Smarty." -#: includes/class/class.LStemplate.php:302 +#: includes/class/class.LStemplate.php:309 msgid "LStemplate : Template %{file} not found." msgstr "LStemplate : le template %{file} est introuvable." @@ -1625,6 +1625,19 @@ msgstr "" "LSformRule_inarray : Les valeurs possibles n'ont pas été configurées pour " "valider les données." +#: includes/class/class.LSformElement_jsonCompositeAttribute.php:249 +#: includes/class/class.LSformElement_jsonCompositeAttribute.php:262 +msgid "Invalid value \"%{value}\" for component %{component}." +msgstr "Valeur invalide pour le composant %{component} : \"%{value}\"" + +#: includes/class/class.LSformElement_jsonCompositeAttribute.php:267 +msgid "Can't validate value of component %{c}." +msgstr "Impossible de valider la valeur du composant %{c}." + +#: includes/class/class.LSformElement_jsonCompositeAttribute.php:281 +msgid "Component %{c} must be defined" +msgstr "Le composant %{c} est obligatoire." + #: includes/class/class.LSformRule_date.php:59 msgid "LSformRule_date : No date format specify." msgstr "LSformRule_date : Aucun format de date spécifié." diff --git a/public_html/lang/ldapsaisie.pot b/public_html/lang/ldapsaisie.pot index 87980c5d..6fa5ff61 100644 --- a/public_html/lang/ldapsaisie.pot +++ b/public_html/lang/ldapsaisie.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-02-08 18:12+0100\n" +"POT-Creation-Date: 2018-04-26 11:33+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -388,7 +388,7 @@ msgstr "" msgid "Unknown type" msgstr "" -#: includes/class/class.LSformElement_valueWithUnit.php:190 +#: includes/class/class.LSformElement_valueWithUnit.php:200 msgid "" "LSformElement_valueWithUnit : Units configuration data are missing for the " "attribute %{attr}." @@ -435,11 +435,11 @@ msgstr "" msgid "LStemplate : Smarty version not recognized." msgstr "" -#: includes/class/class.LStemplate.php:129 +#: includes/class/class.LStemplate.php:130 msgid "LStemplate : Can't load Smarty." msgstr "" -#: includes/class/class.LStemplate.php:302 +#: includes/class/class.LStemplate.php:309 msgid "LStemplate : Template %{file} not found." msgstr "" @@ -1397,6 +1397,19 @@ msgid "" "data." msgstr "" +#: includes/class/class.LSformElement_jsonCompositeAttribute.php:249 +#: includes/class/class.LSformElement_jsonCompositeAttribute.php:262 +msgid "Invalid value \"%{value}\" for component %{component}." +msgstr "" + +#: includes/class/class.LSformElement_jsonCompositeAttribute.php:267 +msgid "Can't validate value of component %{c}." +msgstr "" + +#: includes/class/class.LSformElement_jsonCompositeAttribute.php:281 +msgid "Component %{c} must be defined" +msgstr "" + #: includes/class/class.LSformRule_date.php:59 msgid "LSformRule_date : No date format specify." msgstr "" diff --git a/public_html/templates/default/LSformElement_jsonCompositeAttribute_field.tpl b/public_html/templates/default/LSformElement_jsonCompositeAttribute_field.tpl index 31030e13..a4591818 100644 --- a/public_html/templates/default/LSformElement_jsonCompositeAttribute_field.tpl +++ b/public_html/templates/default/LSformElement_jsonCompositeAttribute_field.tpl @@ -2,35 +2,73 @@ {if isset($parseValue)} {foreach $components as $c => $cconf} {if !isset($parseValue[$c])}{continue}{/if} -

+

- {$parseValue[$c].translated} -

+
    + {if $cconf.multiple && is_array($parseValue[$c])} + {foreach from=$parseValue[$c] item=$cval} +
  • {$cval.translated}
  • + {/foreach} + {else} +
  • {$parseValue[$c].translated}
  • + {/if} +
+
{/foreach} {else} {$noValueTxt} {/if} {else} - {foreach $components as $c => $cconf} -

- + {uniqid var="uuid"} + + {foreach from=$components key=$c item=$cconf name=components} +

+ {if $cconf.type=='select_list'} - {foreach from=$cconf.possible_values key=key item=label} {if is_array($label)} {if count($label.possible_values)>0} - {html_options options=$label.possible_values selected=$parseValue[$c].value} + {if $cconf.multiple && is_array($parseValue[$c])} + {html_options options=$label.possible_values selected=$parseValue[$c]} + {else} + {html_options options=$label.possible_values selected=$parseValue[$c].value} + {/if} {/if} {else} - + {assign var="selected" value=0} + {if $cconf.multiple && is_array($parseValue[$c])} + {foreach from=$parseValue[$c] item=cval} + {if $key==$cval.value}{assign var="selected" value=1}{/if} + {/foreach} + {else} + {if $key == $parseValue[$c].value} + {assign var="selected" value=1} + {/if} + {/if} + {/if} {/foreach} {else} - +
    + {if $cconf.multiple && is_array($parseValue[$c])} + {foreach from=$parseValue[$c] item=$cval} +
  • + {foreachelse} +
  • + {/foreach} + {else} +
  • + {/if} +
{/if} -

+
{/foreach} {/if} From 64071f55e6c6c8f5f87355789b5d717283325a7a Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 26 Apr 2018 11:37:24 +0200 Subject: [PATCH 04/19] Adapt tmp/.gitignore file to new Smarty templace_c filenames --- public_html/tmp/.gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public_html/tmp/.gitignore b/public_html/tmp/.gitignore index f605d295..b00e673f 100644 --- a/public_html/tmp/.gitignore +++ b/public_html/tmp/.gitignore @@ -1,3 +1,3 @@ -*.tpl.php +*.php *.tmp *.log From d06593cf14fc8cde475a5595973e71db126845ec Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 26 Apr 2018 12:18:16 +0200 Subject: [PATCH 05/19] LSattr_html :: select_list : add possiblity to use values of other attribute as possible values --- .../LSattr_html/LSattr_html.entities.xml | 1 + .../LSattr_html_select_list.docbook | 44 ++++++++ .../class/class.LSattr_html_select_list.php | 96 ++++++++++++++++++ .../lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.mo | Bin 43251 -> 44261 bytes .../lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.po | 38 ++++++- public_html/lang/ldapsaisie.pot | 28 ++++- 6 files changed, 202 insertions(+), 5 deletions(-) diff --git a/doc/conf/LSattribute/LSattr_html/LSattr_html.entities.xml b/doc/conf/LSattribute/LSattr_html/LSattr_html.entities.xml index e29c60a3..158a6ac7 100644 --- a/doc/conf/LSattribute/LSattr_html/LSattr_html.entities.xml +++ b/doc/conf/LSattribute/LSattr_html/LSattr_html.entities.xml @@ -20,4 +20,5 @@ +LSattr_html_jsonCompositeAttribute"> LSattr_html_select_list"> diff --git a/doc/conf/LSattribute/LSattr_html/LSattr_html_select_list.docbook b/doc/conf/LSattribute/LSattr_html/LSattr_html_select_list.docbook index ae41e1d3..f75596e5 100644 --- a/doc/conf/LSattribute/LSattr_html/LSattr_html_select_list.docbook +++ b/doc/conf/LSattribute/LSattr_html/LSattr_html_select_list.docbook @@ -22,6 +22,19 @@ 'basedn' => '[Basedn de la recherche]', 'onlyAccessible' => '[Booléen]' ), + 'OTHER_ATTRIBUTE' => '[attr]', + // Or : + 'OTHER_ATTRIBUTE' => array( + '[attr1]' => '[label1]', + '[attr2]' => '[label2]', + [...] + ), + // Or : + 'OTHER_ATTRIBUTE' => array( + 'attr' => [attr], + 'json_component_key' => '[Composant JSON clé]', + 'json_component_label' => '[Composant JSON label]', + ), array ( 'label' => '[LSformat du nom du groupe de valeurs]', 'possible_values' => array ( @@ -128,6 +141,37 @@
+ Si la valeur clé est égale à OTHER_ATTRIBTE, une liste + de valeur possible sera composée à l'aide des valeurs d'un (ou plusieurs) autre + attribut de l'objet courant. La valeur associée peut être alors : + + + + soit le nom d'un attribut dont les valeurs seront utilisées comme valeurs + possibles (la valeur affichée est égale à la valeur stockée). + + + + soit un tableau associatif dont les valeurs clés sont les noms des attributs + dont les valeurs seront utilisés comme valeurs possibles et dont les valeurs associés + seront les labels sous lesquels ces valeurs seront regroupées (la valeur + affichée est égale à la valeur stockée). + + + + soit un tableau associatif référençant un attribut sous la clé attr + dont les valeurs seront utilisées comme valeurs possibles. Cet attribut + peut-être du type &LSattr_html_jsonCompositeAttribute;. Il sera alors possible d'utiliser + les valeurs d'un composant en particulier en le référençant à l'aide de la clé + json_component_key. Il est également possible de référencer un autre composant + à l'aide de la clé json_component_label et dont les valeurs seront + utilisées comme valeurs affichées lors de la sélection. À défaut, les valeurs affichées + seront identiques à celles stockées. + + + + + diff --git a/public_html/includes/class/class.LSattr_html_select_list.php b/public_html/includes/class/class.LSattr_html_select_list.php index 396d7f63..a1f564cc 100644 --- a/public_html/includes/class/class.LSattr_html_select_list.php +++ b/public_html/includes/class/class.LSattr_html_select_list.php @@ -88,6 +88,10 @@ class LSattr_html_select_list extends LSattr_html{ $objInfos=self :: getLSobjectPossibleValues($val_label,$options,$name); $retInfos=self :: _array_merge($retInfos,$objInfos); } + elseif($val_key==='OTHER_ATTRIBUTE') { + $attrInfos=self :: getLSattributePossibleValues($val_label, $options, $name, $ldapObject); + $retInfos=self :: _array_merge($retInfos,$attrInfos); + } elseif (is_array($val_label)) { if (!isset($val_label['possible_values']) || !is_array($val_label['possible_values']) || !isset($val_label['label'])) continue; @@ -273,6 +277,86 @@ class LSattr_html_select_list extends LSattr_html{ return $retInfos; } + + /** + * Retourne un tableau des valeurs possibles d'un autre attribut + * + * @param[in] $attr OTHER_ATTRIBUTE configuration value + * @param[in] $options array|false Attribute options + * @param[in] $name Attribute name + * @param[in] $LSldapObject LSldapObject reference + * + * @author Benjamin Renard + * + * @retval array Tableau associatif des valeurs possible de la liste avec en clé + * la valeur des balises option et en valeur ce qui sera affiché. + */ + protected function getLSattributePossibleValues($attr, $options ,$name ,&$ldapObject) { + $retInfos=array(); + if (is_string($attr)) { + if (isset($ldapObject->attrs[$attr]) && $ldapObject->attrs[$attr] instanceof LSattribute) { + $attr_values = $ldapObject->attrs[$attr]->getValue(); + if (!is_array($attr_values)) + $attr_values = array($attr_values); + foreach($attr_values as $attr_value) + $retInfos[$attr_value] = __($attr_value); + } + else + LSerror :: addErrorCode('LSattr_html_select_list_02',$attr); + } + elseif (is_array($attr)) { + if (isset($attr['attr'])) { + if (isset($ldapObject->attrs[$attr['attr']]) && $ldapObject->attrs[$attr['attr']] instanceof LSattribute) { + if (isset($attr['json_component_key'])) { + if (get_class($ldapObject->attrs[$attr['attr']]->html) == 'LSattr_html_jsonCompositeAttribute') { + $attr_values = $ldapObject->attrs[$attr['attr']]->getValue(); + if (!is_array($attr_values)) + $attr_values = array($attr_values); + foreach($attr_values as $attr_value) { + $value_data = @json_decode($attr_value, true); + if (!isset($value_data[$attr['json_component_key']])) { + LSerror :: addErrorCode('LSattr_html_select_list_05', array('attr' => $attr['attr'], 'value' => $attr_value, 'component' => $attr['json_component_key'])); + return $retInfos; + } + $key = $value_data[$attr['json_component_key']]; + + if (isset($attr['json_component_label'])) { + if (!isset($value_data[$attr['json_component_label']])) { + LSerror :: addErrorCode('LSattr_html_select_list_05', array('attr' => $attr['attr'], 'value' => $attr_value, 'component' => $attr['json_component_label'])); + return $retInfos; + } + $label = $value_data[$attr['json_component_label']]; + } + else + $label = $key; + + $retInfos[$key] = $label; + } + } + else + LSerror :: addErrorCode('LSattr_html_select_list_03',$attr['attr']); + } + else + $retInfos = self :: getLSattributePossibleValues($attr['attr'], $options ,$name ,$ldapObject); + } + else + LSerror :: addErrorCode('LSattr_html_select_list_02',$attr['attr']); + } + else { + foreach($attr as $sub_attr => $sub_label) { + $subRetInfos = self :: getLSattributePossibleValues($sub_attr, $options ,$name ,$ldapObject); + self :: _sort($subRetInfos,$options); + $retInfos[] = array ( + 'label' => $sub_label, + 'possible_values' => $subRetInfos + ); + } + } + } + self :: _sort($retInfos,$options); + return $retInfos; + } + } /* @@ -281,3 +365,15 @@ class LSattr_html_select_list extends LSattr_html{ LSerror :: defineError('LSattr_html_select_list_01', _("LSattr_html_select_list : Configuration data are missing to generate the select list of the attribute %{attr}.") ); +LSerror :: defineError('LSattr_html_select_list_02', +_("LSattr_html_select_list : Invalid attribute %{attr} reference as OTHER_ATTRIBUTE possible values.") +); +LSerror :: defineError('LSattr_html_select_list_03', +_("LSattr_html_select_list : Attribute %{attr} referenced as OTHER_ATTRIBUTE possible values is not a jsonCompositeAttribute.") +); +LSerror :: defineError('LSattr_html_select_list_04', +_("LSattr_html_select_list : Fail to decode the following attribute %{attr} value as JSON : %{value}") +); +LSerror :: defineError('LSattr_html_select_list_05', +_("LSattr_html_select_list : No component %{component} found in the following attribute %{attr} JSON value : %{value}") +); diff --git a/public_html/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.mo b/public_html/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.mo index f7cd32a6d867caf3d6dc031c2917862b08b3e403..f079e6c3015b60840f82f982ed8d937de44419ac 100644 GIT binary patch delta 7759 z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?%=252GQ8De&Ss9D4&WmL@ZwvPh;xocn=XX8MC}V+%FD`vf}z>B{tpV zBBpY+h^anb{J8u^vRvGfH;!cuokuCk{l6?NdyIdgt&zOHxLOPs#oC@>l!~I@$to+y z=N&|Hp7@7&Rcsec;@FRl%d%f0xhE2(s)+wX_F$wBqCx2`ubx#?b@d&2J!mHEvmfq1 z+ojiN?B>K{#6Q)q6j7ecDEnF4u^-A1m0995Fgx``+Y#Xix+`GXkmnZe?B;wZ67 zlwH3a=9MMccXw2~<`;Q3Z{L{vA+HeI#Jl2Su}j<|TKP=86WWLu5us_DqQzqaxb z;w4cU$Kw76I(UF*i_1imwW7cFn&MAoEjFO~_v-QZ^bjq?DPpd;Swvq)izqLPouYxy z?2iVevwC^)L+Ptt>u%X~;-Kg&W~`f0QfJ-5l8S{jvRY1QlYis{c@?ol+%AsD+f~!o z@k8-;Df@qv_qaj4CZe1u9ue=0IijZcxp+=Q=_i(z)qE?kL%Db}sO-)gE4f%TF+l!! z-d3KS#WZoRsPm%%&6a;F{vrlxf1Ob#WR(4E<>!F>Gj%yk9k=rs69RWm87_cW!W#SSRZH%p1{=mp`(u7$cimBq#SiobQI7-r7M7db}UL2*pqu8t-<@D`~8@*n%Zf~pE+vm2~+^u}qZtH4J aX;r>!_w7BWbgZ%Nt9i?}?_JQK-+uwH;eJ&B diff --git a/public_html/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.po b/public_html/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.po index d630b51d..5bfc280b 100644 --- a/public_html/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.po +++ b/public_html/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: LdapSaisie\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-04-26 11:34+0200\n" -"PO-Revision-Date: 2018-04-26 11:35+0200\n" +"POT-Creation-Date: 2018-04-26 11:40+0200\n" +"PO-Revision-Date: 2018-04-26 11:44+0200\n" "Last-Translator: Benjamin Renard \n" "Language-Team: LdapSaisie \n" @@ -1609,7 +1609,7 @@ msgstr "Cliquer pour supprimer cette photo." msgid "Chat with this person." msgstr "Discuter avec cette personne." -#: includes/class/class.LSattr_html_select_list.php:282 +#: includes/class/class.LSattr_html_select_list.php:366 msgid "" "LSattr_html_select_list : Configuration data are missing to generate the " "select list of the attribute %{attr}." @@ -1617,6 +1617,38 @@ msgstr "" "LSattr_html_select_list : Des données de configuration sont manquantes pour " "générer la liste de sélection de l'attribut %{attr}." +#: includes/class/class.LSattr_html_select_list.php:369 +msgid "" +"LSattr_html_select_list : Invalid attribute %{attr} reference as " +"OTHER_ATTRIBUTE possible values." +msgstr "" +"LSattr_html_select_list : Référence invalide à l'attribut %{attr} comme " +"valeurs possibles (OTHER_ATTRIBUTE)." + +#: includes/class/class.LSattr_html_select_list.php:372 +msgid "" +"LSattr_html_select_list : Attribute %{attr} referenced as OTHER_ATTRIBUTE " +"possible values is not a jsonCompositeAttribute." +msgstr "" +"LSattr_html_select_list : L'attribute %{attr} référencé comme valeurs " +"possibles (OTHER_ATTRIBUTE) n'est pas du type jsonCompositeAttribute." + +#: includes/class/class.LSattr_html_select_list.php:375 +msgid "" +"LSattr_html_select_list : Fail to decode the following attribute %{attr} " +"value as JSON : %{value}" +msgstr "" +"LSattr_html_select_list : Impossible de décodé la valeur JSON suivante de " +"l'attribut %{attr} : %{value}" + +#: includes/class/class.LSattr_html_select_list.php:378 +msgid "" +"LSattr_html_select_list : No component %{component} found in the following " +"attribute %{attr} JSON value : %{value}" +msgstr "" +"LSattr_html_select_list : Le composant %{component} n'a pas été trouvé dans " +"la valeur JSON de l'attribut %{attr} : %{value}" + #: includes/class/class.LSformRule_inarray.php:56 msgid "" "LSformRule_inarray : Possible values has not been configured to validate " diff --git a/public_html/lang/ldapsaisie.pot b/public_html/lang/ldapsaisie.pot index 6fa5ff61..31569c0c 100644 --- a/public_html/lang/ldapsaisie.pot +++ b/public_html/lang/ldapsaisie.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-04-26 11:33+0200\n" +"POT-Creation-Date: 2018-04-26 11:39+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1385,12 +1385,36 @@ msgstr "" msgid "Chat with this person." msgstr "" -#: includes/class/class.LSattr_html_select_list.php:282 +#: includes/class/class.LSattr_html_select_list.php:366 msgid "" "LSattr_html_select_list : Configuration data are missing to generate the " "select list of the attribute %{attr}." msgstr "" +#: includes/class/class.LSattr_html_select_list.php:369 +msgid "" +"LSattr_html_select_list : Invalid attribute %{attr} reference as " +"OTHER_ATTRIBUTE possible values." +msgstr "" + +#: includes/class/class.LSattr_html_select_list.php:372 +msgid "" +"LSattr_html_select_list : Attribute %{attr} referenced as OTHER_ATTRIBUTE " +"possible values is not a jsonCompositeAttribute." +msgstr "" + +#: includes/class/class.LSattr_html_select_list.php:375 +msgid "" +"LSattr_html_select_list : Fail to decode the following attribute %{attr} " +"value as JSON : %{value}" +msgstr "" + +#: includes/class/class.LSattr_html_select_list.php:378 +msgid "" +"LSattr_html_select_list : No component %{component} found in the following " +"attribute %{attr} JSON value : %{value}" +msgstr "" + #: includes/class/class.LSformRule_inarray.php:56 msgid "" "LSformRule_inarray : Possible values has not been configured to validate " From 5027792342d9c391dc020b3da821b2b2d115c978 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Fri, 27 Apr 2018 10:02:44 +0200 Subject: [PATCH 06/19] LSattr_html :: jsonCompositeAttribute : fix foreach syntax for retro-compat with old Smarty versions --- .../default/LSformElement_jsonCompositeAttribute_field.tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public_html/templates/default/LSformElement_jsonCompositeAttribute_field.tpl b/public_html/templates/default/LSformElement_jsonCompositeAttribute_field.tpl index a4591818..8b58d99e 100644 --- a/public_html/templates/default/LSformElement_jsonCompositeAttribute_field.tpl +++ b/public_html/templates/default/LSformElement_jsonCompositeAttribute_field.tpl @@ -6,7 +6,7 @@
    {if $cconf.multiple && is_array($parseValue[$c])} - {foreach from=$parseValue[$c] item=$cval} + {foreach from=$parseValue[$c] item=cval}
  • {$cval.translated}
  • {/foreach} {else} @@ -21,7 +21,7 @@ {else} {uniqid var="uuid"} - {foreach from=$components key=$c item=$cconf name=components} + {foreach from=$components key=c item=cconf name=components}