Skip to content

Commit

Permalink
Merge pull request #4971 from kurund/batch-16
Browse files Browse the repository at this point in the history
more cleanup batch 16
  • Loading branch information
kurund committed Jan 18, 2015
2 parents 1766c6f + 79d7553 commit 87878ac
Show file tree
Hide file tree
Showing 53 changed files with 165 additions and 189 deletions.
2 changes: 1 addition & 1 deletion CRM/Activity/Import/Form/DataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function buildQuickForm() {
$this->add('File', 'uploadFile', ts('Import Data File'), 'size=30 maxlength=255', TRUE);
$this->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array(
1 => $uploadSize,
2 => $uploadFileSize
2 => $uploadFileSize,
)), 'maxfilesize', $uploadFileSize);
$this->addRule('uploadFile', ts('A valid file must be uploaded.'), 'uploadedfile');
$this->addRule('uploadFile', ts('Input file must be in CSV format'), 'utf8File');
Expand Down
12 changes: 6 additions & 6 deletions CRM/Activity/Page/AJAX.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public static function getCaseActivity() {
'reporter',
'status',
'links',
'class'
'class',
);

echo CRM_Utils_JSON::encodeDataTableSelector($activities, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
Expand Down Expand Up @@ -293,8 +293,8 @@ public static function getCaseRoles() {
$contactType = $contactType == 'Contact' ? '' : $contactType;
switch ($row['source']) {
case 'caseRel':
$row['actions'] =
'<a href="#editCaseRoleDialog" title="' . ts('Reassign %1', array(1 => $typeLabel)) . '" class="crm-hover-button case-miniform" data-contact_type="' . $contactType . '" data-rel_type="' . $row['relation_type'] . '" data-rel_id="' . $row['rel_id'] . '"data-key="' . CRM_Core_Key::get('civicrm/ajax/relation') . '">' .
$row['actions']
= '<a href="#editCaseRoleDialog" title="' . ts('Reassign %1', array(1 => $typeLabel)) . '" class="crm-hover-button case-miniform" data-contact_type="' . $contactType . '" data-rel_type="' . $row['relation_type'] . '" data-rel_id="' . $row['rel_id'] . '"data-key="' . CRM_Core_Key::get('civicrm/ajax/relation') . '">' .
'<span class="icon ui-icon-pencil"></span>' .
'</a>' .
'<a href="#deleteCaseRoleDialog" title="' . ts('Remove %1', array(1 => $typeLabel)) . '" class="crm-hover-button case-miniform" data-contact_type="' . $contactType . '" data-rel_type="' . $row['relation_type'] . '" data-key="' . CRM_Core_Key::get('civicrm/ajax/delcaserole') . '">' .
Expand All @@ -303,8 +303,8 @@ public static function getCaseRoles() {
break;

case 'caseRoles':
$row['actions'] =
'<a href="#editCaseRoleDialog" title="' . ts('Assign %1', array(1 => $typeLabel)) . '" class="crm-hover-button case-miniform" data-contact_type="' . $contactType . '" data-rel_type="' . $row['relation_type'] . '" data-key="' . CRM_Core_Key::get('civicrm/ajax/relation') . '">' .
$row['actions']
= '<a href="#editCaseRoleDialog" title="' . ts('Assign %1', array(1 => $typeLabel)) . '" class="crm-hover-button case-miniform" data-contact_type="' . $contactType . '" data-rel_type="' . $row['relation_type'] . '" data-key="' . CRM_Core_Key::get('civicrm/ajax/relation') . '">' .
'<span class="icon ui-icon-pencil"></span>' .
'</a>';
break;
Expand Down Expand Up @@ -375,7 +375,7 @@ public static function _convertToCaseActivity($params) {

if (in_array($params['mode'], array(
'move',
'file'
'file',
))) {
$caseActivity = new CRM_Case_DAO_CaseActivity();
$caseActivity->case_id = $params['caseID'];
Expand Down
10 changes: 5 additions & 5 deletions CRM/Activity/Page/UserDashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ class CRM_Activity_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBoar
/**
* List participations for the UF user
*
* @return null
* @return bool
*/
public function listActivities() {

$controller =
new CRM_Core_Controller_Simple(
$controller
= new CRM_Core_Controller_Simple(
'CRM_Activity_Form_Search', ts('Activities'),
NULL,
FALSE, FALSE, TRUE, FALSE
Expand All @@ -61,14 +61,14 @@ public function listActivities() {
$controller->process();
$controller->run();

return;
return FALSE;
}

/**
* the main function that is called when the page
* loads, it decides the which action has to be taken for the page.
*
* @return null
* @return void
*/
public function run() {
parent::preProcess();
Expand Down
10 changes: 2 additions & 8 deletions CRM/Campaign/Form/Survey/Questions.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ class CRM_Campaign_Form_Survey_Questions extends CRM_Campaign_Form_Survey {
* Set default values for the form. Note that in edit/view mode
* the default values are retrieved from the database
*
* @param null
*
* @return array
* array of default values
*/
Expand All @@ -57,8 +55,8 @@ public function setDefaultValues() {
'entity_id' => $this->_surveyId,
);

list($defaults['contact_profile_id'], $second) =
CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
list($defaults['contact_profile_id'], $second)
= CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
$defaults['activity_profile_id'] = $second ? array_shift($second) : '';

return $defaults;
Expand All @@ -67,8 +65,6 @@ public function setDefaultValues() {
/**
* Build the form object
*
* @param null
*
* @return void
*/
public function buildQuickForm() {
Expand Down Expand Up @@ -107,8 +103,6 @@ public function buildQuickForm() {
/**
* Process the form
*
* @param null
*
* @return void
*/
public function postProcess() {
Expand Down
14 changes: 7 additions & 7 deletions CRM/Contact/Form/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ public function buildQuickForm() {
$tasks = $tasks + CRM_Contact_Task::optionalTaskTitle();
}

$search_custom_id =
CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch', $this->_ssID, 'search_custom_id');
$search_custom_id
= CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch', $this->_ssID, 'search_custom_id');

$savedSearchValues = array(
'id' => $this->_ssID,
Expand Down Expand Up @@ -375,8 +375,8 @@ public function buildQuickForm() {
// check if _groupID exists, it might not if
// we are displaying a hidden group
if (!isset($this->_group[$this->_groupID])) {
$this->_group[$this->_groupID] =
CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $this->_groupID, 'title');
$this->_group[$this->_groupID]
= CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $this->_groupID, 'title');
}

// set the group title
Expand Down Expand Up @@ -417,8 +417,8 @@ public function buildQuickForm() {
// we are displaying a hidden group
if (!isset($this->_group[$this->_amtgID])) {
$this->assign('permissionedForGroup', FALSE);
$this->_group[$this->_amtgID] =
CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $this->_amtgID, 'title');
$this->_group[$this->_amtgID]
= CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $this->_amtgID, 'title');
}

// Set dynamic page title for 'Add Members Group'
Expand Down Expand Up @@ -797,7 +797,7 @@ public function postProcess() {
$setDynamic = FALSE;

if (strpos(self::$_selectorName, 'CRM_Contact_Selector') !== FALSE) {
$selector = new self::$_selectorName (
$selector = new self::$_selectorName(
$this->_customSearchClass,
$this->_formValues,
$this->_params,
Expand Down
2 changes: 1 addition & 1 deletion CRM/Contact/Form/Search/Custom/DateAdded.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL
*
* @return string
*/
function all(
public function all(
$offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
Expand Down
2 changes: 1 addition & 1 deletion CRM/Contact/Form/Search/Custom/Proximity.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public function buildForm(&$form) {
*
* @return string
*/
function all(
public function all(
$offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
Expand Down
12 changes: 6 additions & 6 deletions CRM/Contact/Form/Task/RemoveFromGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,21 @@ public function postProcess() {

$status = array(
ts("%count contact removed from '%2'", array(
'count' => $removed,
'plural' => "%count contacts removed from '%2'",
2 => $group[$groupId]
))
'count' => $removed,
'plural' => "%count contacts removed from '%2'",
2 => $group[$groupId],
)),
);
if ($notRemoved) {
$status[] = ts('1 contact was already not in this group', array(
'count' => $notRemoved,
'plural' => '%count contacts were already not in this group'
'plural' => '%count contacts were already not in this group',
));
}
$status = '<ul><li>' . implode('</li><li>', $status) . '</li></ul>';
CRM_Core_Session::setStatus($status, ts("Removed Contact From Group", array(
'plural' => "Removed Contacts From Group",
'count' => $removed
'count' => $removed,
)), 'success', array('expires' => 0));
}
}
1 change: 0 additions & 1 deletion CRM/Contact/Page/SavedSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public function delete($id) {
$savedSearch->id = $id;
$savedSearch->is_active = 0;
$savedSearch->save();
return;
}

/**
Expand Down
8 changes: 4 additions & 4 deletions CRM/Contact/Selector.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se
*
* @return CRM_Contact_Selector
*/
function __construct(
public function __construct(
$customSearchClass,
$formValues = NULL,
$params = NULL,
Expand Down Expand Up @@ -412,7 +412,7 @@ public function &getColumnHeaders($action = NULL, $output = NULL) {
if (in_array($fieldName, array(
'phone',
'im',
'email'
'email',
))) {
if ($type) {
$name = "`$locationTypeName-$fieldName-$type`";
Expand Down Expand Up @@ -593,7 +593,7 @@ public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) {
if (in_array($fieldName, array(
'phone',
'im',
'email'
'email',
))) {
if ($type) {
$names[] = "{$locationTypeName}-{$fieldName}-{$type}";
Expand Down Expand Up @@ -678,7 +678,7 @@ public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) {
elseif (in_array($property, array(
'addressee',
'email_greeting',
'postal_greeting'
'postal_greeting',
))) {
$greeting = $property . '_display';
$row[$property] = $result->$greeting;
Expand Down
8 changes: 4 additions & 4 deletions CRM/Contribute/BAO/ContributionPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ public static function copy($id) {
* @param int $contributionPageId
* Contribution Page Id.
*
* @return boolean
* @return bool
* true if payment processor supports recurring
* else false
*
Expand Down Expand Up @@ -824,7 +824,7 @@ public static function buildOptions($fieldName, $context = NULL, $props = array(
// Fixme - this is going to ignore context, better to get conditions, add params, and call PseudoConstant::get
return CRM_Financial_BAO_FinancialType::getIncomeFinancialType();

break;
break;
}
return CRM_Core_PseudoConstant::get(__CLASS__, $fieldName, $params, $context);
}
Expand Down Expand Up @@ -925,7 +925,7 @@ public static function addInvoicePdfToEmail($contributionId, $userID) {

/**
* Helper to determine if the page supports separate membership payments
* @param int id form id
* @param int $id form id
*
* @return bool
* isSeparateMembershipPayment
Expand All @@ -934,7 +934,7 @@ public static function getIsMembershipPayment($id) {
$membershipBlocks = civicrm_api3('membership_block', 'get', array(
'entity_table' => 'civicrm_contribution_page',
'entity_id' => $id,
'sequential' => TRUE
'sequential' => TRUE,
));
if (!$membershipBlocks['count']) {
return FALSE;
Expand Down
13 changes: 6 additions & 7 deletions CRM/Core/BAO/FinancialTrxn.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public static function create(&$params, $trxnEntityTable = NULL) {
$trxn->save();

// save to entity_financial_trxn table
$entityFinancialTrxnParams =
array(
$entityFinancialTrxnParams
= array(
'entity_table' => "civicrm_contribution",
'financial_trxn_id' => $trxn->id,
'amount' => $params['total_amount'],
Expand Down Expand Up @@ -384,17 +384,16 @@ public static function recordFees($params) {
$params['trxnParams']['from_financial_account_id'] = $params['to_financial_account_id'];
$params['trxnParams']['to_financial_account_id'] = $financialAccount;
$params['trxnParams']['total_amount'] = $amount;
$params['trxnParams']['fee_amount'] =
$params['trxnParams']['net_amount'] = 0;
$params['trxnParams']['fee_amount'] = $params['trxnParams']['net_amount'] = 0;
$params['trxnParams']['status_id'] = CRM_Core_OptionGroup::getValue('contribution_status', 'Completed', 'name');
$params['trxnParams']['contribution_id'] = $contributionId;
$trxn = self::create($params['trxnParams']);
if (empty($params['entity_id'])) {
$financialTrxnID = CRM_Core_BAO_FinancialTrxn::getFinancialTrxnId($params['trxnParams']['contribution_id'], 'DESC');
$params['entity_id'] = $financialTrxnID['financialTrxnId'];
}
$fItemParams =
array(
$fItemParams
= array(
'financial_account_id' => $financialAccount,
'contact_id' => CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Domain', $domainId, 'contact_id'),
'created_date' => date('YmdHis'),
Expand All @@ -416,7 +415,7 @@ public static function recordFees($params) {
* @param int $entityId
* @param string $entityName
* @param bool $returnType
* @param number $lineItemTotal
* @param int $lineItemTotal
*
* @return array|int|NULL|string
* [payment type => amount]
Expand Down
4 changes: 2 additions & 2 deletions CRM/Core/BAO/UFMatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ public static function synchronize(&$user, $update, $uf, $ctype, $isLogin = FALS

// add current contact to recently viewed
if ($ufmatch->contact_id) {
list($displayName, $contactImage, $contactType, $contactSubtype, $contactImageUrl) =
CRM_Contact_BAO_Contact::getDisplayAndImage($ufmatch->contact_id, TRUE, TRUE);
list($displayName, $contactImage, $contactType, $contactSubtype, $contactImageUrl)
= CRM_Contact_BAO_Contact::getDisplayAndImage($ufmatch->contact_id, TRUE, TRUE);

$otherRecent = array(
'imageUrl' => $contactImageUrl,
Expand Down
10 changes: 5 additions & 5 deletions CRM/Core/SelectValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class CRM_Core_SelectValues {

/**
* Preferred mail format
*
*
* @return array
*/
public static function pmf() {
Expand Down Expand Up @@ -81,7 +81,7 @@ public static function contactType() {

/**
* Various pre defined unit list
*
*
* @param string $unitType
* @return array
*/
Expand Down Expand Up @@ -762,7 +762,7 @@ public static function getTimeFormats() {

/**
* Get numeric options
*
*
* @param int $start
* @param int $end
*
Expand Down Expand Up @@ -975,8 +975,8 @@ public static function getScheduleReminderFrequencyUnits() {
static $scheduleReminderFrequencyUnits = NULL;
if (!$scheduleReminderFrequencyUnits) {
$scheduleReminderFrequencyUnits = array(
'hour' => ts('hour')
) + CRM_Core_OptionGroup::values('recur_frequency_units');
'hour' => ts('hour'),
) + CRM_Core_OptionGroup::values('recur_frequency_units');
}

return $scheduleReminderFrequencyUnits;
Expand Down
8 changes: 4 additions & 4 deletions CRM/Core/Smarty/plugins/modifier.mb_truncate.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@
* @link http://smarty.php.net/manual/en/language.modifier.truncate.php
* truncate (Smarty online manual)
*
* @param string
* @param int
* @param string
* @param bool
* @param string $string
* @param int $length
* @param string $etc
* @param bool $break_words
*
* @return string
*/
Expand Down
Loading

0 comments on commit 87878ac

Please sign in to comment.