Commit 21dfd5f5 authored by totten's avatar totten

INFRA-132 - Trailing commas for multiline arrays

parent 7cdbcb16
......@@ -351,7 +351,7 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity {
$acParams = array(
'activity_id' => $activityId,
'contact_id' => $params['source_contact_id'],
'record_type_id' => $sourceID
'record_type_id' => $sourceID,
);
self::deleteActivityContact($activityId, $sourceID);
CRM_Activity_BAO_ActivityContact::create($acParams);
......@@ -1564,7 +1564,7 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND
$activityTargetParams = array(
'activity_id' => $activityID,
'contact_id' => $toID,
'record_type_id' => $targetID
'record_type_id' => $targetID,
);
CRM_Activity_BAO_ActivityContact::create($activityTargetParams);
......@@ -1648,7 +1648,7 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND
$activityTargetParams = array(
'activity_id' => $activityID,
'contact_id' => $toID,
'record_type_id' => $targetID
'record_type_id' => $targetID,
);
CRM_Activity_BAO_ActivityContact::create($activityTargetParams);
return TRUE;
......@@ -2182,7 +2182,7 @@ AND cl.modified_id = c.id
'case_recent_activity_date' => array('title' => ts('Activity Actual Date'), 'type' => CRM_Utils_Type::T_DATE),
'case_scheduled_activity_date' => array(
'title' => ts('Activity Scheduled Date'),
'type' => CRM_Utils_Type::T_DATE
'type' => CRM_Utils_Type::T_DATE,
),
'case_recent_activity_type' => array('title' => ts('Activity Type'), 'type' => CRM_Utils_Type::T_STRING),
'case_activity_status' => array('title' => ts('Activity Status'), 'type' => CRM_Utils_Type::T_STRING),
......@@ -2191,7 +2191,7 @@ AND cl.modified_id = c.id
'case_activity_details' => array('title' => ts('Activity Details'), 'type' => CRM_Utils_Type::T_TEXT),
'case_activity_is_auto' => array(
'title' => ts('Activity Auto-generated?'),
'type' => CRM_Utils_Type::T_BOOLEAN
'type' => CRM_Utils_Type::T_BOOLEAN,
),
);
......
......@@ -93,7 +93,7 @@ AND contact_a.is_deleted = 0
";
$params = array(
1 => array($activityID, 'Integer'),
2 => array($recordTypeID, 'Integer')
2 => array($recordTypeID, 'Integer'),
);
$dao = CRM_Core_DAO::executeQuery($query, $params);
......@@ -130,7 +130,7 @@ AND civicrm_contact.is_deleted = 0
";
$params = array(
1 => array($activityID, 'Integer'),
2 => array($recordTypeID, 'Integer')
2 => array($recordTypeID, 'Integer'),
);
$dao = CRM_Core_DAO::executeQuery($sql, $params);
......
......@@ -146,14 +146,14 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
'type' => 'text',
'label' => ts('Location'),
'attributes' => CRM_Core_DAO::getAttribute('CRM_Activity_DAO_Activity', 'location'),
'required' => FALSE
'required' => FALSE,
),
'details' => array(
'type' => 'wysiwyg',
'label' => ts('Details'),
// forces a smaller edit window
'attributes' => array('rows' => 4, 'cols' => 60),
'required' => FALSE
'required' => FALSE,
),
'status_id' => array(
'type' => 'select',
......@@ -166,12 +166,12 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
'source_contact_id' => array(
'type' => 'entityRef',
'label' => ts('Added By'),
'required' => FALSE
'required' => FALSE,
),
'target_contact_id' => array(
'type' => 'entityRef',
'label' => ts('With Contact'),
'attributes' => array('multiple' => TRUE, 'create' => TRUE)
'attributes' => array('multiple' => TRUE, 'create' => TRUE),
),
'assignee_contact_id' => array(
'type' => 'entityRef',
......@@ -195,8 +195,8 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
'label' => ts('Subject'),
'attributes' => CRM_Core_DAO::getAttribute('CRM_Activity_DAO_Activity',
'subject'
)
)
),
),
);
if (($this->_context == 'standalone') &&
......@@ -279,7 +279,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
if ($this->_activityId &&
in_array($this->_action, array(
CRM_Core_Action::UPDATE,
CRM_Core_Action::VIEW
CRM_Core_Action::VIEW,
)) &&
!CRM_Activity_BAO_Activity::checkPermission($this->_activityId, $this->_action)
) {
......@@ -417,7 +417,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
'standalone',
'home',
'dashlet',
'dashletFullscreen'
'dashletFullscreen',
))
) {
$urlParams = 'reset=1';
......@@ -610,12 +610,12 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
'type' => 'next',
'name' => $button,
'spacing' => '         ',
'isDefault' => TRUE
'isDefault' => TRUE,
),
array(
'type' => 'cancel',
'name' => ts('Cancel')
)
'name' => ts('Cancel'),
),
));
return;
}
......@@ -765,7 +765,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
$buttons = array();
$buttons[] = array(
'type' => 'cancel',
'name' => ts('Done')
'name' => ts('Done'),
);
$this->addButtons($buttons);
}
......@@ -780,12 +780,12 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
'type' => 'upload',
'name' => ts('Save'),
'js' => $js,
'isDefault' => TRUE
'isDefault' => TRUE,
),
array(
'type' => 'cancel',
'name' => ts('Cancel')
)
'name' => ts('Cancel'),
),
)
);
}
......@@ -875,7 +875,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
// delete tags for the entity
$tagParams = array(
'entity_table' => 'civicrm_activity',
'entity_id' => $this->_activityId
'entity_id' => $this->_activityId,
);
CRM_Core_BAO_EntityTag::del($tagParams);
......@@ -987,7 +987,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
),
'linkedColumns' => array('activity_id'),
'isRecurringEntityRecord' => FALSE,
)
),
);
CRM_Core_Form_RecurringEntity::postProcess($params, 'civicrm_activity', $linkedEntities);
......@@ -1129,7 +1129,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
array(
1 => $subject,
2 => $followupStatus,
3 => $mailStatus
3 => $mailStatus,
)
), ts('Saved'), 'success');
......
......@@ -325,7 +325,7 @@ class CRM_Activity_Import_Form_MapField extends CRM_Import_Form_MapField {
$errors['_qf_default'] .= ts('Missing required field: Provide %1 or %2',
array(
1 => $title,
2 => 'Activity Type Label'
2 => 'Activity Type Label',
)) . '<br />';
}
}
......
......@@ -82,7 +82,7 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser {
'activity_label' => array(
'title' => ts('Activity Type Label'),
'headerPattern' => '/(activity.)?type label?/i',
)
),
));
foreach ($fields as $name => $field) {
......
......@@ -118,7 +118,7 @@ class CRM_Activity_Page_AJAX {
0 => 'relation',
1 => 'name',
2 => 'phone',
3 => 'email'
3 => 'email',
);
$sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
......@@ -183,7 +183,7 @@ class CRM_Activity_Page_AJAX {
1 => 'name',
2 => 'phone',
3 => 'email',
4 => 'actions'
4 => 'actions',
);
$sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
......@@ -374,7 +374,7 @@ class CRM_Activity_Page_AJAX {
}
else {
$otherActivity->subject = ts('(Filed on case %1)', array(
1 => $params['caseID']
1 => $params['caseID'],
)) . ' ' . $otherActivity->subject;
}
$otherActivity->activity_date_time = $actDateTime;
......@@ -398,7 +398,7 @@ class CRM_Activity_Page_AJAX {
$src_params = array(
'activity_id' => $mainActivityId,
'contact_id' => $sourceContactID,
'record_type_id' => $sourceID
'record_type_id' => $sourceID,
);
CRM_Activity_BAO_ActivityContact::create($src_params);
......@@ -406,7 +406,7 @@ class CRM_Activity_Page_AJAX {
$targ_params = array(
'activity_id' => $mainActivityId,
'contact_id' => $value,
'record_type_id' => $targetID
'record_type_id' => $targetID,
);
CRM_Activity_BAO_ActivityContact::create($targ_params);
}
......@@ -420,7 +420,7 @@ class CRM_Activity_Page_AJAX {
$assigneeParams = array(
'activity_id' => $mainActivityId,
'contact_id' => $value,
'record_type_id' => $assigneeID
'record_type_id' => $assigneeID,
);
CRM_Activity_BAO_ActivityContact::create($assigneeParams);
}
......
......@@ -103,16 +103,16 @@ class CRM_Admin_Form_LabelFormats extends CRM_Admin_Form {
$this->add('select', 'paper_size', ts('Sheet Size'),
array(
0 => ts('- default -')
0 => ts('- default -'),
) + CRM_Core_BAO_PaperSize::getList(TRUE), FALSE,
array(
'onChange' => "selectPaper( this.value );"
'onChange' => "selectPaper( this.value );",
) + $disabled
);
$this->add('static', 'paper_dimensions', NULL, ts('Sheet Size (w x h)'));
$this->add('select', 'orientation', ts('Orientation'), CRM_Core_BAO_LabelFormat::getPageOrientations(), FALSE,
array(
'onChange' => "updatePaperDimensions();"
'onChange' => "updatePaperDimensions();",
) + $disabled
);
$this->add('select', 'font_name', ts('Font Name'), CRM_Core_BAO_LabelFormat::getFontNames($this->_group));
......@@ -137,7 +137,7 @@ class CRM_Admin_Form_LabelFormats extends CRM_Admin_Form {
$this->addRule('label', ts('Name already exists in Database.'), 'objectExists', array(
'CRM_Core_BAO_LabelFormat',
$this->_id
$this->_id,
));
$this->addRule('NX', ts('Must be an integer'), 'integer');
$this->addRule('NY', ts('Must be an integer'), 'integer');
......
......@@ -431,7 +431,7 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
'entity_table' => 'civicrm_option_value',
'entity_id' => $optionValue->id,
'account_relationship' => $relationTypeId,
'financial_account_id' => $params['financial_account_id']
'financial_account_id' => $params['financial_account_id'],
);
CRM_Financial_BAO_FinancialTypeAccount::add($params);
}
......
......@@ -406,7 +406,7 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form {
'entity_table' => 'civicrm_payment_processor',
'entity_id' => $dao->id,
'account_relationship' => $relationTypeId,
'financial_account_id' => $values['financial_account_id']
'financial_account_id' => $values['financial_account_id'],
);
CRM_Financial_BAO_FinancialTypeAccount::add($params);
}
......
......@@ -61,8 +61,8 @@ class CRM_Admin_Form_Preferences_Event extends CRM_Admin_Form_Preferences {
'title' => ts('Dashboard entries'),
'weight' => 2,
'description' => ts('Configure how many events should be shown on the dashboard. This overrides the default value of 10 entries.'),
'option_values' => array('' => ts('- select -')) + $optionValues + array(-1 => ts('show all'))
)
'option_values' => array('' => ts('- select -')) + $optionValues + array(-1 => ts('show all')),
),
),
);
......
......@@ -306,12 +306,12 @@ class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form {
$recipientKind = array(
'participant_role' => array(
'name' => 'participant role',
'target_id' => 'recipient_listing'
'target_id' => 'recipient_listing',
),
'manual' => array(
'name' => 'recipient',
'target_id' => 'recipient_manual_id'
)
'target_id' => 'recipient_manual_id',
),
);
if (!empty($fields['limit_to']) && array_key_exists($fields['recipient'], $recipientKind) && empty($fields[$recipientKind[$fields['recipient']]['target_id']])) {
$errors[$recipientKind[$fields['recipient']]['target_id']] = ts('If "Also include" or "Limit to" are selected, you must specify at least one %1', array(1 => $recipientKind[$fields['recipient']]['name']));
......
......@@ -100,7 +100,7 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form {
'version' => 3,
'name' => $setting,
'group' => $group,
'default_value' => CRM_Utils_Array::value('default', $settingMetaData['values'][$setting])
'default_value' => CRM_Utils_Array::value('default', $settingMetaData['values'][$setting]),
)
);
}
......
......@@ -50,7 +50,7 @@ class CRM_Admin_Form_Setting_Url extends CRM_Admin_Form_Setting {
public function buildQuickForm() {
CRM_Utils_System::setTitle(ts('Settings - Resource URLs'));
$settingFields = civicrm_api('setting', 'getfields', array(
'version' => 3
'version' => 3,
));
$this->addElement('text', 'userFrameworkResourceURL', ts('CiviCRM Resource URL'));
......
......@@ -102,7 +102,7 @@ class CRM_Admin_Page_AJAX {
$comps = array(
'Event' => 'civicrm_event',
'Contribution' => 'civicrm_contribution_page',
'EventTemplate' => 'civicrm_event_template'
'EventTemplate' => 'civicrm_event_template',
);
$contexts = array();
foreach ($comps as $name => $table) {
......
......@@ -143,7 +143,7 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic {
'communication_style',
'case_status', 'encounter_medium',
'case_type', 'payment_instrument',
'soft_credit_type', 'website_type'
'soft_credit_type', 'website_type',
)
)) {
$this->assign('showIsDefault', TRUE);
......
......@@ -231,7 +231,7 @@ class CRM_Badge_BAO_Badge {
'cap' => 'round',
'join' => 'round',
'dash' => '2,2',
'color' => array(0, 0, 200)
'color' => array(0, 0, 200),
));
$rowCount = CRM_Badge_Form_Layout::FIELD_ROWCOUNT;
......
......@@ -54,7 +54,7 @@ class CRM_Badge_Form_Layout extends CRM_Admin_Form {
$resources = CRM_Core_Resources::singleton();
$resources->addSetting(
array(
'kcfinderPath' => $config->userFrameworkResourceURL . 'packages' . DIRECTORY_SEPARATOR
'kcfinderPath' => $config->userFrameworkResourceURL . 'packages' . DIRECTORY_SEPARATOR,
)
);
$resources->addScriptFile('civicrm', 'templates/CRM/Badge/Form/Layout.js', 1, 'html-header');
......@@ -75,7 +75,7 @@ class CRM_Badge_Form_Layout extends CRM_Admin_Form {
'{event.event_id}' => ts('Event ID'),
'{event.title}' => ts('Event Title'),
'{event.start_date}' => ts('Event Start Date'),
'{event.end_date}' => ts('Event End Date')
'{event.end_date}' => ts('Event End Date'),
);
$participantTokens = CRM_Core_SelectValues::participantTokens();
......
......@@ -469,7 +469,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch {
'url' => 'civicrm/file',
'qs' => 'reset=1&id=%%fid%%&eid=%%eid%%',
'title' => ts('Download Batch'),
)
),
);
}
else {
......@@ -491,7 +491,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch {
'url' => 'civicrm/batch',
'qs' => 'action=delete&id=%%id%%',
'title' => ts('Delete Batch'),
)
),
);
}
return $links;
......
......@@ -175,12 +175,12 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form {
array(
'type' => 'upload',
'name' => ts('Validate & Process the Batch'),
'isDefault' => TRUE
'isDefault' => TRUE,
),
array(
'type' => 'cancel',
'name' => ts('Save & Continue Later'),
)
),
)
);
......@@ -352,7 +352,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form {
'join_date' => $currentDate,
'receive_date' => $currentDate,
'receive_date_time' => $currentTime,
'contribution_status_id' => $completeStatus
'contribution_status_id' => $completeStatus,
);
for ($rowNumber = 1; $rowNumber <= $this->_batchInfo['item_count']; $rowNumber++) {
......@@ -589,14 +589,14 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form {
$dateTypes = array(
'join_date' => 'joinDate',
'membership_start_date' => 'startDate',
'membership_end_date' => 'endDate'
'membership_end_date' => 'endDate',
);
$dates = array(
'join_date',
'start_date',
'end_date',
'reminder_date'
'reminder_date',
);
// get the price set associated with offline memebership
......@@ -713,7 +713,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form {
$editedFieldParams = array(
'price_set_id' => $priceSetId,
'name' => $value['membership_type'][0]
'name' => $value['membership_type'][0],
);
$editedResults = array();
......@@ -726,7 +726,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form {
$fid = $editedResults['id'];
$editedFieldParams = array(
'price_field_id' => $editedResults['id'],
'membership_type_id' => $value['membership_type_id']
'membership_type_id' => $value['membership_type_id'],
);
$editedResults = array();
......
......@@ -244,7 +244,7 @@ SELECT petition.id as id,
$params = array(
1 => array($activity_id, 'Integer'),
2 => array($contact_id, 'Integer'),
3 => array($sourceID, 'Integer')
3 => array($sourceID, 'Integer'),
);
CRM_Core_DAO::executeQuery($sql, $params);
......@@ -305,7 +305,7 @@ AND tag_id = ( SELECT id FROM civicrm_tag WHERE name = %2 )";
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
$params = array(
1 => array($surveyId, 'Integer'),
2 => array($sourceID, 'Integer')
2 => array($sourceID, 'Integer'),
);
$sql .= " GROUP BY civicrm_address.country_id";
$fields = array('total', 'country_id', 'country_iso', 'country');
......@@ -515,7 +515,7 @@ AND tag_id = ( SELECT id FROM civicrm_tag WHERE name = %2 )";
2 => array($surveyId, 'Integer'),
3 => array($surveyInfo['activity_type_id'], 'Integer'),
4 => array($contactId, 'Integer'),
5 => array($sourceID, 'Integer')
5 => array($sourceID, 'Integer'),
);
$dao = CRM_Core_DAO::executeQuery($sql, $params);
......
......@@ -669,7 +669,7 @@ INNER JOIN civicrm_contact contact_a ON ( activityTarget.contact_id = contact_a
'status_id' => $activity->status_id,
'interviewer_id' => $activity->interviewer_id,
'result' => $activity->result,
'activity_date_time' => $activity->activity_date_time
'activity_date_time' => $activity->activity_date_time,
);
}
......
......@@ -206,7 +206,7 @@ class CRM_Campaign_Form_Petition extends CRM_Core_Form {
// custom group id
$this->add('select', 'profile_id', ts('Activity Profile'),
array(
'' => ts('- select -')
'' => ts('- select -'),
) + $customProfiles
);
......
......@@ -81,7 +81,7 @@ class CRM_Campaign_Form_Survey_Questions extends CRM_Campaign_Form_Survey {
array(
1 => $activityTypes[$subTypeId],
2 => CRM_Utils_System::url('civicrm/admin/custom/group', 'action=add&reset=1'),
3 => '_blank'
3 => '_blank',
)
)
);
......
......@@ -118,7 +118,7 @@ class CRM_Campaign_Form_Survey_Results extends CRM_Campaign_Form_Survey {
'option_group_id',
ts('Select Result Set'),
array(
'' => ts('- select -')
'' => ts('- select -'),
) + $optionGroups, FALSE,
array('onChange' => 'loadOptionGroup( )')
);
......@@ -128,7 +128,7 @@ class CRM_Campaign_Form_Survey_Results extends CRM_Campaign_Form_Survey {
ts('Survey Responses'),
$optionTypes,
array(
'onclick' => "showOptionSelect();"
'onclick' => "showOptionSelect();",
), '<br/>', TRUE
);
......@@ -199,7 +199,7 @@ class CRM_Campaign_Form_Survey_Results extends CRM_Campaign_Form_Survey {
$this->addFormRule(array(
'CRM_Campaign_Form_Survey_Results',
'formRule'
'formRule',
), $this);
parent::buildQuickForm();
......@@ -429,7 +429,7 @@ class CRM_Campaign_Form_Survey_Results extends CRM_Campaign_Form_Survey {
array(
1 => array(
'column' => 'sort_name',
'order' => 'ASC'
'order' => 'ASC',
),
);
// for WalkList or default
......@@ -440,7 +440,7 @@ class CRM_Campaign_Form_Survey_Results extends CRM_Campaign_Form_Survey {
'street_number',
'street_name',
'street_unit',
'survey_response'
'survey_response',
);
if (CRM_Core_OptionGroup::getValue('activity_type', 'WalkList') ==
$this->_values['activity_type_id']
......@@ -449,19 +449,19 @@ class CRM_Campaign_Form_Survey_Results extends CRM_Campaign_Form_Survey {
array(
1 => array(
'column' => 'street_name',
'order' => 'ASC'
'order' => 'ASC',
),
2 => array(
'column' => 'street_number_odd_even',
'order' => 'ASC'
'order' => 'ASC',
),
3 => array(
'column' => 'street_number',
'order' => 'ASC'
'order' => 'ASC',