X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FGrant%2FBAO%2FGrant.php;h=11d673128c925dc8a12158ec6d233635da311bed;hb=e36fd3bcbdf7abf8968fa6de2c6fb1f4e76919d3;hp=f0a91cfbb4e3ac654256c68bb3e562db5c722af8;hpb=52df19870805bf5a2bae2388a1f6c5a0309c2d92;p=civicrm-core.git diff --git a/CRM/Grant/BAO/Grant.php b/CRM/Grant/BAO/Grant.php index f0a91cfbb4..11d673128c 100644 --- a/CRM/Grant/BAO/Grant.php +++ b/CRM/Grant/BAO/Grant.php @@ -1,9 +1,9 @@ contact_id) || !isset($grant->grant_type_id)){ $grant->find(TRUE); } @@ -234,7 +238,7 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant { ); } - if (CRM_Utils_Array::value('grant', $ids)) { + if (!empty($ids['grant'])) { CRM_Utils_Hook::post('edit', 'Grant', $grant->id, $grant); } else { @@ -248,8 +252,9 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant { * function to create the event * * @param array $params reference array contains the values submitted by the form - * @param array $ids reference array contains the id + * @param array $ids reference array contains the id * + * @return object * @access public * @static * @@ -269,7 +274,7 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant { if (!$id) { $id = CRM_Utils_Array::value('contact_id', $params); } - if (CRM_Utils_Array::value('note', $params) || CRM_Utils_Array::value('id', CRM_Utils_Array::value('note',$ids))) { + if (!empty($params['note']) || CRM_Utils_Array::value('id', CRM_Utils_Array::value('note', $ids))) { $noteParams = array( 'entity_table' => 'civicrm_grant', 'note' => $params['note'] = $params['note'] ? $params['note'] : "null", @@ -278,7 +283,7 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant { 'modified_date' => date('Ymd'), ); - CRM_Core_BAO_Note::add($noteParams, $ids['note']); + CRM_Core_BAO_Note::add($noteParams, (array) CRM_Utils_Array::value('note', $ids)); } // Log the information on successful add/edit of Grant $logParams = array( @@ -291,7 +296,7 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant { CRM_Core_BAO_Log::add($logParams); // add custom field values - if (CRM_Utils_Array::value('custom', $params) && is_array($params['custom'])) { + if (!empty($params['custom']) && is_array($params['custom'])) { CRM_Core_BAO_CustomValueTable::store($params['custom'], 'civicrm_grant', $grant->id); } @@ -309,11 +314,13 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant { /** * Function to delete the Contact * - * @param int $cid contact id + * @param $id + * + * @return bool + * @internal param int $cid contact id * * @access public * @static - * */ static function deleteContact($id) { $grant = new CRM_Grant_DAO_Grant(); @@ -325,8 +332,9 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant { /** * Function to delete the grant * - * @param int $id grant id + * @param int $id grant id * + * @return bool|mixed * @access public * @static * @@ -412,7 +420,9 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant { /** * Function to get grant record count for a Contact * - * @param int $contactId Contact ID + * @param $contactID + * + * @internal param int $contactId Contact ID * * @return int count of grant records * @access public