mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-18 08:19:05 +01:00
LSformElement::select_object: fix selection via LSselect on create form
This commit is contained in:
parent
4feec44639
commit
aba5a131c2
1 changed files with 11 additions and 3 deletions
|
@ -246,18 +246,26 @@ class LSformElement_select_object extends LSformElement {
|
||||||
if ((isset($_REQUEST['attribute'])) && (isset($_REQUEST['objecttype'])) && (isset($_REQUEST['objectdn'])) && (isset($_REQUEST['idform'])) ) {
|
if ((isset($_REQUEST['attribute'])) && (isset($_REQUEST['objecttype'])) && (isset($_REQUEST['objectdn'])) && (isset($_REQUEST['idform'])) ) {
|
||||||
if (LSsession ::loadLSobject($_REQUEST['objecttype'])) {
|
if (LSsession ::loadLSobject($_REQUEST['objecttype'])) {
|
||||||
$object = new $_REQUEST['objecttype']();
|
$object = new $_REQUEST['objecttype']();
|
||||||
if ($object -> loadData($_REQUEST['objectdn'])) {
|
if ($_REQUEST['idform'] == 'create' || ($_REQUEST['objectdn'] && $object -> loadData($_REQUEST['objectdn']))) {
|
||||||
$form = $object -> getForm($_REQUEST['idform']);
|
$form = $object -> getForm($_REQUEST['idform']);
|
||||||
$field = $form -> getElement($_REQUEST['attribute']);
|
$field = $form -> getElement($_REQUEST['attribute']);
|
||||||
$val = $field -> getValuesFromLSselect();
|
$val = $field -> getValuesFromLSselect();
|
||||||
if ( $val ) {
|
if ( is_array($val) ) {
|
||||||
$data = array(
|
$data = array(
|
||||||
'objects' => $val
|
'objects' => $val
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
self :: log_debug('ajax_refresh(): invalid return of $field -> getValuesFromLSselect()');
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
self :: log_error("ajax_refresh(): Fail to load data of object ".$_REQUEST['objecttype']." from DN '".$_REQUEST['objectdn']."'");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
self :: log_error("ajax_refresh(): Fail to load object type '".$_REQUEST['objecttype']."'");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
self :: log_error("ajax_refresh(): some parameter(s) are missing");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue