object: add clone link

This commit is contained in:
Thomas Gelf 2015-12-17 19:52:10 +01:00
parent 7da9e0e0e1
commit 6466e3392e
2 changed files with 15 additions and 0 deletions

View File

@ -4,5 +4,6 @@
</div>
<div class="content">
<?= $this->actionLinks ?>
<?= $this->form ?>
</div>

View File

@ -127,6 +127,12 @@ abstract class ObjectController extends ActionController
$this->view->title = sprintf($title, ucfirst($ltype));
$this->view->form->handleRequest();
$this->view->actionLinks = $this->view->qlink(
sprintf($this->translate('Clone'), $this->translate(ucfirst($ltype))),
'director/' . $ltype .'/clone',
array('name' => $object->object_name)
);
$this->render('object/form', null, true);
}
@ -156,6 +162,7 @@ abstract class ObjectController extends ActionController
public function cloneAction()
{
$type = $this->getType();
$ltype = strtolower($type);
$this->getTabs()->activate('modify');
$this->view->form = $form = $this->loadForm(
@ -167,6 +174,13 @@ abstract class ObjectController extends ActionController
ucfirst($type)
);
$this->view->form->handleRequest();
$this->view->actionLinks = $this->view->qlink(
sprintf($this->translate('<- back'), $this->translate(ucfirst($ltype))),
'director/' . $ltype,
array('name' => $this->object->object_name)
);
$this->render('object/form', null, true);
}