$object_table = NULL, $object_id = NULL,
$acl_id = NULL, $acl_role = FALSE
) {
- $dao = new CRM_ACL_DAO_ACL;
+ $dao = new CRM_ACL_DAO_ACL();
$t = array(
'ACL' => self::getTableName(),
}
if ($staticGroupIDs) {
- $clauses[] = '( `civicrm_group_contact-ACL`.group_id IN (' . join(', ', $staticGroupIDs) . ') AND `civicrm_group_contact-ACL`.status IN ("Added") )';
+ $clauses[] = '( `civicrm_group_contact-ACL`.group_id IN (' . implode(', ', $staticGroupIDs) . ') AND `civicrm_group_contact-ACL`.status IN ("Added") )';
}
if ($cachedGroupIDs) {
- $clauses[] = '`civicrm_group_contact_cache-ACL`.group_id IN (' . join(', ', $cachedGroupIDs) . ')';
+ $clauses[] = '`civicrm_group_contact_cache-ACL`.group_id IN (' . implode(', ', $cachedGroupIDs) . ')';
}
}
}
$label = ts('Role');
$role = array(
- '-1' => ts('- select role -'),
- '0' => ts('Everyone'),
- ) + CRM_Core_OptionGroup::values('acl_role');
+ '-1' => ts('- select role -'),
+ '0' => ts('Everyone'),
+ ) + CRM_Core_OptionGroup::values('acl_role');
$entityID = &$this->add('select', 'entity_id', $label, $role, TRUE);
if ($this->_id) {
CRM_Core_Form_Tag::buildQuickForm($form, $parentNames, 'civicrm_activity', NULL, TRUE, TRUE);
$surveys = CRM_Campaign_BAO_Survey::getSurveys(TRUE, FALSE, FALSE, TRUE);
- if ($surveys) $form->add('select', 'activity_survey_id', ts('Survey / Petition'),
- array('' => ts('- none -')) + $surveys, FALSE,
- array('class' => 'crm-select2')
- );
-
+ if ($surveys) {
+ $form->add('select', 'activity_survey_id', ts('Survey / Petition'),
+ array('' => ts('- none -')) + $surveys, FALSE,
+ array('class' => 'crm-select2')
+ );
+ }
$extends = array('Activity');
$groupDetails = CRM_Core_BAO_CustomGroup::getGroupDetail(NULL, TRUE, $extends);
if ($groupDetails) {
$status = array(
ts('%count activities un-tagged', array(
'count' => $removed,
- 'plural' => '%count activities un-tagged'
- ))
+ 'plural' => '%count activities un-tagged',
+ )),
);
if ($notRemoved) {
$status[] = ts('1 activity already did not have this tag', array(
'count' => $notRemoved,
- 'plural' => '%count activities already did not have this tag'
+ 'plural' => '%count activities already did not have this tag',
));
}
$status = '<ul><li>' . implode('</li><li>', $status) . '</li></ul>';
$this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array(
'CRM_Financial_DAO_PaymentProcessor',
- $this->_id
+ $this->_id,
));
$this->add('text', 'description', ts('Description'),
if ($this->_action & CRM_Core_Action::DELETE) {
CRM_Financial_BAO_PaymentProcessor::del($this->_id);
CRM_Core_Session::setStatus("", ts('Payment Processor Deleted.'), "success");
- return;
+ return NULL;
}
$values = $this->controller->exportValues($this->_name);
* @param int $domainID
* @param $test
*
- * @return Void
+ * @return void
*/
public function updatePaymentProcessor(&$values, $domainID, $test) {
$dao = new CRM_Financial_DAO_PaymentProcessor();
/**
* Basic setup
*/
-
public function preProcess() {
$config = CRM_Core_Config::singleton();
$this->_uploadMaxSize = (int) ini_get('upload_max_filesize');
$validTriggerPermission = CRM_Core_DAO::checkTriggerViewPermission(FALSE);
// FIXME: for now, disable logging for multilingual sites OR if triggers are not permittted
- $domain = new CRM_Core_DAO_Domain;
+ $domain = new CRM_Core_DAO_Domain();
$domain->find(TRUE);
$attribs = $domain->locales || !$validTriggerPermission ? array('disabled' => 'disabled') : array();
parent::postProcess();
if ($config->logging != $values['logging']) {
- $logging = new CRM_Logging_Schema;
+ $logging = new CRM_Logging_Schema();
if ($values['logging']) {
$logging->enableLogging();
}
// Autocomplete for Contact Search (quick search etc.)
$options = array(
- ts('Contact Name') => 1
- ) + array_flip(CRM_Core_OptionGroup::values('contact_autocomplete_options',
+ ts('Contact Name') => 1,
+ ) + array_flip(CRM_Core_OptionGroup::values('contact_autocomplete_options',
FALSE, FALSE, TRUE
));
$this->addCheckBox('autocompleteContactSearch', ts('Autocomplete Contact Search'), $options,
// Autocomplete for Contact Reference (custom fields)
$optionsCR = array(
- ts('Contact Name') => 1
- ) + array_flip(CRM_Core_OptionGroup::values('contact_reference_options',
+ ts('Contact Name') => 1,
+ ) + array_flip(CRM_Core_OptionGroup::values('contact_reference_options',
FALSE, FALSE, TRUE
));
$this->addCheckBox('autocompleteContactReference', ts('Contact Reference Options'), $optionsCR,
*
* @return void
*/
- function preProcess() {
+ public function preProcess() {
$this->_search = CRM_Utils_Array::value('search', $_GET);
$this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE, FALSE);
$this->_searchTab = CRM_Utils_Request::retrieve('type', 'String', $this, FALSE, 'campaign');
$campaignTypes = CRM_Campaign_PseudoConstant::campaignType();
$this->add('select', 'campaign_type_id', ts('Campaign Type'),
array(
- '' => ts('- select -')
+ '' => ts('- select -'),
) + $campaignTypes
);
$campaignStatus = CRM_Campaign_PseudoConstant::campaignStatus();
$this->addElement('select', 'status_id', ts('Campaign Status'),
array(
- '' => ts('- select -')
+ '' => ts('- select -'),
) + $campaignStatus
);
$this->set('campaignStatus', $campaignStatus);
/**
* Build the form object
*
- * @param null
- *
* @return void
*/
public function buildQuickForm() {
),
);
}
- $buttons[] =
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- );
+ $buttons[] = array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ );
$this->addButtons($buttons);
$url = CRM_Utils_System::url('civicrm/campaign', 'reset=1&subPage=survey');
$this->postProcessHook();
- if ($this->_action & CRM_Core_Action::ADD)
+ if ($this->_action & CRM_Core_Action::ADD) {
CRM_Utils_System::redirect(CRM_Utils_System::url("civicrm/survey/configure/questions",
"action=update&reset=1&id={$this->_surveyId}"));
-
+ }
if ($this->controller->getButtonName('submit') == "_qf_{$className}_upload_done") {
CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/campaign', 'reset=1&subPage=survey'));
}
/**
* Set variables up before form is built
*
- * @param null
- *
* @return void
*/
- function preProcess() {
+ public function preProcess() {
$this->_action = CRM_Utils_Request::retrieve('action', 'String', $this);
if ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::DELETE)) {
* Set default values for the form.
* the default values are retrieved from the database.
*
- * @param null
- *
* @return array
* array of default values
*/
*
* @return void
*/
- function preProcess() {
+ public function preProcess() {
$this->_interviewToRelease = $this->get('interviewToRelease');
if ($this->_interviewToRelease) {
//user came from interview form.
foreach (array(
'surveyId',
'contactIds',
- 'interviewerId'
+ 'interviewerId',
) as $fld) {
$this->{"_$fld"} = $this->get($fld);
}
$activityStatus = CRM_Core_PseudoConstant::activityStatus('name');
$statusIds = array();
foreach (array(
- 'Scheduled'
+ 'Scheduled',
) as $name) {
if ($statusId = array_search($name, $activityStatus)) {
$statusIds[] = $statusId;
->addSetting(array(
'tabSettings' => array(
'active' => strtolower(CRM_Utils_Array::value('subPage', $_GET, 'reserve')),
- )
+ ),
));
}
array(
'manage campaign',
'administer CiviCampaign',
- "{$name} campaign contacts"
- )
+ "{$name} campaign contacts",
+ ),
))
) {
continue;
*
* @return \CRM_Campaign_Selector_Search
*/
- function __construct(
+ public function __construct(
&$queryParams,
$action = CRM_Core_Action::NONE,
$surveyClause = NULL,
*
* @return array
*/
- static
- public function &links() {
+ static public function &links() {
return self::$_links = array();
}
/**
* @return array
* which contains an array of strings
- **/
+ */
public function getQILL() {
return $this->_query->qill();
}
CRM_Core_Error::fatal(ts('You are not authorized to access this page.'));
}
- if ($this->_activityTypeFile =
- CRM_Activity_BAO_Activity::getFileForActivityTypeId($this->_activityTypeId,
+ if ($this->_activityTypeFile = CRM_Activity_BAO_Activity::getFileForActivityTypeId($this->_activityTypeId,
'Case'
)
) {
}
$this->add('text', 'activity_subject', ts('Subject'),
array_merge($s, array(
- 'maxlength' => '128'
+ 'maxlength' => '128',
)), TRUE
);
$this->assign('caseId', $this->_id);
$output = CRM_Core_Selector_Controller::SESSION;
$selector = new CRM_Activity_Selector_Activity($this->_contactId, $this->_permission, FALSE, 'case');
- $controller =
- new CRM_Core_Selector_Controller(
+ $controller = new CRM_Core_Selector_Controller(
$selector,
$this->get(CRM_Utils_Pager::PAGE_ID),
NULL,
/**
* called when action is browse
*
- * @return null
+ * @return void
*/
public function browse() {
* @return array
* (reference) of action links
*/
- static
- public function &links() {
+ static public function &links() {
$config = CRM_Core_Config::singleton();
if (!(self::$_links)) {
$primaryClause = " AND civicrm_email.is_primary = 1";
}
-
$locationClause = NULL;
if ($locationTypeID) {
$locationClause = " AND civicrm_email.location_type_id = $locationTypeID";
$cond = " AND civicrm_phone.phone_type_id = '$type'";
}
-
$sql = "
SELECT civicrm_contact.display_name, civicrm_phone.phone, civicrm_contact.do_not_sms
FROM civicrm_contact
$location['displayAddress'] = str_replace('<br />', ', ', addslashes($address));
$location['url'] = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $dao->contact_id);
$location['location_type'] = $dao->location_type;
- $location['image'] = CRM_Contact_BAO_Contact_Utils::getImage(isset($dao->contact_sub_type) ?
- $dao->contact_sub_type : $dao->contact_type, $imageUrlOnly, $dao->contact_id
+ $location['image'] = CRM_Contact_BAO_Contact_Utils::getImage(isset($dao->contact_sub_type) ? $dao->contact_sub_type : $dao->contact_type, $imageUrlOnly, $dao->contact_id
);
$locations[] = $location;
}
throw new CRM_Core_Exception(ts('Invalid relationship type'));
}
-
//check dependencies
// delete all relationships
$params = array(
1 => array(
CRM_Core_DAO::VALUE_SEPARATOR . $relationshipTypeId . CRM_Core_DAO::VALUE_SEPARATOR,
- 'String'
- )
+ 'String',
+ ),
);
CRM_Core_DAO::executeQuery($query, $params);
$from = $customClass->from();
$where = $customClass->where();
-
return array($from, $where);
}
}
/**
* Get action Links
*
- * @return array
+ * @return void
* (reference) of action links
*/
public function &links() {
foreach (array(
'now',
'yearDate',
- 'monthDate'
+ 'monthDate',
) as $date) {
$$date = $dates[$date];
}
*
* @param string $jobLog
* @throws CRM_Core_Exception
- * @return boolean
+ * @return bool
*/
public function hackyHandleBrokenCode($jobLog) {
if (stristr($this->_name, 'job')) {
if (is_a($result, 'CRM_Core_Error')) {
CRM_Core_Error::displaySessionError($result);
CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/event/cart_checkout', "_qf_Payment_display=1&qfKey={$this->controller->_key}", TRUE, NULL, FALSE));
- return;
+ return NULL;
}
elseif (!$result['trxn_id']) {
CRM_Core_Error::fatal(ts("Financial institution didn't return a transaction id."));
'slot_label_id',
ts('Conference Slot'),
array(
- '' => ts('- select -')
+ '' => ts('- select -'),
) + $slots,
FALSE
);
)
);
-
$this->assign('profileTitle', $this->_title);
$this->assign('componentIds', $this->_participantIds);
$fileFieldExists = FALSE;
*/
public static function updatePendingOnlineContribution($participantId, $statusId) {
if (!$participantId || !$statusId) {
- return;
+ return NULL;
}
$contributionId = CRM_Contribute_BAO_Contribution::checkOnlinePendingContribution($participantId,
* @param array $params
* (reference ) an assoc array of name/value pairs.
*
- * @return CRM_Contact_BAO_Contact
+ * @return void
*/
public static function create(&$params) {
$transaction = new CRM_Core_Transaction();
}
elseif (in_array($key, array(
'birth_date',
- 'deceased_date'
+ 'deceased_date',
))) {
list($value) = CRM_Utils_Date::setDateDefaults($value);
}
foreach (array(
'display_errors',
'html_errors',
- 'xmlrpc_errors'
+ 'xmlrpc_errors',
) as $key) {
$this->backup[$key] = ini_get($key);
ini_set($key, 0);
foreach (array(
'display_errors',
'html_errors',
- 'xmlrpc_errors'
+ 'xmlrpc_errors',
) as $key) {
ini_set($key, $this->backup[$key]);
}
$count = 0;
$totalAmount = $average = array();
while ($dao->fetch()) {
- $totalAmount[] =
- CRM_Utils_Money::format($dao->amount, $dao->currency) . '(' .
+ $totalAmount[] = CRM_Utils_Money::format($dao->amount, $dao->currency) . '(' .
$dao->count . ')';
$average[] = CRM_Utils_Money::format($dao->avg, $dao->currency);
$count += $dao->count;
public static function create(&$params, $ids) {
if (!is_array($params) || empty($params)) {
- return;
+ return NULL;
}
if ($id = CRM_Utils_Array::value('id', $ids)) {
* @param int $fieldId
* Price field id.
*
- * @return boolean
+ * @return bool
*
*/
public static function deleteValues($fieldId) {
* @param int $id
* Id.
*
- * @return boolean
+ * @return bool
*
*/
public static function del($id) {
*/
$this->_response['titleTop'] = ts('Page %1 of %2', array(
1 => '<input size="2" maxlength="3" name="' . self::PAGE_ID . '" type="text" value="' . $this->_response['currentPage'] . '" />',
- 2 => $this->_response['numPages']
+ 2 => $this->_response['numPages'],
));
$this->_response['titleBottom'] = ts('Page %1 of %2', array(
1 => '<input size="2" maxlength="3" name="' . self::PAGE_ID_BOTTOM . '" type="text" value="' . $this->_response['currentPage'] . '" />',
- 2 => $this->_response['numPages']
+ 2 => $this->_response['numPages'],
));
}
/**
* Use the pager class to get the pageId and Offset
*
- * @param void
- *
* @return array
* an array of the pageID and offset
*/
* This function does nothing in Drupal 8. Changes to the base_url should be made
* in settings.php directly.
*
- * @param null
- *
* @return void
*/
public function mapConfigToSSL() {
* @return array|bool
* [contactID, ufID, uniqueString] if success else false if no auth
*
- * This always bootstraps Drupal
+ * This always bootstraps Drupal
*/
public function authenticate($name, $password, $loadCMSBootstrap = FALSE, $realPath = NULL) {
(new CRM_Utils_System_Drupal8())->loadBootStrap(array(), FALSE);
* Get the latest version number if it's newer than the local one
*
* @return string|null
- * Returns version number of the latest release if it is greater than the local version
+ * Returns version number of the latest release if it is greater than the local version
*/
public function isNewerVersionAvailable() {
$newerVersion = NULL;
* Get active payment processor types
*/
private function getPayProcStats() {
- $dao = new CRM_Financial_DAO_PaymentProcessor;
+ $dao = new CRM_Financial_DAO_PaymentProcessor();
$dao->is_active = 1;
$dao->find();
$ppTypes = array();
'CRM_Pledge_DAO_PledgeBlock' => NULL,
);
foreach ($tables as $daoName => $where) {
- $dao = new $daoName;
+ $dao = new $daoName();
if ($where) {
$dao->whereAdd($where);
}
*
* @return array
*
- * {@getfields activity_get}
+ * {@getfields activity_get}
* @example ActivityGet.php Basic example
* @example Activity/DateTimeHigh.php Example get with date filtering
* {@example ActivityGet.php 0}
*
* @return array
* details of found Option Values
- * {@getfields OptionValue_get}
+ * {@getfields OptionValue_get}
*/
function civicrm_api3_custom_search_get($params) {
require_once 'api/v3/OptionValue.php';
*
* @return array
* Array of newly created option_value property values.
- * {@getfields OptionValue_create}
+ * {@getfields OptionValue_create}
*/
function civicrm_api3_custom_search_create($params) {
require_once 'api/v3/OptionValue.php';
*
* @return array
* Api result
- * {@getfields ReportTemplate_create}
+ * {@getfields ReportTemplate_create}
*/
function civicrm_api3_custom_search_delete($params) {
require_once 'api/v3/OptionValue.php';
'phone_type_id',
$values['location']['phone'][1]
)
- ),
- 'phone' => CRM_Utils_Array::value(
+ ),
+ 'phone' => CRM_Utils_Array::value(
'phone',
$values['location']['phone'][1]
- ),
+ ),
);
}
*
* @return array
* grant array
- * {@getfields grant_create}
+ * {@getfields grant_create}
*/
function civicrm_api3_grant_create($params) {
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'Grant');
*
* @return array
* Array of matching grants
- * {@getfields grant_get}
+ * {@getfields grant_get}
*/
function civicrm_api3_grant_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params, TRUE, 'Grant');
*
* @return array
* API Result Array
- * {@getfields grant_delete}
+ * {@getfields grant_delete}
*/
function civicrm_api3_grant_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
*
* @return array
* api result array
- * {@getfields loc_block_create}
+ * {@getfields loc_block_create}
*/
function civicrm_api3_loc_block_create($params) {
$entities = array();
*
* @return array
* Array of matching loc_blocks
- * {@getfields loc_block_get}
+ * {@getfields loc_block_get}
*/
function civicrm_api3_loc_block_get($params) {
$options = _civicrm_api3_get_options_from_params($params);
*
* @return array
* API result array
- * {@getfields loc_block_delete}
+ * {@getfields loc_block_delete}
*/
function civicrm_api3_loc_block_delete($params) {
return _civicrm_api3_basic_delete('CRM_Core_DAO_LocBlock', $params);
*
* @return array
* api result array
- * {@getfields mail_settings_create}
+ * {@getfields mail_settings_create}
*/
function civicrm_api3_mail_settings_create($params) {
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
*
* @return array
* Array of matching mail_settings
- * {@getfields mail_settings_get}
+ * {@getfields mail_settings_get}
*/
function civicrm_api3_mail_settings_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
*
* @return array
* api result array
- * {@getfields mail_settings_delete}
+ * {@getfields mail_settings_delete}
*/
function civicrm_api3_mail_settings_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
//ie. because the api is an anomaly & passing in id is not valid
throw new Exception('This api call does not accept api as a parameter');
}
- $options = _civicrm_api3_get_options_from_params($params, TRUE,'contribution','get');
+ $options = _civicrm_api3_get_options_from_params($params, TRUE, 'contribution', 'get');
$fnName = '_civicrm_api3_mailing_contact_get_' . strtolower($params['type']);
return $fnName(
$params['contact_id'],
$params['contact_id']['title'] = 'Contact ID';
$params['type'] = array(
'api.default' => 'Delivered',
- 'title' => 'Type',// doesn't really explain the field - but not sure I understand it to explain it better
+ 'title' => 'Type', // doesn't really explain the field - but not sure I understand it to explain it better
'type' => CRM_Utils_Type::T_STRING,
'options' => array(
'Delivered' => 'Delivered',
* @throws API_Exception
* @return array
* api result array
- * {@getfields mailing_event_subscribe_create}
+ * {@getfields mailing_event_subscribe_create}
*/
function civicrm_api3_mailing_event_subscribe_create($params) {
$email = $params['email'];
$group = new CRM_Contact_DAO_Group();
$group->is_active = 1;
- $group->id = (int)$group_id;
+ $group->id = (int) $group_id;
if (!$group->find(TRUE)) {
throw new API_Exception('Invalid Group id');
}
if ($subscribe !== NULL) {
/* Ask the contact for confirmation */
-
$subscribe->send_confirm_request($email);
$values = array();
*
* @return array
* Api Result
- * {@getfields phone_delete}
+ * {@getfields phone_delete}
* @example PhoneDelete.php
*/
function civicrm_api3_phone_delete($params) {
*
* @return array
* api result array
- * {@getfields price_field_value_create}
+ * {@getfields price_field_value_create}
*/
function civicrm_api3_price_field_value_create($params) {
$ids = array();
*
* @return array
* Array of matching price_field_values
- * {@getfields price_field_value_get}
+ * {@getfields price_field_value_get}
*/
function civicrm_api3_price_field_value_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
*
* @return array
* API result array
- * {@getfields price_field_value_delete}
+ * {@getfields price_field_value_delete}
*/
function civicrm_api3_price_field_value_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
*
* @return array
* api result array
- * {@getfields price_set_create}
+ * {@getfields price_set_create}
*/
function civicrm_api3_price_set_create($params) {
$result = _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
*
* @return array
* Array of matching price_sets
- * {@getfields price_set_get}
+ * {@getfields price_set_get}
*/
function civicrm_api3_price_set_get($params) {
// hack to make getcount work. - not sure the best approach here
*
* @return array
* API result array
- * {@getfields price_set_delete}
+ * {@getfields price_set_delete}
*/
function civicrm_api3_price_set_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
*
* @return array
* api result array
- * {@getfields survey_create}
+ * {@getfields survey_create}
*/
function civicrm_api3_survey_create($params) {
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'Survey');
*
* @return array
* API result Array of matching surveys
- * {@getfields survey_get}
+ * {@getfields survey_get}
*/
function civicrm_api3_survey_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params, TRUE, 'Survey');
*
* @return array
* api result array
- * {@getfields survey_delete}
+ * {@getfields survey_delete}
*/
function civicrm_api3_survey_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
*
* @return array
* Array of newly created tag property values.
- * {@getfields tag_create}
+ * {@getfields tag_create}
*/
function civicrm_api3_tag_create($params) {
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
*
* @return array
* API result array
- * {@getfields tag_delete}
+ * {@getfields tag_delete}
*/
function civicrm_api3_tag_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
*
* @return array
* details of found tags else error
- * {@getfields tag_get}
+ * {@getfields tag_get}
*/
function civicrm_api3_tag_get($params) {
$location_type_id = CRM_Utils_Array::value('location_type_id', $params);
$phone_type = CRM_Utils_Array::value('phone_type_id', $params, CRM_Utils_Array::value('phone_type', $params));
- if (! CRM_Core_BAO_UFField::isValidFieldName($field_name)) {
+ if (!CRM_Core_BAO_UFField::isValidFieldName($field_name)) {
throw new API_Exception('The field_name is not valid');
}
$params['field_name'] = array($field_type, $field_name, $location_type_id, $phone_type);
*
* @param array $params
*
- * @return array
+ * @return void
* fields valid for other functions
*/
function _civicrm_api3_uf_field_create_spec(&$params) {
*
* @return array
* (reference) Array
- * {@getfields UFField_get
+ * {@getfields UFField_get
* @example UFFieldGet.php
*/
function civicrm_api3_uf_field_get($params) {
class CRM_RespondentProcessor {
/**
*/
- function __construct() {
+ public function __construct() {
$config = CRM_Core_Config::singleton();
//this does not return on failure
class test_extension_manager_reporttest extends CRM_Core_Report {
/**
*/
- function __construct() {
- $logging = new CRM_Logging_Schema;
+ public function __construct() {
+ $logging = new CRM_Logging_Schema();
$this->tables[] = 'civicrm_contact';
$this->tables = array_merge($this->tables, array_keys($logging->customDataLogTables()));
$this->tables[] = 'civicrm_email';
parent::__construct();
}
- function buildQuickForm() {
+ public function buildQuickForm() {
$layout = CRM_Utils_Request::retrieve('layout', 'String', $this);
$this->assign('layout', $layout);
array(/* deceased[0], */
$deceased[1]->id,
$deceased[2]->id,
- $living[0]->id
+ $living[0]->id,
),
$group->id
);
$this->assertCacheMatches(
array(/* deceased[0], */
$deceased[1]->id,
- $deceased[2]->id
+ $deceased[2]->id,
),
$parent->id
);
* @param int $numObjects
* @param bool $createOnly
*/
- function createTestObject($daoName, $params = array(), $numObjects = 1, $createOnly = FALSE) {
+ public function createTestObject($daoName, $params = array(), $numObjects = 1, $createOnly = FALSE) {
$objects = CRM_Core_DAO::createTestObject($daoName, $params, $numObjects, $createOnly);
if (is_array($objects)) {
$this->registerTestObjects($objects);
$cases[] = array('mode=256', array('mode' => '256'));
$cases[] = array(
'mode=256,addSequence=1,attachUpload=1',
- array('mode' => '256', 'addSequence' => '1', 'attachUpload' => 1)
+ array('mode' => '256', 'addSequence' => '1', 'attachUpload' => 1),
);
$cases[] = array(
'mode=256,urlToSession=a:b:c:d',
'urlToSession' => array(
array('urlVar' => 'a', 'sessionVar' => 'b', 'type' => 'c', 'default' => 'd'),
),
- )
+ ),
);
$cases[] = array(
'mode=256,urlToSession=a:b:c:d;z:y:x:w',
array('urlVar' => 'a', 'sessionVar' => 'b', 'type' => 'c', 'default' => 'd'),
array('urlVar' => 'z', 'sessionVar' => 'y', 'type' => 'x', 'default' => 'w'),
),
- )
+ ),
);
$cases[] = array('url=whiz!;.:#=%/|+bang?', array('url' => 'whiz!;.:#=%/|+bang?'));
return $cases;
$paypalIPN->main();
$contribution = $this->callAPISuccess('contribution', 'get', array(
'contribution_recur_id' => $this->_contributionRecurID,
- 'sequential' => 1
+ 'sequential' => 1,
));
$this->assertEquals(2, $contribution['count']);
$this->assertEquals('second_one', $contribution['values'][1]['trxn_id']);
$paypalIPN->main();
$contribution = $this->callAPISuccess('contribution', 'get', array(
'contribution_recur_id' => $this->_contributionRecurID,
- 'sequential' => 1
+ 'sequential' => 1,
));
$this->assertEquals(2, $contribution['count']);
$this->assertEquals('second_one', $contribution['values'][1]['trxn_id']);
$this->callAPISuccessGetSingle('membership_payment', array('contribution_id' => $contribution['values'][1]['id']));
$this->callAPISuccessGetSingle('line_item', array(
'contribution_id' => $contribution['values'][1]['id'],
- 'entity_table' => 'civicrm_membership'
+ 'entity_table' => 'civicrm_membership',
));
}
'value' => 'foo',
'is_active' => 1,
'weight' => 0,
- )
+ ),
),
);
$result = civicrm_api3('custom_field', 'create', $api_params);
// But we can also fetch by ID
$result = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'contact_type', array(
'keyColumn' => 'id',
- 'labelColumn' => 'name'
+ 'labelColumn' => 'name',
));
$this->assertEquals($byId, $result);
// Make sure flip param works
$result = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'contact_type', array(
'keyColumn' => 'id',
'labelColumn' => 'name',
- 'flip' => TRUE
+ 'flip' => TRUE,
));
$this->assertEquals(array_flip($byId), $result);
}
array(
'type' => 'Sql',
'name' => 'test-queue',
- )
+ ),
);
$queueSpecs[] = array(
array(
'type' => 'Memory',
'name' => 'test-queue',
- )
+ ),
);
return $queueSpecs;
}
- /* ----------------------- Per-provider tests ----------------------- */
+ /**
+ * Per-provider tests
+ */
public function setUp() {
parent::setUp();
$this->queueService = CRM_Queue_Service::singleton(TRUE);
array(
'location_type_id' => 2,
'email' => 'j2@example.com',
- 'signature_text' => 'You know, a lotta ins, a lotta outs, a lotta what-have-yous.'
+ 'signature_text' => 'You know, a lotta ins, a lotta outs, a lotta what-have-yous.',
),
),
),
array(
'location_type_id' => 1,
'street_address' => 'j1-a Example Ave',
- 'supplemental_address_1' => 'The Dude abides.'
+ 'supplemental_address_1' => 'The Dude abides.',
),
array(
'location_type_id' => 2,
'street_address' => 'j2 Example Ave',
- 'supplemental_address_1' => 'You know, a lotta ins, a lotta outs, a lotta what-have-yous.'
+ 'supplemental_address_1' => 'You know, a lotta ins, a lotta outs, a lotta what-have-yous.',
),
),
),
*/
private static function getInstance() {
if (is_null(self::$instance)) {
- self::$instance = new self;
+ self::$instance = new self();
}
return self::$instance;
}
/**
* Helper function to delete custom field
* @deprecated use function on parent class
- * @param object of Custom Field to delete
*/
public static function deleteField($params) {
require_once 'CRM/Core/BAO/CustomField.php';
/**
* Helper function to delete custom group
* @deprecated use function on parent class
- * @param object Custom Group to delete
- * @return boolean
+ * @return bool
* true if Group deleted, false otherwise
*/
public static function deleteGroup($params) {
* Helper function to delete an Event
*
* @param int $eventId
- * @return boolean
+ * @return bool
* true if event deleted, false otherwise
*/
public static function delete($eventId) {
*
* @return int
* $paymentProcessor id of created payment processor@todo this appears not to be working but because it doesn't extend the test class
- * callAPISuccess won't work
- * I have duplicated this on the main test class as a work around
+ * callAPISuccess won't work
+ * I have duplicated this on the main test class as a work around
*/
public static function create() {
* @param int $id
* Id of the PayPal Pro payment processor.
* to be deleted
- * @return boolean
+ * @return bool
* true if payment processor deleted, false otherwise
*/
public static function delete($id) {
$participantEmails = array($primaryParticipant, $secParticipant, $thirdParticipant);
$addtlPart = array($secParticipant, $thirdParticipant);
- $primaryParticipantInfo =
- $this->_testOnlineRegistration($registerUrl, 2, $anonymous, FALSE, $participantEmails, "Test Processor");
+ $primaryParticipantInfo = $this->_testOnlineRegistration($registerUrl, 2, $anonymous, FALSE, $participantEmails, "Test Processor");
$primaryDisplayName = "{$primaryParticipantInfo['first_name']} {$primaryParticipantInfo['last_name']}";
$this->webtestLogin();
$this->openCiviPage("event/search", "reset=1");
parent::setUp();
}
- /*
+ /**
* Test contact import for Individuals Subtype.
*/
public function testIndividualSubtypeImport() {
$this->importContacts($headers, $rows, 'Individual', 'No Duplicate Checking', array(), $other);
}
- /*
+ /**
* Test contact import for Organization Subtype.
*/
public function testOrganizationSubtypeImport() {
$this->importContacts($headers, $rows, 'Organization', 'No Duplicate Checking', array(), $other);
}
- /*
+ /**
* Test contact import for Household Subtype.
*/
public function testHouseholdSubtypeImport() {
parent::setUp();
}
- /*
+ /**
* Test contact import for Individuals.
*/
public function testIndividualImport() {
$this->importContacts($headers, $rows, 'Individual', 'No Duplicate Checking');
}
- /*
+ /**
* Test contact import for Organization.
*/
public function testOrganizationImport() {
$this->importContacts($headers, $rows, 'Organization', 'No Duplicate Checking');
}
- /*
+ /**
* Test contact import for Household.
*/
public function testHouseholdImport() {
parent::setUp();
}
- /*
+ /**
* Test contact import for Individuals Duplicate Matching.
*/
public function testIndividualDuplicateMatchingImport() {
$this->importContacts($headers, $rows, 'Individual', 'No Duplicate Checking');
}
- /*
+ /**
* Test contact import for Organization Duplicate Matching.
*/
public function testOrganizationDuplicateMatchingImport() {
$this->importContacts($headers, $rows, 'Organization', 'No Duplicate Checking');
}
- /*
+ /**
* Test contact import for Household Duplicate Matching.
*/
public function testHouseholdDuplicateMatchingImport() {
$this->assertEquals($result['not_added'], 1);
}
- ///////////////// civicrm_entity_tag_get methods
+ /**
+ * civicrm_entity_tag_get methods
+ */
public function testGetNoEntityID() {
$ContactId = $this->_individualID;
$tagID = $this->_tagID;
$entity = $this->callAPISuccess('entity_tag', 'get', $paramsEntity);
}
- ///////////////// civicrm_entity_tag_Delete methods
+ /**
+ * civicrm_entity_tag_Delete methods
+ */
public function testEntityTagDeleteNoTagId() {
$entityTagParams = array(
'contact_id_i' => $this->_individualID,
$this->assertEquals($result['not_removed'], 1);
}
- ///////////////// civicrm_tag_entities_get methods
-
+ /**
+ * civicrm_tag_entities_get methods
+ */
public function testCommonContactEntityTagAdd() {
$params = array(
'contact_id' => $this->_individualID,
$this->assertEquals($result['id'], $result['values'][$result['id']]['id'], " in line " . __LINE__);
}
- /*
- * Check for useful message if contact doesn't exist
- */
+ /**
+ * Check for useful message if contact doesn't exist
+ */
public function testMembershipCreateWithInvalidContact() {
$params = array(
'contact_id' => 999,
/**
* per CRM-15746 check that the id can be altered in an update hook
*/
- function testMembershipUpdateCreateHookCRM15746() {
+ public function testMembershipUpdateCreateHookCRM15746() {
$this->hookClass->setHook('civicrm_pre', array($this, 'hook_civicrm_pre_update_create_membership'));
$result = $this->callAPISuccess('membership', 'create', $this->_params);
$this->callAPISuccess('membership', 'create', array('id' => $result['id'], 'end_date' => '1 year ago'));
$this->callAPISuccessGetCount('membership', array(), 2);
}
- function hook_civicrm_pre_update_create_membership($op, $objectName, $id, &$params) {
+ public function hook_civicrm_pre_update_create_membership($op, $objectName, $id, &$params) {
if ($objectName == 'Membership' && $op == 'edit') {
$existingMembership = $this->callAPISuccessGetSingle('membership', array('id' => $params['id']));
unset($params['id'], $params['membership_id']);