Assembla home | Assembla project page
 

Changeset 111

Show
Ignore:
Timestamp:
07/18/07 15:52:42 (1 year ago)
Author:
digitalspaghetti
Message:

Ammended Event view & controller. Also fixed error in Post controller.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branch/controllers/events_controller.php

    r107 r111  
    33 
    44        var $name = 'Events'; 
    5         var $helpers = array('Html', 'Form', 'Ajax', 'GoogleMap' ); 
     5        var $helpers = array('GoogleMap'); 
    66 
    77        function index() { 
    8                 $this->Event->recursive = 0;             
    9                 $this->set('events', $this->paginate()); 
    10                 $this->set('default', $this->Event->aveLatLng()); 
     8                $this->Event->recursive = 1; 
     9                $isFeed = ife($this->RequestHandler->prefers('rss') == 'rss', true, false); 
     10                 
     11                if ($isFeed) { 
     12                        $this->set('channel', array('title' => 'Latest events for Webrocket', 'description' => 'Webrocket RSS Feed')); 
     13                } 
     14                if (!$isFeed) { 
     15                        // Overide paginate limit, may need to change 
     16                        $this->cacheAction = '1 hour'; 
     17                        $this->passedArgs['limit'] = 10; 
     18                        $this->passedArgs['order'] = array('Event.created' => 'DESC'); 
     19                        $this->set('events', $this->paginate(null, array('Event.published'=>1))); 
     20                        $this->set('default', $this->Event->aveLatLng()); 
     21                } else { 
     22                        // RSS Feed 
     23                        $this->set('posts', $this->Event->findAll(null, null, array('Event.created' => 'DESC'), 20));    
     24                } 
    1125        } 
    1226 
     
    2034 
    2135        function add() { 
    22                 if (!empty($this->data)) { 
    23                         $this->cleanUpFields(); 
    24                         $this->Event->create(); 
    25                         if ($this->Event->save($this->data)) { 
    26                                 $this->Session->setFlash('The Event has been saved'); 
    27                                 $this->redirect(array('action'=>'index'), null, true); 
    28                         } else { 
    29                                 $this->Session->setFlash('The Event could not be saved. Please, try again.'); 
     36                if ($this->level >= 500 ) { 
     37                        if (!empty($this->data)) { 
     38                                $this->data['Event']['user_id'] = $this->othAuth->user('id'); 
     39                                $this->cleanUpFields(); 
     40                                $this->Event->create(); 
     41                                if ($this->Event->save($this->data)) { 
     42                                        $this->Session->setFlash('The Event has been saved'); 
     43                                        $this->redirect(array('action'=>'index'), null, true); 
     44                                } else { 
     45                                        $this->Session->setFlash('The Event could not be saved. Please, try again.'); 
     46                                } 
    3047                        } 
     48                        $this->set('venues', $this->Event->Venue->generateList(null, 'name ASC', null,'{n}.Venue.id','{n}.Venue.fullName')); 
     49                        $this->set('eventTypes', $this->Event->EventType->generateList()); 
     50                        $this->set('subjects', $this->Event->Subject->generateList()); 
     51                } else { 
     52                        $this->Session->setFlash('You do not have permission to add an event.  Please log in.'); 
     53                        $this->redirect(array('controller' => 'users','action'=>'login'), null, true); 
    3154                } 
    32                 $venues = $this->Event->Venue->generateList(null, 'name ASC'); 
    33                 $eventTypes = $this->Event->EventType->generateList(); 
    34                 $users = $this->Event->User->generateList(); 
    35                 $subjects = $this->Event->Subject->generateList(); 
    36                 $this->set(compact('tags', 'venues', 'eventTypes', 'users', 'subjects')); 
    3755        } 
    3856 
    3957        function edit($id = null) { 
    40                 if (!$id && empty($this->data)) { 
    41                         $this->Session->setFlash('Invalid Event'); 
    42                         $this->redirect(array('action'=>'index'), null, true); 
     58                if ($this->othAuth->user('id') == $this->data['Event']['user_id'] || $this->level >= 900) { 
     59                        if (!$id && empty($this->data)) { 
     60                                $this->Session->setFlash('Invalid Event'); 
     61                                $this->redirect(array('action'=>'index'), null, true); 
     62                        } 
     63                        if (!empty($this->data)) { 
     64                                $this->cleanUpFields(); 
     65                                if ($this->Event->save($this->data)) { 
     66                                        $this->Session->setFlash('The Event saved'); 
     67                                        $this->redirect(array('action'=>'index'), null, true); 
     68                                } else { 
     69                                        $this->Session->setFlash('The Event could not be saved. Please, try again.'); 
     70                                } 
     71                        } 
     72                        if (empty($this->data)) { 
     73                                $this->data = $this->Event->read(null, $id); 
     74                        } 
     75                        $this->set('venues', $this->Event->Venue->generateList(null, 'name ASC', null,'{n}.Venue.id','{n}.Venue.fullName')); 
     76                        $this->set('eventTypes', $this->Event->EventType->generateList()); 
     77                        $this->set('subjects', $this->Event->Subject->generateList()); 
     78                } else { 
     79                        $this->Session->setFlash('You do not have permission to edit an event.  Please log in.'); 
     80                        $this->redirect(array('controller' => 'users','action'=>'login'), null, true); 
    4381                } 
    44                 if (!empty($this->data)) { 
    45                         $this->cleanUpFields(); 
    46                         if ($this->Event->save($this->data)) { 
    47                                 $this->Session->setFlash('The Event saved'); 
    48                                 $this->redirect(array('action'=>'index'), null, true); 
    49                         } else { 
    50                                 $this->Session->setFlash('The Event could not be saved. Please, try again.'); 
    51                         } 
    52                 } 
    53                 if (empty($this->data)) { 
    54                         $this->data = $this->Event->read(null, $id); 
    55                 } 
    56                 $tags = $this->Event->Tag->generateList(); 
    57                 $venues = $this->Event->Venue->generateList(); 
    58                 $eventTypes = $this->Event->EventType->generateList(); 
    59                 $users = $this->Event->User->generateList(); 
    60                 $subjects = $this->Event->Subject->generateList(); 
    61                 $this->set(compact('tags','venues','eventTypes','users','subjects')); 
    6282        } 
    6383 
     
    6787                        $this->redirect(array('action'=>'index'), null, true); 
    6888                } 
    69                 if ($this->Event->del($id)) { 
    70                         $this->Session->setFlash('Event #'.$id.' deleted'); 
    71                         $this->redirect(array('action'=>'index'), null, true); 
     89                if ($this->othAuth->user('id') == $this->data['Post']['user_id'] || $this->level >= 900) { 
     90                        if ($this->Event->del($id)) { 
     91                                $this->Session->setFlash('Event #'.$id.' deleted'); 
     92                                $this->redirect(array('action'=>'index'), null, true); 
     93                        } 
     94                } else { 
     95                        $this->Session->setFlash('You do no have permission to delete this'); 
     96                        $this->redirect(array('controller'=>'users','action'=>'login'), null, true); 
    7297                } 
    7398        } 
     
    75100 
    76101        function admin_index() { 
    77                 $this->Event->recursive = 0;             
    78                 $this->set('events', $this->paginate()); 
    79                 $this->set('default', $this->Event->aveLatLng()); 
     102                $this->Event->recursive = 1; 
     103                $isFeed = ife($this->RequestHandler->prefers('rss') == 'rss', true, false); 
     104                 
     105                if ($isFeed) { 
     106                        $this->set('channel', array('title' => 'Latest events for Webrocket', 'description' => 'Webrocket RSS Feed')); 
     107                } 
     108                if (!$isFeed) { 
     109                        // Overide paginate limit, may need to change 
     110                        $this->cacheAction = '1 hour'; 
     111                        $this->passedArgs['limit'] = 10; 
     112                        $this->passedArgs['order'] = array('Event.created' => 'DESC'); 
     113                        $this->set('events', $this->paginate(null, array('Event.published'=>1))); 
     114                        $this->set('default', $this->Event->aveLatLng()); 
     115                } else { 
     116                        // RSS Feed 
     117                        $this->set('posts', $this->Event->findAll(null, null, array('Event.created' => 'DESC'), 20));    
     118                } 
    80119        } 
    81120 
     
    90129        function admin_add() { 
    91130                if (!empty($this->data)) { 
     131                        $this->data['Event']['user_id'] = $this->othAuth->user('id'); 
    92132                        $this->cleanUpFields(); 
    93133                        $this->Event->create(); 
     
    99139                        } 
    100140                } 
    101                 $venues = $this->Event->Venue->generateList(null, 'name ASC', null,'{n}.Venue.id','{n}.Venue.fullName'); 
    102                 $eventTypes = $this->Event->EventType->generateList(); 
    103                 $users = $this->Event->User->generateList(); 
    104                 $subjects = $this->Event->Subject->generateList(); 
    105                 $this->set(compact('venues', 'eventTypes', 'users', 'subjects')); 
     141                $this->set('venues', $this->Event->Venue->generateList(null, 'name ASC', null,'{n}.Venue.id','{n}.Venue.fullName')); 
     142                $this->set('eventTypes', $this->Event->EventType->generateList()); 
     143                $this->set('subjects', $this->Event->Subject->generateList()); 
    106144        } 
    107145 
     
    123161                        $this->data = $this->Event->read(null, $id); 
    124162                } 
    125                 $tags = $this->Event->Tag->generateList(); 
    126                 $venues = $this->Event->Venue->generateList(); 
    127                 $eventTypes = $this->Event->EventType->generateList(); 
    128                 $users = $this->Event->User->generateList(); 
    129                 $subjects = $this->Event->Subject->generateList(); 
    130                 $this->set(compact('tags','venues','eventTypes','users','subjects')); 
     163                $this->set('venues', $this->Event->Venue->generateList(null, 'name ASC', null,'{n}.Venue.id','{n}.Venue.fullName')); 
     164                $this->set('eventTypes', $this->Event->EventType->generateList()); 
     165                $this->set('subjects', $this->Event->Subject->generateList()); 
    131166        } 
    132167 
  • branch/controllers/posts_controller.php

    r110 r111  
    5959                                } 
    6060                        } 
     61                        $this->set('access_levels', $this->Group->generateList(null, 'Group.name ASC', null,'{n}.Group.level', '{n}.Group.name')); 
     62                        $this->set('subjects', $this->Post->Subject->generateList()); 
     63                        $this->set('images', $this->Post->Image->generateList(null,null,null,'{n}.Image.id', '{n}.Image.alt')); 
    6164                } else { 
    6265                        $this->Session->setFlash('You do not have permission to add a post.  Please log in.'); 
    6366                        $this->redirect(array('controller' => 'users','action'=>'login'), null, true); 
    6467                } 
    65                 $this->set('access_levels', $this->Group->generateList(null, 'Group.name ASC', null,'{n}.Group.level', '{n}.Group.name')); 
    66                 $this->set('subjects', $this->Post->Subject->generateList()); 
    67                 $this->set('images', $this->Post->Image->generateList(null,null,null,'{n}.Image.id', '{n}.Image.alt')); 
     68                 
    6869        } 
    6970 
     
    8384                                } 
    8485                        } 
     86                        $this->set('access_levels', $this->Group->generateList(null, 'Group.name ASC', null,'{n}.Group.level', '{n}.Group.name')); 
     87                        $this->set('subjects', $this->Post->Subject->generateList()); 
     88                        $this->set('images', $this->Post->Image->generateList(null,null,null,'{n}.Image.id', '{n}.Image.alt')); 
    8589                } else { 
    8690                        $this->Session->setFlash('You do no have permission to edit this post'); 
     
    9094                        $this->data = $this->Post->read(null, $id); 
    9195                } 
    92                 $this->set('access_levels', $this->Group->generateList(null, 'Group.name ASC', null,'{n}.Group.level', '{n}.Group.name')); 
    93                 $this->set('subjects', $this->Post->Subject->generateList()); 
    94                 $this->set('images', $this->Post->Image->generateList(null,null,null,'{n}.Image.id', '{n}.Image.alt')); 
    9596        } 
    9697 
  • branch/models/event.php

    r107 r111  
    88        //The Associations below have been created with all possible keys, those that are not needed can be removed 
    99        var $belongsTo = array( 
    10                         'Venue' => array('className' => 'Venue', 
    11                                                                 'foreignKey' => 'venue_id', 
    12                                                                 'conditions' => '', 
    13                                                                 'fields' => '', 
    14                                                                 'order' => '', 
    15                                                                 'counterCache' => ''), 
     10                        'Venue' => array('className' => 'Venue'), 
    1611                        'EventType' => array('className' => 'EventType', 
    17                                                                 'foreignKey' => 'event_type_id', 
    18                                                                 'conditions' => '', 
    19                                                                 'fields' => '', 
    20                                                                 'order' => '', 
    21                                                                 'counterCache' => ''), 
    22                         'User' => array('className' => 'User', 
    23                                                                 'foreignKey' => 'user_id', 
    24                                                                 'conditions' => '', 
    25                                                                 'fields' => '', 
    26                                                                 'order' => '', 
    27                                                                 'counterCache' => ''), 
    28                         'Subject' => array('className' => 'Subject', 
    29                                                                 'foreignKey' => 'subject_id', 
    30                                                                 'conditions' => '', 
    31                                                                 'fields' => '', 
    32                                                                 'order' => '', 
    33                                                                 'counterCache' => ''), 
     12                                                                'foreignKey' => 'event_type_id'), 
     13                        'User' => array('className' => 'User'), 
     14                        'Subject' => array('className' => 'Subject'), 
    3415        ); 
    3516 
     
    3920                                                'foreignKey' => 'event_id', 
    4021                                                'associationForeignKey' => 'tag_id', 
    41                                                 'conditions' => '', 
    42                                                 'fields' => '', 
    43                                                 'order' => '', 
    44                                                 'limit' => '', 
    45                                                 'offset' => '', 
    46                                                 'unique' => '', 
    47                                                 'finderQuery' => '', 
    48                                                 'deleteQuery' => '', 
    49                                                 'insertQuery' => ''), 
     22                                                'order' => 'Tag.tag ASC', 
     23                                                'unique' => true), 
    5024        ); 
    5125         
  • branch/views/events/add.ctp

    r79 r111  
    22<?php echo $form->create('Event');?> 
    33        <fieldset> 
    4                 <legend><?php __('Add', true);?> <?php __('Event');?></legend> 
     4                <legend><?php __('Event Details');?></legend> 
    55        <?php 
    6                 echo $form->input('venue_id'); 
    7                 echo $form->input('event_type_id'); 
    8                 echo $form->input('event_date'); 
    9                 echo $form->input('event_time'); 
    10                 echo $form->input('event_url'); 
    11                 echo $form->input('body'); 
    12                 echo $form->input('tags'); 
    13                 echo $form->input('user_id'); 
    14                 echo $form->input('subject_id'); 
    15                 echo $form->input('published'); 
    16                 echo $form->input('Tag'); 
     6                e($form->input('subject_id')); 
     7                e($form->input('venue_id')); 
     8                e($form->input('event_type_id')); 
     9                e($form->input('event_url')); 
     10                e($form->input('event_ticket1', array('label'=>'Ticket URL'))); 
     11                e($form->input('event_ticket2', array('label'=>'Ticket Phone'))); 
     12                e($form->input('event_price', array('label'=>'Ticket Price'))); 
     13                e($form->input('body', array('class'=>'wymeditor'))); 
    1714        ?> 
    1815        </fieldset> 
    19 <?php echo $form->end('Submit');?> 
     16         
     17        <fieldset> 
     18                <legend><?php __('Event Date &amp; Time');?></legend> 
     19        <?php  
     20                e($form->input('event_date')); 
     21                e($form->input('event_time'));           
     22        ?> 
     23        </fieldset> 
     24         
     25        <fieldset> 
     26                <legend><?php __('Event Metadata');?></legend> 
     27                        <?php e($form->input('tags', array('type'=>'text', 'class'=>'tags')));?> 
     28        </fieldset> 
     29         
     30        <fieldset> 
     31                <legend><?php __('Event Options');?></legend> 
     32                        <?php e($form->input('published')); ?> 
     33        </fieldset> 
     34<?php e($form->end('Submit', array('class'=>'wymupdate')));?> 
    2035</div> 
    21 <div class="actions"> 
    22         <ul> 
    23                 <li><?php echo $html->link(__('List', true).' '.__('Events', true), array('action'=>'index'));?></li> 
    24                 <li><?php echo $html->link(__('List', true).' '.__('Venues', true), array('controller'=> 'venues', 'action'=>'index')); ?> </li> 
    25                 <li><?php echo $html->link(__('New', true).' '.__('Venue', true), array('controller'=> 'venues', 'action'=>'add')); ?> </li> 
    26                 <li><?php echo $html->link(__('List', true).' '.__('Event Types', true), array('controller'=> 'event_types', 'action'=>'index')); ?> </li> 
    27                 <li><?php echo $html->link(__('New', true).' '.__('Event Type', true), array('controller'=> 'event_types', 'action'=>'add')); ?> </li> 
    28                 <li><?php echo $html->link(__('List', true).' '.__('Users', true), array('controller'=> 'users', 'action'=>'index')); ?> </li> 
    29                 <li><?php echo $html->link(__('New', true).' '.__('User', true), array('controller'=> 'users', 'action'=>'add')); ?> </li> 
    30                 <li><?php echo $html->link(__('List', true).' '.__('Subjects', true), array('controller'=> 'subjects', 'action'=>'index')); ?> </li> 
    31                 <li><?php echo $html->link(__('New', true).' '.__('Subject', true), array('controller'=> 'subjects', 'action'=>'add')); ?> </li> 
    32                 <li><?php echo $html->link(__('List', true).' '.__('Tags', true), array('controller'=> 'tags', 'action'=>'index')); ?> </li> 
    33                 <li><?php echo $html->link(__('New', true).' '.__('Tag', true), array('controller'=> 'tags', 'action'=>'add')); ?> </li> 
    34         </ul> 
    35 </div> 
  • branch/views/events/admin_add.ctp

    r85 r111  
    44                <legend><?php __('Event Details');?></legend> 
    55        <?php 
    6                 echo $form->input('subject_id'); 
    7                 echo $form->input('venue_id'); 
    8                 echo $form->input('event_type_id'); 
    9                 echo $form->input('event_url'); 
    10                 echo $form->input('event_ticket1', array('label'=>'Ticket URL')); 
    11                 echo $form->input('event_ticket2', array('label'=>'Ticket Phone')); 
    12                 echo $form->input('event_price', array('label'=>'Ticket Price')); 
    13                 echo $form->input('body', array('class'=>'wymeditor')); 
     6                e($form->input('subject_id')); 
     7                e($form->input('venue_id')); 
     8                e($form->input('event_type_id')); 
     9                e($form->input('event_url')); 
     10                e($form->input('event_ticket1', array('label'=>'Ticket URL'))); 
     11                e($form->input('event_ticket2', array('label'=>'Ticket Phone'))); 
     12                e($form->input('event_price', array('label'=>'Ticket Price'))); 
     13                e($form->input('body', array('class'=>'wymeditor'))); 
    1414        ?> 
    1515        </fieldset> 
     
    1818                <legend><?php __('Event Date &amp; Time');?></legend> 
    1919        <?php  
    20                 echo $form->input('event_date'); 
    21                 echo $form->input('event_time');               
     20                e($form->input('event_date')); 
     21                e($form->input('event_time'));                 
    2222        ?> 
    2323        </fieldset> 
     
    2525        <fieldset> 
    2626                <legend><?php __('Event Metadata');?></legend> 
    27                         <?php echo $form->input('tags', array('type'=>'text', 'class'=>'tags'));?> 
     27                        <?php e($form->input('tags', array('type'=>'text', 'class'=>'tags')));?> 
    2828        </fieldset> 
    2929         
    3030        <fieldset> 
    3131                <legend><?php __('Event Options');?></legend> 
    32                         <?php echo $form->input('published'); ?> 
     32                        <?php e($form->input('published')); ?> 
    3333        </fieldset> 
    34 <?php echo $form->end('Submit',  array('class'=>'wymupdate'));?> 
     34<?php e($form->end('Submit', array('class'=>'wymupdate')));?> 
    3535</div> 
  • branch/views/events/admin_view.ctp

    r79 r111  
    1 <div class="event"> 
    2 <h2><?php  __('Event');?></h2> 
    3         <dl> 
    4                 <dt class="altrow">Id</dt> 
    5                 <dd class="altrow"> 
    6                         <?php echo $event['Event']['id']?> 
    7                         &nbsp; 
    8                 </dd> 
    9                 <dt>Venue</dt> 
    10                 <dd> 
    11                         <?php echo $html->link($event['Venue']['name'], array('controller'=> 'venues', 'action'=>'view', $event['Venue']['id'])); ?> 
    12                         &nbsp; 
    13                 </dd> 
    14                 <dt class="altrow">EventType</dt> 
    15                 <dd class="altrow"> 
    16                         <?php echo $html->link($event['EventType']['title'], array('controller'=> 'event_types', 'action'=>'view', $event['EventType']['id'])); ?> 
    17                         &nbsp; 
    18                 </dd> 
    19                 <dt>Event Date</dt> 
    20                 <dd> 
    21                         <?php echo $event['Event']['event_date']?> 
    22                         &nbsp; 
    23                 </dd> 
    24                 <dt class="altrow">Event Time</dt> 
    25                 <dd class="altrow"> 
    26                         <?php echo $event['Event']['event_time']?> 
    27                         &nbsp; 
    28                 </dd> 
    29                 <dt>Event Url</dt> 
    30                 <dd> 
    31                         <?php echo $event['Event']['event_url']?> 
    32                         &nbsp; 
    33                 </dd> 
    34                 <dt class="altrow">Body</dt> 
    35                 <dd class="altrow"> 
    36                         <?php echo $event['Event']['body']?> 
    37                         &nbsp; 
    38                 </dd> 
    39                 <dt>Tags</dt> 
    40                 <dd> 
    41                         <?php echo $event['Event']['tags']?> 
    42                         &nbsp; 
    43                 </dd> 
    44                 <dt class="altrow">User</dt> 
    45                 <dd class="altrow"> 
    46                         <?php echo $html->link($event['User']['name'], array('controller'=> 'users', 'action'=>'view', $event['User']['id'])); ?> 
    47                         &nbsp; 
    48                 </dd> 
    49                 <dt>Subject</dt> 
    50                 <dd> 
    51                         <?php echo $html->link($event['Subject']['title'], array('controller'=> 'subjects', 'action'=>'view', $event['Subject']['id'])); ?> 
    52                         &nbsp; 
    53                 </dd> 
    54                 <dt class="altrow">Published</dt> 
    55                 <dd class="altrow"> 
    56                         <?php echo $event['Event']['published']?> 
    57                         &nbsp; 
    58                 </dd> 
    59                 <dt>Created</dt> 
    60                 <dd> 
    61                         <?php echo $event['Event']['created']?> 
    62                         &nbsp; 
    63                 </dd> 
    64                 <dt class="altrow">Modified</dt> 
    65                 <dd class="altrow"> 
    66                         <?php echo $event['Event']['modified']?> 
    67                         &nbsp; 
    68                 </dd> 
    69         </dl> 
     1<?php e($javascript->codeBlock('$j().ready(function(){$j("#gmap").jmap({center: ['. $event['Venue']['latitude'] .','. $event['Venue']['longitude'] .']});});'));?> 
     2<?php e($javascript->codeBlock('$j().ready(function(){$("#gmap").addPoint("' . $event['Venue']['latitude'] . '","' . $event['Venue']['longitude'] . '","' . $event['Venue']['name'] . '<br />' . $event['Venue']['street'] . '<br />' . $event['Venue']['city'] . ',' . $event['Venue']['postcode'] . '");});'));?> 
     3 
     4<div class="vevent" id="hcalendar-<?php echo $event['Event']['id']?>"> 
     5        <h2><?php  __('Event');?></h2> 
     6 
     7        <div style="float:right;width:50%;height:400px;" id="gmap"></div> 
     8        <div style="width:100%"> 
     9                <h3><?php e($event['EventType']['title']);?> - <?php e($event['Subject']['title']);?> - <?php e($event['Venue']['city']);?></h3> 
     10                 
     11                 <a class="url" href="<?php echo $event['Event']['event_url']?>"> 
     12                        <abbr class="dtstart" title="20080716T0800"><?php echo $event['Event']['event_date']?> <?php echo $event['Event']['event_time']?></abbr>&mdash; 
     13                        <span class="summary"><?php e($event['EventType']['title']);?> &mdash; <?php e($event['Subject']['title']); ?></span> &mdash; at  
     14                        <span class="location"><?php e($event['Venue']['name']);?></span> 
     15                </a> 
     16                <div class="description"><?php echo $event['Event']['body']?></div> 
     17                <div class="tags">Tags:  
     18                <?php foreach ($event['Tag'] as $tag) : ?> 
     19                <a href="http://eventful.com/events/tags/<?php e($tag['tag']);?>"><?php e($tag['tag']);?></a> &nbsp; 
     20                <?php endforeach;?> 
     21          </div> 
     22        </div> 
    7023</div> 
     24 
    7125<div class="actions"> 
    7226        <ul> 
    7327                <li><?php echo $html->link(__('Edit', true).' '.__('Event', true),   array('action'=>'edit', $event['Event']['id'])); ?> </li> 
    7428                <li><?php echo $html->link(__('Delete', true).' '.__('Event', true), array('action'=>'delete', $event['Event']['id']), null, __('Are you sure you want to delete', true).' #' . $event['Event']['id'] . '?'); ?> </li> 
    75                 <li><?php echo $html->link(__('List', true).' '.__('Events', true), array('action'=>'index')); ?> </li> 
    76                 <li><?php echo $html->link(__('New', true).' '.__('Event', true), array('action'=>'add')); ?> </li> 
    77                 <li><?php echo $html->link(__('List', true).' '.__('Venues', true), array('controller'=> 'venues', 'action'=>'index')); ?> </li> 
    78                 <li><?php echo $html->link(__('New', true).' '.__('Venue', true), array('controller'=> 'venues', 'action'=>'add')); ?> </li> 
    79                 <li><?php echo $html->link(__('List', true).' '.__('Event Types', true), array('controller'=> 'event_types', 'action'=>'index')); ?> </li> 
    80                 <li><?php echo $html->link(__('New', true).' '.__('Event Type', true), array('controller'=> 'event_types', 'action'=>'add')); ?> </li> 
    81                 <li><?php echo $html->link(__('List', true).' '.__('Users', true), array('controller'=> 'users', 'action'=>'index')); ?> </li> 
    82                 <li><?php echo $html->link(__('New', true).' '.__('User', true), array('controller'=> 'users', 'action'=>'add')); ?> </li> 
    83                 <li><?php echo $html->link(__('List', true).' '.__('Subjects', true), array('controller'=> 'subjects', 'action'=>'index')); ?> </li> 
    84                 <li><?php echo $html->link(__('New', true).' '.__('Subject', true), array('controller'=> 'subjects', 'action'=>'add')); ?> </li> 
    85                 <li><?php echo $html->link(__('List', true).' '.__('Tags', true), array('controller'=> 'tags', 'action'=>'index')); ?> </li> 
    86                 <li><?php echo $html->link(__('New', true).' '.__('Tag', true), array('controller'=> 'tags', 'action'=>'add')); ?> </li> 
    8729        </ul> 
    8830</div> 
    89 <div class="related"> 
    90         <h3><?php  __('Related');?> <?php __('Tags');?></h3> 
    91         <?php if (!empty($event['Tag'])):?> 
    92         <table cellpadding = "0" cellspacing = "0"> 
    93         <tr> 
    94                 <th>Id</th> 
    95                 <th>Tag</th> 
    96                 <th class="actions"><?php __('Actions');?></th> 
    97         </tr> 
    98         <?php 
    99                 $i = 0; 
    100                 foreach ($event['Tag'] as $tag): 
    101                         $class = null; 
    102                         if ($i++ % 2 == 0) { 
    103                                 $class = ' class="altrow"'; 
    104                         } 
    105                 ?> 
    106                 <tr<?php echo $class;?>> 
    107                         <td><?php echo $tag['id'];?></td> 
    108                         <td><?php echo $tag['tag'];?></td> 
    109                         <td class="actions"> 
    110                                 <?php echo $html->link(__('View', true), array('controller'=> 'tags', 'action'=>'view', $tag['id'])); ?> 
    111                                 <?php echo $html->link(__('Edit', true), array('controller'=> 'tags', 'action'=>'edit', $tag['id'])); ?> 
    112                                 <?php echo $html->link(__('Delete', true), array('controller'=> 'tags', 'action'=>'delete', $tag['id']), null, __('Are you sure you want to delete', true).' #' . $tag['id'] . '?'); ?> 
    113                         </td> 
    114                 </tr> 
    115         <?php endforeach; ?> 
    116         </table> 
    117         <?php endif; ?> 
    118  
    119         <div class="actions"> 
    120                 <ul> 
    121                         <li><?php echo $html->link(__('New', true).' '.__('Tag', true), array('controller'=> 'tags', 'action'=>'add'));?> </li> 
    122                 </ul> 
    123         </div> 
    124 </div> 
  • branch/views/events/edit.ctp

    r79 r111  
    22<?php echo $form->create('Event');?> 
    33        <fieldset> 
    4                 <legend><?php __('Edit', true);?> <?php __('Event');?></legend> 
     4                <legend><?php __('Event Details');?></legend> 
    55        <?php 
    66                echo $form->input('id'); 
     7                echo $form->input('subject_id'); 
    78                echo $form->input('venue_id'); 
    89                echo $form->input('event_type_id'); 
    9                 echo $form->input('event_date'); 
    10                 echo $form->input('event_time'); 
    1110                echo $form->input('event_url'); 
    12                 echo $form->input('body'); 
    13                 echo $form->input('tags'); 
    14                 echo $form->input('user_id'); 
    15                 echo $form->input('subject_id'); 
    16                 echo $form->input('published'); 
    17                 echo $form->input('Tag'); 
     11                echo $form->input('event_ticket1', array('label'=>'Ticket URL')); 
     12                echo $form->input('event_ticket2', array('label'=>'Ticket Phone')); 
     13                echo $form->input('event_price', array('label'=>'Ticket Price')); 
     14                echo $form->input('body', array('class'=>'wymeditor')); 
    1815        ?> 
    1916        </fieldset> 
    20 <?php echo $form->end('Submit');?> 
     17         
     18        <fieldset> 
     19                <legend><?php __('Event Date &amp; Time');?></legend> 
     20        <?php  
     21                echo $form->input('event_date'); 
     22                echo $form->input('event_time');                 
     23        ?> 
     24        </fieldset> 
     25         
     26        <fieldset> 
     27                <legend><?php __('Event Metadata');?></legend> 
     28                        <?php echo $form->input('tags', array('type'=>'text', 'class'=>'tags'));?> 
     29        </fieldset> 
     30         
     31        <fieldset> 
     32                <legend><?php __('Event Options');?></legend> 
     33                        <?php echo $form->input('published'); ?> 
     34        </fieldset> 
     35<?php echo $form->end('Submit',  array('class'=>'wymupdate'));?> 
    2136</div> 
    2237<div class="actions"> 
    2338        <ul> 
    2439                <li><?php echo $html->link(__('Delete', true), array('action'=>'delete', $form->value('Event.id')), null, __('Are you sure you want to delete', true).' #' . $form->value('Event.id')); ?></li> 
    25                 <li><?php echo $html->link(__('List', true).' '.__('Events', true), array('action'=>'index'));?></li> 
    26                 <li><?php echo $html->link(__('List', true).' '.__('Venues', true), array('controller'=> 'venues', 'action'=>'index')); ?> </li> 
    27                 <li><?php echo $html->link(__('New', true).' '.__('Venue', true), array('controller'=> 'venues', 'action'=>'add')); ?> </li> 
    28                 <li><?php echo $html->link(__('List', true).' '.__('Event Types', true), array('controller'=> 'event_types', 'action'=>'index')); ?> </li> 
    29                 <li><?php echo $html->link(__('New', true).' '.__('Event Type', true), array('controller'=> 'event_types', 'action'=>'add')); ?> </li> 
    30                 <li><?php echo $html->link(__('List', true).' '.__('Users', true), array('controller'=> 'users', 'action'=>'index')); ?> </li> 
    31                 <li><?php echo $html->link(__('New', true).' '.__('User', true), array('controller'=> 'users', 'action'=>'add')); ?> </li> 
    32                 <li><?php echo $html->link(__('List', true).' '.__('Subjects', true), array('controller'=> 'subjects', 'action'=>'index')); ?> </li> 
    33                 <li><?php echo $html->link(__('New', true).' '.__('Subject', true), array('controller'=> 'subjects', 'action'=>'add')); ?> </li> 
    34                 <li><?php echo $html->link(__('List', true).' '.__('Tags', true), array('controller'=> 'tags', 'action'=>'index')); ?> </li> 
    35                 <li><?php echo $html->link(__('New', true).' '.__('Tag', true), array('controller'=> 'tags', 'action'=>'add')); ?> </li> 
    3640        </ul> 
    3741</div>