Changeset 741 for trunk/app/controllers

Show
Ignore:
Timestamp:
08/27/08 20:16:13 (3 months ago)
Author:
aarkerio
Message:

Little Bugs fixed

Location:
trunk/app/controllers
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/controllers/reports_controller.php

    r740 r741  
    113113 } 
    114114 /*=== ADMIN  METHODS ===*/ 
    115  public function admin_points($participation_id, $sense) 
     115 public function admin_points($report_id, $sense) 
    116116 { 
    117    $points = $this->Participation->field('points', array('Participation.id'=>$participation_id)); 
     117   $points = (int) $this->Report->field('points', array('Report.id'=>$report_id)); 
    118118    
    119119   $points = ($sense == 'up' ) ? ($points + 1) : ($points - 1); 
    120120 
    121    $this->data['Participation']['id']       = $participation_id;     
     121   $this->data['Report']['id']       = $report_id;     
    122122       
    123    $this->data['Participation']['points']   = $points; 
     123   $this->data['Report']['points']   = $points; 
    124124      
    125    if ($this->Participation->save($this->data['Participation'])): 
     125   if ($this->Report->save($this->data)): 
    126126             $this->set('points', $points); 
    127          $this->render('points', 'ajax'); 
     127         $this->render('admin_points', 'ajax'); 
    128128   endif; 
    129129 } 
  • trunk/app/controllers/webquests_controller.php

    r740 r741  
    8585         $this->data['ResultWebquest']['user_id'] = $this->Auth->user('id'); 
    8686                   
    87          if ($this->Webquest->ResultWebquest->save($this->data['ResultWebquest'])): 
     87         if ($this->Webquest->ResultWebquest->save($this->data)): 
    8888             $this->msgFlash(__('Data saved', true),  
    8989          '/vclassrooms/show/'.$this->data['ResultWebquest']['blogger_id'].'/'.$this->data['ResultWebquest']['vclassroom_id']); 
     
    9494 public function admin_points($resultwebquest_id, $sense) 
    9595 { 
    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; 
    103103      
    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; 
    108108 } 
    109109