Changeset 79
- Timestamp:
- 07/06/07 15:47:52 (1 year ago)
- Files:
-
- branch/controllers/events_controller.php (modified) (9 diffs)
- branch/controllers/venues_controller.php (modified) (5 diffs)
- branch/db.sql (modified) (18 diffs)
- branch/models/event.php (modified) (2 diffs)
- branch/models/venue.php (modified) (1 diff)
- branch/tests/cases/controllers/events_controller.test.php (modified) (1 diff)
- branch/tests/cases/models/event.test.php (modified) (1 diff)
- branch/views/events/add.ctp (modified) (1 diff)
- branch/views/events/admin_add.ctp (modified) (1 diff)
- branch/views/events/admin_edit.ctp (modified) (1 diff)
- branch/views/events/admin_index.ctp (modified) (1 diff)
- branch/views/events/admin_view.ctp (modified) (1 diff)
- branch/views/events/edit.ctp (modified) (1 diff)
- branch/views/events/index.ctp (modified) (1 diff)
- branch/views/events/view.ctp (modified) (1 diff)
- branch/views/helpers/google_map.php (modified) (1 diff)
- branch/views/layouts/default.ctp (modified) (1 diff)
- branch/views/venues/admin_add.ctp (moved) (moved from branch/views/venues/add.ctp) (1 diff)
- branch/views/venues/admin_edit.ctp (moved) (moved from branch/views/venues/edit.ctp) (1 diff)
- branch/views/venues/admin_index.ctp (moved) (moved from branch/views/venues/index.ctp)
- branch/views/venues/admin_view.ctp (moved) (moved from branch/views/venues/view.ctp) (1 diff)
- branch/webroot/css/default.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branch/controllers/events_controller.php
r60 r79 3 3 4 4 var $name = 'Events'; 5 var $ uses = array('Event', 'Group');5 var $helpers = array('Html', 'Form', 'Ajax', 'GoogleMap' ); 6 6 7 7 function index() { … … 11 11 12 12 function view($id = null) { 13 if (!$id) {13 if (!$id) { 14 14 $this->Session->setFlash('Invalid Event.'); 15 15 $this->redirect(array('action'=>'index'), null, true); … … 19 19 20 20 function add() { 21 if (!empty($this->data)) {21 if (!empty($this->data)) { 22 22 $this->cleanUpFields(); 23 23 $this->Event->create(); 24 if ($this->Event->save($this->data)) {24 if ($this->Event->save($this->data)) { 25 25 $this->Session->setFlash('The Event has been saved'); 26 26 $this->redirect(array('action'=>'index'), null, true); … … 30 30 } 31 31 $tags = $this->Event->Tag->generateList(); 32 $ countries = $this->Event->Country->generateList();32 $venues = $this->Event->Venue->generateList(); 33 33 $eventTypes = $this->Event->EventType->generateList(); 34 34 $users = $this->Event->User->generateList(); 35 35 $subjects = $this->Event->Subject->generateList(); 36 $this->set(compact('tags', ' countries', 'eventTypes', 'users', 'subjects'));36 $this->set(compact('tags', 'venues', 'eventTypes', 'users', 'subjects')); 37 37 } 38 38 39 39 function edit($id = null) { 40 if (!$id && empty($this->data)) {40 if (!$id && empty($this->data)) { 41 41 $this->Session->setFlash('Invalid Event'); 42 42 $this->redirect(array('action'=>'index'), null, true); 43 43 } 44 if (!empty($this->data)) {44 if (!empty($this->data)) { 45 45 $this->cleanUpFields(); 46 if ($this->Event->save($this->data)) {46 if ($this->Event->save($this->data)) { 47 47 $this->Session->setFlash('The Event saved'); 48 48 $this->redirect(array('action'=>'index'), null, true); … … 51 51 } 52 52 } 53 if (empty($this->data)) {53 if (empty($this->data)) { 54 54 $this->data = $this->Event->read(null, $id); 55 55 } 56 56 $tags = $this->Event->Tag->generateList(); 57 $ countries = $this->Event->Country->generateList();57 $venues = $this->Event->Venue->generateList(); 58 58 $eventTypes = $this->Event->EventType->generateList(); 59 59 $users = $this->Event->User->generateList(); 60 60 $subjects = $this->Event->Subject->generateList(); 61 $this->set(compact('tags',' countries','eventTypes','users','subjects'));61 $this->set(compact('tags','venues','eventTypes','users','subjects')); 62 62 } 63 63 64 64 function delete($id = null) { 65 if (!$id) {65 if (!$id) { 66 66 $this->Session->setFlash('Invalid id for Event'); 67 67 $this->redirect(array('action'=>'index'), null, true); 68 68 } 69 if ($this->Event->del($id)) {69 if ($this->Event->del($id)) { 70 70 $this->Session->setFlash('Event #'.$id.' deleted'); 71 71 $this->redirect(array('action'=>'index'), null, true); … … 80 80 81 81 function admin_view($id = null) { 82 if (!$id) {82 if (!$id) { 83 83 $this->Session->setFlash('Invalid Event.'); 84 84 $this->redirect(array('action'=>'index'), null, true); … … 88 88 89 89 function admin_add() { 90 if(!empty($this->data)) { 91 $this->data['Event']['user_id'] = $this->othAuth->user('id'); 90 if (!empty($this->data)) { 92 91 $this->cleanUpFields(); 93 92 $this->Event->create(); 94 if ($this->Event->save($this->data)) {93 if ($this->Event->save($this->data)) { 95 94 $this->Session->setFlash('The Event has been saved'); 96 95 $this->redirect(array('action'=>'index'), null, true); … … 100 99 } 101 100 $tags = $this->Event->Tag->generateList(); 102 $ countries = $this->Event->Country->generateList();101 $venues = $this->Event->Venue->generateList(); 103 102 $eventTypes = $this->Event->EventType->generateList(); 104 103 $users = $this->Event->User->generateList(); 105 104 $subjects = $this->Event->Subject->generateList(); 106 $this->set(compact('tags', ' countries', 'eventTypes', 'users', 'subjects'));105 $this->set(compact('tags', 'venues', 'eventTypes', 'users', 'subjects')); 107 106 } 108 107 109 108 function admin_edit($id = null) { 110 if (!$id && empty($this->data)) {109 if (!$id && empty($this->data)) { 111 110 $this->Session->setFlash('Invalid Event'); 112 111 $this->redirect(array('action'=>'index'), null, true); 113 112 } 114 if (!empty($this->data)) {113 if (!empty($this->data)) { 115 114 $this->cleanUpFields(); 116 if ($this->Event->save($this->data)) {115 if ($this->Event->save($this->data)) { 117 116 $this->Session->setFlash('The Event saved'); 118 117 $this->redirect(array('action'=>'index'), null, true); … … 121 120 } 122 121 } 123 if (empty($this->data)) {122 if (empty($this->data)) { 124 123 $this->data = $this->Event->read(null, $id); 125 124 } 126 125 $tags = $this->Event->Tag->generateList(); 127 $ countries = $this->Event->Country->generateList();126 $venues = $this->Event->Venue->generateList(); 128 127 $eventTypes = $this->Event->EventType->generateList(); 129 128 $users = $this->Event->User->generateList(); 130 129 $subjects = $this->Event->Subject->generateList(); 131 $this->set(compact('tags',' countries','eventTypes','users','subjects'));130 $this->set(compact('tags','venues','eventTypes','users','subjects')); 132 131 } 133 132 134 133 function admin_delete($id = null) { 135 if (!$id) {134 if (!$id) { 136 135 $this->Session->setFlash('Invalid id for Event'); 137 136 $this->redirect(array('action'=>'index'), null, true); 138 137 } 139 if ($this->Event->del($id)) {138 if ($this->Event->del($id)) { 140 139 $this->Session->setFlash('Event #'.$id.' deleted'); 141 140 $this->redirect(array('action'=>'index'), null, true); branch/controllers/venues_controller.php
r78 r79 7 7 8 8 function admin_index() { 9 $this->layout = "map";10 9 $this->Venue->recursive = 0; 11 10 $this->set('points', $this->Venue->findAll()); … … 13 12 14 13 function admin_add() { 15 $this->layout = "map";16 14 if(empty($this->data)) { 17 15 $this->render(); … … 36 34 if($this->Venue->save($this->data)) { 37 35 $this->Session->setFlash('The Venue has been saved'); 38 //$this->redirect('/ points/index');36 //$this->redirect('/venues/index'); 39 37 } else { 40 38 $this->Session->setFlash('Please correct errors below.'); … … 62 60 if($this->Venue->save($this->data)) { 63 61 $this->Session->setFlash('The Venue has been saved'); 64 $this->redirect('/ points/index');62 $this->redirect('/venues/index'); 65 63 } else { 66 64 $this->Session->setFlash('Please correct errors below.'); … … 77 75 if($this->Venue->del($id)) { 78 76 $this->Session->setFlash('The Venue deleted: id '.$id.''); 79 $this->redirect('/ points/index');77 $this->redirect('/venues/index'); 80 78 } 81 79 } branch/db.sql
r77 r79 4 4 -- 5 5 -- Host: localhost 6 -- Generation Time: Jul 0 5, 2007 at 05:49 PM6 -- Generation Time: Jul 06, 2007 at 03:29 PM 7 7 -- Server version: 5.0.38 8 8 -- PHP Version: 5.2.1 … … 431 431 CREATE TABLE `events` ( 432 432 `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, 438 434 `event_type_id` int(8) unsigned NOT NULL, 439 435 `event_date` date NOT NULL, … … 448 444 `modified` datetime NOT NULL, 449 445 PRIMARY KEY (`id`) 450 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;446 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ; 451 447 452 448 -- 453 449 -- Dumping data for table `events` 454 450 -- 455 456 451 457 452 -- -------------------------------------------------------- … … 472 467 -- 473 468 474 475 469 -- -------------------------------------------------------- 476 470 … … 489 483 `modified` datetime NOT NULL, 490 484 PRIMARY KEY (`id`) 491 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;485 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ; 492 486 493 487 -- … … 514 508 `modified` datetime NOT NULL, 515 509 PRIMARY KEY (`id`) 516 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;510 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ; 517 511 518 512 -- … … 634 628 `modified` datetime default NULL, 635 629 PRIMARY KEY (`id`) 636 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2;630 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ; 637 631 638 632 -- … … 769 763 `modified` datetime NOT NULL, 770 764 PRIMARY KEY (`id`) 771 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;765 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ; 772 766 773 767 -- … … 838 832 `comments` varchar(255) collate utf8_unicode_ci NOT NULL, 839 833 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 ; 841 835 842 836 -- … … 862 856 -- 863 857 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`) VALUES893 (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');896 858 897 859 -- -------------------------------------------------------- … … 919 881 `modified` datetime default NULL, 920 882 PRIMARY KEY (`id`) 921 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2;883 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ; 922 884 923 885 -- 924 886 -- Dumping data for table `posts` 925 887 -- 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`) VALUES928 (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');929 888 930 889 -- -------------------------------------------------------- … … 944 903 -- Dumping data for table `posts_tags` 945 904 -- 946 947 INSERT INTO `posts_tags` (`post_id`, `tag_id`) VALUES948 (1, 5),949 (1, 6),950 (1, 7),951 (1, 8);952 905 953 906 -- -------------------------------------------------------- … … 968 921 `modified` datetime NOT NULL, 969 922 PRIMARY KEY (`id`) 970 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;923 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ; 971 924 972 925 -- … … 1102 1055 `modified` datetime default NULL, 1103 1056 PRIMARY KEY (`id`) 1104 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT= 2;1057 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; 1105 1058 1106 1059 -- … … 1109 1062 1110 1063 INSERT 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'); 1112 1067 1113 1068 -- -------------------------------------------------------- … … 1122 1077 `tag` varchar(255) collate utf8_unicode_ci NOT NULL, 1123 1078 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 ; 1125 1080 1126 1081 -- 1127 1082 -- Dumping data for table `tags` 1128 1083 -- 1129 1130 INSERT INTO `tags` (`id`, `tag`) VALUES1131 (4, 'Test 2'),1132 (3, 'Test'),1133 (5, 'No Half Measures'),1134 (6, 'Youtube'),1135 (7, 'Videos'),1136 (8, 'Members Only');1137 1084 1138 1085 -- -------------------------------------------------------- … … 1280 1227 1281 1228 -- 1229 -- Table structure for table `venues` 1230 -- 1231 1232 DROP TABLE IF EXISTS `venues`; 1233 CREATE 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 -- 1282 1256 -- Table structure for table `videos` 1283 1257 -- … … 1299 1273 `modified` datetime NOT NULL, 1300 1274 PRIMARY KEY (`id`) 1301 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=8;1275 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ; 1302 1276 1303 1277 -- 1304 1278 -- Dumping data for table `videos` 1305 1279 -- 1306 1307 INSERT INTO `videos` (`id`, `title`, `slug`, `body`, `published`, `playlist_id`, `pages`, `num_per_page`, `user_id`, `subject_id`, `tags`, `created`, `modified`) VALUES1308 (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 5 5 6 6 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 );20 7 21 8 //The Associations below have been created with all possible keys, those that are not needed can be removed 22 9 var $belongsTo = array( 23 ' Country' => array('className' => 'Country',24 'foreignKey' => ' country_id',10 'Venue' => array('className' => 'Venue', 11 'foreignKey' => 'venue_id', 25 12 'conditions' => '', 26 13 'fields' => '', … … 57 44 'limit' => '', 58 45 'offset' => '', 59 'unique' => true,46 'unique' => '', 60 47 'finderQuery' => '', 61 48 'deleteQuery' => '', 62 49 'insertQuery' => ''), 63 50 ); 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 } 64 63 65 64 } branch/models/venue.php
r78 r79 3 3 4 4 var $name = 'Venue'; 5 6 var $actsAs = array('CounterCache','Tag'); 5 7 6 8 //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 3 3 loadController('Events'); 4 4 5 class EventsControllerTestCase extends UnitTestCase {5 class EventsControllerTestCase extends CakeTestCase { 6 6 var $TestObject = null; 7 7 branch/tests/cases/models/event.test.php
r55 r79 3 3 loadModel('Event'); 4 4 5 class EventTestCase extends UnitTestCase {5 class EventTestCase extends CakeTestCase { 6 6 var $TestObject = null; 7 7 branch/views/events/add.ctp
r55 r79 1 1 <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');?> 21 20 </div> 22 21 <div class="actions"> 23 22 <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> 33 34 </ul> 34 35 </div> branch/views/events/admin_add.ctp
r68 r79 1 1 <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 & 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');?> 31 32 </div> branch/views/events/admin_edit.ctp
r68 r79 1 1 <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 & 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');?> 33 33 </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