// Address Standardization
$addrProviders = array(
- '' => '- select -'
- ) + CRM_Core_SelectValues::addressProvider();
+ '' => '- select -',
+ ) + CRM_Core_SelectValues::addressProvider();
$this->_varNames = array(
CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME => array(
* add the rules (mainly global rules) for form.
* All local rules are added near the element
*
- * @param null
- *
* @return void
*/
public function addRules() {
$ret['illegal'] = TRUE;
$table = $template->fetch('CRM/Price/Page/table.tpl');
$ret['content'] = ts('Unable to disable the \'%1\' price set - it is currently in use by one or more active events, contribution pages or contributions.', array(
- 1 => $priceSet
+ 1 => $priceSet,
)) . "<br/> $table";
}
else {
//make location type required for inline edit
$form->addSelect("address[$blockId][location_type_id]", array(
'entity' => 'address',
- 'class' => 'eight'
+ 'class' => 'eight',
) + $js, $inlineEdit);
if (!$inlineEdit) {
'postal_code' => array(
ts('Zip / Postal Code'),
array_merge($attributes['postal_code'], array('class' => 'crm_postal_code')),
- NULL
+ NULL,
),
'postal_code_suffix' => array(
ts('Postal Code Suffix'),
array('size' => 4, 'maxlength' => 12, 'class' => 'crm_postal_code_suffix'),
- NULL
+ NULL,
),
'country_id' => array(ts('Country'), $attributes['country_id'], 'country'),
'state_province_id' => array(ts('State/Province'), $attributes['state_province_id'], NULL),
if (in_array($nameWithoutID, array(
'street_number',
'street_name',
- 'street_unit'
+ 'street_unit',
)) && !empty($addressOptions['street_address_parsing'])
) {
$continue = FALSE;
$profileLinks = CRM_Core_BAO_UFGroup::getCreateLinks(array(
'new_individual',
'new_organization',
- 'new_household'
+ 'new_household',
), 'shared_address');
$form->addEntityRef("address[$blockId][master_contact_id]", ts('Share With'), array('create' => $profileLinks));
}
'name' => $shareAddressContactNames[$addressValue['master_id']]['name'],
'options' => CRM_Core_BAO_Address::getValues(array(
'entity_id' => $master_cid,
- 'contact_id' => $master_cid
+ 'contact_id' => $master_cid,
)),
'master_id' => $addressValue['master_id'],
);
'street_number',
'street_number_suffix',
'street_name',
- 'street_unit'
+ 'street_unit',
) as $fld) {
if (in_array($fld, array(
'street_name',
- 'street_unit'
+ 'street_unit',
))) {
$streetAddress .= ' ';
}
'url' => CRM_Utils_System::url('civicrm/contact/search/custom/list',
'reset=1'
),
- )
+ ),
);
CRM_Utils_System::appendBreadCrumb($breadCrumb);
$context = $this->get('context');
if (in_array($context, array(
'smog',
- 'amtg'
+ 'amtg',
))) {
$urlParams = 'reset=1&force=1&context=smog&gid=';
$urlParams .= ($context == 'smog') ? $this->get('gid') : $this->get('amtgID');
$url = CRM_Utils_System::url('civicrm/contact/' . $fragment, $path);
$session->replaceUserContext($url);
- return;
}
/**
/**
* Class constructor
*/
- function __construct(
+ public function __construct(
&$mapperKeys, $mapperLocType = NULL, $mapperPhoneType = NULL, $mapperImProvider = NULL, $mapperRelated = NULL, $mapperRelatedContactType = NULL, $mapperRelatedContactDetails = NULL, $mapperRelatedContactLocType = NULL, $mapperRelatedContactPhoneType = NULL, $mapperRelatedContactImProvider = NULL,
$mapperWebsiteType = NULL, $mapperRelatedContactWebsiteType = NULL
) {
}
//Relationship importables
- $this->_relationships = $relations =
- CRM_Contact_BAO_Relationship::getContactRelationshipType(
+ $this->_relationships = $relations
+ = CRM_Contact_BAO_Relationship::getContactRelationshipType(
NULL, NULL, NULL, $this->_contactType,
FALSE, 'label', TRUE, $this->_contactSubType
);
* @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 boo
* the result of this processing
*/
public function summary(&$values) {
*
* @param bool $doGeocodeAddress
*
- * @return boolean
+ * @return bool
* the result of this processing
*/
public function import($onDuplicate, &$values, $doGeocodeAddress = FALSE) {
$newContact = $this->createContact($formatted, $contactFields, $onDuplicate, $contactId);
}
// else skip does nothing and just returns an error code.
-
-
if ($cid) {
$contact = array(
'contact_id' => $cid,
// get payment instrument id
if (!empty($query->_returnProperties['payment_instrument_id'])) {
- $query->_select['instrument_id'] = "contribution_payment_instrument.value as instrument_id";
+ $query->_select['instrument_id'] = "contribution_payment_instrument.value as instrument_id";
$query->_select['payment_instrument_id'] = "contribution_payment_instrument.value as payment_instrument_id";
$query->_element['instrument_id'] = $query->_element['payment_instrument_id'] = 1;
$query->_tables['civicrm_contribution'] = 1;
case 'financial_type':
$query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause($fields[$name]['where'], $op, $value, 'String');
- CRM_Core_Error::debug( '$query', $query->_where[$grouping] );
+ CRM_Core_Error::debug('$query', $query->_where[$grouping]);
list($op, $value) = CRM_Contact_BAO_Query::buildQillForFieldValue('CRM_Contribute_DAO_Contribution', $name, $value, $op);
$query->_qill[$grouping][] = ts('%1 %2 %3', array(1 => $fields[$name]['title'], 2 => $op, 3 => $value));
$query->_tables['civicrm_contribution'] = $query->_whereTables['civicrm_contribution'] = 1;
$form->add('select', 'contribution_currency_type',
ts('Currency Type'),
array(
- '' => ts('- any -')
+ '' => ts('- any -'),
) +
CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'currency', array('labelColumn' => 'name')),
FALSE, array('class' => 'crm-select2')
$form->add('select', 'contribution_page_id',
ts('Contribution Page'),
array(
- '' => ts('- any -')
+ '' => ts('- any -'),
) +
CRM_Contribute_PseudoConstant::contributionPage(),
FALSE, array('class' => 'crm-select2')
$form->add('select', 'contribution_pcp_made_through_id',
ts('Personal Campaign Page'),
array(
- '' => ts('- any -')
+ '' => ts('- any -'),
) +
CRM_Contribute_PseudoConstant::pcPage(),
FALSE, array('class' => 'crm-select2')
public static function buildDateWhere(&$values, $query, $name, $field, $title) {
$fieldPart = strpos($name, $field);
if ($fieldPart === FALSE) {
- return;
+ return NULL;
}
// we only have recurring dates using this ATM so lets' short cut to find the table name
$table = 'contribution_recur';
$this->assign('mode', $this->_mode);
if ($this->_subscriptionDetails->contact_id) {
- list($this->_donorDisplayName, $this->_donorEmail) =
- CRM_Contact_BAO_Contact::getContactDetails($this->_subscriptionDetails->contact_id);
+ list($this->_donorDisplayName, $this->_donorEmail)
+ = CRM_Contact_BAO_Contact::getContactDetails($this->_subscriptionDetails->contact_id);
}
}
* 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
*/
CRM_Core_Error::displaySessionError($cancelSubscription);
}
elseif ($cancelSubscription) {
- $activityParams =
- array(
+ $activityParams
+ = array(
'subject' => $this->_mid ? ts('Auto-renewal membership cancelled') : ts('Recurring contribution cancelled'),
'details' => $message,
);
$inputParams = array('id' => $this->_mid);
CRM_Member_BAO_Membership::getValues($inputParams, $tplParams);
$tplParams = $tplParams[$this->_mid];
- $tplParams['membership_status'] =
- CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipStatus', $tplParams['status_id']);
- $tplParams['membershipType'] =
- CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $tplParams['membership_type_id']);
+ $tplParams['membership_status']
+ = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipStatus', $tplParams['status_id']);
+ $tplParams['membershipType']
+ = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $tplParams['membership_type_id']);
$status = ts('The automatic renewal of your %1 membership has been cancelled as requested. This does not affect the status of your membership - you will receive a separate notification when your membership is up for renewal.', array(1 => $tplParams['membershipType']));
$msgTitle = 'Membership Renewal Cancelled';
$msgType = 'info';
$value,
array('title', 'receipt_from_name', 'receipt_from_email')
);
- $receiptFrom =
- '"' .
- CRM_Utils_Array::value('receipt_from_name', $value[$this->_subscriptionDetails->contribution_page_id]) .
+ $receiptFrom
+ = '"' . CRM_Utils_Array::value('receipt_from_name', $value[$this->_subscriptionDetails->contribution_page_id]) .
'" <' .
$value[$this->_subscriptionDetails->contribution_page_id]['receipt_from_email'] .
'>';
}
// send notification
- $sendTemplateParams =
- array(
+ $sendTemplateParams
+ = array(
'groupName' => $this->_mode == 'auto_renew' ? 'msg_tpl_workflow_membership' : 'msg_tpl_workflow_contribution',
'valueName' => $this->_mode == 'auto_renew' ? 'membership_autorenew_cancelled' : 'contribution_recurring_cancelled',
'contactId' => $this->_subscriptionDetails->contact_id,
$session->setStatus($status, $msgTitle, $msgType);
}
elseif (!$userID) {
- if ($status)
+ if ($status) {
CRM_Utils_System::setUFMessage($status);
- // keep result as 1, since we not displaying anything on the redirected page anyway
- return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contribute/subscriptionstatus',
+ // keep result as 1, since we not displaying anything on the redirected page anyway
+ return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contribute/subscriptionstatus',
"reset=1&task=cancel&result=1"));
+ }
}
}
}
* @param array $entityBlock
* Input parameters to find object.
*
- * @return boolean
+ * @return bool
*/
public static function &getValues($entityBlock) {
return CRM_Core_BAO_Block::getValues('email', $entityBlock);
/**
* Get page orientations recognized by the DOMPDF package used to create PDF letters.
*
- * @param void
- *
* @return array
* array of page orientations
*/
/**
* Get font sizes supported by the TCPDF package used to create PDF labels.
*
- * @param void
- *
* @return array
* array of font sizes
*/
/**
* Get measurement units recognized by the TCPDF package used to create PDF labels.
*
- * @param void
- *
* @return array
* array of measurement units
*/
/**
* Get text alignment recognized by the TCPDF package used to create PDF labels.
*
- * @param void
- *
* @return array
* array of alignments
*/
/**
* Get text alignment recognized by the TCPDF package used to create PDF labels.
*
- * @param void
- *
* @return array
* array of alignments
*/
public static function addOrder(&$list, $returnURL) {
$filter = "option_group_id = " . self::_getGid();
CRM_Utils_Weight::addOrder($list, 'CRM_Core_DAO_OptionValue', 'id', $returnURL, $filter);
+ return $list;
}
/**
/**
* Return the name of the group for customized labels
*
- * @param void
- *
* @return void
*/
public static function customGroupName() {
* @param int $id
* Mapping id.
*
- * @return boolean
+ * @return boo
*/
public static function del($id) {
// delete from mapping_field table
* @param string $mapTypeId
* mapping Type.
*
- * @return boolean
+ * @return boo
*/
public static function checkMapping($nameField, $mapTypeId) {
$mapping = new CRM_Core_DAO_Mapping();
foreach (array(
'groups',
'tags',
- 'notes'
+ 'notes',
) as $value) {
unset($fields['Individual'][$value]);
unset($fields['Household'][$value]);
$fields['Contact']['note_body'] = array('title' => $noteTitle . ': ' . ts('Body Only'), 'name' => 'note_body');
$fields['Contact']['note_subject'] = array(
'title' => $noteTitle . ': ' . ts('Subject Only'),
- 'name' => 'note_subject'
+ 'name' => 'note_subject',
);
}
}
$csRelationships = array();
if ($mappingType == 'Export') {
- $subTypeRelationshipTypes =
- CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, NULL, NULL, $val['parent'],
+ $subTypeRelationshipTypes
+ = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, NULL, NULL, $val['parent'],
FALSE, 'label', TRUE, $subType);
foreach ($subTypeRelationshipTypes as $key => $var) {
0,
);
}
-
-
return $fields;
}
$mappingFields->delete();
if (empty($params['mapper'])) {
- return;
+ return NULL;
}
//save record in mapping field table
* @param object $note
* Either the id of the note to retrieve, or the CRM_Core_DAO_Note object itself.
*
- * @return boolean
+ * @return bool
* TRUE if the note should be displayed, otherwise FALSE
*
*/
* @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
* @param bool $ignoreKey
* Should we not set a qfKey for this controller (for standalone forms).
*/
- function __construct(
+ public function __construct(
$title = NULL,
$modal = TRUE,
$mode = NULL,
// lets try to get it from the session and/or the request vars
// we do this early on in case there is a fatal error in retrieving the
// key and/or session
- $this->_entryURL =
- CRM_Utils_Request::retrieve('entryURL', 'String', $this);
+ $this->_entryURL
+ = CRM_Utils_Request::retrieve('entryURL', 'String', $this);
// add a unique validable key to the name
$name = CRM_Utils_System::getClassName($this);
* Helper function to add all the needed default actions. Note that the framework
* redefines all of the default QFC actions
*
- * @param string directory to store all the uploaded files
- * @param array names for the various upload buttons (note u can have more than 1 upload)
+ * @param string $uploadDirectory to store all the uploaded files
+ * @param array $uploadNames for the various upload buttons (note u can have more than 1 upload)
*
*
* @return void
/**
* Getter for embedded
*
- * @return boolean
+ * @return bool
* return the embedded value
*/
public function getEmbedded() {
/**
* Getter for skipRedirection
*
- * @return boolean
+ * @return bool
* return the skipRedirection value
*/
public function getSkipRedirection() {
/**
* Getter for print
*
- * @return boolean
+ * @return bool
* return the print value
*/
public function getPrint() {
* @param \Civi\Core\Event\UnhandledExceptionEvent $event
* @throws Exception
*/
- static function handleException($event) {
+ public static function handleException($event) {
$e = $event->exception;
if ($e instanceof CRM_Core_Exception) {
$params = $e->getErrorData();
// FIXME: This is done to maintain current wire protocol, but it might be
// simpler to just require different 'types' for pages and forms
if (preg_match('/^CRM_[a-zA-Z0-9]+_Page_Inline_/', $className)) {
- $page = new $className;
+ $page = new $className();
$page->run();
}
else {
'rule_message' => ts('Please enter a valid value for your card security code. This is usually the last 3-4 digits on the card\'s signature panel.'),
'rule_name' => 'integer',
'rule_parameters' => NULL,
- )
+ ),
),
),
'credit_card_exp_date' => array(
'rule_message' => ts('Card expiration date cannot be a past date.'),
'rule_name' => 'currentDate',
'rule_parameters' => TRUE,
- )
+ ),
),
),
'credit_card_type' => array(
'rule_message' => ts('Please enter a valid Bank Identification Number (value must not contain punctuation characters).'),
'rule_name' => 'nopunctuation',
'rule_parameters' => NULL,
- )
+ ),
),
'is_required' => TRUE,
),
'rule_message' => ts('Please enter a valid Bank Identification Number (value must not contain punctuation characters).'),
'rule_name' => 'nopunctuation',
'rule_parameters' => NULL,
- )
+ ),
),
),
'bank_name' => array(
* the result in an nice formatted array (or an error object)
* @abstract
*/
- abstract function doDirectPayment(&$params);
+ abstract protected function doDirectPayment(&$params);
/**
* Process payment - this function wraps around both doTransferPayment and doDirectPayment
* @return string
* the error message if any
*/
- abstract function checkConfig();
+ abstract protected function checkConfig();
/**
* @param $paymentProcessor
* @param string $method
* Method to check for.
*
- * @return boolean
+ * @return bool
*/
public function isSupported($method = 'cancelSubscription') {
return method_exists(CRM_Utils_System::getClassName($this), $method);
*
* @return string
* the HMAC_MD5 encoding string
- **/
+ */
public function hmac($key, $data) {
if (function_exists('mhash')) {
// Use PHP mhash extension
*
* @return string
* fingerprint
- **/
+ */
public function CalculateFP() {
$x_tran_key = $this->_getParam('paymentKey');
$loginid = $this->_getParam('apiLogin');
* @param string $str
* The permission to check.
*
- * @return boolean
- * true if yes, else false
*/
-
public function check($str) {
//no default behaviour
}
* @param array $array
* The roles to check.
*
- * @return boolean
+ * @return bool
* true if yes, else false
*/
-
public function checkGroupRole($array) {
return FALSE;
}
* @param string $permissionName
* Name of the permission we are interested in.
*
- * @return string
- * a comma separated list of email addresses
*/
public function permissionEmails($permissionName) {
CRM_Core_Error::fatal("this function only works in Drupal 6 at the moment");
* @param string $roleName
* Name of the role we are interested in.
*
- * @return string
- * a comma separated list of email addresses
*/
public function roleEmails($roleName) {
CRM_Core_Error::fatal("this function only works in Drupal 6 at the moment");
/**
* Set variables up before form is built
*
- * @param null
- *
* @return void
*/
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
*/
/**
* Build the form object
*
- * @param null
- *
* @return void
*/
public function buildQuickForm() {
'option_group_id',
ts('Multiple Choice Option Sets'),
array(
- '' => ts('- select -')
+ '' => ts('- select -'),
) + $optionGroups
);
}
ts('Option Type'),
$optionTypes,
array(
- 'onclick' => "showOptionSelect();"
+ 'onclick' => "showOptionSelect();",
), '<br/>'
);
/**
* Process the form
*
- * @param null
- *
* @return void
*/
public function postProcess() {
1,
2,
3,
- 5
+ 5,
))) {
if (empty($params['is_searchable'])) {
$params['is_search_range'] = 0;
/**
* Set variables up before form is built
*
- * @param null
- *
* @return void
*/
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
*/
/**
* Build the form object
*
- * @param null
- *
* @return void
*/
public function buildQuickForm() {
/**
* Process the form
*
- * @param null
- *
* @return void
*/
public function postProcess() {
}
$fieldValues = array('option_group_id' => $this->_optionGroupID);
- $customOption->weight =
- CRM_Utils_Weight::updateOtherWeights(
+ $customOption->weight
+ = CRM_Utils_Weight::updateOtherWeights(
'CRM_Core_DAO_OptionValue',
$oldWeight,
$params['weight'],
else {
$defVal[] = $customOption->value;
}
- $customField->default_value =
- CRM_Core_DAO::VALUE_SEPARATOR .
+ $customField->default_value
+ = CRM_Core_DAO::VALUE_SEPARATOR .
implode(CRM_Core_DAO::VALUE_SEPARATOR, $defVal) .
CRM_Core_DAO::VALUE_SEPARATOR;
$customField->save();
}
}
- $customField->default_value =
- CRM_Core_DAO::VALUE_SEPARATOR .
+ $customField->default_value
+ = CRM_Core_DAO::VALUE_SEPARATOR .
implode(CRM_Core_DAO::VALUE_SEPARATOR, $tempVal) .
CRM_Core_DAO::VALUE_SEPARATOR;
$customField->save();
$params_array = array(
'cart_id' => $cart->id,
'contact_id' => CRM_Event_Cart_Form_Cart::find_or_create_contact(),
- 'event_id' => $event_id
+ 'event_id' => $event_id,
);
//XXX security?
$this->set('values', $this->_values);
$this->set('fields', $this->_fields);
- $this->_availableRegistrations =
- CRM_Event_BAO_Participant::eventFull(
+ $this->_availableRegistrations
+ = CRM_Event_BAO_Participant::eventFull(
$this->_values['event']['id'], TRUE,
CRM_Utils_Array::value('has_waitlist', $this->_values['event'])
);
*/
public static function addParticipant(&$form, $contactID) {
if (empty($form->_params)) {
- return;
+ return NULL;
}
$params = $form->_params;
$transaction = new CRM_Core_Transaction();
),
'register_date' => ($registerDate) ? $registerDate : date('YmdHis'),
'source' => CRM_Utils_String::ellipsify(
- isset($params['participant_source']) ?
- CRM_Utils_Array::value('participant_source', $params) : CRM_Utils_Array::value('description', $params),
+ isset($params['participant_source']) ? CRM_Utils_Array::value('participant_source', $params) : CRM_Utils_Array::value('description', $params),
$participantFields['participant_source']['maxlength']
),
'fee_level' => CRM_Utils_Array::value('amount_level', $params),
$optionMaxValues[$priceFieldId][$optId] = $currentMaxValue;
}
else {
- $optionMaxValues[$priceFieldId][$optId] =
- $currentMaxValue + CRM_Utils_Array::value($optId, CRM_Utils_Array::value($priceFieldId, $optionMaxValues), 0);
+ $optionMaxValues[$priceFieldId][$optId]
+ = $currentMaxValue + CRM_Utils_Array::value($optId, CRM_Utils_Array::value($priceFieldId, $optionMaxValues), 0);
}
}
if ($optMax && $total > $optMax) {
$errors['soldOutOptions'][] = ts('Option %1 has sold out.', array(1 => $feeBlock[$fieldId]['options'][$optId]['label']));
if ($opDbCount && ($opDbCount >= $optMax)) {
- $errors[$currentParticipantNum]["price_{$fieldId}"] =
- ts('Sorry, this option is currently sold out.');
+ $errors[$currentParticipantNum]["price_{$fieldId}"]
+ = ts('Sorry, this option is currently sold out.');
}
elseif (($optMax - $opDbCount) == 1) {
- $errors[$currentParticipantNum]["price_{$fieldId}"] =
- ts('Sorry, currently only a single seat is available for this option.', array(1 => ($optMax - $opDbCount)));
+ $errors[$currentParticipantNum]["price_{$fieldId}"]
+ = ts('Sorry, currently only a single seat is available for this option.', array(1 => ($optMax - $opDbCount)));
}
else {
- $errors[$currentParticipantNum]["price_{$fieldId}"] =
- ts('Sorry, currently only %1 seats are available for this option.', array(1 => ($optMax - $opDbCount)));
+ $errors[$currentParticipantNum]["price_{$fieldId}"]
+ = ts('Sorry, currently only %1 seats are available for this option.', array(1 => ($optMax - $opDbCount)));
}
}
}
public function buildQuickForm() {
// CRM_Event_Form_Task_Batch::buildQuickForm() gets ufGroupId
// from the form, so set it here to the id of the reserved profile
- $dao = new CRM_Core_DAO_UFGroup;
+ $dao = new CRM_Core_DAO_UFGroup();
$dao->name = 'participant_status';
$dao->find(TRUE);
$this->set('ufGroupId', $dao->id);
asort($statuses, SORT_STRING);
$this->add('select', 'status_change', ts('Change All Statuses'),
array(
- '' => ts('- select status -')
+ '' => ts('- select status -'),
) + $statuses
);
/**
* Define action links
*
- * @return array
* self::$_links array of action links
*/
public function &links() {
/**
* Create a security hash from the job, email and contact ids
*
- * @param array The ids to be hashed
- *
* @return int
* The hash
*/
/**
*/
public function __construct() {
- $logging = new CRM_Logging_Schema;
+ $logging = new CRM_Logging_Schema();
$this->tables[] = 'civicrm_contact';
$this->tables = array_merge($this->tables, array_keys($logging->customDataLogTables()));
$this->tables[] = 'civicrm_email';
'title' => ts('Relationship'),
'operatorType' => CRM_Report_Form::OP_SELECT,
'options' => array(
- '' => '- any relationship type -',
- ) +
- CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, NULL, TRUE),
+ '' => '- any relationship type -',
+ ) +
+ CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, NULL, TRUE),
'type' => CRM_Utils_Type::T_INT,
),
),
'reset=1&force=1&id_op=eq&id_value=' . $row['civicrm_contact_id'],
$this->_absoluteUrl, $this->_id, $this->_drilldownReport
);
- $rows[$rowNum]['civicrm_contact_sort_name_a'] =
- $rows[$rowNum]['civicrm_contact_sort_name_a'] . ' (' .
+ $rows[$rowNum]['civicrm_contact_sort_name_a']
+ = $rows[$rowNum]['civicrm_contact_sort_name_a'] . ' (' .
$rows[$rowNum]['civicrm_contact_id'] . ')';
$rows[$rowNum]['civicrm_contact_sort_name_a_link'] = $url;
$rows[$rowNum]['civicrm_contact_sort_name_a_hover'] = ts("View Contact details for this contact.");
'reset=1&force=1&id_op=eq&id_value=' . $row['civicrm_contact_b_id'],
$this->_absoluteUrl, $this->_id, $this->_drilldownReport
);
- $rows[$rowNum]['civicrm_contact_b_sort_name_b'] =
- $rows[$rowNum]['civicrm_contact_b_sort_name_b'] . ' (' .
+ $rows[$rowNum]['civicrm_contact_b_sort_name_b']
+ = $rows[$rowNum]['civicrm_contact_b_sort_name_b'] . ' (' .
$rows[$rowNum]['civicrm_contact_b_id'] . ')';
$rows[$rowNum]['civicrm_contact_b_sort_name_b_link'] = $url;
$rows[$rowNum]['civicrm_contact_b_sort_name_b_hover'] = ts("View Contact details for this contact.");
if (array_key_exists('civicrm_relationship_relationship_id', $row) &&
array_key_exists('civicrm_contact_id', $row)
) {
- $url =
- "/civicrm/contact/view/rel?reset=1&action=update&rtype=a_b&cid=" .
+ $url = "/civicrm/contact/view/rel?reset=1&action=update&rtype=a_b&cid=" .
$row['civicrm_contact_id'] . "&id=" .
$row['civicrm_relationship_relationship_id'];
$rows[$rowNum]['civicrm_relationship_relationship_id_link'] = $url;
public function __construct() {
$this->_autoIncludeIndexedFieldsAsOrderBys = 1;
$this->_columns = array(
- 'civicrm_contact' => array(
- 'dao' => 'CRM_Contact_DAO_Contact',
- 'fields' => array(
- 'sort_name' => array(
- 'title' => ts('Contact Name'),
- 'required' => TRUE,
- 'no_repeat' => TRUE,
- ),
- 'first_name' => array(
- 'title' => ts('First Name'),
- ),
- 'middle_name' => array(
- 'title' => ts('Middle Name'),
- ),
- 'last_name' => array(
- 'title' => ts('Last Name'),
- ),
- 'id' => array(
- 'no_display' => TRUE,
- 'required' => TRUE,
- ),
- 'contact_type' => array(
- 'title' => ts('Contact Type'),
- ),
- 'contact_sub_type' => array(
- 'title' => ts('Contact Subtype'),
- ),
- 'gender_id' => array(
- 'title' => ts('Gender'),
- ),
- 'birth_date' => array(
- 'title' => ts('Birth Date'),
- ),
- 'age' => array(
- 'title' => ts('Age'),
- 'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, CURDATE())',
- ),
+ 'civicrm_contact' => array(
+ 'dao' => 'CRM_Contact_DAO_Contact',
+ 'fields' => array(
+ 'sort_name' => array(
+ 'title' => ts('Contact Name'),
+ 'required' => TRUE,
+ 'no_repeat' => TRUE,
),
- 'filters' => array(
- 'sort_name' => array('title' => ts('Contact Name')),
- 'source' => array(
- 'title' => ts('Contact Source'),
- 'type' => CRM_Utils_Type::T_STRING,
- ),
- 'id' => array(
- 'title' => ts('Contact ID'),
- 'no_display' => TRUE,
- ),
- 'gender_id' => array(
- 'title' => ts('Gender'),
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id'),
- ),
- 'birth_date' => array(
- 'title' => ts('Birth Date'),
- 'operatorType' => CRM_Report_Form::OP_DATE,
- ),
+ 'first_name' => array(
+ 'title' => ts('First Name'),
),
- 'grouping' => 'contact-fields',
- 'order_bys' => array(
- 'sort_name' => array(
- 'title' => ts('Last Name, First Name'),
- 'default' => '1',
- 'default_weight' => '0',
- 'default_order' => 'ASC',
- ),
- 'gender_id' => array(
- 'name' => 'gender_id',
- 'title' => ts('Gender'),
- ),
- 'birth_date' => array(
- 'name' => 'birth_date',
- 'title' => ts('Birth Date'),
- ),
+ 'middle_name' => array(
+ 'title' => ts('Middle Name'),
+ ),
+ 'last_name' => array(
+ 'title' => ts('Last Name'),
+ ),
+ 'id' => array(
+ 'no_display' => TRUE,
+ 'required' => TRUE,
+ ),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
+ ),
+ 'gender_id' => array(
+ 'title' => ts('Gender'),
+ ),
+ 'birth_date' => array(
+ 'title' => ts('Birth Date'),
+ ),
+ 'age' => array(
+ 'title' => ts('Age'),
+ 'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, CURDATE())',
),
),
- 'civicrm_email' => array(
- 'dao' => 'CRM_Core_DAO_Email',
- 'fields' => array(
- 'email' => array(
- 'title' => ts('Email'),
- 'no_repeat' => TRUE,
- ),
+ 'filters' => array(
+ 'sort_name' => array('title' => ts('Contact Name')),
+ 'source' => array(
+ 'title' => ts('Contact Source'),
+ 'type' => CRM_Utils_Type::T_STRING,
+ ),
+ 'id' => array(
+ 'title' => ts('Contact ID'),
+ 'no_display' => TRUE,
+ ),
+ 'gender_id' => array(
+ 'title' => ts('Gender'),
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id'),
),
- 'grouping' => 'contact-fields',
- 'order_bys' => array(
- 'email' => array(
- 'title' => ts('Email'),
- ),
+ 'birth_date' => array(
+ 'title' => ts('Birth Date'),
+ 'operatorType' => CRM_Report_Form::OP_DATE,
+ ),
+ ),
+ 'grouping' => 'contact-fields',
+ 'order_bys' => array(
+ 'sort_name' => array(
+ 'title' => ts('Last Name, First Name'),
+ 'default' => '1',
+ 'default_weight' => '0',
+ 'default_order' => 'ASC',
+ ),
+ 'gender_id' => array(
+ 'name' => 'gender_id',
+ 'title' => ts('Gender'),
+ ),
+ 'birth_date' => array(
+ 'name' => 'birth_date',
+ 'title' => ts('Birth Date'),
+ ),
+ ),
+ ),
+ 'civicrm_email' => array(
+ 'dao' => 'CRM_Core_DAO_Email',
+ 'fields' => array(
+ 'email' => array(
+ 'title' => ts('Email'),
+ 'no_repeat' => TRUE,
+ ),
+ ),
+ 'grouping' => 'contact-fields',
+ 'order_bys' => array(
+ 'email' => array(
+ 'title' => ts('Email'),
),
),
- 'civicrm_phone' => array(
- 'dao' => 'CRM_Core_DAO_Phone',
- 'fields' => array(
- 'phone' => NULL,
- 'phone_ext' => array(
- 'title' => ts('Phone Extension'),
- ),
+ ),
+ 'civicrm_phone' => array(
+ 'dao' => 'CRM_Core_DAO_Phone',
+ 'fields' => array(
+ 'phone' => NULL,
+ 'phone_ext' => array(
+ 'title' => ts('Phone Extension'),
),
- 'grouping' => 'contact-fields',
),
- ) + $this->getAddressColumns(array('group_by' => FALSE));
+ 'grouping' => 'contact-fields',
+ ),
+ ) + $this->getAddressColumns(array('group_by' => FALSE));
$this->_groupFilter = TRUE;
$this->_tagFilter = TRUE;
}
}
// Drop index UI_title for civicrm_price_set
- $domain = new CRM_Core_DAO_Domain;
+ $domain = new CRM_Core_DAO_Domain();
$domain->find(TRUE);
if ($domain->locales) {
$locales = explode(CRM_Core_DAO::VALUE_SEPARATOR, $domain->locales);
$dao = CRM_Core_DAO::executeQuery($query);
if (!$dao->N) {
- $domain = new CRM_Core_DAO_Domain;
+ $domain = new CRM_Core_DAO_Domain();
$domain->find(TRUE);
if ($domain->locales) {
$addTo[2] = $dao->contribution_page_id;
$options = array(
'otherAmount' => $dao->is_allow_other_amount,
- 'membership' => $dao->membership_block_id
+ 'membership' => $dao->membership_block_id,
);
self::createPriceSet($daoName, $addTo, $options);
}
'2' => array('membership_amount', 'String'),
'3' => array(
CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership', $result->membership_id, 'membership_type_id'),
- 'Integer'
+ 'Integer',
),
);
$res = CRM_Core_DAO::executeQuery($sql, $params);
if (!empty($defaults)) {
$lineParams['price_field_id'] = $defaults['id'];
$lineParams['label'] = $defaults['label'];
- $lineParams['price_field_value_id'] =
- CRM_Core_DAO::getFieldValue('CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue', $defaults['id'], 'id', 'price_field_id');
+ $lineParams['price_field_value_id']
+ = CRM_Core_DAO::getFieldValue('CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue', $defaults['id'], 'id', 'price_field_id');
}
else {
- $lineParams['price_field_id'] =
- CRM_Core_DAO::getFieldValue('CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field', $priceSetId, 'id', 'price_set_id');
+ $lineParams['price_field_id']
+ = CRM_Core_DAO::getFieldValue('CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field', $priceSetId, 'id', 'price_set_id');
$lineParams['label'] = 'Contribution Amount';
}
$lineParams['qty'] = 1;
$dao->start_date,
$dao->end_date,
$memStatus,
- $status
+ $status,
);
}
}
* @param $whereField
* @param null $additionalWhereCond
*/
- function table(
+ public function table(
&$ids,
$tableName,
&$fields,
* @param null $lastExportTime
* @param bool $discoverContacts
*/
- function run(
+ public function run(
$fileName,
$lastExportTime = NULL,
$discoverContacts = FALSE
if (!self::$_currencySymbols) {
self::$_currencySymbols = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'currency', array(
'keyColumn' => 'name',
- 'labelColumn' => 'symbol'
+ 'labelColumn' => 'symbol',
));
}
$dispatcher->addListener('DAO::post-delete', array('\CRM_Core_BAO_RecurringEntity', 'triggerDelete'));
$dispatcher->addListener('hook_civicrm_unhandled_exception', array(
'CRM_Core_LegacyErrorHandler',
- 'handleException'
+ 'handleException',
));
return $dispatcher;
}
*
* @param array $params
* @return array API Success Array
- * API Success Array
+ * API Success Array
* @throws \API_Exception
* @throws \Civi\API\Exception\UnauthorizedException
*/
return civicrm_api3_create_success($params);
}
else {
- throw new API_Exception(ts('Queue event could not be found'),'no_queue_event
+ throw new API_Exception(ts('Queue event could not be found'), 'no_queue_event
');
}
}
switch ($detail) {
case 'Delivered':
$stats[$params['mailing_id']] += array(
- $detail => CRM_Mailing_Event_BAO_Delivered::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, $params['date']),
+ $detail => CRM_Mailing_Event_BAO_Delivered::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, $params['date']),
);
break;
case 'Bounces':
$stats[$params['mailing_id']] += array(
- $detail => CRM_Mailing_Event_BAO_Bounce::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, $params['date']),
+ $detail => CRM_Mailing_Event_BAO_Bounce::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, $params['date']),
);
break;
case 'Unsubscribers':
$stats[$params['mailing_id']] += array(
- $detail => CRM_Mailing_Event_BAO_Unsubscribe::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, NULL, $params['date']),
+ $detail => CRM_Mailing_Event_BAO_Unsubscribe::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, NULL, $params['date']),
);
break;
case 'Unique Clicks':
$stats[$params['mailing_id']] += array(
- $detail => CRM_Mailing_Event_BAO_TrackableURLOpen::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, NULL, $params['date']),
+ $detail => CRM_Mailing_Event_BAO_TrackableURLOpen::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, NULL, $params['date']),
);
break;
case 'Opened':
$stats[$params['mailing_id']] += array(
- $detail => CRM_Mailing_Event_BAO_Opened::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, $params['date']),
+ $detail => CRM_Mailing_Event_BAO_Opened::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, $params['date']),
);
break;
}
*
* @return array
* api result
- * {@getfields membership_delete}
+ * {@getfields membership_delete}
*/
function civicrm_api3_membership_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
*
* @return array
* Array of newly created membership property values.
- * {@getfields membership_create}
+ * {@getfields membership_create}
*/
function civicrm_api3_membership_create($params) {
// check params for membership id during update
// Fixme: This code belongs in the BAO
$action = CRM_Core_Action::ADD;
// we need user id during add mode
- $ids = array();
- if (!empty($params['contact_id'])) {
- $ids['userId'] = $params['contact_id'];
- }
+ $ids = array();
+ if (!empty($params['contact_id'])) {
+ $ids['userId'] = $params['contact_id'];
+ }
//for edit membership id should be present
if (!empty($params['id'])) {
$ids['membership'] = $params['id'];
$params['status_id'] = array('IN' => CRM_Member_BAO_MembershipStatus::getMembershipStatusCurrent());
}
- $options = _civicrm_api3_get_options_from_params($params, TRUE,'membership', 'get');
+ $options = _civicrm_api3_get_options_from_params($params, TRUE, 'membership', 'get');
if ($options['is_count']) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
return civicrm_api3_create_success($membershipValues, $params, 'membership', 'get');
}
- $members = _civicrm_api3_membership_relationsship_get_customv2behaviour($params, $membershipValues, $contactID);
+ $members = _civicrm_api3_membership_relationsship_get_customv2behaviour($params, $membershipValues, $contactID);
return civicrm_api3_create_success($members, $params, 'membership', 'get');
}
'is_contact' => 0,
'description' => "Set this value to Yes if you want CiviCRM error/debugging messages to also appear in Drupal error logs",
'prefetch' => 1,
- 'help_text' => "Set this value to Yes if you want CiviCRM error/debugging messages the appear in your CMS' error log.
-In the case of Drupal, this will cause all CiviCRM error messages to appear in the watchdog (assuming you have Drupal's watchdog enabled)",
+ 'help_text' => "Set this value to Yes if you want CiviCRM error/debugging messages the appear in your CMS' error log. In the case of Drupal, this will cause all CiviCRM error messages to appear in the watchdog (assuming you have Drupal's watchdog enabled)",
),
'backtrace' => array(
'group_name' => 'Developer Preferences',
*/
private static function getInstance() {
if (is_null(self::$instance)) {
- self::$instance = new self;
+ self::$instance = new self();
}
return self::$instance;
}
* @param $expectedValue
* @param string $message
*/
- function assertDBCompareValue(
+ public function assertDBCompareValue(
&$testCase, $daoName, $searchValue, $returnColumn, $searchColumn,
$expectedValue, $message
) {
'edit-1-profile-create',
'edit-1-profile-edit',
'edit-1-profile-listings',
- 'edit-1-profile-view'
+ 'edit-1-profile-view',
);
$this->changePermissions($permission);
$this->customGroupDelete($ids['custom_group_id']);
}
- /*
- */
public function testgetfieldspledge() {
$result = $this->callAPISuccess('pledge', 'getfields', array('action' => 'get'));
$this->assertEquals(1, $result['values']['next_pay_date']['api.return']);
$this->assertEquals($oldPledge['id'], $earlyPledge['id'], ' check correct pledge returned ' . __LINE__);
}
- /*
+ /**
* create 2 pledges - see if we can get by status id
*/
public function testGetOverduePledge() {
}
- /*
+ /**
* create 2 pledges - see if we can get by status id
*/
public function testSortParamPledge() {
$pledge = $this->callAPISuccess('pledge', 'delete', $pledgeID);
}
- /*
+ /**
* Test that pledge with weekly schedule calculates dates correctly
*/
public function testCreatePledgeWeeklySchedule() {
//ensure that correct number of payments created & last payment has the right date
$payments = $this->callAPISuccess('PledgePayment', 'Get', array(
'pledge_id' => $pledge['id'],
- 'sequential' => 1
+ 'sequential' => 1,
));
$this->assertEquals($payments['count'], 5, 'In line ' . __LINE__);
$this->assertEquals('2011-07-06 00:00:00', $payments['values'][4]['scheduled_date'], 'In line ' . __LINE__);
$pledge = $this->callAPISuccess('pledge', 'delete', $pledgeID);
}
- /*
- * test that using original_installment_amount rather than pledge_original_installment_amount works
- * Pledge field behaviour is a bit random & so pledge has come to try to handle both unique & non -unique fields
- */
+ /**
+ * test that using original_installment_amount rather than pledge_original_installment_amount works
+ * Pledge field behaviour is a bit random & so pledge has come to try to handle both unique & non -unique fields
+ */
public function testCreatePledgeWithNonUnique() {
$params = $this->_params;
$params['original_installment_amount'] = $params['pledge_original_installment_amount'];
$pledge = $this->callAPISuccess('pledge', 'delete', $new_params);
}
- ///////////////// civicrm_pledge_delete methods
public function testDeleteEmptyParamsPledge() {
$pledge = $this->callAPIFailure('pledge', 'delete', array(), 'Mandatory key(s) missing from params array: id');
}