* @param array $params
*/
public function setApiFilter(&$params) {
- if (CRM_Utils_Array::value('target_contact_id', $params)) {
+ if (!empty($params['target_contact_id'])) {
$this->selectAdd();
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
foreach ($activities as $key => $value) {
//Check if recurring activity
- if (CRM_Utils_Array::value('is_recurring_activity', $value)) {
+ if (!empty($value['is_recurring_activity'])) {
if ($key == $value['is_recurring_activity']) {
$activities[$key]['activity_type'] = $activities[$key]['activity_type'] . '<br/><span class="bold">Recurring Activity - (Parent)</span>';
}
$startOffset = CRM_Utils_Array::value('height_image_2', $formattedRow);
}
- if (CRM_Utils_Array::value('participant_image', $formattedRow)) {
+ if (!empty($formattedRow['participant_image'])) {
$imageAlign = 0;
switch (CRM_Utils_Array::value('alignment_participant_image', $formattedRow)) {
case 'R':
$this->assign('dataArray', $taxRate);
}
else {
- if (CRM_Utils_Array::value('price_set_id', $submittedValues)) {
+ if (!empty($submittedValues['price_set_id'])) {
$this->assign('totalTaxAmount', $submittedValues['tax_amount']);
$this->assign('getTaxDetails', $getTaxDetails);
$this->assign('dataArray', $taxRate);
$contactID = CRM_Core_Session::singleton()->get('userID');
$allDashlets = CRM_Utils_Array::index(array('name'), $getDashlets['values']);
$defaultDashlets = array();
- if (CRM_Utils_Array::value('blog', $allDashlets)) {
+ if (!empty($allDashlets['blog'])) {
$defaultDashlets['blog'] = array(
'dashboard_id' => $allDashlets['blog']['id'],
'is_active' => 1,
* @return object
*/
public static function add(&$params) {
- if (CRM_Utils_Array::value('id', $params)) {
+ if (!empty($params['id'])) {
CRM_Utils_Hook::pre('edit', 'RecurringEntity', $params['id'], $params);
}
else {
$daoRecurringEntity->find(TRUE);
$result = $daoRecurringEntity->save();
- if (CRM_Utils_Array::value('id', $params)) {
+ if (!empty($params['id'])) {
CRM_Utils_Hook::post('edit', 'RecurringEntity', $daoRecurringEntity->id, $daoRecurringEntity);
}
else {
*/
public function mapFormValuesToDB($formParams = array()) {
$dbParams = array();
- if (CRM_Utils_Array::value('used_for', $formParams)) {
+ if (!empty($formParams['used_for'])) {
$dbParams['used_for'] = $formParams['used_for'];
}
- if (CRM_Utils_Array::value('entity_id', $formParams)) {
+ if (!empty($formParams['entity_id'])) {
$dbParams['entity_value'] = $formParams['entity_id'];
}
- if (CRM_Utils_Array::value('repetition_start_date', $formParams)) {
- if (CRM_Utils_Array::value('repetition_start_date_display', $formParams)) {
+ if (!empty($formParams['repetition_start_date'])) {
+ if (!empty($formParams['repetition_start_date_display'])) {
$repetitionStartDate = $formParams['repetition_start_date_display'];
}
else {
$repetitionStartDate = $formParams['repetition_start_date'];
}
- if (CRM_Utils_Array::value('repetition_start_date_time', $formParams)) {
+ if (!empty($formParams['repetition_start_date_time'])) {
$repetitionStartDate = $repetitionStartDate . " " . $formParams['repetition_start_date_time'];
}
$repetition_start_date = new DateTime($repetitionStartDate);
$dbParams['start_action_date'] = CRM_Utils_Date::processDate($repetition_start_date->format('Y-m-d H:i:s'));
}
- if (CRM_Utils_Array::value('repetition_frequency_unit', $formParams)) {
+ if (!empty($formParams['repetition_frequency_unit'])) {
$dbParams['repetition_frequency_unit'] = $formParams['repetition_frequency_unit'];
}
- if (CRM_Utils_Array::value('repetition_frequency_interval', $formParams)) {
+ if (!empty($formParams['repetition_frequency_interval'])) {
$dbParams['repetition_frequency_interval'] = $formParams['repetition_frequency_interval'];
}
//For Repeats on:(weekly case)
if ($formParams['repetition_frequency_unit'] == 'week') {
- if (CRM_Utils_Array::value('start_action_condition', $formParams)) {
+ if (!empty($formParams['start_action_condition'])) {
$repeats_on = CRM_Utils_Array::value('start_action_condition', $formParams);
$dbParams['start_action_condition'] = implode(",", array_keys($repeats_on));
}
//For Repeats By:(monthly case)
if ($formParams['repetition_frequency_unit'] == 'month') {
if ($formParams['repeats_by'] == 1) {
- if (CRM_Utils_Array::value('limit_to', $formParams)) {
+ if (!empty($formParams['limit_to'])) {
$dbParams['limit_to'] = $formParams['limit_to'];
}
}
//For "Ends" - After:
if ($formParams['ends'] == 1) {
- if (CRM_Utils_Array::value('start_action_offset', $formParams)) {
+ if (!empty($formParams['start_action_offset'])) {
$dbParams['start_action_offset'] = $formParams['start_action_offset'];
}
}
//For "Ends" - On:
if ($formParams['ends'] == 2) {
- if (CRM_Utils_Array::value('repeat_absolute_date', $formParams)) {
+ if (!empty($formParams['repeat_absolute_date'])) {
$dbParams['absolute_date'] = CRM_Utils_Date::processDate($formParams['repeat_absolute_date']);
}
}
$r->count($scheduleReminderDetails['start_action_offset']);
}
- if (CRM_Utils_Array::value('absolute_date', $scheduleReminderDetails)) {
+ if (!empty($scheduleReminderDetails['absolute_date'])) {
$absoluteDate = CRM_Utils_Date::setDateDefaults($scheduleReminderDetails['absolute_date']);
$endDate = new DateTime($absoluteDate[0] . ' ' . $absoluteDate[1]);
$endDate->modify('+1 day');
);
$defaults = array();
CRM_Core_DAO::commonRetrieve($dao, $params, $defaults);
- if (CRM_Utils_Array::value('id', $defaults)) {
+ if (!empty($defaults['id'])) {
$result['entityId'] = $defaults['id'];
$result['entityTable'] = $entityTable;
}
if ($values['allowRepeatConfigToSubmit'] == 1) {
$dayOfTheWeek = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday');
//Repeats
- if (!CRM_Utils_Array::value('repetition_frequency_unit', $values)) {
+ if (empty($values['repetition_frequency_unit'])) {
$errors['repetition_frequency_unit'] = ts('This is a required field');
}
//Repeats every
- if (!CRM_Utils_Array::value('repetition_frequency_interval', $values)) {
+ if (empty($values['repetition_frequency_interval'])) {
$errors['repetition_frequency_interval'] = ts('This is a required field');
}
//Ends
- if (CRM_Utils_Array::value('ends', $values)) {
+ if (!empty($values['ends'])) {
if ($values['ends'] == 1) {
if (empty($values['start_action_offset'])) {
$errors['start_action_offset'] = ts('This is a required field');
}
}
if ($values['ends'] == 2) {
- if (CRM_Utils_Array::value('repeat_absolute_date', $values)) {
+ if (!empty($values['repeat_absolute_date'])) {
$entityStartDate = CRM_Utils_Date::processDate($values['repetition_start_date']);
$end = CRM_Utils_Date::processDate($values['repeat_absolute_date']);
if (($end < $entityStartDate) && ($end != 0)) {
}
//Repeats BY
- if (CRM_Utils_Array::value('repeats_by', $values)) {
+ if (!empty($values['repeats_by'])) {
if ($values['repeats_by'] == 1) {
- if (CRM_Utils_Array::value('limit_to', $values)) {
+ if (!empty($values['limit_to'])) {
if ($values['limit_to'] < 1 && $values['limit_to'] > 31) {
$errors['limit_to'] = ts('Invalid day of the month');
}
}
}
if ($values['repeats_by'] == 2) {
- if (CRM_Utils_Array::value('entity_status_1', $values)) {
+ if (!empty($values['entity_status_1'])) {
$dayOfTheWeekNo = array('first', 'second', 'third', 'fourth', 'last');
if (!in_array($values['entity_status_1'], $dayOfTheWeekNo)) {
$errors['entity_status_1'] = ts('Invalid option');
else {
$errors['entity_status_1'] = ts('Invalid option');
}
- if (CRM_Utils_Array::value('entity_status_2', $values)) {
+ if (!empty($values['entity_status_2'])) {
if (!in_array($values['entity_status_2'], $dayOfTheWeek)) {
$errors['entity_status_2'] = ts('Invalid day name');
}
*/
public static function postProcess($params = array(), $type, $linkedEntities = array()) {
//Check entity_id not present in params take it from class variable
- if (!CRM_Utils_Array::value('entity_id', $params)) {
+ if (empty($params['entity_id'])) {
$params['entity_id'] = self::$_entityId;
}
//Process this function only when you get this variable
if ($params['allowRepeatConfigToSubmit'] == 1) {
if (CRM_Utils_Array::value('entity_table', $params) && CRM_Utils_Array::value('entity_id', $params) && $type) {
$params['used_for'] = $type;
- if (!CRM_Utils_Array::value('parent_entity_id', $params)) {
+ if (empty($params['parent_entity_id'])) {
$params['parent_entity_id'] = self::$_parentEntityId;
}
- if (CRM_Utils_Array::value('schedule_reminder_id', $params)) {
+ if (!empty($params['schedule_reminder_id'])) {
$params['id'] = $params['schedule_reminder_id'];
}
else {
$dbParams = $recurobj->mapFormValuesToDB($params);
//Delete repeat configuration and rebuild
- if (CRM_Utils_Array::value('id', $params)) {
+ if (!empty($params['id'])) {
CRM_Core_BAO_ActionSchedule::del($params['id']);
unset($params['id']);
}
$recursion->excludeDates = $excludeDateList;
$recursion->excludeDateRangeColumns = $params['excludeDateRangeColumns'];
}
- if (CRM_Utils_Array::value('intervalDateColumns', $params)) {
+ if (!empty($params['intervalDateColumns'])) {
$recursion->intervalDateColumns = $params['intervalDateColumns'];
}
$recursion->entity_id = $params['entity_id'];
$entityId = CRM_Utils_Type::escape($_REQUEST['entityId'], 'Integer');
$entityTable = CRM_Utils_Type::escape($_REQUEST['entityTable'], 'String');
- if (CRM_Utils_Array::value('linkedEntityTable', $_REQUEST)) {
+ if (!empty($_REQUEST['linkedEntityTable'])) {
$result = CRM_Core_BAO_RecurringEntity::updateModeLinkedEntity($entityId, $_REQUEST['linkedEntityTable'], $entityTable);
}
public static function dedupeRuleFieldsWeight($params) {
$rgBao = new CRM_Dedupe_BAO_RuleGroup();
$rgBao->contact_type = $params['contact_type'];
- if (CRM_Utils_Array::value('id', $params)) {
+ if (!empty($params['id'])) {
// accept an ID if provided
$rgBao->id = $params['id'];
}
CRM_Event_BAO_Participant::changeFeeSelections($params, $this->_participantId, $this->_contributionId, $feeBlock, $lineItems, $this->_paidAmount, $params['priceSetId']);
$this->contributionAmt = CRM_Core_DAO::getFieldValue('CRM_Contribute_BAO_Contribution', $this->_contributionId, 'total_amount');
// email sending
- if (CRM_Utils_Array::value('send_receipt', $params)) {
+ if (!empty($params['send_receipt'])) {
$fetchParticipantVals = array('id' => $this->_participantId);
CRM_Event_BAO_Participant::getValues($fetchParticipantVals, $participantDetails, CRM_Core_DAO::$_nullArray);
$participantParams = array_merge($params, $participantDetails[$this->_participantId]);
foreach ($params['price_set_id'] as $priceSetID) {
CRM_Price_BAO_PriceSet::addTo('civicrm_' . $entityName, $entity->id, $priceSetID);
//@todo - how should we do this - copied from form
- //if (CRM_Utils_Array::value('price_field_id', $params)) {
+ //if (!empty($params['price_field_id'])) {
// $priceSetID = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $params['price_field_id'], 'price_set_id');
// CRM_Price_BAO_PriceSet::setIsQuickConfig($priceSetID, 0);
//}
$chart = "&charts=" . $params['charts'];
}
$limitResult = NULL;
- if (CRM_Utils_Array::value('row_count', $params)) {
+ if (!empty($params['row_count'])) {
$limitResult = '&rowCount=' . $params['row_count'];
}
$dashletParams['name'] = "report/{$instance->id}";