- LSformElement_select_object

-> Les lignes supprimées sont barré plutôt que supprimées complétement
	-> Correction d'un bug lorsque l'élément est validé avec une liste vide
- LSattribute : Correction de la méthode isUpdate()
This commit is contained in:
Benjamin Renard 2008-10-15 09:12:20 +00:00
parent b8227ca48a
commit abbf310b2d
6 changed files with 26 additions and 22 deletions

View file

@ -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 {

View file

@ -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;
}

View file

@ -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']();

View file

@ -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;
}
/**

View file

@ -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;

View file

@ -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);
}
});