Skip to content

Commit

Permalink
Merge pull request civicrm#4938 from eileenmcnaughton/minor-tidies
Browse files Browse the repository at this point in the history
Minor tidies
  • Loading branch information
eileenmcnaughton committed Jan 15, 2015
2 parents 174db15 + d868941 commit bb82b35
Show file tree
Hide file tree
Showing 38 changed files with 620 additions and 550 deletions.
80 changes: 42 additions & 38 deletions CRM/Activity/BAO/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/

/**
* This class is for activity functions
*
* This class is for activity functions.s
*/
class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity {

Expand All @@ -54,7 +52,7 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity {
static $_importableFields = NULL;

/**
* Check if there is absolute minimum of data to add the object
* Check if there is absolute minimum of data to add the object.
*
* @param array $params
* (reference ) an assoc array of name/value pairs.
Expand All @@ -69,7 +67,7 @@ public static function dataExists(&$params) {
}

/**
* Fetch object based on array of properties
* Fetch object based on array of properties.
*
* @param array $params
* (reference ) an assoc array of name/value pairs.
Expand Down Expand Up @@ -139,12 +137,12 @@ public static function retrieve(&$params, &$defaults) {
}

/**
* Delete the activity
* Delete the activity.
*
* @param array $params
* @param bool $moveToTrash
*
* @return void
* @return mixed
*/
public static function deleteActivity(&$params, $moveToTrash = FALSE) {
// CRM-9137
Expand Down Expand Up @@ -245,7 +243,7 @@ public static function deleteActivity(&$params, $moveToTrash = FALSE) {
}

/**
* Delete activity assignment record
* Delete activity assignment record.
*
* @param int $activityId
* @param int $recordTypeID
Expand All @@ -260,7 +258,7 @@ public static function deleteActivityContact($activityId, $recordTypeID = NULL)
}

/**
* Process the activities
* Process the activities.
*
* @param array $params
* Associated array of the submitted values.
Expand Down Expand Up @@ -613,8 +611,12 @@ public static function create(&$params) {
}

/**
* @param $activity
* @param null $logMessage
* Create an activity.
*
* @todo elaborate on what this does.
*
* @param CRM_Core_DAO_Activity $activity
* @param string $logMessage
*
* @return bool
*/
Expand All @@ -638,7 +640,7 @@ public static function logActivityAction($activity, $logMessage = NULL) {
}

/**
* Get the list Activities
* Get the list Activities.
*
* @param array $input
* Array of parameters.
Expand All @@ -653,8 +655,7 @@ public static function logActivityAction($activity, $logMessage = NULL) {
* - activity_type_id int|string the activitiy types we want to restrict by
*
* @return array
* (reference) $values the relevant data object values of open activities
*
* Relevant data object values of open activities
*/
public static function &getActivities($input) {
//step 1: Get the basic activity data
Expand Down Expand Up @@ -897,9 +898,12 @@ public static function &getActivities($input) {
}

/**
* Get the component id and name those are enabled and logged in
* user has permission. To decide whether we are going to include
* component related activities w/ core activity retrieve process.
* Get the component id and name if those are enabled and allowed.
*
* Checks whether logged in user has permission.
* To decide whether we are going to include
* component related activities with core activity retrieve process.
* (what did that just mean?)
*
* @return array
* Array of component id and name.
Expand Down Expand Up @@ -930,7 +934,7 @@ public static function activityComponents() {
}

/**
* Get the activity Count
* Get the activity Count.
*
* @param array $input
* Array of parameters.
Expand All @@ -943,7 +947,6 @@ public static function activityComponents() {
*
* @return int
* count of activities
*
*/
public static function &getActivitiesCount($input) {
$input['count'] = TRUE;
Expand All @@ -966,7 +969,7 @@ public static function &getActivitiesCount($input) {
}

/**
* Get the activity sql clause to pick activities
* Get the activity sql clause to pick activities.
*
* @param array $input
* Array of parameters.
Expand All @@ -980,7 +983,6 @@ public static function &getActivitiesCount($input) {
*
* @return int
* count of activities
*
*/
public static function getActivitySQLClause($input) {
$params = array();
Expand Down Expand Up @@ -1145,8 +1147,9 @@ public static function getActivitySQLClause($input) {
}

/**
* Send the message to all the contacts and also insert a
* contact activity in each contacts record
* Send the message to all the contacts.
*
* Also insert a contact activity in each contacts record.
*
* @param array $contactDetails
* The array of contact details to send the email.
Expand Down Expand Up @@ -1357,6 +1360,8 @@ public static function sendEmail(
}

/**
* Send SMS.
*
* @param array $contactDetails
* @param array $activityParams
* @param array $smsParams
Expand Down Expand Up @@ -1494,7 +1499,6 @@ public static function sendSMS(
* @param int $toID
* The contact id of the recipient.
* @param $tokenText
* @param $tokenHtml
* @param array $smsParams
* The params used for sending sms.
* @param int $activityID
Expand Down Expand Up @@ -1647,7 +1651,7 @@ public static function sendMessage(
}

/**
* Combine all the importable fields from the lower levels object
* Combine all the importable fields from the lower levels object.
*
* The ordering is important, since currently we do not have a weight
* scheme. Adding weight is super important and should be done in the
Expand Down Expand Up @@ -1704,7 +1708,7 @@ public static function &importableFields($status = FALSE) {
}

/**
* get the Activities of a target contact
* Get the Activities of a target contact.
*
* @param int $contactId
* Id of the contact whose activities need to find.
Expand Down Expand Up @@ -1777,7 +1781,7 @@ public static function getContactActivity($contactId) {
}

/**
* Add activity for Membership/Event/Contribution
* Add activity for Membership/Event/Contribution.
*
* @param object $activity
* (reference) particular component object.
Expand Down Expand Up @@ -1896,13 +1900,13 @@ public static function addActivity(
}

/**
* Get Parent activity for currently viewed activity
* Get Parent activity for currently viewed activity.
*
* @param int $activityId
* Current activity id.
*
* @return int
* $parentId Id of parent activity otherwise false.
* Id of parent activity otherwise false.
*/
public static function getParentActivity($activityId) {
static $parentActivities = array();
Expand All @@ -1924,7 +1928,7 @@ public static function getParentActivity($activityId) {
}

/**
* Get total count of prior revision of currently viewd activity
* Get total count of prior revision of currently viewed activity.
*
* @param $activityID
* Current activity id.
Expand Down Expand Up @@ -1962,7 +1966,7 @@ public static function getPriorCount($activityID) {
}

/**
* Get all prior activities of currently viewed activity
* Get all prior activities of currently viewed activity.
*
* @param $activityID
* Current activity id.
Expand Down Expand Up @@ -2013,7 +2017,7 @@ public static function getPriorAcitivities($activityID, $onlyPriorRevisions = FA
}

/**
* Find the latest revision of a given activity
* Find the latest revision of a given activity.
*
* @param int $activityID
* Prior activity id.
Expand Down Expand Up @@ -2046,7 +2050,7 @@ public static function getLatestActivityId($activityID) {
}

/**
* Create a follow up a given activity
* Create a follow up a given activity.
*
* @param int $activityId
* activity id of parent activity.
Expand Down Expand Up @@ -2120,11 +2124,11 @@ public static function getFileForActivityTypeId($activityTypeId, $crmDir = 'Acti
}

/**
* Restore the activity
* Restore the activity.
*
* @param array $params
*
* @return void
* @return CRM_Activity_DAO_Activity
*/
public static function restoreActivity(&$params) {
$activity = new CRM_Activity_DAO_Activity();
Expand All @@ -2137,7 +2141,7 @@ public static function restoreActivity(&$params) {
}

/**
* Get the exportable fields for Activities
* Get the exportable fields for Activities.
*
* @param string $name
* If it is called by case $name = Case else $name = Activity.
Expand Down Expand Up @@ -2435,13 +2439,13 @@ public static function checkPermission($activityId, $action) {
}

/**
* wrapper for ajax activity selector
* Wrapper for ajax activity selector.
*
* @param array $params
* Associated array for params record id.
*
* @return array
* associated array of contact activities
* Associated array of contact activities
*/
public static function getContactActivitySelector(&$params) {
// format the params
Expand Down
17 changes: 4 additions & 13 deletions CRM/Admin/Form/Setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/

/**
* This class generates form components generic to CiviCRM settings
*
*/
class CRM_Admin_Form_Setting extends CRM_Core_Form {

Expand All @@ -44,10 +42,8 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form {

/**
* Set default values for the form.
* default values are retrieved from the database
*
*
* @return void
* Default values are retrieved from the database.
*/
public function setDefaultValues() {
if (!$this->_defaults) {
Expand Down Expand Up @@ -89,10 +85,10 @@ public function setDefaultValues() {

//Set defaults for autocomplete and contact reference options
$this->_defaults['autocompleteContactSearch'] = array(
'1' => 1
'1' => 1,
) + $autoSearchFields;
$this->_defaults['autocompleteContactReference'] = array(
'1' => 1
'1' => 1,
) + $cRSearchFields;

// we can handle all the ones defined in the metadata here. Others to be converted
Expand All @@ -116,8 +112,6 @@ public function setDefaultValues() {

/**
* Build the form object
*
* @return void
*/
public function buildQuickForm() {
$session = CRM_Core_Session::singleton();
Expand Down Expand Up @@ -169,10 +163,7 @@ public function buildQuickForm() {
}

/**
* Process the form submission
*
*
* @return void
* Process the form submission.
*/
public function postProcess() {
// store the submitted values in an array
Expand Down
7 changes: 2 additions & 5 deletions CRM/Campaign/Form/Gotv.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/

/**
Expand All @@ -50,11 +49,9 @@ class CRM_Campaign_Form_Gotv extends CRM_Core_Form {
protected $_searchVoterFor;

/**
* Processing needed for buildForm and later
*
* @return void
* Processing needed for buildForm and later.
*/
function preProcess() {
public function preProcess() {
$this->_search = CRM_Utils_Array::value('search', $_GET);
$this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE);
$this->_surveyId = CRM_Utils_Request::retrieve('sid', 'Positive', $this);
Expand Down
Loading

0 comments on commit bb82b35

Please sign in to comment.