Skip to content

Commit

Permalink
Merge pull request #4959 from rohankatkar/batch-17
Browse files Browse the repository at this point in the history
INFRA 32 - Batch #17
  • Loading branch information
kurund committed Jan 16, 2015
2 parents f830c1e + acb1052 commit 041d366
Show file tree
Hide file tree
Showing 57 changed files with 138 additions and 194 deletions.
4 changes: 2 additions & 2 deletions CRM/ACL/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class CRM_ACL_API {
* @param int $contactID
* The contactID for whom the check is made.
*
* @return boolean
* @return bool
* true if yes, else false
*/
public static function check($str, $contactID = NULL) {
Expand Down Expand Up @@ -208,7 +208,7 @@ public static function groupPermission(
//adding a way for unit tests to flush the cache
if ($flush) {
$cache = array();
return;
return NULL;
}
if (!$contactID) {
$session = CRM_Core_Session::singleton();
Expand Down
4 changes: 2 additions & 2 deletions CRM/Activity/Import/Form/MapField.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function preProcess() {
'activity_type_id',
'activity_label',
'target_contact_id',
'activity_subject'
'activity_subject',
);
foreach ($requiredFields as $val) {
$highlightedFields[] = $val;
Expand Down Expand Up @@ -195,7 +195,7 @@ public function buildQuickForm() {
$defaults["mapper[$i]"] = array(
$this->defaultFromHeader($this->_columnHeaders[$i],
$headerPatterns
)
),
);
}
else {
Expand Down
4 changes: 2 additions & 2 deletions CRM/Batch/Form/Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public function buildQuickForm() {
for ($rowNumber = 1; $rowNumber <= $this->_batchInfo['item_count']; $rowNumber++) {
$this->addEntityRef("primary_contact_id[{$rowNumber}]", '', array(
'create' => TRUE,
'placeholder' => ts('- select -')
'placeholder' => ts('- select -'),
));

// special field specific to membership batch udpate
Expand Down Expand Up @@ -253,7 +253,7 @@ public function buildQuickForm() {
'contact' => array(
'return' => implode(',', $contactReturnProperties),
'fieldmap' => array_flip($contactReturnProperties),
)
),
));

// don't set the status message when form is submitted.
Expand Down
8 changes: 4 additions & 4 deletions CRM/Campaign/Form/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class CRM_Campaign_Form_Search extends CRM_Core_Form_Search {
*
* @return void
*/
function preProcess() {
public function preProcess() {
$this->_done = FALSE;
$this->_defaults = array();

Expand All @@ -96,7 +96,7 @@ function preProcess() {
if (!in_array($this->_operation, array(
'reserve',
'release',
'interview'
'interview',
))
) {
$this->_operation = 'reserve';
Expand Down Expand Up @@ -232,7 +232,7 @@ public function buildQuickForm() {
$taskValue = array(
$currentTaskValue => ts('Record %1 Responses',
array(1 => $activityTypes[$surveyTypeId])
)
),
);
}

Expand Down Expand Up @@ -356,7 +356,7 @@ public function formatParams() {
$contactType = CRM_Campaign_BAO_Survey::getSurveyContactType(CRM_Utils_Array::value('campaign_survey_id', $this->_formValues));
if ($contactType && in_array($this->_operation, array(
'reserve',
'interview'
'interview',
))
) {
$this->_formValues['contact_type'][$contactType] = 1;
Expand Down
8 changes: 1 addition & 7 deletions CRM/Campaign/Form/Survey/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ public function preProcess() {
* 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 Down Expand Up @@ -143,8 +141,6 @@ public function setDefaultValues() {
/**
* Build the form object
*
* @param null
*
* @return void
*/
public function buildQuickForm() {
Expand Down Expand Up @@ -190,8 +186,6 @@ public function buildQuickForm() {
/**
* Process the form
*
* @param null
*
* @return void
*/
public function postProcess() {
Expand Down Expand Up @@ -229,7 +223,7 @@ public function postProcess() {
1 => array(
$this->_values['result_id'],
'Positive',
)
),
)
);
// delete option group if no any survey is using it.
Expand Down
16 changes: 8 additions & 8 deletions CRM/Campaign/Form/Task/Interview.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ public function preProcess() {
$orderByParams = CRM_Utils_Array::value('order_bys', $_POST);
}
elseif (CRM_Core_OptionGroup::getValue('activity_type', 'WalkList') == $this->_surveyDetails['activity_type_id']) {
$orderByParams =
array(
$orderByParams
= array(
1 => array(
'column' => 'civicrm_address.street_name',
'order' => 'ASC',
Expand Down Expand Up @@ -288,8 +288,8 @@ public function validateIds() {
public function buildQuickForm() {
$this->assign('surveyTypeId', $this->_surveyTypeId);

$options =
array(
$options
= array(
'' => ' - none - ',
'civicrm_address.street_name' => 'Street Name',
'civicrm_address.street_number%2' => 'Odd / Even Street Number',
Expand Down Expand Up @@ -408,8 +408,8 @@ public function setDefaultValues() {
}

if (CRM_Core_OptionGroup::getValue('activity_type', 'WalkList') == $this->_surveyDetails['activity_type_id']) {
$defaults['order_bys'] =
array(
$defaults['order_bys']
= array(
1 => array(
'column' => 'civicrm_address.street_name',
'order' => 'ASC',
Expand All @@ -429,8 +429,8 @@ public function setDefaultValues() {
);
}
else {
$defaults['order_bys'] =
array(
$defaults['order_bys']
= array(
1 => array(
'column' => 'contact_a.sort_name',
'order' => 'ASC',
Expand Down
8 changes: 4 additions & 4 deletions CRM/Case/XMLProcessor/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function run($clientID, $caseID, $activitySetName, $params) {
public function &getRedactionRules() {
foreach (array(
'redactionStringRules',
'redactionRegexRules'
'redactionRegexRules',
) as $key => $rule) {
$$rule = CRM_Case_PseudoConstant::redactionRule($key);

Expand Down Expand Up @@ -96,7 +96,7 @@ public function &getRedactionRules() {
*
* @return array
*/
function &caseInfo(
public function &caseInfo(
$clientID,
$caseID
) {
Expand Down Expand Up @@ -323,7 +323,7 @@ public function &getActivity($clientID, $activityDAO, &$activityTypeInfo) {
$clientID = CRM_Utils_Type::escape($clientID, 'Integer');
if (!in_array($activityTypeInfo['name'], array(
'Email',
'Inbound Email'
'Inbound Email',
))
) {
$activity['editURL'] = CRM_Utils_System::url('civicrm/case/activity',
Expand Down Expand Up @@ -637,7 +637,7 @@ public function getActivityTypeCustomSQL($activityTypeID, $dateFormat = NULL) {
1 => array(
$activityTypeID,
'Integer',
)
),
);
$dao = CRM_Core_DAO::executeQuery($query, $params);

Expand Down
8 changes: 3 additions & 5 deletions CRM/Contact/BAO/Contact/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CRM_Contact_BAO_Contact_Permission {
* Contact id.
* @param int|string $type the type of operation (view|edit)
*
* @return boolean
* @return bool
* true if the user has permission, false otherwise
*/
public static function allow($id, $type = CRM_Core_Permission::VIEW) {
Expand Down Expand Up @@ -143,8 +143,6 @@ public static function cache($userID, $type = CRM_Core_Permission::VIEW, $force

CRM_Core_DAO::executeQuery('DELETE FROM civicrm_acl_contact_cache WHERE contact_id IN (SELECT id FROM civicrm_contact WHERE is_deleted = 1)');
$_processed[$userID] = 1;

return;
}

/**
Expand All @@ -154,9 +152,9 @@ public static function cache($userID, $type = CRM_Core_Permission::VIEW, $force
* @param int $contactID
* Contact id.
*
* @return boolean
* @return bool
*/
static function hasContactsInCache(
public static function hasContactsInCache(
$type = CRM_Core_Permission::VIEW,
$contactID = NULL
) {
Expand Down
2 changes: 0 additions & 2 deletions CRM/Contact/BAO/SavedSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,6 @@ public function buildClause() {
$this->where_tables = serialize($whereTables);
}
}

return;
}

public function save() {
Expand Down
2 changes: 1 addition & 1 deletion CRM/Contact/Form/Location.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static function preProcess(&$form) {
$className = CRM_Utils_System::getClassName($form);
if (in_array($className, array(
'CRM_Event_Form_ManageEvent_Location',
'CRM_Contact_Form_Domain'
'CRM_Contact_Form_Domain',
))) {
$form->_blocks = array(
'Address' => ts('Address'),
Expand Down
2 changes: 1 addition & 1 deletion CRM/Contact/Form/Search/Custom/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL
*
* @return string
*/
function sql(
public function sql(
$selectClause,
$offset = 0,
$rowcount = 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ public function runQueries($queryText, &$tables, $entityIDTableName, $limit) {
}

$query = $tableValues + array(
'text' => CRM_Utils_QueryFormatter::singleton()
->format($queryText, CRM_Utils_QueryFormatter::LANG_SOLR),
);
'text' => CRM_Utils_QueryFormatter::singleton()
->format($queryText, CRM_Utils_QueryFormatter::LANG_SOLR),
);
list($intLimit, $intOffset) = $this->parseLimitOffset($limit);
$files = $searcher->search($query, $intLimit, $intOffset);
$matches = array();
Expand Down
6 changes: 1 addition & 5 deletions CRM/Contact/Form/Search/Custom/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ public function __construct(&$formValues) {
$this->_groups = FALSE;
$this->_tags = FALSE;
$this->_andOr = CRM_Utils_Array::value('andOr', $this->_formValues);


//make easy to check conditions for groups and tags are
//selected or it is empty search
if (empty($this->_includeGroups) && empty($this->_excludeGroups) &&
Expand Down Expand Up @@ -183,7 +181,7 @@ public function setDefaultValues() {
*
* @return string
*/
function all(
public function all(
$offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
Expand Down Expand Up @@ -354,8 +352,6 @@ public function from() {
SELECT civicrm_contact.id as contact_id, ''
FROM civicrm_contact";
}


//used only when exclude group is selected
if ($xGroups != 0) {
$includeGroup .= " LEFT JOIN Xg_{$this->_tableName}
Expand Down
1 change: 0 additions & 1 deletion CRM/Contact/Page/View/ContactSmartGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class CRM_Contact_Page_View_ContactSmartGroup extends CRM_Core_Page {
/**
* called when action is browse
*
* @return null
*/
public function browse() {
$in = CRM_Contact_BAO_GroupContact::getContactGroup($this->_contactId, 'Added');
Expand Down
3 changes: 1 addition & 2 deletions CRM/Contact/Page/View/UserDashBoard.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public function buildUserDashBoard() {
'sectionTitle' => ts('Your Assigned Activities'),
'weight' => 5,
);
$userDashboard = new CRM_Activity_Page_UserDashboard;
$userDashboard = new CRM_Activity_Page_UserDashboard();
$userDashboard->run();
}

Expand Down Expand Up @@ -214,7 +214,6 @@ public function run() {
* @return array
* (reference) of action links
*/
static
public function &links() {
if (!(self::$_links)) {
$disableExtra = ts('Are you sure you want to disable this relationship?');
Expand Down
8 changes: 3 additions & 5 deletions CRM/Contribute/Form/AdditionalPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function preProcess() {
*/
public function setDefaultValues() {
if ($this->_view == 'transaction' && ($this->_action & CRM_Core_Action::BROWSE)) {
return;
return NULL;
}
$defaults = array();
if ($this->_mode) {
Expand Down Expand Up @@ -333,8 +333,6 @@ public function buildQuickForm() {
),
)
);


$mailingInfo = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
'mailing_backend'
);
Expand Down Expand Up @@ -429,8 +427,8 @@ public function processCreditCard($submittedValues) {

//get the payment processor id as per mode.
//@todo unclear relevance of mode - seems like a lot of duplicated params here!
$this->_params['payment_processor'] = $params['payment_processor_id'] =
$this->_params['payment_processor_id'] = $submittedValues['payment_processor_id'] = $this->_paymentProcessor['id'];
$this->_params['payment_processor'] = $params['payment_processor_id']
= $this->_params['payment_processor_id'] = $submittedValues['payment_processor_id'] = $this->_paymentProcessor['id'];

$now = date('YmdHis');
$fields = array();
Expand Down
9 changes: 3 additions & 6 deletions CRM/Contribute/Form/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ public function buildQuickForm() {
if ($this->_context == 'standalone') {
$this->addEntityRef('contact_id', ts('Contact'), array(
'create' => TRUE,
'api' => array('extra' => array('email'))
'api' => array('extra' => array('email')),
), TRUE);
}

Expand Down Expand Up @@ -1550,8 +1550,8 @@ public function processCreditCard($submittedValues, $config, $session, $lineItem
);

//get the payment processor id as per mode.
$this->_params['payment_processor'] = $params['payment_processor_id'] =
$this->_params['payment_processor_id'] = $submittedValues['payment_processor_id'] = $this->_paymentProcessor['id'];
$this->_params['payment_processor'] = $params['payment_processor_id']
= $this->_params['payment_processor_id'] = $submittedValues['payment_processor_id'] = $this->_paymentProcessor['id'];

$now = date('YmdHis');
$fields = array();
Expand Down Expand Up @@ -1762,8 +1762,6 @@ public function processCreditCard($submittedValues, $config, $session, $lineItem
$this->_id,
'Contribution'
);


if (empty($paymentParams['is_recur'])) {
$contribution = CRM_Contribute_Form_Contribution_Confirm::processContribution($this,
$this->_params,
Expand Down Expand Up @@ -1818,7 +1816,6 @@ public function processCreditCard($submittedValues, $config, $session, $lineItem
/**
* @param array $paymentParams
*
* @return array
*/
public function cleanupDBAfterPaymentFailure($paymentParams, $message) {
//make sure to cleanup db for recurring case.
Expand Down
Loading

0 comments on commit 041d366

Please sign in to comment.