CRM_Contact_BAO_Contact_Permission::cache($id, CRM_Core_Permission::VIEW, TRUE);
}
- // deletes all the cache entries
+ /**
+ * Deletes all the cache entries.
+ */
public static function resetCache() {
// reset any static caching
self::$_cache = NULL;
/**
* Used to copy custom fields and attachments from an existing activity to another.
- * @see CRM_Case_Page_AJAX::_convertToCaseActivity() for example
+ * @see CRM_Case_Page_AJAX::_convertToCaseActivity()
*
* @param array $params
*/
* Validate type of contact image
*
* @param array $params
- * @param String $imageIndex
+ * @param string $imageIndex
* Index of image field.
- * @param String $statusMsg
+ * @param string $statusMsg
* Status message to be set after operation.
* @param string $opType
* Type of operation like fatal, bounce etc.
/**
* Function to set is_delete true or restore deleted contact
*
- * @param int $contact Contact DAO object
- * @param boolean $restore true to set the is_delete = 1 else false to restore deleted contact,
+ * @param int $contact
+ * Contact DAO object.
+ * @param bool $restore
+ * True to set the is_delete = 1 else false to restore deleted contact,
* i.e. is_delete = 0
*
* @return void
if ($relationship->find(TRUE)) {
CRM_Contact_BAO_Relationship::setIsActive($relationship->id, FALSE);
CRM_Contact_BAO_Relationship::relatedMemberships($contactId, $relMembershipParams,
- $ids = array(
- ), CRM_Core_Action::DELETE
+ $ids = array(),
+ CRM_Core_Action::DELETE
);
}
$relationship->free();
* @return array $groupList associated array of group list
* -rp = rowcount
* -page= offset
- * @todo there seems little reason for the small number of functions that call this to pass in
- * params that then need to be translated in this function since they are coding them when calling
+ * @todo there seems little reason for the small number of functions that call this to pass in
+ * params that then need to be translated in this function since they are coding them when calling
*/
static public function getGroupListSelector(&$params) {
// format the params
$query->_tables['civicrm_address'] = $query->_whereTables['civicrm_address'] = 1;
- require_once (str_replace('_', DIRECTORY_SEPARATOR, $fnName) . '.php');
+ require_once str_replace('_', DIRECTORY_SEPARATOR, $fnName) . '.php';
$fnName::format($proximityAddress);
if (
!is_numeric(CRM_Utils_Array::value('geo_code_1', $proximityAddress)) ||
$customSearchClass = $ext->keyToClass($customSearchClass);
}
- $error = include_once ($customSearchFile);
+ $error = include_once $customSearchFile;
if ($error == FALSE) {
CRM_Core_Error::fatal('Custom search file: ' . $customSearchFile . ' does not exist. Please verify your custom search settings in CiviCRM administrative panel.');
}
);
if ($isMultiple) {
$this->assign('multiRecordDisplay', $this->_multiRecordDisplay);
- $saveButtonName = $this->_copyValueId ? 'Save a Copy': 'Save';
+ $saveButtonName = $this->_copyValueId ? 'Save a Copy' : 'Save';
$this->addButtons(array(
array(
'type' => 'upload',
$template = CRM_Core_Smarty::singleton();
$tplGroupTree = $template->get_template_vars('address_groupTree');
- $tplGroupTree = empty($tplGroupTree) ? array(
- ) : $tplGroupTree;
+ $tplGroupTree = empty($tplGroupTree) ? array() : $tplGroupTree;
$form->assign('address_groupTree', $tplGroupTree + array($blockId => $groupTree));
// unset the temp smarty var that got created
//build 1 instance of all blocks, without using ajax ...
foreach ($form->_blocks as $blockName => $label) {
- require_once (str_replace('_', DIRECTORY_SEPARATOR, 'CRM_Contact_Form_Edit_' . $blockName) . '.php');
+ require_once str_replace('_', DIRECTORY_SEPARATOR, 'CRM_Contact_Form_Edit_' . $blockName) . '.php';
$name = strtolower($blockName);
$instances = array(1);
'limit' => 1,
'version' => 3,
);
- $note = civicrm_api('Note' ,'getsingle', $noteParams);
+ $note = civicrm_api('Note', 'getsingle', $noteParams);
$defaults['note'] = CRM_Utils_Array::value('note', $note);
}
}
'entity_id' => $id,
'entity_table' => 'civicrm_relationship',
);
- $existing = civicrm_api3('note' ,'get', $noteParams);
+ $existing = civicrm_api3('note', 'get', $noteParams);
if (!empty($existing['id'])) {
$noteParams['id'] = $existing['id'];
}
$setDynamic = TRUE;
}
else {
- $selector = new self::$_selectorName (
+ $selector = new self::$_selectorName(
$this->_params,
$this->_action,
NULL,
}
$selectorName = $this->controller->selectorName();
- require_once(str_replace('_', DIRECTORY_SEPARATOR, $selectorName) . '.php');
+ require_once str_replace('_', DIRECTORY_SEPARATOR, $selectorName) . '.php';
$fv = $this->get('formValues');
$customClass = $this->get('customSearchClass');
$ccValues['details'][] = "<a href='{$contactURL}'>" . $form->_contactDetails[$contactId]['display_name'] . "</a>";
break;
case 'bcc_id':
- $bccValues['email'][]= '"' . $form->_contactDetails[$contactId]['sort_name'] . '" <' . $email . '>';
+ $bccValues['email'][] = '"' . $form->_contactDetails[$contactId]['sort_name'] . '" <' . $email . '>';
$bccValues['details'][] = "<a href='{$contactURL}'>" . $form->_contactDetails[$contactId]['display_name'] . "</a>";
break;
}
}
$selectorName = $this->controller->selectorName();
- require_once (str_replace('_', DIRECTORY_SEPARATOR, $selectorName) . '.php');
+ require_once str_replace('_', DIRECTORY_SEPARATOR, $selectorName) . '.php';
$returnP = isset($returnPropeties) ? $returnPropeties : "";
$customSearchClass = $this->get('customSearchClass');
}
// we only have recurring dates using this ATM so lets' short cut to find the table name
$table = 'contribution_recur';
- $fieldName = split($table . '_', $field);
+ $fieldName = explode($table . '_', $field);
$query->dateQueryBuilder($values,
'civicrm_' . $table, $field, $fieldName[1], $title
);
* Date: 8/12/2014
* Time: 10:33 AM
*/
-
-class CRM_Contribute_Exception_InactiveContributionPageException extends Exception{
+class CRM_Contribute_Exception_InactiveContributionPageException extends Exception {
private $id;
public function __construct($message, $id) {
parent::__construct(ts($message));
*/
public function postProcess() {
$sendReceipt = $pId = $contribution = $isRelatedId = FALSE;
- $softParams = $softIDs =array();
+ $softParams = $softIDs = array();
if ($this->_action & CRM_Core_Action::DELETE) {
CRM_Contribute_BAO_Contribution::deleteContribution($this->_id);
$submittedValues['tax_amount'] = 'null';
}
if ($lineItems[$itemId]['tax_rate']) {
- $lineItems[$itemId]['tax_amount'] = ($lineItems[$itemId]['tax_rate']/100) * $lineItems[$itemId]['line_total'];
+ $lineItems[$itemId]['tax_amount'] = ($lineItems[$itemId]['tax_rate'] / 100) * $lineItems[$itemId]['line_total'];
$submittedValues['total_amount'] = $lineItems[$itemId]['line_total'] + $lineItems[$itemId]['tax_amount'];
$submittedValues['tax_amount'] = $lineItems[$itemId]['tax_amount'];
}
if ($fixed_period_start_day) {
$date = explode('-', date('Y-m-d'));
$month = substr($fixed_period_start_day, 0, strlen($fixed_period_start_day) - 2);
- $day = substr($fixed_period_start_day, -2) . "<br>";
+ $day = substr($fixed_period_start_day, -2) . "<br/>";
$year = $date[0];
$startDate = $year . '-' . $month . '-' . $day;
}
$contact['is_sent'][$groupBy][$groupByID] = TRUE;
if (!empty($formValues['email_options'])) {
if (self::emailLetter($contact, $html[$contributionId], $isPDF, $formValues, $emailParams)) {
- $emailed ++;
+ $emailed++;
if (!stristr($formValues['email_options'], 'both')) {
unset($html[$contributionId]);
}
else {
return FALSE;
}
- break;
+ break;
case 'payment_instrument':
static $paymentInstruments = NULL;
";
$sqlParams = array(1 => array($entity_id, 'Integer'));
- return CRM_Core_DAO::singleValueQuery($query, $sqlParams);
+ return CRM_Core_DAO::singleValueQuery($query, $sqlParams);
}
$financialAccountType = CRM_Contribute_PseudoConstant::financialAccountType($params['financial_type_id']);
$accountRelationship = CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND label IN ('Premiums Inventory Account is', 'Cost of Sales Account is')");
$toFinancialAccount = !empty($params['isDeleted']) ? 'Premiums Inventory Account is' : 'Cost of Sales Account is';
- $fromFinancialAccount = !empty($params['isDeleted']) ? 'Cost of Sales Account is': 'Premiums Inventory Account is';
+ $fromFinancialAccount = !empty($params['isDeleted']) ? 'Cost of Sales Account is' : 'Premiums Inventory Account is';
$accountRelationship = array_flip($accountRelationship);
$financialtrxn = array(
'to_financial_account_id' => $financialAccountType[$accountRelationship[$toFinancialAccount]],
* @return array array of font names
* @static
*/
- public static function getFontNames($name='label_format') {
+ public static function getFontNames($name = 'label_format') {
$label = new CRM_Utils_PDF_Label(self::getDefaultValues($name));
return $label->getFontNames();
}
*
* @return int Group ID (null if Group ID doesn't exist)
*/
- private static function _getGid($name='label_format') {
+ private static function _getGid($name = 'label_format') {
if (!isset(self::$_gid[$name]) || !self::$_gid[$name]) {
self::$_gid[$name] = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $name, 'id', 'name');
if (!self::$_gid[$name]) {
* @return array (reference) label format list
* @static
*/
- public static function &getList($namesOnly = FALSE, $groupName='label_format') {
+ public static function &getList($namesOnly = FALSE, $groupName = 'label_format') {
static $list = array();
if (self::_getGid($groupName)) {
// get saved label formats from Option Value table
* @return CRM_Core_DAO_OptionValue object
* @static
*/
- public static function retrieve(&$params, &$values, $groupName='label_format') {
+ public static function retrieve(&$params, &$values, $groupName = 'label_format') {
$optionValue = new CRM_Core_DAO_OptionValue();
$optionValue->copyValues($params);
$optionValue->option_group_id = self::_getGid($groupName);
$$bodyType = CRM_Utils_Token::replaceDomainTokens($$bodyType, $domain, TRUE, $tokens, TRUE);
$$bodyType = CRM_Utils_Token::replaceContactTokens($$bodyType, $contact, FALSE, $tokens, FALSE, TRUE);
$$bodyType = CRM_Utils_Token::replaceComponentTokens($$bodyType, $contact, $tokens, TRUE);
- $$bodyType = CRM_Utils_Token::replaceHookTokens($$bodyType, $contact , $categories, TRUE);
+ $$bodyType = CRM_Utils_Token::replaceHookTokens($$bodyType, $contact, $categories, TRUE);
}
}
$html = $body_html;
if (!empty($params['id'])) {
$ids = array('optionValue' => $params['id']);
}
- return CRM_Core_BAO_OptionValue::add($params, $ids);
+ return CRM_Core_BAO_OptionValue::add($params, $ids);
}
/**
* Set default Parameters
),
'stationery' => array(
'name' => 'stationery',
- 'type' =>CRM_Utils_Type::T_STRING,
+ 'type' => CRM_Utils_Type::T_STRING,
'default' => '',
),
'orientation' => array(
/**
* Delete a civiCRM-table
*
- * @param String $tableName
+ * @param string $tableName
* Name of the table to be created.
*
* @return bool
);
$settingParams = array_diff_key($params, array_fill_keys($ignoredParams, TRUE));
$getFieldsParams = array('version' => 3);
- if (count($settingParams) ==1) {
+ if (count($settingParams) == 1) {
// ie we are only setting one field - we'll pass it into getfields for efficiency
list($name) = array_keys($settingParams);
$getFieldsParams['name'] = $name;
// whenever there is a possibility of more than one domain we must force it
$config = CRM_Core_Config::singleton();
if (empty($domainID)) {
- $domainID= CRM_Core_Config::domainID();
+ $domainID = CRM_Core_Config::domainID();
}
$domain = new CRM_Core_DAO_Domain();
$domain->id = $domainID;
* $Id$
*
*/
-class CRM_Core_I18n_SchemaStructure_4_2_alpha1
-{
+class CRM_Core_I18n_SchemaStructure_4_2_alpha1 {
/**
* @return array
*/
- public static function &columns()
- {
+ public static function &columns() {
static $result = NULL;
if (!$result) {
$result = array(
* $Id$
*
*/
-class CRM_Core_I18n_SchemaStructure_4_3_1
-{
+class CRM_Core_I18n_SchemaStructure_4_3_1 {
/**
* @return array
*/
* Generated from schema_structure.tpl
* DO NOT EDIT. Generated by CRM_Core_CodeGen
*/
-class CRM_Core_I18n_SchemaStructure_4_5_beta2
-{
- public static function &columns()
- {
+class CRM_Core_I18n_SchemaStructure_4_5_beta2 {
+ public static function &columns() {
static $result = NULL;
if (!$result) {
$result = array(
*
* @return boolean
*/
- private function react(IDS_Report$result) {
+ private function react(IDS_Report $result) {
$impact = $result->getImpact();
if ($impact >= $this->threshold['kick']) {
* @void
*/
static public function hackMenuRebuild($args) {
- if (array('civicrm','menu','rebuild') == $args || array('civicrm', 'clearcache') == $args) {
+ if (array('civicrm', 'menu', 'rebuild') == $args || array('civicrm', 'clearcache') == $args) {
// ensure that the user has a good privilege level
if (CRM_Core_Permission::check('administer CiviCRM')) {
self::rebuildMenuAndCaches();
$result = NULL;
if (is_array($item['page_callback'])) {
- require_once (str_replace('_', DIRECTORY_SEPARATOR, $item['page_callback'][0]) . '.php');
+ require_once str_replace('_', DIRECTORY_SEPARATOR, $item['page_callback'][0]) . '.php';
$result = call_user_func($item['page_callback']);
}
elseif (strstr($item['page_callback'], '_Form')) {
}
else {
$newArgs = explode('/', $_GET[$config->userFrameworkURLVar]);
- require_once (str_replace('_', DIRECTORY_SEPARATOR, $item['page_callback']) . '.php');
+ require_once str_replace('_', DIRECTORY_SEPARATOR, $item['page_callback']) . '.php';
$mode = 'null';
if (isset($pageArgs['mode'])) {
$mode = $pageArgs['mode'];
}
$input['invoice'] = self::getValue('i', FALSE);
$this->getInput($input, $ids);
- if ($this-> transactionExists($input['trxn_id'])) {
+ if ($this->transactionExists($input['trxn_id'])) {
throw new CRM_Core_Exception('This transaction has already been processed');
}
/**
*
*/
-class CRM_Core_Permission_Drupal extends CRM_Core_Permission_DrupalBase{
+class CRM_Core_Permission_Drupal extends CRM_Core_Permission_DrupalBase {
/**
* Is this user someone with access for the entire system
/**
*
*/
-class CRM_Core_Permission_Drupal8 extends CRM_Core_Permission_DrupalBase{
+class CRM_Core_Permission_Drupal8 extends CRM_Core_Permission_DrupalBase {
/**
* Given a permission string, check for access requirements
*
* Variable substitutions can happen from client-side
*
* Note: this function rarely needs to be called directly and is mostly for internal use.
- * @see CRM_Core_Resources::addScriptFile which automatically adds translated strings from js files
+ * See CRM_Core_Resources::addScriptFile which automatically adds translated strings from js files
*
* Simple example:
* // From php:
/**
* Class CRM_Custom_Import_Field
*/
-class CRM_Custom_Import_Field extends CRM_Contact_Import_Field{}
+class CRM_Custom_Import_Field extends CRM_Contact_Import_Field {
+}
CRM_Event_BAO_Participant::deleteParticipant($this->_id);
CRM_Core_Session::setStatus(ts('Selected participant was deleted successfully.'), ts('Record Deleted'), 'success');
if (!empty($participantLinks)) {
- $status = ts('The following participants no longer have an event fee recorded. You can edit their registration and record a replacement contribution by clicking the links below:') . '<br>' . $participantLinks;
+ $status = ts('The following participants no longer have an event fee recorded. You can edit their registration and record a replacement contribution by clicking the links below:') . '<br/>' . $participantLinks;
CRM_Core_Session::setStatus($status, ts('Group Payment Deleted'));
}
return;
}
if (!empty($errors)) {
- $soldOutOptions = implode("<br>", $priceSetErrors['soldOutOptions']);
+ $soldOutOptions = implode("<br/>", $priceSetErrors['soldOutOptions']);
CRM_Core_Session::setStatus(ts('You have been returned to the start of the registration process and any sold out events have been removed from your selections. You will not be able to continue until you review your booking and select different events if you wish. The following events were sold out:'), ts('Unfortunately some of your options have now sold out for one or more participants.'), 'error');
CRM_Core_Session::setStatus(ts("{$soldOutOptions}"), ts('Sold out:'), 'error');
CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/event/register', "_qf_Register_display=true&qfKey=" . $fields['qfKey']));
// Hardcode maximum number of additional participants here for now. May need to make this configurable per event.
// Label is value + 1, since the code sees this is ADDITIONAL participants (in addition to "self")
$additionalOptions = array(
- '' => '1', 1 => '2', 2 => '3', 3 => '4', 4 => '5',
- 5 => '6', 6 => '7', 7 => '8', 8 => '9', 9 => '10',
+ '' => '1',
+ 1 => '2',
+ 2 => '3',
+ 3 => '4',
+ 4 => '5',
+ 5 => '6',
+ 6 => '7',
+ 7 => '8',
+ 8 => '9',
+ 9 => '10',
);
$element = $this->add('select', 'additional_participants',
ts('How many people are you registering?'),
$status = array(ts('Participant(s) Deleted: %1 (Total Selected: %2)', array(1 => $deletedParticipants, 2 => count($this->_participantIds))));
if (!empty($participantLinks)) {
- $status[] = ts('The following participants no longer have an event fee recorded. You can edit their registration and record a replacement contribution by clicking the links below:') . '<br>' . $participantLinks;
+ $status[] = ts('The following participants no longer have an event fee recorded. You can edit their registration and record a replacement contribution by clicking the links below:') . '<br/>' . $participantLinks;
}
foreach ($status as $text) {
CRM_Core_Session::setStatus($text, '', 'info');
);
//CRM-10434
- $discountId= CRM_Core_BAO_Discount::findSet($this->_id, 'civicrm_event');
+ $discountId = CRM_Core_BAO_Discount::findSet($this->_id, 'civicrm_event');
if ($discountId) {
$priceSetId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Discount', $discountId, 'price_set_id');
}
if ($parserClass[0] == 'CRM' &&
count($parserClass) >= 3
) {
- require_once(str_replace('_', DIRECTORY_SEPARATOR, $parserName) . ".php");
+ require_once str_replace('_', DIRECTORY_SEPARATOR, $parserName) . ".php";
// ensure the functions exists
if (method_exists($parserName, 'errorFileName') &&
method_exists($parserName, 'saveFileName')
public static function exportCustom($customSearchClass, $formValues, $order) {
$ext = CRM_Extension_System::singleton()->getMapper();
if (!$ext->isExtensionClass($customSearchClass)) {
- require_once(str_replace('_', DIRECTORY_SEPARATOR, $customSearchClass) . '.php');
+ require_once str_replace('_', DIRECTORY_SEPARATOR, $customSearchClass) . '.php';
}
else {
- require_once($ext->classToPath($customSearchClass));
+ require_once $ext->classToPath($customSearchClass);
}
$search = new $customSearchClass($formValues);
/**
* This class contains payment processor related functions.
*/
-class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProcessor
-{
+class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProcessor {
/**
* Static holder for the default payment processor
*/
$paymentProcessorType = new CRM_Financial_DAO_PaymentProcessorType();
$paymentProcessorType->id = $paymentProcessorTypeId;
if ($paymentProcessorType->delete()) {
- CRM_Core_Session::setStatus(ts('Selected Payment Processor type has been deleted.<br>'), '', 'success');
+ CRM_Core_Session::setStatus(ts('Selected Payment Processor type has been deleted.<br/>'), '', 'success');
return TRUE;
}
}
if ($this->_action & CRM_Core_Action::VIEW) {
$this->view();
}
- elseif ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD | CRM_Core_Action::DELETE
- | CRM_Core_Action::RENEW)) {
+ elseif ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD | CRM_Core_Action::DELETE | CRM_Core_Action::RENEW)) {
self::setContext($this);
$this->edit();
}
/**
* Setter for $_limitValue
*
- * @param number $_limitValue
+ * @param int $_limitValue
*/
public function setLimitValue($_limitValue) {
$this->_limitValue = $_limitValue;
/**
* Setter for $_offsetValue
*
- * @param number $_offsetValue
+ * @param int $_offsetValue
*/
public function setOffsetValue($_offsetValue) {
$this->_offsetValue = $_offsetValue;
if (in_array($op, array('bw', 'nbw')) && ($min || $max)) {
$value = "{$pair[$op]} $min " . ts('and') . " $max";
}
- elseif ($val && CRM_Utils_Array::value('operatorType', $field) &
- self::OP_ENTITYREF
- ) {
+ elseif ($val && CRM_Utils_Array::value('operatorType', $field) & self::OP_ENTITYREF) {
$this->setEntityRefDefaults($field, $tableName);
$result = civicrm_api3($field['attributes']['entity'], 'getlist',
array('id' => $val) +
}
}
if (!empty($tempErrors)) {
- $errors['fields'] = implode("<br>", $tempErrors);
+ $errors['fields'] = implode("<br/>", $tempErrors);
}
}
*
*/
-class CRM_SMS_Page_Callback
-{
+class CRM_SMS_Page_Callback {
public function run() {
$provider = CRM_SMS_Provider::singleton($_REQUEST);
* plugin status page or the Drupal admin/reports/status path.
*
* @return array of messages
- * @see Drupal's hook_requirements() -
- * https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_requirements
+ * @link https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_requirements
*/
public function checkAll() {
$checks = array();
die ("SECURITY FATAL: the url can't contain '..'. Please report the issue on the forum at civicrm.org");
}
- $request = split('/', $request);
+ $request = explode('/', $request);
$entity = _civicrm_api_get_camel_name($request[2]);
$tplfile = _civicrm_api_get_camel_name($request[3]);
else {
return FALSE;
}
- } elseif (0 != substr_compare($base, $filename, 0, $baselen)) {
+ }
+ elseif (0 != substr_compare($base, $filename, 0, $baselen)) {
return FALSE;
}
}