示例#1
0
 /**
  * process the form after the input has been submitted and validated
  *
  * @access public
  *
  * @return void
  */
 public function postProcess()
 {
     $updatedGrants = 0;
     // get the submitted form values.
     $params = $this->controller->exportValues($this->_name);
     $qfKey = $params['qfKey'];
     foreach ($params as $key => $value) {
         if ($value == '' || $key == 'qfKey') {
             unset($params[$key]);
         }
     }
     if (!empty($params)) {
         foreach ($params as $key => $value) {
             $values[$key] = $value;
         }
         foreach ($this->_grantIds as $grantId) {
             $ids['grant_id'] = $grantId;
             CRM_Grant_BAO_Grant::add($values, $ids);
             $updatedGrants++;
         }
     }
     $status = ts('Updated Grant(s): %1 (Total Selected: %2)', array(1 => $updatedGrants, 2 => count($this->_grantIds)));
     CRM_Core_Session::setStatus($status, '', 'info');
     CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/grant/search', 'force=1&qfKey=' . $qfKey));
 }