* @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) {
//adding a way for unit tests to flush the cache
if ($flush) {
$cache = array();
- return;
+ return NULL;
}
if (!$contactID) {
$session = CRM_Core_Session::singleton();
'activity_type_id',
'activity_label',
'target_contact_id',
- 'activity_subject'
+ 'activity_subject',
);
foreach ($requiredFields as $val) {
$highlightedFields[] = $val;
$defaults["mapper[$i]"] = array(
$this->defaultFromHeader($this->_columnHeaders[$i],
$headerPatterns
- )
+ ),
);
}
else {
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
'contact' => array(
'return' => implode(',', $contactReturnProperties),
'fieldmap' => array_flip($contactReturnProperties),
- )
+ ),
));
// don't set the status message when form is submitted.
*
* @return void
*/
- function preProcess() {
+ public function preProcess() {
$this->_done = FALSE;
$this->_defaults = array();
if (!in_array($this->_operation, array(
'reserve',
'release',
- 'interview'
+ 'interview',
))
) {
$this->_operation = 'reserve';
$taskValue = array(
$currentTaskValue => ts('Record %1 Responses',
array(1 => $activityTypes[$surveyTypeId])
- )
+ ),
);
}
$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;
* 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
*/
/**
* Build the form object
*
- * @param null
- *
* @return void
*/
public function buildQuickForm() {
/**
* Process the form
*
- * @param null
- *
* @return void
*/
public function postProcess() {
1 => array(
$this->_values['result_id'],
'Positive',
- )
+ ),
)
);
// delete option group if no any survey is using it.
$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',
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',
}
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',
);
}
else {
- $defaults['order_bys'] =
- array(
+ $defaults['order_bys']
+ = array(
1 => array(
'column' => 'contact_a.sort_name',
'order' => 'ASC',
public function &getRedactionRules() {
foreach (array(
'redactionStringRules',
- 'redactionRegexRules'
+ 'redactionRegexRules',
) as $key => $rule) {
$$rule = CRM_Case_PseudoConstant::redactionRule($key);
*
* @return array
*/
- function &caseInfo(
+ public function &caseInfo(
$clientID,
$caseID
) {
$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',
1 => array(
$activityTypeID,
'Integer',
- )
+ ),
);
$dao = CRM_Core_DAO::executeQuery($query, $params);
* 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) {
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;
}
/**
* @param int $contactID
* Contact id.
*
- * @return boolean
+ * @return bool
*/
- static function hasContactsInCache(
+ public static function hasContactsInCache(
$type = CRM_Core_Permission::VIEW,
$contactID = NULL
) {
$this->where_tables = serialize($whereTables);
}
}
-
- return;
}
public function save() {
$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'),
*
* @return string
*/
- function sql(
+ public function sql(
$selectClause,
$offset = 0,
$rowcount = 0,
}
$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();
$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) &&
*
* @return string
*/
- function all(
+ public function all(
$offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
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}
/**
* called when action is browse
*
- * @return null
*/
public function browse() {
$in = CRM_Contact_BAO_GroupContact::getContactGroup($this->_contactId, 'Added');
'sectionTitle' => ts('Your Assigned Activities'),
'weight' => 5,
);
- $userDashboard = new CRM_Activity_Page_UserDashboard;
+ $userDashboard = new CRM_Activity_Page_UserDashboard();
$userDashboard->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?');
*/
public function setDefaultValues() {
if ($this->_view == 'transaction' && ($this->_action & CRM_Core_Action::BROWSE)) {
- return;
+ return NULL;
}
$defaults = array();
if ($this->_mode) {
),
)
);
-
-
$mailingInfo = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
'mailing_backend'
);
//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();
if ($this->_context == 'standalone') {
$this->addEntityRef('contact_id', ts('Contact'), array(
'create' => TRUE,
- 'api' => array('extra' => array('email'))
+ 'api' => array('extra' => array('email')),
), TRUE);
}
);
//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();
$this->_id,
'Contribution'
);
-
-
if (empty($paymentParams['is_recur'])) {
$contribution = CRM_Contribute_Form_Contribution_Confirm::processContribution($this,
$this->_params,
/**
* @param array $paymentParams
*
- * @return array
*/
public function cleanupDBAfterPaymentFailure($paymentParams, $message) {
//make sure to cleanup db for recurring case.
}
$this->add('select', 'price_set_id', ts('Price Set'),
array(
- '' => ts('- none -')
+ '' => ts('- none -'),
) + $price,
NULL, array('onchange' => "showHideAmountBlock( this.value, 'price_set_id' );")
);
'html_type',
'name',
'is_active',
- 'label'
+ 'label',
));
foreach ($priceFields as $priceField) {
if ($priceField['id'] && $priceField['html_type'] == 'Radio' && $priceField['name'] == 'contribution_amount') {
if (in_array($field, array(
'min_amount',
- 'max_amount'
+ 'max_amount',
))) {
$val = CRM_Utils_Rule::cleanMoney($val);
}
*
* @return void
*/
- function preProcess() {
+ public function preProcess() {
$this->set('searchFormName', 'Search');
/**
foreach (array(
'contribution_amount_low',
- 'contribution_amount_high'
+ 'contribution_amount_high',
) as $f) {
if (isset($this->_formValues[$f])) {
$this->_formValues[$f] = CRM_Utils_Rule::cleanMoney($this->_formValues[$f]);
'contribution_soft_credit_type_id',
'contribution_status_id',
'contribution_source',
- 'contribution_trxn_id'
+ 'contribution_trxn_id',
);
foreach ($specialParams as $element) {
$value = CRM_Utils_Array::value($element, $this->_formValues);
* @param array $values
* The array of values belonging to this line.
*
- * @return boolean
+ * @return bool
*/
public function mapField(&$values) {
return CRM_Import_Parser::VALID;
* @param array $values
* The array of values belonging to this line.
*
- * @return boolean
+ * @return bool
* the result of this processing
*/
public function preview(&$values) {
* @param array $values
* The array of values belonging to this line.
*
- * @return boolean
+ * @return bool
* the result of this processing
*/
public function summary(&$values) {
* @param array $values
* The array of values belonging to this line.
*
- * @return boolean
+ * @return bool
* the result of this processing
*/
public function import($onDuplicate, &$values) {
/**
* called when action is browse
*
- * @return null
*/
public function browse() {
// add annual contribution
if (empty($this->_contactId)) {
$this->_contactId = civicrm_api3('contribution', 'getvalue', array(
'id' => $this->_id,
- 'return' => 'contact_id'
+ 'return' => 'contact_id',
));
}
$this->assign('contactId', $this->_contactId);
* Given the list of params in the params array, fetch the object
* and store the values in the values array
*
- * @param array entityBlock input parameters to find object
+ * @param array $entityBlock input parameters to find object
*
- * @return boolean
+ * @return bool
*/
public static function &getValues($entityBlock) {
return CRM_Core_BAO_Block::getValues('im', $entityBlock);
if (empty($entityElements)) {
return NULL;
}
-
-
$entityId = $entityElements['entity_id'];
$entityTable = $entityElements['entity_table'];
-
-
$sql = "SELECT cim.name as im, ltype.name as locationType, cim.is_primary as is_primary, cim.id as im_id, cim.location_type_id as locationTypeId
FROM civicrm_loc_block loc, civicrm_im cim, civicrm_location_type ltype, {$entityTable} ev
WHERE ev.id = %1
'phone',
'email',
'im',
- 'address'
+ 'address',
) as $loc) {
$locBlock["{$loc}_id"] = !empty($location["$loc"][0]) ? $location["$loc"][0]->id : NULL;
$locBlock["{$loc}_2_id"] = !empty($location["$loc"][1]) ? $location["$loc"][1]->id : NULL;
* @param array $params
* (reference ) an assoc array of name/value pairs.
*
- * @return boolean
+ * @return bool
*/
public static function dataExists(&$params) {
// return if no data present
'IM',
'Phone',
'Address',
- 'OpenID'
+ 'OpenID',
) as $block) {
$name = strtolower($block);
if (array_key_exists($name, $primaryLocBlockIds) &&
/**
* Add/update navigation record
*
- * @param array associated array of submitted values
+ * @param $params associated array of submitted values
*
* @return object
* navigation object
'parentID' => $navigation->parent_id,
'navID' => $navigation->id,
'active' => $navigation->is_active,
- )
+ ),
);
self::buildNavigationTree($navigationTree[$navigation->id]['child'], $navigation->id, $navigationMenu);
}
//we need to check core view/edit or supported acls.
if (in_array($menuName, array(
'Search...',
- 'Contacts'
+ 'Contacts',
))) {
if (!CRM_Core_Permission::giveMeAllACLs()) {
$skipMenuItems[] = $navID;
/**
* Get Option Group ID for Paper Sizes
*
- * @param void
- *
* @return int
* Group ID (null if Group ID doesn't exist)
*/
* @param string $returnURL
* URL of page calling this function.
*
- * @return array
- * (reference) List of Paper Sizes
*/
public static function &addOrder(&$list, $returnURL) {
$filter = "option_group_id = " . self::_getGid();
/**
* Retrieve the default Paper Size values
*
- * @param NULL
- *
* @return array
* Name/value pairs containing the default Paper Size values.
*/
/**
* Get page orientations recognized by the DOMPDF package used to create PDF letters.
*
- * @param void
- *
* @return array
* array of page orientations
*/
/**
* Get measurement units recognized by the DOMPDF package used to create PDF letters.
*
- * @param void
- *
* @return array
* array of measurement units
*/
/**
* Get Option Group ID for PDF Page Formats
*
- * @param void
- *
* @return int
* Group ID (null if Group ID doesn't exist)
*/
/**
* Get the default PDF Page Format values
*
- * @param NULL
- *
* @return array
* Name/value pairs containing the default PDF Page Format values.
*/
*
* @return CRM_Core_DAO_WordRepalcement
*/
-
public static function retrieve(&$params, &$defaults) {
return CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_WordRepalcement', $params, $defaults);
}
foreach ($table['foreignKey'] as $fkName => $fkValue) {
if ($this->tables[$fkValue['table']]['archive'] == 'true') {
$table['foreignKey'][$fkName]['table'] = 'archive_' . $table['foreignKey'][$fkName]['table'];
- $table['foreignKey'][$fkName]['uniqName'] =
- str_replace('FK_', 'FK_archive_', $table['foreignKey'][$fkName]['uniqName']);
+ $table['foreignKey'][$fkName]['uniqName']
+ = str_replace('FK_', 'FK_archive_', $table['foreignKey'][$fkName]['uniqName']);
}
}
$archiveTables[$name] = $table;
}
$tables[$name] = &$table;
- return;
}
/**
$field['cols'] = isset($fieldXML->html) ? $this->value('cols', $fieldXML->html) : NULL;
break;
- break;
+ break;
case 'datetime':
$field['sqlType'] = $field['phpType'] = $type;
'title' => ts('Country'),
'cc_field' => TRUE,
'attributes' => array(
- '' => ts('- select -')
- ) +
- CRM_Core_PseudoConstant::country(),
+ '' => ts('- select -'),
+ ) +
+ CRM_Core_PseudoConstant::country(),
'is_required' => TRUE,
);
//CRM-15509 working towards giving control over billing fields to payment processors. For now removing tpl hard-coding
// which was previously available only in some form flows
if (!empty($form->_paymentProcessor) && !empty($form->_paymentProcessor['object']) && $form->_paymentProcessor['object']->isSupported('buildForm')) {
$form->_paymentProcessor['object']->buildForm($form);
- return;
+ return NULL;
}
self::setPaymentFieldsByProcessor($form, $processor, empty($isBillingDataOptional));
* array('access CiviEvent', 'access CiviContribute')
* ),
*
- * @return boolean
+ * @return bool
* true if yes, else false
*/
public static function check($permissions) {
* @param array $array
* The group/role to check.
*
- * @return boolean
+ * @return bool
* true if yes, else false
*/
public static function checkGroupRole($array) {
* Validate user permission across
* edit or view or with supportable acls.
*
- * @return boolean
- **/
+ * @return bool
+ */
public static function giveMeAllACLs() {
if (CRM_Core_Permission::check('view all contacts') ||
CRM_Core_Permission::check('edit all contacts')
$lineItemCount = CRM_Core_DAO::singleValueQuery("select count(*) FROM civicrm_line_item WHERE contribution_id = %1", array(
1 => array(
$participantPayment->contribution_id,
- 'Integer'
- )
+ 'Integer',
+ ),
));
if ($lineItemCount == 1) {
$sql = "UPDATE civicrm_line_item li
WHERE contribution_id = %2 AND entity_table = 'civicrm_contribution'";
CRM_Core_DAO::executeQuery($sql, array(
1 => array($participantPayment->participant_id, 'Integer'),
- 2 => array($participantPayment->contribution_id, 'Integer')
+ 2 => array($participantPayment->contribution_id, 'Integer'),
));
}
* @param array $params
* Associative array whose values match the record to be deleted.
*
- * @return boolean
+ * @return bool
* true if deleted false otherwise
*/
public static function deleteParticipantPayment($params) {
'cap' => 'round',
'join' => 'round',
'dash' => '2,2',
- 'color' => array(0, 0, 200)
+ 'color' => array(0, 0, 200),
));
$this->pdf->SetFontSize(9);
$ufGroupElement = $this->add('select', 'uf_group_id', ts('Select Profile'),
array(
- '' => ts('- select profile -')
+ '' => ts('- select profile -'),
) + $profiles, TRUE
);
$this->addDefaultButtons(ts('Continue'));
'first_name',
'last_name',
'external_identifier',
- 'participant_status_id'
+ 'participant_status_id',
);
foreach ($highlightedFieldsArray as $name) {
$highlightedFields[] = $name;
$headerPatterns = $this->get('headerPatterns');
$dataPatterns = $this->get('dataPatterns');
$hasLocationTypes = $this->get('fieldTypes');
-
-
/* Initialize all field usages to false */
foreach ($mapperKeys as $key) {
}
else {
$errors['_qf_default'] .= ts('Missing required contact matching fields.') . " $fieldMessage " . ts('(Sum of all weights should be greater than or equal to threshold: %1).', array(
- 1 => $threshold
+ 1 => $threshold,
)) . ' ' . ts('Or Provide Contact ID or External ID.') . '<br />';
}
}
if (isset(self::$_entityID)) {
$statusID = CRM_Core_DAO::getFieldValue('CRM_Batch_BAO_Batch', self::$_entityID, 'status_id');
}
- $breadCrumb =
- array(
+ $breadCrumb
+ = array(
array(
'title' => ts('Accounting Batches'),
'url' => CRM_Utils_System::url('civicrm/financial/financialbatches',
'CiviMail.ignored',
date('Y'),
date('m'),
- date('d')
+ date('d'),
)));
$this->_processed = $this->maildir(implode(DIRECTORY_SEPARATOR, array(
'CiviMail.processed',
date('Y'),
date('m'),
- date('d')
+ date('d'),
)));
}
print "copying message $nr to ignored folder\n";
}
$set = new ezcMailStorageSet($this->_transport->fetchByMessageNr($nr), $this->_ignored);
- $parser = new ezcMailParser;
+ $parser = new ezcMailParser();
$parser->parseMail($set);
$this->_leftToProcess--;
}
print "copying message $nr to processed folder\n";
}
$set = new ezcMailStorageSet($this->_transport->fetchByMessageNr($nr), $this->_processed);
- $parser = new ezcMailParser;
+ $parser = new ezcMailParser();
$parser->parseMail($set);
$this->_leftToProcess--;
}
'CiviMail.ignored',
date('Y'),
date('m'),
- date('d')
+ date('d'),
)));
$this->_processed = $this->maildir(implode(DIRECTORY_SEPARATOR, array(
'CiviMail.processed',
date('Y'),
date('m'),
- date('d')
+ date('d'),
)));
}
print "fetching message $nr and putting it in the ignored mailbox\n";
}
$set = new ezcMailStorageSet($this->_transport->fetchByMessageNr($nr), $this->_ignored);
- $parser = new ezcMailParser;
+ $parser = new ezcMailParser();
$parser->parseMail($set);
$this->_transport->delete($nr);
}
print "fetching message $nr and putting it in the processed mailbox\n";
}
$set = new ezcMailStorageSet($this->_transport->fetchByMessageNr($nr), $this->_processed);
- $parser = new ezcMailParser;
+ $parser = new ezcMailParser();
$parser->parseMail($set);
$this->_transport->delete($nr);
}
* @param string $joinDate
* Join date of the member whose membership status is to be calculated.
* @param \date|string $statusDate status date of the member whose membership status is to be calculated.
- * @param bool $excludeIsAdminExclude the statuses those having is_admin = 1.
+ * @param bool $excludeIsAdmin the statuses those having is_admin = 1.
* Exclude the statuses those having is_admin = 1.
* @param int $membershipTypeID
* @param array $membership
*
* @return array
*/
- static function getMembershipStatusByDate(
+ public static function getMembershipStatusByDate(
$startDate, $endDate, $joinDate,
$statusDate = 'today', $excludeIsAdmin = FALSE, $membershipTypeID, $membership = array()
) {
/**
* Class constructor
*/
- function __construct($controller, $action = CRM_Core_Action::NONE) {
+ public function __construct($controller, $action = CRM_Core_Action::NONE) {
parent::__construct($controller, $action);
$this->_pages = array();
* @param int $id
* Price Set id.
*
- * @return boolean
+ * @return bool
* false if fields exist for this set, true if the
* set could be deleted
*
$className = CRM_Utils_System::getClassName($form);
if (in_array($className, array(
'CRM_Contribute_Form_Contribution',
- 'CRM_Member_Form_Membership'
+ 'CRM_Member_Form_Membership',
))) {
$validFieldsOnly = FALSE;
}
*
* @param int $id
* Id of the database record.
- * @param bool $isQuickConfigValue we want to set the is_quick_config field.
+ * @param bool $isQuickConfig we want to set the is_quick_config field.
* Value we want to set the is_quick_config field.
*
* @return Object
*
*/
public static function checkMembershipPriceSet($id) {
- $query =
- "
-SELECT pfv.id, pfv.price_field_id, pfv.name, pfv.membership_type_id, pf.html_type, mt.auto_renew
+ $query
+ = "SELECT pfv.id, pfv.price_field_id, pfv.name, pfv.membership_type_id, pf.html_type, mt.auto_renew
FROM civicrm_price_field_value pfv
LEFT JOIN civicrm_price_field pf ON pf.id = pfv.price_field_id
LEFT JOIN civicrm_price_set ps ON ps.id = pf.price_set_id
/**
* Get the action links for this page.
*
- * @param null
- *
* @return array
* array of action links that we need to display for the browse screen
*/
- function &actionLinks() {
+ public function &actionLinks() {
// check if variable _actionsLinks is populated
if (!isset(self::$_actionLinks)) {
// helper variable for nicer formatting
* type of action and executes that action.
* Finally it calls the parent's run method.
*
- * @param null
- *
* @return void
*/
public function run() {
'date_format',
'time_format',
'default_value',
- 'is_required'
+ 'is_required',
);
foreach ($fieldIDs as $key => $fieldID) {
$fieldIDs[$key] = !is_numeric($fieldID) ? CRM_Core_BAO_CustomField::getKeyID($fieldID) : $fieldID;
$options[$fieldIDs[$key]]['attributes']['is_required'] = !empty($returnValues['is_required']);
$options[$fieldIDs[$key]]['attributes']['default_value'] = CRM_Utils_Array::value('default_value', $returnValues);
- $options[$fieldIDs[$key]]['attributes']['format'] =
- $options[$fieldIDs[$key]]['attributes']['date_format'] = CRM_Utils_Array::value('date_format', $returnValues);
+ $options[$fieldIDs[$key]]['attributes']['format']
+ = $options[$fieldIDs[$key]]['attributes']['date_format'] = CRM_Utils_Array::value('date_format', $returnValues);
$options[$fieldIDs[$key]]['attributes']['time_format'] = CRM_Utils_Array::value('time_format', $returnValues);
}
$actionParams = array(
'recordId' => $recId,
'gid' => $this->_profileId,
- 'id' => $this->_contactId
+ 'id' => $this->_contactId,
);
$op = 'profile.multiValue.row';
}
*/
public function run($args = NULL) {
if ($args[1] !== 'profile') {
- return;
+ return NULL;
}
$secondArg = CRM_Utils_Array::value(2, $args, '');
// make sure that this profile enables mapping
// CRM-8609
- $isMap =
- CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $profileGID, 'is_map');
+ $isMap = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $profileGID, 'is_map');
if (!$isMap) {
CRM_Core_Error::statusBounce(ts('This profile does not have the map feature turned on.'));
}
}
CRM_Utils_System::permissionDenied();
- return;
}
}
*
* @param int $instanceId
*
- * @return boolean
+ * @return bool
* true if yes, else false
*/
public static function isInstanceGroupRoleAllowed($instanceId) {
/**
* Given a string like "field_name = @value", replace "@value" with an escaped SQL string
*
- * @param string SQL expression
+ * @param $expr SQL expression
* @param null|array $args a list of values to insert into the SQL expression; keys are prefix-coded:
* prefix '@' => escape SQL
* prefix '#' => literal number, skip escaping but do validation
* @param array $params
* (reference ) input parameters.
*
- * @return boolean
+ * @return bool
* true if success, else false
*/
function civicrm_api3_contribution_delete($params) {
* Input parameters.
*
* @throws Exception
- * @return array
- * Api result array
+ * Api result array.
*/
function civicrm_api3_contribution_sendconfirmation($params) {
$contribution = new CRM_Contribute_BAO_Contribution();
$contribution->id = $params['id'];
- if (! $contribution->find(TRUE)) {
+ if (!$contribution->find(TRUE)) {
throw new Exception('Contribution does not exist');
}
$input = $ids = $cvalues = array('receipt_from_email' => $params['receipt_from_email']);
* {@getfields Contribution_completetransaction}
*
* @throws API_Exception
- * @return array
- * Api result array
+ * Api result array.
*/
function civicrm_api3_contribution_completetransaction(&$params) {
*
* @return array
* api result array
- * {@getfields contribution_page_create}
+ * {@getfields contribution_page_create}
*/
function civicrm_api3_contribution_page_create($params) {
$result = _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
*
* @return array
* API Result array Array of matching contribution_pages
- * {@getfields contribution_page_get}
+ * {@getfields contribution_page_get}
*/
function civicrm_api3_contribution_page_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
*
* @return array
* API result Array
- * {@getfields contribution_page_delete}
+ * {@getfields contribution_page_delete}
*/
function civicrm_api3_contribution_page_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
*
* @return array
* API result array
- * {@getfields contribution_page_delete}
+ * {@getfields contribution_page_delete}
*/
function civicrm_api3_contribution_page_submit($params) {
$result = CRM_Contribute_Form_Contribution_Confirm::submit($params);
* @param array $params
* Array included 'pledge_id' of pledge to delete.
*
- * @return boolean
+ * @return bool
* true if success, else false
- * {@getfields pledge_delete}
+ * {@getfields pledge_delete}
* @example PledgeDelete.php
*/
function civicrm_api3_pledge_delete($params) {
*
* @return array
* array of pledges, if error an array with an error id and error message
- * {@getfields pledge_get}
+ * {@getfields pledge_get}
* @example PledgeGet.php
*/
function civicrm_api3_pledge_get($params) {
* @param array $values
* The reformatted properties that we can use internally.
*
- * @return array|CRM_Core_Error
*/
function _civicrm_api3_pledge_format_params(&$values) {
*
* @return array
*
- * {@getfields word_replacement_create}
+ * {@getfields word_replacement_create}
*/
function civicrm_api3_word_replacement_create($params) {
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
* php bin/csv/export.php -e <entity> [ --field=value --field=value ] [ -s site.org ]
* e.g.: php bin/csv/export.php -e Contact --email=jamie@progressivetech.org
*
- **/
+ */
require_once dirname(__DIR__) . '/cli.class.php';
$entityExporter = new civicrm_cli_csv_exporter();
//since we are loading activities from dataset, we know total number of activities
// 8 schedule activities that should be shown on dashboard
$count = 8;
- $this->assertEquals($count, sizeof($activities), 'In line ' . __LINE__);
+ $this->assertEquals($count, count($activities), 'In line ' . __LINE__);
foreach ($activities as $key => $value) {
$this->assertEquals($value['subject'], "subject {$key}", 'Verify activity subject is correct.');
//since we are loading activities from dataset, we know total number of activities for this contact
// 5 activities ( 2 scheduled, 3 Completed ), note that dashboard shows only scheduled activities
$count = 2;
- $this->assertEquals($count, sizeof($activities), 'In line ' . __LINE__);
+ $this->assertEquals($count, count($activities), 'In line ' . __LINE__);
foreach ($activities as $key => $value) {
$this->assertEquals($value['subject'], "subject {$key}", 'Verify activity subject is correct.');
//since we are loading activities from dataset, we know total number of activities for this contact
// 5 activities, Contact Summary should show all activities
$count = 5;
- $this->assertEquals($count, sizeof($activities), 'In line ' . __LINE__);
+ $this->assertEquals($count, count($activities), 'In line ' . __LINE__);
foreach ($activities as $key => $value) {
$this->assertEquals($value['subject'], "subject {$key}", 'Verify activity subject is correct.');
//since we are loading activities from dataset, we know total number of activities for this contact
// This contact does not have any activities
- $this->assertEquals(0, sizeof($activities), 'In line ' . __LINE__);
+ $this->assertEquals(0, count($activities), 'In line ' . __LINE__);
}
}
* @return CRM_Contact_BAO_QueryTestDataProvider
*/
public function dataProvider() {
- return new CRM_Contact_BAO_QueryTestDataProvider;
+ return new CRM_Contact_BAO_QueryTestDataProvider();
}
public function setUp() {
$this->callAPISuccess('address', 'create', array(
'contact_id' => $contactID,
'city' => 'Cool City',
- 'location_type_id' => 1
+ 'location_type_id' => 1,
));
$params = array(
0 => array(
$this->callAPISuccess('address', 'create', array(
'contact_id' => $contactID,
'city' => 'Cool City',
- 'location_type_id' => 1
+ 'location_type_id' => 1,
));
$params = array(
0 => array(
$this->callAPISuccess('address', 'create', array(
'contact_id' => $contactID,
'city' => 'Cool City',
- 'location_type_id' => 1
+ 'location_type_id' => 1,
));
$params = array(
0 => array(
*/
private static function getInstance() {
if (is_null(self::$instance)) {
- self::$instance = new self;
+ self::$instance = new self();
}
return self::$instance;
}
$this->openCiviPage('admin/uf/group/field/add', array(
'action' => 'add',
'reset' => 1,
- 'gid' => $gid
+ 'gid' => $gid,
), 'field_name[0]');
$this->select('field_name[0]', "value=Membership");
$this->select('field_name[1]', "label={$checkboxFieldLabel} :: {$customGroupTitle}");
//Assertions
$actualAmount = $this->_getPremiumActualCost($contId, $to, $from, $cost2, "'civicrm_contribution'");
- $this->assertEquals($actualAmount,null,"Verify actual cost for changed premium");
+ $this->assertEquals($actualAmount, NULL, "Verify actual cost for changed premium");
$deletedAmount = $this->_getPremiumActualCost($contId, $from, $to, $cost, "'civicrm_contribution'");
- $this->assertEquals($deletedAmount, null, "Verify actual cost for deleted premium");
+ $this->assertEquals($deletedAmount, NULL, "Verify actual cost for deleted premium");
}
public function testDeletePremium() {
//Assertions
$actualAmount = $this->_getPremiumActualCost($contId, $from, $to, NULL, "'civicrm_contribution'");
- $this->assertEquals($actualAmount, null, "Verify actual cost for deleted premium");
+ $this->assertEquals($actualAmount, NULL, "Verify actual cost for deleted premium");
}
public function testChangePaymentInstrument() {
*
* @return null|string
*/
- function _getPremiumActualCost($entityId, $from = NULL, $to = NULL, $cost = NULL, $entityTable = NULL, $select = "ft.total_amount AS amount") {
+ public function _getPremiumActualCost($entityId, $from = NULL, $to = NULL, $cost = NULL, $entityTable = NULL, $select = "ft.total_amount AS amount") {
$financialAccount = CRM_Contribute_PseudoConstant::financialAccount();
$query = "SELECT
{$select}
*
* @return null|string
*/
- function _getFinancialTrxnAmount($contId) {
+ public function _getFinancialTrxnAmount($contId) {
$query = "SELECT
SUM( ft.total_amount ) AS total
FROM civicrm_financial_trxn AS ft
*
* @return null|string
*/
- function _getFinancialItemAmount($contId) {
+ public function _getFinancialItemAmount($contId) {
$lineItem = key(CRM_Price_BAO_LineItem::getLineItems($contId, 'contribution'));
$query = "SELECT
SUM(amount)
*
* @return null|string
*/
- function _getTotalContributedAmount($contId) {
+ public function _getTotalContributedAmount($contId) {
$query = "SELECT
SUM(amount)
FROM civicrm_entity_financial_trxn
$this->quickCleanup($tablesToTruncate, TRUE);
}
- /*
+ /**
* Test that custom fields is returned for correct contact type only
*/
public function testGetFields() {
$this->assertArrayHasKey("custom_{$this->IndividualField['id']}", $result['values'], 'If This fails there is probably a caching issue - failure in line' . __LINE__ . print_r(array_keys($result['values']), TRUE));
$result = $this->callAPISuccess('Contact', 'getfields', array(
'action' => 'create',
- 'contact_type' => 'Individual'
+ 'contact_type' => 'Individual',
), 'in line' . __LINE__);
$this->assertArrayHasKey("custom_{$this->IndividualField['id']}", $result['values']);
$result = $this->callAPISuccess('Contact', 'getfields', array(
'action' => 'create',
- 'contact_type' => 'Organization'
+ 'contact_type' => 'Organization',
));
$this->assertArrayNotHasKey("custom_{$this->IndividualField['id']}", $result['values'], 'in line' . __LINE__ . print_r(array_keys($result['values']), TRUE));
$result = $this->callAPISuccess('Relationship', 'getfields', array('action' => 'create'), 'in line' . __LINE__);
$this->assertTrue(in_array("custom_{$this->IndiStudentField['id']}", $contact['undefined_fields']), __LINE__);
}
-
-
// Retrieve Methods
/**
public function setUp() {
$phoneBankActivityTypeID = $this->callAPISuccessGetValue('Option_value', array(
'label' => 'PhoneBank',
- 'return' => 'value'
+ 'return' => 'value',
), 'integer');
$this->useTransaction();
$this->enableCiviCampaign();