Assembla home | Assembla project page
 

Changeset 79

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

More improvments to the event system with maps

Files:

Legend:

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

    r60 r79  
    33 
    44        var $name = 'Events'; 
    5         var $uses = array('Event', 'Group'); 
     5        var $helpers = array('Html', 'Form', 'Ajax', 'GoogleMap' ); 
    66 
    77        function index() { 
     
    1111 
    1212        function view($id = null) { 
    13                 if(!$id) { 
     13                if (!$id) { 
    1414                        $this->Session->setFlash('Invalid Event.'); 
    1515                        $this->redirect(array('action'=>'index'), null, true); 
     
    1919 
    2020        function add() { 
    21                 if(!empty($this->data)) { 
     21                if (!empty($this->data)) { 
    2222                        $this->cleanUpFields(); 
    2323                        $this->Event->create(); 
    24                         if($this->Event->save($this->data)) { 
     24                        if ($this->Event->save($this->data)) { 
    2525                                $this->Session->setFlash('The Event has been saved'); 
    2626                                $this->redirect(array('action'=>'index'), null, true); 
     
    3030                } 
    3131                $tags = $this->Event->Tag->generateList(); 
    32                 $countries = $this->Event->Country->generateList(); 
     32                $venues = $this->Event->Venue->generateList(); 
    3333                $eventTypes = $this->Event->EventType->generateList(); 
    3434                $users = $this->Event->User->generateList(); 
    3535                $subjects = $this->Event->Subject->generateList(); 
    36                 $this->set(compact('tags', 'countries', 'eventTypes', 'users', 'subjects')); 
     36                $this->set(compact('tags', 'venues', 'eventTypes', 'users', 'subjects')); 
    3737        } 
    3838 
    3939        function edit($id = null) { 
    40                 if(!$id && empty($this->data)) { 
     40                if (!$id && empty($this->data)) { 
    4141                        $this->Session->setFlash('Invalid Event'); 
    4242                        $this->redirect(array('action'=>'index'), null, true); 
    4343                } 
    44                 if(!empty($this->data)) { 
     44                if (!empty($this->data)) { 
    4545                        $this->cleanUpFields(); 
    46                         if($this->Event->save($this->data)) { 
     46                        if ($this->Event->save($this->data)) { 
    4747                                $this->Session->setFlash('The Event saved'); 
    4848                                $this->redirect(array('action'=>'index'), null, true); 
     
    5151                        } 
    5252                } 
    53                 if(empty($this->data)) { 
     53                if (empty($this->data)) { 
    5454                        $this->data = $this->Event->read(null, $id); 
    5555                } 
    5656                $tags = $this->Event->Tag->generateList(); 
    57                 $countries = $this->Event->Country->generateList(); 
     57                $venues = $this->Event->Venue->generateList(); 
    5858                $eventTypes = $this->Event->EventType->generateList(); 
    5959                $users = $this->Event->User->generateList(); 
    6060                $subjects = $this->Event->Subject->generateList(); 
    61                 $this->set(compact('tags','countries','eventTypes','users','subjects')); 
     61                $this->set(compact('tags','venues','eventTypes','users','subjects')); 
    6262        } 
    6363 
    6464        function delete($id = null) { 
    65                 if(!$id) { 
     65                if (!$id) { 
    6666                        $this->Session->setFlash('Invalid id for Event'); 
    6767                        $this->redirect(array('action'=>'index'), null, true); 
    6868                } 
    69                 if($this->Event->del($id)) { 
     69                if ($this->Event->del($id)) { 
    7070                        $this->Session->setFlash('Event #'.$id.' deleted'); 
    7171                        $this->redirect(array('action'=>'index'), null, true); 
     
    8080 
    8181        function admin_view($id = null) { 
    82                 if(!$id) { 
     82                if (!$id) { 
    8383                        $this->Session->setFlash('Invalid Event.'); 
    8484                        $this->redirect(array('action'=>'index'), null, true); 
     
    8888 
    8989        function admin_add() { 
    90                 if(!empty($this->data)) { 
    91                         $this->data['Event']['user_id'] = $this->othAuth->user('id'); 
     90                if (!empty($this->data)) { 
    9291                        $this->cleanUpFields(); 
    9392                        $this->Event->create(); 
    94                         if($this->Event->save($this->data)) { 
     93                        if ($this->Event->save($this->data)) { 
    9594                                $this->Session->setFlash('The Event has been saved'); 
    9695                                $this->redirect(array('action'=>'index'), null, true); 
     
    10099                } 
    101100                $tags = $this->Event->Tag->generateList(); 
    102                 $countries = $this->Event->Country->generateList(); 
     101                $venues = $this->Event->Venue->generateList(); 
    103102                $eventTypes = $this->Event->EventType->generateList(); 
    104103                $users = $this->Event->User->generateList(); 
    105104                $subjects = $this->Event->Subject->generateList(); 
    106                 $this->set(compact('tags', 'countries', 'eventTypes', 'users', 'subjects')); 
     105                $this->set(compact('tags', 'venues', 'eventTypes', 'users', 'subjects')); 
    107106        } 
    108107 
    109108        function admin_edit($id = null) { 
    110                 if(!$id && empty($this->data)) { 
     109                if (!$id && empty($this->data)) { 
    111110                        $this->Session->setFlash('Invalid Event'); 
    112111                        $this->redirect(array('action'=>'index'), null, true); 
    113112                } 
    114                 if(!empty($this->data)) { 
     113                if (!empty($this->data)) { 
    115114                        $this->cleanUpFields(); 
    116                         if($this->Event->save($this->data)) { 
     115                        if ($this->Event->save($this->data)) { 
    117116                                $this->Session->setFlash('The Event saved'); 
    118117                                $this->redirect(array('action'=>'index'), null, true); 
     
    121120                        } 
    122121                } 
    123                 if(empty($this->data)) { 
     122                if (empty($this->data)) { 
    124123                        $this->data = $this->Event->read(null, $id); 
    125124                } 
    126125                $tags = $this->Event->Tag->generateList(); 
    127                 $countries = $this->Event->Country->generateList(); 
     126                $venues = $this->Event->Venue->generateList(); 
    128127                $eventTypes = $this->Event->EventType->generateList(); 
    129128                $users = $this->Event->User->generateList(); 
    130129                $subjects = $this->Event->Subject->generateList(); 
    131                 $this->set(compact('tags','countries','eventTypes','users','subjects')); 
     130                $this->set(compact('tags','venues','eventTypes','users','subjects')); 
    132131        } 
    133132 
    134133        function admin_delete($id = null) { 
    135                 if(!$id) { 
     134                if (!$id) { 
    136135                        $this->Session->setFlash('Invalid id for Event'); 
    137136                        $this->redirect(array('action'=>'index'), null, true); 
    138137                } 
    139                 if($this->Event->del($id)) { 
     138                if ($this->Event->del($id)) { 
    140139                        $this->Session->setFlash('Event #'.$id.' deleted'); 
    141140                        $this->redirect(array('action'=>'index'), null, true); 
  • branch/controllers/venues_controller.php

    r78 r79  
    77 
    88        function admin_index() { 
    9                 $this->layout = "map"; 
    109                $this->Venue->recursive = 0; 
    1110                $this->set('points', $this->Venue->findAll()); 
     
    1312 
    1413        function admin_add() { 
    15                 $this->layout = "map"; 
    1614                if(empty($this->data)) { 
    1715                        $this->render(); 
     
    3634                        if($this->Venue->save($this->data)) { 
    3735                                $this->Session->setFlash('The Venue has been saved'); 
    38                                 //$this->redirect('/points/index'); 
     36                                //$this->redirect('/venues/index'); 
    3937                        } else { 
    4038                                $this->Session->setFlash('Please correct errors below.'); 
     
    6260                        if($this->Venue->save($this->data)) { 
    6361                                $this->Session->setFlash('The Venue has been saved'); 
    64                                 $this->redirect('/points/index'); 
     62                                $this->redirect('/venues/index'); 
    6563                        } else { 
    6664                                $this->Session->setFlash('Please correct errors below.'); 
     
    7775                if($this->Venue->del($id)) { 
    7876                        $this->Session->setFlash('The Venue deleted: id '.$id.''); 
    79                         $this->redirect('/points/index'); 
     77                        $this->redirect('/venues/index'); 
    8078                } 
    8179        } 
  • branch/db.sql

    r77 r79  
    44--  
    55-- Host: localhost 
    6 -- Generation Time: Jul 05, 2007 at 05:49 PM 
     6-- Generation Time: Jul 06, 2007 at 03:29 PM 
    77-- Server version: 5.0.38 
    88-- PHP Version: 5.2.1 
     
    431431CREATE TABLE `events` ( 
    432432  `id` int(8) unsigned NOT NULL auto_increment, 
    433   `venue` varchar(255) NOT NULL, 
    434   `address` varchar(255) default NULL, 
    435   `city` varchar(255) NOT NULL, 
    436   `country_id` int(3) NOT NULL, 
    437   `postcode` varchar(255) NOT NULL, 
     433  `venue_id` int(8) NOT NULL, 
    438434  `event_type_id` int(8) unsigned NOT NULL, 
    439435  `event_date` date NOT NULL, 
     
    448444  `modified` datetime NOT NULL, 
    449445  PRIMARY KEY  (`id`) 
    450 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1
     446) ENGINE=MyISAM DEFAULT CHARSET=utf8
    451447 
    452448--  
    453449-- Dumping data for table `events` 
    454450--  
    455  
    456451 
    457452-- -------------------------------------------------------- 
     
    472467--  
    473468 
    474  
    475469-- -------------------------------------------------------- 
    476470 
     
    489483  `modified` datetime NOT NULL, 
    490484  PRIMARY KEY  (`id`) 
    491 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1
     485) ENGINE=MyISAM DEFAULT CHARSET=utf8
    492486 
    493487--  
     
    514508  `modified` datetime NOT NULL, 
    515509  PRIMARY KEY  (`id`) 
    516 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1
     510) ENGINE=MyISAM DEFAULT CHARSET=utf8
    517511 
    518512--  
     
    634628  `modified` datetime default NULL, 
    635629  PRIMARY KEY  (`id`) 
    636 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2
     630) ENGINE=MyISAM  DEFAULT CHARSET=utf8
    637631 
    638632--  
     
    769763  `modified` datetime NOT NULL, 
    770764  PRIMARY KEY  (`id`) 
    771 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1
     765) ENGINE=MyISAM DEFAULT CHARSET=utf8
    772766 
    773767--  
     
    838832  `comments` varchar(255) collate utf8_unicode_ci NOT NULL, 
    839833  PRIMARY KEY  (`id`) 
    840 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1
     834) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
    841835 
    842836--  
     
    862856--  
    863857 
    864  
    865 -- -------------------------------------------------------- 
    866  
    867 --  
    868 -- Table structure for table `points` 
    869 --  
    870  
    871 DROP TABLE IF EXISTS `points`; 
    872 CREATE TABLE `points` ( 
    873   `id` int(11) NOT NULL auto_increment, 
    874   `name` varchar(60) NOT NULL, 
    875   `description` text NOT NULL, 
    876   `street` varchar(60) NOT NULL, 
    877   `city` varchar(60) NOT NULL, 
    878   `state` varchar(2) NOT NULL, 
    879   `zip` varchar(5) NOT NULL, 
    880   `latitude` float NOT NULL, 
    881   `longitude` float NOT NULL, 
    882   `zoom` int(11) NOT NULL, 
    883   `created` datetime NOT NULL, 
    884   `modified` datetime NOT NULL, 
    885   PRIMARY KEY  (`id`) 
    886 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ; 
    887  
    888 --  
    889 -- Dumping data for table `points` 
    890 --  
    891  
    892 INSERT INTO `points` (`id`, `name`, `description`, `street`, `city`, `state`, `zip`, `latitude`, `longitude`, `zoom`, `created`, `modified`) VALUES  
    893 (1, 'Tane''s Home', 'Tanes Home', '20/4 Dalgety Ave', 'Edinburgh', '', 'EH7 5', 55.9584, -3.16237, 3, '2007-07-05 17:10:14', '2007-07-05 17:10:14'), 
    894 (4, '', '', '', '', '', '', 55.8683, -4.27112, 0, '2007-07-05 17:21:59', '2007-07-05 17:21:59'), 
    895 (5, '', '', '', '', '', '', 34.0996, -118.412, 0, '2007-07-05 17:31:55', '2007-07-05 17:31:55'); 
    896858 
    897859-- -------------------------------------------------------- 
     
    919881  `modified` datetime default NULL, 
    920882  PRIMARY KEY  (`id`) 
    921 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2
     883) ENGINE=MyISAM  DEFAULT CHARSET=utf8
    922884 
    923885--  
    924886-- Dumping data for table `posts` 
    925887--  
    926  
    927 INSERT INTO `posts` (`id`, `title`, `byline`, `body`, `post_date`, `comments_count`, `user_id`, `subject_id`, `access_level`, `stub`, `tags`, `frontpage`, `published`, `created`, `modified`) VALUES  
    928 (1, 'Welcome to the new No Half Measures website', 'New updated fancy do.', '<p><img alt="" title="" src="http://webrocket/img/NoHalfMeasures.jpg" align="left"/>Welcome to the new No Half Measures website.  This website has been updated to include lots of new features, such as:</p><ul><li>RSS feeds for all news and event content</li><li>Access to all our artists videos on youtube</li><li>You are able to comment on stories</li><li>Members-only access areas.<br /></li></ul>', '2007-06-21 14:56:00', NULL, 1, 1, 0, 'welcome_to_the_new_no_half_measures_website', 'No Half Measures, Youtube, Videos, Members Only', 1, 1, '2007-06-21 14:59:32', '2007-06-21 15:12:10'); 
    929888 
    930889-- -------------------------------------------------------- 
     
    944903-- Dumping data for table `posts_tags` 
    945904--  
    946  
    947 INSERT INTO `posts_tags` (`post_id`, `tag_id`) VALUES  
    948 (1, 5), 
    949 (1, 6), 
    950 (1, 7), 
    951 (1, 8); 
    952905 
    953906-- -------------------------------------------------------- 
     
    968921  `modified` datetime NOT NULL, 
    969922  PRIMARY KEY  (`id`) 
    970 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1
     923) ENGINE=MyISAM DEFAULT CHARSET=utf8
    971924 
    972925--  
     
    11021055  `modified` datetime default NULL, 
    11031056  PRIMARY KEY  (`id`) 
    1104 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2
     1057) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4
    11051058 
    11061059--  
     
    11091062 
    11101063INSERT INTO `subjects` (`id`, `title`, `posts_count`, `pages_count`, `events_count`, `feeds_count`, `images_count`, `galleries_count`, `videos_count`, `created`, `modified`) VALUES  
    1111 (1, 'Uncatagorised', 1, 0, 2, 0, 0, 0, 0, '2007-05-01 17:05:55', '2007-05-01 17:05:55'); 
     1064(1, 'Uncatagorised', 1, 0, 2, 0, 0, 0, 0, '2007-05-01 17:05:55', '2007-05-01 17:05:55'), 
     1065(2, 'The Hedrons', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2007-07-06 14:33:59', '2007-07-06 14:33:59'), 
     1066(3, 'Wet Wet Wet', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2007-07-06 14:34:09', '2007-07-06 14:34:09'); 
    11121067 
    11131068-- -------------------------------------------------------- 
     
    11221077  `tag` varchar(255) collate utf8_unicode_ci NOT NULL, 
    11231078  PRIMARY KEY  (`id`) 
    1124 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=9
     1079) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
    11251080 
    11261081--  
    11271082-- Dumping data for table `tags` 
    11281083--  
    1129  
    1130 INSERT INTO `tags` (`id`, `tag`) VALUES  
    1131 (4, 'Test 2'), 
    1132 (3, 'Test'), 
    1133 (5, 'No Half Measures'), 
    1134 (6, 'Youtube'), 
    1135 (7, 'Videos'), 
    1136 (8, 'Members Only'); 
    11371084 
    11381085-- -------------------------------------------------------- 
     
    12801227 
    12811228--  
     1229-- Table structure for table `venues` 
     1230--  
     1231 
     1232DROP TABLE IF EXISTS `venues`; 
     1233CREATE TABLE `venues` ( 
     1234  `id` int(8) NOT NULL auto_increment, 
     1235  `name` varchar(255) collate utf8_unicode_ci NOT NULL, 
     1236  `description` text collate utf8_unicode_ci NOT NULL, 
     1237  `street` varchar(255) collate utf8_unicode_ci NOT NULL, 
     1238  `city` varchar(255) collate utf8_unicode_ci NOT NULL, 
     1239  `state` varchar(255) collate utf8_unicode_ci default NULL, 
     1240  `postcode` varchar(255) collate utf8_unicode_ci NOT NULL, 
     1241  `latitude` float NOT NULL, 
     1242  `longitude` float NOT NULL, 
     1243  `zoom` int(11) NOT NULL, 
     1244  `created` datetime default NULL, 
     1245  `modified` datetime default NULL, 
     1246  PRIMARY KEY  (`id`) 
     1247) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ; 
     1248 
     1249--  
     1250-- Dumping data for table `venues` 
     1251--  
     1252 
     1253-- -------------------------------------------------------- 
     1254 
     1255--  
    12821256-- Table structure for table `videos` 
    12831257--  
     
    12991273  `modified` datetime NOT NULL, 
    13001274  PRIMARY KEY  (`id`) 
    1301 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=8
     1275) ENGINE=MyISAM  DEFAULT CHARSET=utf8
    13021276 
    13031277--  
    13041278-- Dumping data for table `videos` 
    13051279--  
    1306  
    1307 INSERT INTO `videos` (`id`, `title`, `slug`, `body`, `published`, `playlist_id`, `pages`, `num_per_page`, `user_id`, `subject_id`, `tags`, `created`, `modified`) VALUES  
    1308 (4, 'The Hedrons Playlist', 'the_hedrons_playlist', 'All of The hedrons videos', 1, '374A01AB56A74B24', 1, 20, 1, 1, 'The Hedrons, Videos, Singles, Album, Music', '2007-06-22 14:15:08', '2007-06-22 14:15:08'), 
    1309 (5, 'The Hedrons EPK Videos', 'the_hedrons_epk_videos', 'The Hedrons press & Documentry videos', 1, '1C0DBE8419B7009A', 1, 20, 1, 1, 'The Hedrons, EPK, Videos, Press', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), 
    1310 (6, 'The Hedrons Music Videos', 'the_hedrons_music_videos', 'All of The Hedrons music videos', 1, 'DC8DA47DD3DF59EA', 1, 20, 1, 1, 'The Hedrons, Music, Videos', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), 
    1311 (7, 'The Hedrons Live Videos', 'the_hedrons_live_videos', 'A collection of live performances by The Hedrons', 1, '447B38C4E627A018', 1, 20, 1, 1, 'The Hedrons, Live, Music', '0000-00-00 00:00:00', '0000-00-00 00:00:00'); 
    1312  
  • branch/models/event.php

    r69 r79  
    55         
    66        var $actsAs = array('CounterCache','Tag'); 
    7          
    8         var $validate = array( 
    9                 'venue' => VALID_NOT_EMPTY, 
    10                 'city' => VALID_NOT_EMPTY, 
    11                 'country_id' => VALID_NOT_EMPTY, 
    12                 'postcode' => VALID_NOT_EMPTY, 
    13                 'event_type_id' => VALID_NOT_EMPTY, 
    14                 'event_date' => VALID_NOT_EMPTY, 
    15                 'tags' => VALID_NOT_EMPTY, 
    16                 'user_id' => VALID_NOT_EMPTY, 
    17                 'subject_id' => VALID_NOT_EMPTY, 
    18                 'published' => VALID_NOT_EMPTY, 
    19         ); 
    207 
    218        //The Associations below have been created with all possible keys, those that are not needed can be removed 
    229        var $belongsTo = array( 
    23                         'Country' => array('className' => 'Country', 
    24                                                                 'foreignKey' => 'country_id', 
     10                        'Venue' => array('className' => 'Venue', 
     11                                                                'foreignKey' => 'venue_id', 
    2512                                                                'conditions' => '', 
    2613                                                                'fields' => '', 
     
    5744                                                'limit' => '', 
    5845                                                'offset' => '', 
    59                                                 'unique' => true
     46                                                'unique' => ''
    6047                                                'finderQuery' => '', 
    6148                                                'deleteQuery' => '', 
    6249                                                'insertQuery' => ''), 
    6350        ); 
     51         
     52        function publish($id) 
     53    { 
     54        $this->id = $id; 
     55        $this->savefield('published', 1); 
     56    } 
     57     
     58        function unpublish($id) 
     59    { 
     60        $this->id = $id; 
     61        $this->savefield('published', 0); 
     62    } 
    6463 
    6564} 
  • branch/models/venue.php

    r78 r79  
    33 
    44        var $name = 'Venue'; 
     5         
     6        var $actsAs = array('CounterCache','Tag'); 
    57 
    68        //The Associations below have been created with all possible keys, those that are not needed can be removed 
  • branch/tests/cases/controllers/events_controller.test.php

    r55 r79  
    33loadController('Events'); 
    44 
    5 class EventsControllerTestCase extends UnitTestCase { 
     5class EventsControllerTestCase extends CakeTestCase { 
    66        var $TestObject = null; 
    77 
  • branch/tests/cases/models/event.test.php

    r55 r79  
    33loadModel('Event'); 
    44 
    5 class EventTestCase extends UnitTestCase { 
     5class EventTestCase extends CakeTestCase { 
    66        var $TestObject = null; 
    77 
  • branch/views/events/add.ctp

    r55 r79  
    11<div class="event"> 
    2 <h2>New Event</h2> 
    3         <?php echo $form->create('Event');?> 
    4                 <?php echo $form->input('venue', array('class' => 'required'));?> 
    5                 <?php echo $form->input('address');?> 
    6                 <?php echo $form->input('city', array('class' => 'required'));?> 
    7                 <?php echo $form->input('country_id', array('class' => 'required', 'options' => $countries));?> 
    8                 <?php echo $form->input('postcode', array('class' => 'required'));?> 
    9                 <?php echo $form->input('event_type_id', array('class' => 'required', 'options' => $eventTypes));?> 
    10                 <?php echo $form->input('event_date', array('class' => 'required'));?> 
    11                 <?php echo $form->input('event_time');?> 
    12                 <?php echo $form->input('event_url');?> 
    13                 <?php echo $form->input('notes');?> 
    14                 <?php echo $form->input('tags', array('class' => 'required'));?> 
    15                 <?php echo $form->input('user_id', array('class' => 'required', 'options' => $users));?> 
    16                 <?php echo $form->input('subject_id', array('class' => 'required', 'options' => $subjects));?> 
    17                 <?php echo $form->input('published', array('class' => 'required'));?> 
    18                 <?php echo $form->input('Tag/Tag', array('options' => $tags, 'multiple' => 'multiple'));?> 
    19                 <?php echo $form->submit('Add');?> 
    20         </form> 
     2<?php echo $form->create('Event');?> 
     3        <fieldset> 
     4                <legend><?php __('Add', true);?> <?php __('Event');?></legend> 
     5        <?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'); 
     17        ?> 
     18        </fieldset> 
     19<?php echo $form->end('Submit');?> 
    2120</div> 
    2221<div class="actions"> 
    2322        <ul> 
    24                 <li><?php echo $html->link('List Events', array('action'=>'index')); ?></li> 
    25                 <li><?php echo $html->link('View Countries', array('controller'=> 'countries', 'action'=>'view'));?></li> 
    26                 <li><?php echo $html->link('Add Countries', array('controller'=> 'countries', 'action'=>'add')); ?></li> 
    27                 <li><?php echo $html->link('View Event Types', array('controller'=> 'event_types', 'action'=>'view'));?></li> 
    28                 <li><?php echo $html->link('Add Event Types', array('controller'=> 'event_types', 'action'=>'add')); ?></li> 
    29                 <li><?php echo $html->link('View Users', array('controller'=> 'users', 'action'=>'view'));?></li> 
    30                 <li><?php echo $html->link('Add Users', array('controller'=> 'users', 'action'=>'add')); ?></li> 
    31                 <li><?php echo $html->link('View Subjects', array('controller'=> 'subjects', 'action'=>'view'));?></li> 
    32                 <li><?php echo $html->link('Add Subjects', array('controller'=> 'subjects', 'action'=>'add')); ?></li> 
     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> 
    3334        </ul> 
    3435</div> 
  • branch/views/events/admin_add.ctp

    r68 r79  
    11<div class="event"> 
    2 <h2>New Event</h2> 
    3         <?php echo $form->create('Event');?> 
    4                 <fieldset id="main-content"> 
    5                         <legend>Main Content</legend> 
    6                         <?php echo $form->input('venue', array('class' => 'required'));?> 
    7                         <?php echo $form->input('address');?> 
    8                         <?php echo $form->input('city', array('class' => 'required'));?> 
    9                         <?php echo $form->input('country_id', array('class' => 'required', 'options' => $countries));?> 
    10                         <?php echo $form->input('postcode', array('class' => 'required'));?> 
    11                         <?php echo $form->input('event_type_id', array('class' => 'required', 'options' => $eventTypes));?> 
    12                         <?php echo $form->input('event_date', array('class' => 'required'));?> 
    13                         <?php echo $form->input('event_time');?> 
    14                         <?php echo $form->input('event_url');?> 
    15                 </fieldset> 
    16                  
    17                 <fieldset id="meta-content"> 
    18                         <legend>Meta Data</legend> 
    19                         <?php echo $form->input('body',array('class'=>'wymeditor'));?> 
    20                         <?php echo $form->input('tags', array('class' => 'tags', 'type'=>'text'));?> 
    21                         <?php echo $form->input('subject_id', array('class' => 'required', 'options' => $subjects));?> 
    22                 </fieldset> 
    23                  
    24                 <fieldset id="publishing-options"> 
    25                         <legend>Publishing Options</legend> 
    26                         <?php echo $form->input('published', array('class' => 'required'));?> 
    27                 </fieldset> 
    28                  
    29                 <?php echo $form->submit('Add', array('class'=>'wymupdate'));?> 
    30         </form> 
     2<?php echo $form->create('Event');?> 
     3        <fieldset> 
     4                <legend><?php __('Event Details');?></legend> 
     5        <?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('body'); 
     11        ?> 
     12        </fieldset> 
     13         
     14        <fieldset> 
     15                <legend><?php __('Event Date &amp; Time');?></legend> 
     16        <?php  
     17                echo $form->input('event_date'); 
     18                echo $form->input('event_time');                 
     19        ?> 
     20        </fieldset> 
     21         
     22        <fieldset> 
     23                <legend><?php __('Event Metadata');?></legend> 
     24                        <?php echo $form->input('tags', array('type'=>'text'));?> 
     25        </fieldset> 
     26         
     27        <fieldset> 
     28                <legend><?php __('Event Options');?></legend> 
     29                        <?php echo $form->input('published'); ?> 
     30        </fieldset> 
     31<?php echo $form->end('Submit');?> 
    3132</div> 
  • branch/views/events/admin_edit.ctp

    r68 r79  
    11<div class="event"> 
    2 <h2>Edit Event</h2
    3         <?php echo $form->create('Event');?
    4                <fieldset id="main-content"
    5                        <legend>Main Content</legend> 
    6                        <?php echo $form->input('id');?> 
    7                        <?php echo $form->input('venue', array('class' => 'required'));?> 
    8                        <?php echo $form->input('address');?> 
    9                        <?php echo $form->input('city', array('class' => 'required'));?> 
    10                        <?php echo $form->input('country_id', array('class' => 'required', 'options' => $countries));?> 
    11                        <?php echo $form->input('postcode', array('class' => 'required'));?> 
    12                        <?php echo $form->input('event_type_id', array('class' => 'required', 'options' => $eventTypes));?> 
    13                        <?php echo $form->input('event_date', array('class' => 'required'));?
    14                        <?php echo $form->input('event_time');?> 
    15                        <?php echo $form->input('event_url');?
    16                </fieldset
    17                 
    18                 <fieldset id="meta-content"> 
    19                        <legend>Meta Data</legend> 
    20                        <?php echo $form->input('body',array('class'=>'wymeditor'));?> 
    21                        <?php echo $form->input('tags', array('class' => 'tags', 'type'=>'text'));?
    22                        <?php echo $form->input('subject_id', array('class' => 'required', 'options' => $subjects));?> 
    23                </fieldset> 
    24                  
    25                 <fieldset id="publishing-options"
    26                        <legend>Publishing Options</legend
    27                        <?php echo $form->input('published', array('class' => 'required'));?> 
    28                </fieldset> 
    29                  
    30                 <?php echo $form->submit('Add', array('class'=>'wymupdate'));?> 
    31                <?php echo $html->link('Delete', array('action'=>'delete', $html->tagValue('Event/id')), null, 'Are you sure you want to delete #' . $html->tagValue('Event/id')); ?
    32        </form
     2<?php echo $form->create('Event');?
     3        <fieldset
     4               <legend><?php __('Event Details');?></legend
     5        <?php 
     6                echo $form->input('id'); 
     7                echo $form->input('subject_id'); 
     8                echo $form->input('venue_id'); 
     9                echo $form->input('event_type_id'); 
     10                echo $form->input('event_url'); 
     11                echo $form->input('body'); 
     12        ?> 
     13        </fieldset
     14         
     15        <fieldset
     16               <legend><?php __('Event Date &amp; Time');?></legend
     17        <?php  
     18                echo $form->input('event_date'); 
     19                echo $form->input('event_time');                
     20        ?> 
     21        </fieldset
     22         
     23        <fieldset> 
     24                <legend><?php __('Event Metadata');?></legend> 
     25                       <?php echo $form->input('tags', array('type'=>'text'));?
     26        </fieldset
     27         
     28        <fieldset> 
     29                <legend><?php __('Event Options');?></legend> 
     30                       <?php echo $form->input('published'); ?> 
     31        </fieldset
     32<?php echo $form->end('Submit');?
    3333</div> 
     34<div class="actions"> 
     35        <ul> 
     36                <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> 
     37        </ul> 
     38</div> 
  • branch/views/events/admin_index.ctp

    r60 r79  
    1 <?php if ($events) { ?> 
    2         <div class="events"> 
    3         <h2>List Events</h2> 
    4          
    5         <table cellpadding="0" cellspacing="0"> 
    6                 <tr> 
    7                         <th><?php echo $paginator->sort('id');?></th> 
    8                         <th><?php echo $paginator->sort('venue');?></th> 
    9                         <th><?php echo $paginator->sort('event_type_id');?></th> 
    10                         <th><?php echo $paginator->sort('event_date');?></th> 
    11                         <th><?php echo $paginator->sort('event_time');?></th> 
    12                         <th><?php echo $paginator->sort('tags');?></th> 
    13                         <th><?php echo $paginator->sort('user_id');?></th> 
    14                         <th><?php echo $paginator->sort('subject_id');?></th> 
    15                         <th><?php echo $paginator->sort('published');?></th> 
    16                         <th>Actions</th> 
    17                 </tr> 
    18         <?php foreach ($events as $event): ?> 
    19                 <tr> 
    20                         <td><?php echo $event['Event']['id']; ?></td> 
    21                         <td> 
    22                                 <?php echo $event['Event']['venue']; ?><br /> 
    23                                 <?php echo $event['Event']['address']; ?><br /> 
    24                                 <?php echo $event['Event']['city']; ?><br /> 
    25                                 <?php echo $html->link($event['Country']['name'], array('controller'=> 'countries', 'action'=>'view', $event['Country']['id'])); ?><br /> 
    26                                 <?php echo $event['Event']['postcode']; ?>       
    27                         </td> 
    28                         <td><?php echo $html->link($event['EventType']['title'], array('controller'=> 'event_types', 'action'=>'view', $event['EventType']['id'])); ?></td> 
    29                         <td><?php echo $event['Event']['event_date']; ?></td> 
    30                         <td><?php echo $event['Event']['event_time']; ?></td> 
    31                         <td><?php echo $event['Event']['tags']; ?></td> 
    32                         <td><?php echo $html->link($event['User']['name'], array('controller'=> 'users', 'action'=>'view', $event['User']['id'])); ?></td> 
    33                         <td><?php echo $html->link($event['Subject']['title'], array('controller'=> 'subjects', 'action'=>'view', $event['Subject']['id'])); ?></td> 
    34                         <td><?php echo $event['Event']['published']; ?></td> 
    35                         <td class="actions"> 
    36                                 <?php echo $html->link('View', array('action'=>'view', $event['Event']['id'])); ?> 
    37