Changeset 624
- Timestamp:
- 07/04/08 14:25:17 (3 months ago)
- Location:
- trunk/app
- Files:
-
- 8 modified
-
config/sql/postgresql/vclassrooms.sql (modified) (1 diff)
-
controllers/vclassrooms_controller.php (modified) (3 diffs)
-
locale/spa/LC_MESSAGES/default.po (modified) (1 diff)
-
views/ecourses/admin_vclassrooms.ctp (modified) (1 diff)
-
views/lessons/admin_add.ctp (modified) (2 diffs)
-
views/lessons/admin_edit.ctp (modified) (2 diffs)
-
views/vclassrooms/admin_add.ctp (modified) (1 diff)
-
views/vclassrooms/admin_edit.ctp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/config/sql/postgresql/vclassrooms.sql
r436 r624 8 8 "ecourse_id" int NOT NULL REFERENCES ecourses(id) ON DELETE CASCADE, 9 9 "secret" varchar(6), -- secret code to allow students register by themselves 10 "sdate" date NOT NULL DEFAULT now(), --starting date 11 "fdate" date NOT NULL DEFAULT now(), -- finish date 10 12 "access" smallint NOT NULL DEFAULT 0 -- public / only with code 11 13 ); -
trunk/app/controllers/vclassrooms_controller.php
r617 r624 143 143 public function admin_listing($historic = null) 144 144 { 145 $this->layout = 'admin'; 146 $conditions = array("Vclassroom.user_id"=>$this->Auth->user('id'), "Vclassroom.status"=>1); 147 $fields = array('id', 'name', 'created', 'user_id', 'ecourse_id', 'status'); 148 $order = "Vclassroom.id DESC"; 149 150 if ($historic === 'historic') 151 { 145 $this->layout = 'admin'; 146 $conditions = array("Vclassroom.user_id"=>$this->Auth->user('id'), "Vclassroom.status"=>1); 147 $fields = array('id', 'name', 'created', 'user_id', 'ecourse_id', 'status'); 148 $order = "Vclassroom.id DESC"; 149 150 if ($historic === 'historic'): 152 151 $conditions['Vclassroom.status'] = 0; 153 152 $this->set('historic', true); 154 }155 156 $this->pageTitle = 'eClass';157 158 $this->set('data', $this->Vclassroom->findAll($conditions, $fields, $order, null, null, 2));153 endif; 154 155 $this->pageTitle = 'eClass'; 156 157 $this->set('data', $this->Vclassroom->findAll($conditions, $fields, $order, null, null, 2)); 159 158 } 160 159 … … 261 260 262 261 if (!empty($this->data["Vclassroom"])): 263 $this->Sanitize = new Sanitize;264 265 $this->Sanitize->clean($this->data["Vclassroom"]);266 267 $this->data["Vclassroom"]["user_id"] = $this->Auth->user('id');268 269 $this->Vclassroom->create();270 271 if ($this->Vclassroom->save($this->data["Vclassroom"])):262 $this->Sanitize = new Sanitize; 263 264 $this->Sanitize->clean($this->data['Vclassroom']); 265 266 $this->data['Vclassroom']['user_id'] = $this->Auth->user('id'); 267 268 $this->Vclassroom->create(); 269 270 if ($this->Vclassroom->save($this->data["Vclassroom"])): 272 271 $this->msgFlash('vClassroom added', '/admin/ecourses/vclassrooms/'.$this->data["Vclassroom"]["ecourse_id"]); 273 endif;272 endif; 274 273 else: 275 274 $this->data = $this->Vclassroom->Ecourse->read(null, $ecourse_id); … … 342 341 } 343 342 344 public function admin_delete($ id, $ecourse_id)345 { 346 if ($this->Vclassroom->del($ id)):347 $this->msgFlash( 'Classroom deleted','/admin/ecourses/vclassrooms/'.$ecourse_id);343 public function admin_delete($vclassroom_id, $ecourse_id) 344 { 345 if ($this->Vclassroom->del($vclassroom_id)): 346 $this->msgFlash(__('vClassroom deleted', true),'/admin/ecourses/vclassrooms/'.$ecourse_id); 348 347 else: 349 348 $this->flash('Error, call support', '/admin/ecourses/vclassrooms/'.$ecourse_id); -
trunk/app/locale/spa/LC_MESSAGES/default.po
r620 r624 2 2 msgstr "Eliminar" 3 3 4 msgid "Starting date" 5 msgstr "Fecha de inicio" 6 7 msgid "Finishing date" 8 msgstr "Fecha de fin de curso" 9 10 msgid "New Group for e-Course" 11 msgstr "Nuevo grupo para el e-Course" 12 13 msgid "Filed classrooms" 14 msgstr "Grupos archivados" 15 16 msgid "Edit vClass" 17 msgstr "Editar vClass" 18 4 19 msgid "Edit" 5 20 msgstr "Editar" 21 22 msgid "New Lesson" 23 msgstr "Nueva lección" 24 25 msgid "Edit Lesson" 26 msgstr "Editar lección" 6 27 7 28 msgid "New eCourse" -
trunk/app/views/ecourses/admin_vclassrooms.ctp
r617 r624 25 25 26 26 27 $msg = __('Are you sure to want to delete this?', true); 28 27 29 foreach ($data['Vclassroom'] as $val): 28 30 $s = ($val['status'] == 1) ? 'Enabled' : 'Filed'; 29 31 30 $tmp = $html->div('butonright', $gags->sendEdit($val['id'], 'Vclassroom')); 31 $tmp .= $html->link($val['name'], '/admin/vclassrooms/members/'.$val['id']); 32 $tmp .= $html->div(null, 'Secret:'. $val['secret']); 33 $tmp .= $html->para(null, 'Status: '.$html->link($s,'/admin/vclassrooms/change/'.$val['id'].'/'.$val['status'].'/'.$val['ecourse_id'])); 34 $tmp .= $html->div('butonright', $gags->confirmDel($val['id'], 'Vclassroom')); 35 36 echo $html->div('grayblock', $tmp); 32 $tmp = $html->div('butonright', $gags->sendEdit($val['id'], 'Vclassroom')); 33 $tmp .= $html->link($val['name'], '/admin/vclassrooms/members/'.$val['id']); 34 $tmp .= $html->div(null, 'Secret:'. $val['secret']); 35 $tmp .= $html->para(null, 'Status: '.$html->link($s,'/admin/vclassrooms/change/'.$val['id'].'/'.$val['status'].'/'.$val['ecourse_id'])); 36 $tmp .= $html->div('butonright', 37 $form->create('Vclassroom', array('action'=>'/admin_delete/'.$val['id'].'/'.$val['ecourse_id'], "onsubmit"=>"return confirm('".$msg."')")). 38 $form->end(__('Delete', true))); 39 echo $html->div('grayblock', $tmp); 37 40 endforeach; 38 41 39 42 if ( !isset( $historic ) ): 40 43 echo $html->link( 41 $html->image('admin/historic.png', array('alt'=> 'Filed classrooms', 'title'=>'Filed classrooms')),44 $html->image('admin/historic.png', array('alt'=>__('Filed classrooms', true), 'title'=>__('Filed classrooms', true))), 42 45 '/admin/ecourses/vclassrooms/'.$data['Ecourse']['id'].'/historic', null, null, false); 43 46 endif; -
trunk/app/views/lessons/admin_add.ctp
r585 r624 6 6 7 7 <fieldset> 8 <legend> Add Lesson</legend>8 <legend><?php __('New Lesson'); ?></legend> 9 9 <table> 10 10 <tr><td> 11 <?php11 <?php 12 12 echo $form->input('Lesson.title', array("size" => 50, "maxlength" => 120)); 13 13 echo $form->error('Lesson.title', 'Title is required.'); 14 ?>14 ?> 15 15 </td> 16 16 <td> … … 44 44 ?> 45 45 </td></tr> 46 <tr><td colspan="3"> </fieldset> 47 <?php echo $form->end('Save'); ?> 46 <tr><td colspan="3"> 47 <?php echo $form->end(__('Save', true)); ?> 48 </fieldset> 48 49 </td></tr> 49 50 </table> -
trunk/app/views/lessons/admin_edit.ctp
r585 r624 12 12 ?> 13 13 <fieldset> 14 <legend> Edit Lesson: <?php echo $this->data['Lesson']['title']; ?></legend>14 <legend><?php __('Edit Lesson');?> : <?php echo $this->data['Lesson']['title']; ?></legend> 15 15 <table> 16 16 <tr><td> … … 51 51 ?> 52 52 </td></tr> 53 <tr><td colspan="3"> </fieldset> 54 <?php echo $form->end('Save'); ?> 53 <tr><td colspan="3"> 54 <?php echo $form->end(__('Save', true)); ?> 55 </fieldset> 55 56 </td></tr> 56 57 </table> -
trunk/app/views/vclassrooms/admin_add.ctp
r617 r624 12 12 ?> 13 13 <fieldset> 14 <legend>New Group for e-Course: <?php echo $this->data['Ecourse']['title']; ?></legend> 15 <?php 16 echo $form->input('Vclassroom.name', array('size' => 40, 'maxlength' => 60)); 17 18 echo $form->label('Vclassroom.status', 'Enabled:'); 19 echo $form->checkbox('Vclassroom.status', array('value'=>1)); 14 <legend><?php __('New Group for e-Course'); ?>:<?php echo $this->data['Ecourse']['title']; ?></legend> 15 <?php 16 echo $form->input('Vclassroom.name', array('size' => 40, 'maxlength' => 60)); 20 17 18 echo $form->input('Vclassroom.sdate',array('type'=>'date','label'=>__('Starting date', true), 'dateFormat'=>'DMY')); 19 20 echo $html->para(null, '<br />'); 21 21 22 echo $form->input('Vclassroom.secret', array('size' => 7, 'maxlength' => 6)); 23 echo $form->end('Save'); 22 echo $form->input('Vclassroom.fdate',array('type'=>'date','label'=>__('Finishing date', true), 'dateFormat'=>'DMY')); 23 24 echo $form->input('Vclassroom.secret', array('size' => 7, 'maxlength' => 6)); 25 26 echo $form->label('Vclassroom.status', __('Enabled', true)); 27 echo $form->checkbox('Vclassroom.status', array('value'=>1)); 28 29 echo $form->end('Save'); 24 30 ?> 25 31 </fieldset> -
trunk/app/views/vclassrooms/admin_edit.ctp
r617 r624 1 1 <?php 2 //exit(var_dump($this->data));2 //exit(debug($this->data)); 3 3 echo $javascript->link('fckeditor/fckeditor'); 4 4 echo $html->addCrumb('Control Panel', '/admin/entries/start'); … … 11 11 12 12 <fieldset> 13 <legend> Edit Group</legend>13 <legend><?php __('Edit vClass');?></legend> 14 14 <?php 15 echo $form->input('Vclassroom.name', array('size' => 40, 'maxlength' => 60));15 echo $form->input('Vclassroom.name', array('size' => 40, 'maxlength' => 60)); 16 16 17 echo $form->label('Vclassroom.status', 'Status:'); 18 echo $form->checkbox('Vclassroom.status'); 17 echo $form->input('Vclassroom.sdate',array('type'=>'date','label'=>__('Starting date', true), 'dateFormat'=>'DMY')); 19 18 20 echo $form->input('Vclassroom.secret', array('size' => 6, 'maxlength' => 6)) 19 echo $form->input('Vclassroom.fdate',array('type'=>'date','label'=>__('Finishing date', true), 'dateFormat'=>'DMY')); 20 21 echo $form->label('Vclassroom.status', 'Status:'); 22 echo $form->checkbox('Vclassroom.status'); 23 24 echo $form->input('Vclassroom.secret', array('size' => 6, 'maxlength' => 6)); 25 26 echo $form->end(__('Save', true)); 21 27 ?> 22 <div style="clear:both"></div>23 <?php echo $form->end('Save'); ?>24 28 </fieldset> 25 29 </div>
