diff --git a/trunk/css/black/LSformElement_select_object.css b/trunk/css/black/LSformElement_select_object.css index 29e39a5b..db396fc1 100644 --- a/trunk/css/black/LSformElement_select_object.css +++ b/trunk/css/black/LSformElement_select_object.css @@ -5,7 +5,12 @@ a.LSformElement_select_object { text-decoration: none; color: #33302b; font-weight: normal; - +} + +a.LSformElement_select_object_deleted { + font-style: italic; + color: #777; + text-decoration: line-through; } ul.LSformElement_select_object_edit { diff --git a/trunk/css/default/LSformElement_select_object.css b/trunk/css/default/LSformElement_select_object.css index f1313747..26383e99 100644 --- a/trunk/css/default/LSformElement_select_object.css +++ b/trunk/css/default/LSformElement_select_object.css @@ -5,7 +5,12 @@ a.LSformElement_select_object { text-decoration: none; color: #000; font-weight: normal; - +} + +a.LSformElement_select_object_deleted { + font-style: italic; + color: #777; + text-decoration: line-through; } ul.LSformElement_select_object_edit { @@ -27,3 +32,4 @@ li.LSformElement_select_object_addBtn { img.LSformElement_select_object_deleteBtn { cursor: pointer; } + diff --git a/trunk/includes/class/class.LSattr_html_select_object.php b/trunk/includes/class/class.LSattr_html_select_object.php index 330bf58e..26c4c114 100644 --- a/trunk/includes/class/class.LSattr_html_select_object.php +++ b/trunk/includes/class/class.LSattr_html_select_object.php @@ -90,7 +90,7 @@ class LSattr_html_select_object extends LSattr_html{ return; } - if ((is_array($values))&&(!empty($values))) { + if (is_array($values)) { $obj=new $conf['object_type'](); foreach($values as $dn => $name) { if ($obj -> loadData($dn)) { @@ -139,7 +139,7 @@ class LSattr_html_select_object extends LSattr_html{ return; } - if ((is_array($values))&&(!empty($values))) { + if (is_array($values)) { if(($conf['value_attribute']=='dn')||($conf['value_attribute']=='%{dn}')||$fromDNs) { $DNs=$values; $obj = new $conf['object_type'](); diff --git a/trunk/includes/class/class.LSattribute.php b/trunk/includes/class/class.LSattribute.php index 4621bf9f..6e1bd5fe 100644 --- a/trunk/includes/class/class.LSattribute.php +++ b/trunk/includes/class/class.LSattribute.php @@ -389,7 +389,7 @@ class LSattribute { * @retval boolean true si l'attribut a été mis à jour, false sinon */ function isUpdate() { - return ($this -> updateData)?true:false; + return ($this -> updateData===false)?false:true; } /** diff --git a/trunk/includes/class/class.LSformElement_select_object.php b/trunk/includes/class/class.LSformElement_select_object.php index cc0f725f..c415c3cf 100644 --- a/trunk/includes/class/class.LSformElement_select_object.php +++ b/trunk/includes/class/class.LSformElement_select_object.php @@ -54,7 +54,6 @@ class LSformElement_select_object extends LSformElement { $params['addBtn'] = _('Modifier'); $params['deleteBtns'] = _('Supprimer'); $params['multiple'] = ($this -> params['multiple'])?1:0; - $params['noValueLabel'] = _('Aucune valeur definie'); } $ul_id="LSformElement_select_object_".$this -> name; diff --git a/trunk/includes/js/LSformElement_select_object_field.js b/trunk/includes/js/LSformElement_select_object_field.js index 1858d986..47f4501a 100644 --- a/trunk/includes/js/LSformElement_select_object_field.js +++ b/trunk/includes/js/LSformElement_select_object_field.js @@ -115,24 +115,18 @@ var LSformElement_select_object_field = new Class({ }, LSformElement_select_object_deleteBtn: function(img) { - img.getParent().destroy(); - if (!$type(this.ul.getFirst('li.LSformElement_select_object'))) { - this.addNoValueField(); - } - }, - - addNoValueField: function() { - var li = new Element('li'); - - li.set('html',this.params.noValueLabel); - - if (!this.params.multiple) { - this.addSingleAddBtn(li); + var li = img.getParent(); + var a = li.getFirst('a'); + var input = li.getFirst('input'); + if (a.hasClass('LSformElement_select_object_deleted')) { + input.name=this.params['attr_name']+'[]'; + a.addClass('LSformElement_select_object'); + a.removeClass('LSformElement_select_object_deleted'); } else { - li.addClass('LSformElement_select_object'); + input.name=($random(1,10000)); + a.addClass('LSformElement_select_object_deleted'); + a.removeClass('LSformElement_select_object'); } - - li.injectInside(this.ul); } });