fix: [event:view] Correctly display `Edit Event` when Editing instead of

`Add Event`
pull/5445/head
mokaddem 2019-12-03 16:17:31 +01:00
parent 3d1b8e9c9a
commit adb83afe73
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
2 changed files with 3 additions and 1 deletions

View File

@ -2082,6 +2082,7 @@ class EventsController extends AppController
if (isset($this->params['named']['extends'])) {
$this->set('extends_uuid', $this->params['named']['extends']);
}
$this->set('action', 'add');
}
public function addIOC($id)
@ -2423,6 +2424,7 @@ class EventsController extends AppController
$this->set('fieldDesc', $fieldDesc);
$this->set('eventDescriptions', $this->Event->fieldDescriptions);
$this->set('event', $this->Event->data);
$this->set('action', 'edit');
$this->render('add');
}

View File

@ -3,7 +3,7 @@
echo $this->element('genericElements/Form/genericForm', array(
'form' => $this->Form,
'data' => array(
'title' => __('Add Event'),
'title' => $action === 'add' ? __('Add Event') : __('Edit Event'),
'model' => $modelForForm,
'fields' => array(
array(