Skip to content
Permalink
Browse files

Move delete link into edit dialog (since this is only very rarely nee…

…ded for invoices anyways)
  • Loading branch information...
flack committed Mar 5, 2019
1 parent 3f4d386 commit 3e4f21d18b5d362c524f29308a32f2705c0e4d36
@@ -81,6 +81,14 @@ public function _handler_update(Request $request, $guid)
'controller' => $this->load_controller(),
'save_callback' => [$this, 'save_callback']
]);
if ($this->invoice->can_do('midgard:delete')) {
$delete = $this->get_workflow('delete', [
'object' => $this->invoice,
'label' => $this->_l10n->get('invoice')
]);
$workflow->add_dialog_button($delete, $this->router->generate('invoice_delete', ['guid' => $guid]));
}
return $workflow->run($request);
}
@@ -88,11 +88,6 @@ private function populate_toolbar($handler_id)
]);
}
if ($this->invoice->can_do('midgard:delete')) {
$workflow = $this->get_workflow('delete', ['object' => $this->invoice]);
$buttons[] = $workflow->get_button($this->router->generate('invoice_delete', ['guid' => $this->invoice->guid]));
}
$buttons[] = [
MIDCOM_TOOLBAR_URL => $this->router->generate('invoice_items', ['guid' => $this->invoice->guid]),
MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('edit invoice items'),

0 comments on commit 3e4f21d

Please sign in to comment.
You can’t perform that action at this time.