示例#1
0
 /**
  * Approve a report and assign it to one or more categories
  */
 public function __response_approve_report($vars)
 {
     $incident_id = $this->data->id;
     $categories = array();
     if (isset($vars['add_category'])) {
         $categories = $vars['add_category'];
     }
     $verify = 0;
     if (isset($vars['verify'])) {
         $verify = (int) $vars['verify'];
     }
     foreach ($categories as $category_id) {
         // Assign Category
         Incident_Category_Model::assign_category_to_incident($incident_id, $category_id);
     }
     // Approve Report
     Incident_Model::set_approve($incident_id, 1);
     // Set Verification
     Incident_Model::set_verification($incident_id, $verify);
     return TRUE;
 }