fix: [event add view] Avoided setting the action variable

- That is available from the view side within $this->request->params
pull/5470/head
chrisr3d 2019-12-11 10:59:15 +01:00
parent 28a2be67fc
commit 47540c206a
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
2 changed files with 2 additions and 3 deletions

View File

@ -2082,7 +2082,6 @@ 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)
@ -2424,7 +2423,6 @@ 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

@ -1,5 +1,6 @@
<?php
$modelForForm = 'Event';
$action = $this->request->params['action'];
echo $this->element('genericElements/Form/genericForm', array(
'form' => $this->Form,
'data' => array(
@ -64,7 +65,7 @@
)
)
));
echo $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'event-collection', 'menuItem' => $this->action === 'add' ? 'add' : 'editEvent'));
echo $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'event-collection', 'menuItem' => $action === 'add' ? 'add' : 'editEvent'));
?>
<script type="text/javascript">