mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-18 16:19:06 +01:00
LSrelation : fixed refresh bug when multiple relations content the same object
This commit is contained in:
parent
06a77651d0
commit
54561a253b
3 changed files with 12 additions and 6 deletions
|
@ -205,7 +205,7 @@ class LSrelation {
|
||||||
else {
|
else {
|
||||||
$class=' LSrelation_editable';
|
$class=' LSrelation_editable';
|
||||||
}
|
}
|
||||||
$data['html'].= "<li class='LSrelation'><a href='view.php?LSobject=".$relationConf['LSobject']."&dn=".urlencode($o -> getDn())."' class='LSrelation$class' id='".$o -> getDn()."'>".$o -> getDisplayName(NULL,true)."</a></li>\n";
|
$data['html'].= "<li class='LSrelation'><a href='view.php?LSobject=".$relationConf['LSobject']."&dn=".urlencode($o -> getDn())."' class='LSrelation$class' id='LSrelation_".$_REQUEST['id']."_".$o -> getDn()."'>".$o -> getDisplayName(NULL,true)."</a></li>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -288,7 +288,8 @@ class LSrelation {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$data=array(
|
$data=array(
|
||||||
'dn' => $_REQUEST['dn']
|
'dn' => $_REQUEST['dn'],
|
||||||
|
'id' => $_REQUEST['id']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@ var LSrelation = new Class({
|
||||||
template: 'LSrelation',
|
template: 'LSrelation',
|
||||||
action: 'deleteByDn',
|
action: 'deleteByDn',
|
||||||
id: id,
|
id: id,
|
||||||
dn: a.id
|
dn: this.a2dn(a)
|
||||||
};
|
};
|
||||||
data.imgload=varLSdefault.loadingImgDisplay(li,'inside');
|
data.imgload=varLSdefault.loadingImgDisplay(li,'inside');
|
||||||
new Request({url: 'index_ajax.php', data: data, onSuccess: this.deleteFromImgComplete.bind(this)}).send();
|
new Request({url: 'index_ajax.php', data: data, onSuccess: this.deleteFromImgComplete.bind(this)}).send();
|
||||||
|
@ -79,8 +79,8 @@ var LSrelation = new Class({
|
||||||
var data = JSON.decode(responseText);
|
var data = JSON.decode(responseText);
|
||||||
if ( varLSdefault.checkAjaxReturn(data) ) {
|
if ( varLSdefault.checkAjaxReturn(data) ) {
|
||||||
try {
|
try {
|
||||||
var li = $(data.dn).getParent();
|
var ul=$('LSrelation_ul_'+data.id);
|
||||||
var ul=$(data.dn).getParent().getParent();
|
var li = $('LSrelation_'+data.id+'_'+data.dn).getParent();
|
||||||
li.destroy();
|
li.destroy();
|
||||||
if (!$type(ul.getFirst())) {
|
if (!$type(ul.getFirst())) {
|
||||||
var getId = /LSrelation_ul_([0-9]*)/
|
var getId = /LSrelation_ul_([0-9]*)/
|
||||||
|
@ -141,6 +141,11 @@ var LSrelation = new Class({
|
||||||
$('LSrelation_ul_'+this.refreshRelation).set('html',data.html);
|
$('LSrelation_ul_'+this.refreshRelation).set('html',data.html);
|
||||||
this.initializeBtn();
|
this.initializeBtn();
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
a2dn: function(a) {
|
||||||
|
var getId = /LSrelation_[0-9]*_(.*)$/
|
||||||
|
return getId.exec(a.id)[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
{/if}
|
{/if}
|
||||||
<ul id='LSrelation_ul_{$item.id}' class='LSrelation'>
|
<ul id='LSrelation_ul_{$item.id}' class='LSrelation'>
|
||||||
{foreach from=$item.objectList item=object}
|
{foreach from=$item.objectList item=object}
|
||||||
<li class='LSrelation'><a href='view.php?LSobject={$item.LSobject}&dn={$object.dn|escape:'url'}' class='LSrelation{if $object.canEdit} LSrelation_editable{/if}' id='{$object.dn}'>{$object.text}</a></li>
|
<li class='LSrelation'><a href='view.php?LSobject={$item.LSobject}&dn={$object.dn|escape:'url'}' class='LSrelation{if $object.canEdit} LSrelation_editable{/if}' id='LSrelation_{$item.id}_{$object.dn}'>{$object.text}</a></li>
|
||||||
{foreachelse}
|
{foreachelse}
|
||||||
<li class='LSrelation'>{$item.emptyText}</li>
|
<li class='LSrelation'>{$item.emptyText}</li>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
|
|
Loading…
Reference in a new issue