diff --git a/public_html/includes/class/class.LSrelation.php b/public_html/includes/class/class.LSrelation.php index 69303501..88169d89 100644 --- a/public_html/includes/class/class.LSrelation.php +++ b/public_html/includes/class/class.LSrelation.php @@ -254,21 +254,22 @@ class LSrelation { 'objectDn' => $object -> getDn(), ); $relation = new LSrelation($object, $relationName); + if ($relation -> canEdit()) { $return['actions'][] = array( 'label' => _('Modify'), 'url' => 'select.php?LSobject='.$relationConf['LSobject'].'&multiple=1'.($relation -> getRelatedEditableAttribute()?'&editableAttr='.$relation -> getRelatedEditableAttribute():''), 'action' => 'modify' ); - if ($relation -> canCreate()) { - $return['actions'][] = array( - 'label' => _('New'), - 'url' => 'create.php?LSobject='.$relationConf['LSobject'].'&LSrelation='.$relationName.'&relatedLSobject='.$object->getType().'&relatedLSobjectDN='.urlencode($object -> getValue('dn')), - 'action' => 'create' - ); - } } - + if ($relation -> canCreate()) { + $return['actions'][] = array( + 'label' => _('New'), + 'url' => 'create.php?LSobject='.$relationConf['LSobject'].'&LSrelation='.$relationName.'&relatedLSobject='.$object->getType().'&relatedLSobjectDN='.urlencode($object -> getValue('dn')), + 'action' => 'create' + ); + } + $list = $relation -> listRelatedObjects(); if (is_array($list)) { foreach($list as $o) {