Changeset 741 for trunk/app/controllers
- Timestamp:
- 08/27/08 20:16:13 (3 months ago)
- Location:
- trunk/app/controllers
- Files:
-
- 2 modified
-
reports_controller.php (modified) (1 diff)
-
webquests_controller.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/reports_controller.php
r740 r741 113 113 } 114 114 /*=== ADMIN METHODS ===*/ 115 public function admin_points($ participation_id, $sense)115 public function admin_points($report_id, $sense) 116 116 { 117 $points = $this->Participation->field('points', array('Participation.id'=>$participation_id));117 $points = (int) $this->Report->field('points', array('Report.id'=>$report_id)); 118 118 119 119 $points = ($sense == 'up' ) ? ($points + 1) : ($points - 1); 120 120 121 $this->data[' Participation']['id'] = $participation_id;121 $this->data['Report']['id'] = $report_id; 122 122 123 $this->data[' Participation']['points'] = $points;123 $this->data['Report']['points'] = $points; 124 124 125 if ($this-> Participation->save($this->data['Participation'])):125 if ($this->Report->save($this->data)): 126 126 $this->set('points', $points); 127 $this->render(' points', 'ajax');127 $this->render('admin_points', 'ajax'); 128 128 endif; 129 129 } -
trunk/app/controllers/webquests_controller.php
r740 r741 85 85 $this->data['ResultWebquest']['user_id'] = $this->Auth->user('id'); 86 86 87 if ($this->Webquest->ResultWebquest->save($this->data ['ResultWebquest'])):87 if ($this->Webquest->ResultWebquest->save($this->data)): 88 88 $this->msgFlash(__('Data saved', true), 89 89 '/vclassrooms/show/'.$this->data['ResultWebquest']['blogger_id'].'/'.$this->data['ResultWebquest']['vclassroom_id']); … … 94 94 public function admin_points($resultwebquest_id, $sense) 95 95 { 96 $points =$this->Webquest->ResultWebquest->field('points', array('ResultWebquest.id'=>$resultwebquest_id));97 98 $points = ($sense == 'up' ) ? ($points + 1) : ($points - 1);99 100 $this->data['Participation']['id'] = $participation_id;101 102 $this->data['Participation']['points'] = $points;96 $points = (int) $this->Webquest->ResultWebquest->field('points', array('ResultWebquest.id'=>$resultwebquest_id)); 97 98 $points = ($sense == 'up' ) ? ($points + 1) : ($points - 1); 99 100 $this->data['ResultWebquest']['id'] = $resultwebquest_id; 101 102 $this->data['ResultWebquest']['points'] = $points; 103 103 104 if ($this->Webquest->ResultWebquest->save($this->data['Participation'])):105 $this->set('points', $points);106 $this->render('points', 'ajax');107 endif;104 if ($this->Webquest->ResultWebquest->save($this->data)): 105 $this->set('points', $points); 106 $this->render('admin_points', 'ajax'); 107 endif; 108 108 } 109 109
