Fix event Groups associations

This commit is contained in:
Isaac Connor 2017-12-19 18:09:41 -05:00
parent e47c8fad88
commit 85b7baa131
2 changed files with 2 additions and 9 deletions

View File

@ -102,10 +102,6 @@ class EventsController extends AppController {
*/
public function view($id = null) {
$this->loadModel('Config');
$configs = $this->Config->find('list', array(
'fields' => array('Name', 'Value'),
'conditions' => array('Name' => array('ZM_DIR_EVENTS'))
));
$this->Event->recursive = 1;
if (!$this->Event->exists($id)) {
@ -123,9 +119,6 @@ class EventsController extends AppController {
$options = array('conditions' => array(array('Event.' . $this->Event->primaryKey => $id), $mon_options));
$event = $this->Event->find('first', $options);
//$path = $configs['ZM_DIR_EVENTS'].'/'.$this->Image->getEventPath($event).'/';
//$event['Event']['BasePath'] = $path;
# Get the previous and next events for any monitor
$this->Event->id = $id;
$event_neighbors = $this->Event->find('neighbors');

View File

@ -78,10 +78,10 @@ class Event extends AppModel {
'className' => 'Group',
'joinTable' => 'Groups_Monitors',
'foreignKey' => 'MonitorId',
'associationForeignKey' => 'GroupId',
'associationForeignKey' => 'MonitorId',
'unique' => true,
'dependent' => false,
'conditions' => 'Groups_Monitors.MonitorId=Event.MonitorId',
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',