LSrelation : Add create button even if user can't edit the relation

This commit is contained in:
Benjamin Renard 2017-08-02 12:09:25 +02:00
parent 486f33ccf9
commit 7970489489

View file

@ -254,19 +254,20 @@ class LSrelation {
'objectDn' => $object -> getDn(), 'objectDn' => $object -> getDn(),
); );
$relation = new LSrelation($object, $relationName); $relation = new LSrelation($object, $relationName);
if ($relation -> canEdit()) { if ($relation -> canEdit()) {
$return['actions'][] = array( $return['actions'][] = array(
'label' => _('Modify'), 'label' => _('Modify'),
'url' => 'select.php?LSobject='.$relationConf['LSobject'].'&multiple=1'.($relation -> getRelatedEditableAttribute()?'&editableAttr='.$relation -> getRelatedEditableAttribute():''), 'url' => 'select.php?LSobject='.$relationConf['LSobject'].'&multiple=1'.($relation -> getRelatedEditableAttribute()?'&editableAttr='.$relation -> getRelatedEditableAttribute():''),
'action' => 'modify' 'action' => 'modify'
); );
if ($relation -> canCreate()) { }
$return['actions'][] = array( if ($relation -> canCreate()) {
'label' => _('New'), $return['actions'][] = array(
'url' => 'create.php?LSobject='.$relationConf['LSobject'].'&LSrelation='.$relationName.'&relatedLSobject='.$object->getType().'&relatedLSobjectDN='.urlencode($object -> getValue('dn')), 'label' => _('New'),
'action' => 'create' 'url' => 'create.php?LSobject='.$relationConf['LSobject'].'&LSrelation='.$relationName.'&relatedLSobject='.$object->getType().'&relatedLSobjectDN='.urlencode($object -> getValue('dn')),
); 'action' => 'create'
} );
} }
$list = $relation -> listRelatedObjects(); $list = $relation -> listRelatedObjects();