mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-12-18 22:43:47 +01:00
LSselect : Added feature to filter object selection that can't be modified by user
This commit is contained in:
parent
fda14d5930
commit
216fae6b7f
3 changed files with 21 additions and 1 deletions
|
@ -82,6 +82,10 @@ class LSselect {
|
|||
LSerror :: addErrorCode('LSsession_12');
|
||||
}
|
||||
}
|
||||
|
||||
public static function selectablly($obj,$args) {
|
||||
return (LSsession::canEdit($obj->type,$obj->dn,$args))?1:0;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -35,12 +35,27 @@ if(LSsession :: startLSsession()) {
|
|||
$LSsearch -> setParamsFormPostData();
|
||||
$LSsearch -> setParam('nbObjectsByPage',NB_LSOBJECT_LIST_SELECT);
|
||||
|
||||
$selectablly=((isset($_REQUEST['selectablly']))?$_REQUEST['selectablly']:0);
|
||||
|
||||
if (is_string($_REQUEST['editableAttr'])) {
|
||||
$LSsearch -> setParam(
|
||||
'customInfos',
|
||||
array (
|
||||
'selectablly' => array (
|
||||
'function' => array('LSselect','selectablly'),
|
||||
'args' => $_REQUEST['editableAttr']
|
||||
)
|
||||
)
|
||||
);
|
||||
$selectablly=1;
|
||||
}
|
||||
$multiple = ((isset($_REQUEST['multiple']))?1:0);
|
||||
|
||||
$searchForm = array (
|
||||
'action' => $_SERVER['PHP_SELF'],
|
||||
'recursive' => (! LSsession :: isSubDnLSobject($LSobject) && LSsession :: subDnIsEnabled() ),
|
||||
'multiple' => $multiple,
|
||||
'selectablly' => $selectablly,
|
||||
'labels' => array (
|
||||
'submit' => _('Search'),
|
||||
'approx' => _('Approximative search'),
|
||||
|
@ -60,6 +75,7 @@ if(LSsession :: startLSsession()) {
|
|||
$LSsearch -> getHiddenFieldForm(),
|
||||
array(
|
||||
'ajax' => 1,
|
||||
'selectablly' => $selectablly,
|
||||
'multiple' => $multiple
|
||||
)
|
||||
)
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
</tr>
|
||||
{foreach from=$page.list item=object}
|
||||
<tr class='{cycle values="LSobject-list,LSobject-list LSobject-list-bis"}'>
|
||||
<td class='LSobject-list LSobject-select-check'><input type='{if $searchForm.multiple}checkbox{else}radio{/if}' name='LSobjects_selected[]' value='{$object->dn}' {if $object->LSselect}checked="true"{/if} class='LSobject-select' /></td>
|
||||
<td class='LSobject-list LSobject-select-check'><input type='{if $searchForm.multiple}checkbox{else}radio{/if}' name='LSobjects_selected[]' value='{$object->dn}' {if $object->LSselect}checked="true"{/if}{if $searchForm.selectablly}{if !$object->selectablly} disabled{/if}{/if} class='LSobject-select' /></td>
|
||||
<td class='LSobject-list LSobject-select-names'>{$object->displayName}</td>
|
||||
{if $LSsearch->displaySubDn}
|
||||
<td class='LSobject-list LSobject-select-level'>{$object->subDn}</td>
|
||||
|
|
Loading…
Reference in a new issue