LSrelation: fix new button opening in LSsmoothbox

This commit is contained in:
Benjamin Renard 2020-05-13 15:41:28 +02:00
parent 351b18827d
commit 8e2c521d18
2 changed files with 5 additions and 3 deletions

View file

@ -259,14 +259,16 @@ class LSrelation {
$return['actions'][] = array( $return['actions'][] = array(
'label' => _('Modify'), 'label' => _('Modify'),
'url' => 'object/'.$relationConf['LSobject'].'/select?multiple=1'.($relation -> getRelatedEditableAttribute()?'&editableAttr='.$relation -> getRelatedEditableAttribute():''), 'url' => 'object/'.$relationConf['LSobject'].'/select?multiple=1'.($relation -> getRelatedEditableAttribute()?'&editableAttr='.$relation -> getRelatedEditableAttribute():''),
'action' => 'modify' 'action' => 'modify',
'class' => 'LSrelation_modify',
); );
} }
if ($relation -> canCreate()) { if ($relation -> canCreate()) {
$return['actions'][] = array( $return['actions'][] = array(
'label' => _('New'), 'label' => _('New'),
'url' => 'object/'.$relationConf['LSobject'].'/create?LSrelation='.$relationName.'&relatedLSobject='.$object->getType().'&relatedLSobjectDN='.urlencode($object -> getValue('dn')), 'url' => 'object/'.$relationConf['LSobject'].'/create?LSrelation='.$relationName.'&relatedLSobject='.$object->getType().'&relatedLSobjectDN='.urlencode($object -> getValue('dn')),
'action' => 'create' 'action' => 'create',
'class' => null,
); );
} }

View file

@ -2,7 +2,7 @@
{if $item.actions!=''} {if $item.actions!=''}
<ul class='LSview-actions'> <ul class='LSview-actions'>
{foreach from=$item.actions item=action} {foreach from=$item.actions item=action}
<li class='LSview-actions'><a href='{$action.url}' class='LSview-actions LSrelation_modify' id='{$item.id|escape:"quotes"}'><img src='{img name=$action.action}' alt='{$action.label|escape:"htmlall"}' title='{$action.label|escape:"htmlall"}' /> {$action.label|escape:"htmlall"}</a></li> <li class='LSview-actions'><a href='{$action.url}' class='LSview-actions{if $action.class} {$action.class}{/if}' id='{$item.id|escape:"quotes"}'><img src='{img name=$action.action}' alt='{$action.label|escape:"htmlall"}' title='{$action.label|escape:"htmlall"}' /> {$action.label|escape:"htmlall"}</a></li>
{/foreach} {/foreach}
</ul> </ul>
{/if} {/if}