$this->add('File', 'uploadFile', ts('Import Data File'), 'size=30 maxlength=255', TRUE);
$this->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array(
1 => $uploadSize,
- 2 => $uploadFileSize
+ 2 => $uploadFileSize,
)), 'maxfilesize', $uploadFileSize);
$this->addRule('uploadFile', ts('A valid file must be uploaded.'), 'uploadedfile');
$this->addRule('uploadFile', ts('Input file must be in CSV format'), 'utf8File');
'reporter',
'status',
'links',
- 'class'
+ 'class',
);
echo CRM_Utils_JSON::encodeDataTableSelector($activities, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
$contactType = $contactType == 'Contact' ? '' : $contactType;
switch ($row['source']) {
case 'caseRel':
- $row['actions'] =
- '<a href="#editCaseRoleDialog" title="' . ts('Reassign %1', array(1 => $typeLabel)) . '" class="crm-hover-button case-miniform" data-contact_type="' . $contactType . '" data-rel_type="' . $row['relation_type'] . '" data-rel_id="' . $row['rel_id'] . '"data-key="' . CRM_Core_Key::get('civicrm/ajax/relation') . '">' .
+ $row['actions']
+ = '<a href="#editCaseRoleDialog" title="' . ts('Reassign %1', array(1 => $typeLabel)) . '" class="crm-hover-button case-miniform" data-contact_type="' . $contactType . '" data-rel_type="' . $row['relation_type'] . '" data-rel_id="' . $row['rel_id'] . '"data-key="' . CRM_Core_Key::get('civicrm/ajax/relation') . '">' .
'<span class="icon ui-icon-pencil"></span>' .
'</a>' .
'<a href="#deleteCaseRoleDialog" title="' . ts('Remove %1', array(1 => $typeLabel)) . '" class="crm-hover-button case-miniform" data-contact_type="' . $contactType . '" data-rel_type="' . $row['relation_type'] . '" data-key="' . CRM_Core_Key::get('civicrm/ajax/delcaserole') . '">' .
break;
case 'caseRoles':
- $row['actions'] =
- '<a href="#editCaseRoleDialog" title="' . ts('Assign %1', array(1 => $typeLabel)) . '" class="crm-hover-button case-miniform" data-contact_type="' . $contactType . '" data-rel_type="' . $row['relation_type'] . '" data-key="' . CRM_Core_Key::get('civicrm/ajax/relation') . '">' .
+ $row['actions']
+ = '<a href="#editCaseRoleDialog" title="' . ts('Assign %1', array(1 => $typeLabel)) . '" class="crm-hover-button case-miniform" data-contact_type="' . $contactType . '" data-rel_type="' . $row['relation_type'] . '" data-key="' . CRM_Core_Key::get('civicrm/ajax/relation') . '">' .
'<span class="icon ui-icon-pencil"></span>' .
'</a>';
break;
if (in_array($params['mode'], array(
'move',
- 'file'
+ 'file',
))) {
$caseActivity = new CRM_Case_DAO_CaseActivity();
$caseActivity->case_id = $params['caseID'];
/**
* List participations for the UF user
*
- * @return null
+ * @return bool
*/
public function listActivities() {
- $controller =
- new CRM_Core_Controller_Simple(
+ $controller
+ = new CRM_Core_Controller_Simple(
'CRM_Activity_Form_Search', ts('Activities'),
NULL,
FALSE, FALSE, TRUE, FALSE
$controller->process();
$controller->run();
- return;
+ return FALSE;
}
/**
* the main function that is called when the page
* loads, it decides the which action has to be taken for the page.
*
- * @return null
+ * @return void
*/
public function run() {
parent::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
*/
'entity_id' => $this->_surveyId,
);
- list($defaults['contact_profile_id'], $second) =
- CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
+ list($defaults['contact_profile_id'], $second)
+ = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
$defaults['activity_profile_id'] = $second ? array_shift($second) : '';
return $defaults;
/**
* Build the form object
*
- * @param null
- *
* @return void
*/
public function buildQuickForm() {
/**
* Process the form
*
- * @param null
- *
* @return void
*/
public function postProcess() {
$tasks = $tasks + CRM_Contact_Task::optionalTaskTitle();
}
- $search_custom_id =
- CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch', $this->_ssID, 'search_custom_id');
+ $search_custom_id
+ = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch', $this->_ssID, 'search_custom_id');
$savedSearchValues = array(
'id' => $this->_ssID,
// check if _groupID exists, it might not if
// we are displaying a hidden group
if (!isset($this->_group[$this->_groupID])) {
- $this->_group[$this->_groupID] =
- CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $this->_groupID, 'title');
+ $this->_group[$this->_groupID]
+ = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $this->_groupID, 'title');
}
// set the group title
// we are displaying a hidden group
if (!isset($this->_group[$this->_amtgID])) {
$this->assign('permissionedForGroup', FALSE);
- $this->_group[$this->_amtgID] =
- CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $this->_amtgID, 'title');
+ $this->_group[$this->_amtgID]
+ = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $this->_amtgID, 'title');
}
// Set dynamic page title for 'Add Members Group'
$setDynamic = FALSE;
if (strpos(self::$_selectorName, 'CRM_Contact_Selector') !== FALSE) {
- $selector = new self::$_selectorName (
+ $selector = new self::$_selectorName(
$this->_customSearchClass,
$this->_formValues,
$this->_params,
*
* @return string
*/
- function all(
+ public function all(
$offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
*
* @return string
*/
- function all(
+ public function all(
$offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
$status = array(
ts("%count contact removed from '%2'", array(
- 'count' => $removed,
- 'plural' => "%count contacts removed from '%2'",
- 2 => $group[$groupId]
- ))
+ 'count' => $removed,
+ 'plural' => "%count contacts removed from '%2'",
+ 2 => $group[$groupId],
+ )),
);
if ($notRemoved) {
$status[] = ts('1 contact was already not in this group', array(
'count' => $notRemoved,
- 'plural' => '%count contacts were already not in this group'
+ 'plural' => '%count contacts were already not in this group',
));
}
$status = '<ul><li>' . implode('</li><li>', $status) . '</li></ul>';
CRM_Core_Session::setStatus($status, ts("Removed Contact From Group", array(
'plural' => "Removed Contacts From Group",
- 'count' => $removed
+ 'count' => $removed,
)), 'success', array('expires' => 0));
}
}
$savedSearch->id = $id;
$savedSearch->is_active = 0;
$savedSearch->save();
- return;
}
/**
*
* @return CRM_Contact_Selector
*/
- function __construct(
+ public function __construct(
$customSearchClass,
$formValues = NULL,
$params = NULL,
if (in_array($fieldName, array(
'phone',
'im',
- 'email'
+ 'email',
))) {
if ($type) {
$name = "`$locationTypeName-$fieldName-$type`";
if (in_array($fieldName, array(
'phone',
'im',
- 'email'
+ 'email',
))) {
if ($type) {
$names[] = "{$locationTypeName}-{$fieldName}-{$type}";
elseif (in_array($property, array(
'addressee',
'email_greeting',
- 'postal_greeting'
+ 'postal_greeting',
))) {
$greeting = $property . '_display';
$row[$property] = $result->$greeting;
* @param int $contributionPageId
* Contribution Page Id.
*
- * @return boolean
+ * @return bool
* true if payment processor supports recurring
* else false
*
// Fixme - this is going to ignore context, better to get conditions, add params, and call PseudoConstant::get
return CRM_Financial_BAO_FinancialType::getIncomeFinancialType();
- break;
+ break;
}
return CRM_Core_PseudoConstant::get(__CLASS__, $fieldName, $params, $context);
}
/**
* Helper to determine if the page supports separate membership payments
- * @param int id form id
+ * @param int $id form id
*
* @return bool
* isSeparateMembershipPayment
$membershipBlocks = civicrm_api3('membership_block', 'get', array(
'entity_table' => 'civicrm_contribution_page',
'entity_id' => $id,
- 'sequential' => TRUE
+ 'sequential' => TRUE,
));
if (!$membershipBlocks['count']) {
return FALSE;
$trxn->save();
// save to entity_financial_trxn table
- $entityFinancialTrxnParams =
- array(
+ $entityFinancialTrxnParams
+ = array(
'entity_table' => "civicrm_contribution",
'financial_trxn_id' => $trxn->id,
'amount' => $params['total_amount'],
$params['trxnParams']['from_financial_account_id'] = $params['to_financial_account_id'];
$params['trxnParams']['to_financial_account_id'] = $financialAccount;
$params['trxnParams']['total_amount'] = $amount;
- $params['trxnParams']['fee_amount'] =
- $params['trxnParams']['net_amount'] = 0;
+ $params['trxnParams']['fee_amount'] = $params['trxnParams']['net_amount'] = 0;
$params['trxnParams']['status_id'] = CRM_Core_OptionGroup::getValue('contribution_status', 'Completed', 'name');
$params['trxnParams']['contribution_id'] = $contributionId;
$trxn = self::create($params['trxnParams']);
$financialTrxnID = CRM_Core_BAO_FinancialTrxn::getFinancialTrxnId($params['trxnParams']['contribution_id'], 'DESC');
$params['entity_id'] = $financialTrxnID['financialTrxnId'];
}
- $fItemParams =
- array(
+ $fItemParams
+ = array(
'financial_account_id' => $financialAccount,
'contact_id' => CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Domain', $domainId, 'contact_id'),
'created_date' => date('YmdHis'),
* @param int $entityId
* @param string $entityName
* @param bool $returnType
- * @param number $lineItemTotal
+ * @param int $lineItemTotal
*
* @return array|int|NULL|string
* [payment type => amount]
// add current contact to recently viewed
if ($ufmatch->contact_id) {
- list($displayName, $contactImage, $contactType, $contactSubtype, $contactImageUrl) =
- CRM_Contact_BAO_Contact::getDisplayAndImage($ufmatch->contact_id, TRUE, TRUE);
+ list($displayName, $contactImage, $contactType, $contactSubtype, $contactImageUrl)
+ = CRM_Contact_BAO_Contact::getDisplayAndImage($ufmatch->contact_id, TRUE, TRUE);
$otherRecent = array(
'imageUrl' => $contactImageUrl,
/**
* Preferred mail format
- *
+ *
* @return array
*/
public static function pmf() {
/**
* Various pre defined unit list
- *
+ *
* @param string $unitType
* @return array
*/
/**
* Get numeric options
- *
+ *
* @param int $start
* @param int $end
*
static $scheduleReminderFrequencyUnits = NULL;
if (!$scheduleReminderFrequencyUnits) {
$scheduleReminderFrequencyUnits = array(
- 'hour' => ts('hour')
- ) + CRM_Core_OptionGroup::values('recur_frequency_units');
+ 'hour' => ts('hour'),
+ ) + CRM_Core_OptionGroup::values('recur_frequency_units');
}
return $scheduleReminderFrequencyUnits;
* @link http://smarty.php.net/manual/en/language.modifier.truncate.php
* truncate (Smarty online manual)
*
- * @param string
- * @param int
- * @param string
- * @param bool
+ * @param string $string
+ * @param int $length
+ * @param string $etc
+ * @param bool $break_words
*
* @return string
*/
<?php
-
/**
* Class CRM_Dedupe_BAO_QueryBuilder
*/
}
}
}
-
-;
else {
if ($this->_cc == 'fail') {
$statusMsg = '<div class="bold">' . ts('Your Credit Card transaction was not successful. No money has yet been charged to your card.') . '</div><div><br />' . ts('Click the "Confirm Registration" button to complete your registration in %1, or click "Cancel Registration" if you are no longer interested in attending this event.', array(
- 1 => $values['title']
+ 1 => $values['title'],
)) . '</div>';
}
else {
$statusMsg = '<div class="bold">' . ts('Confirm your registration for %1.', array(
- 1 => $values['title']
+ 1 => $values['title'],
)) . '</div><div><br />' . ts('Click the "Confirm Registration" button to begin, or click "Cancel Registration" if you are no longer interested in attending this event.') . '</div>';
}
$buttons = array_merge($buttons, array(
'name' => ts('Confirm Registration'),
'spacing' => ' ',
'isDefault' => TRUE,
- )
+ ),
));
}
}
'name' => ts('Cancel Registration'),
'spacing' => ' ',
'js' => array('onclick' => 'return confirm(\'' . $cancelConfirm . '\');'),
- )
+ ),
));
if (!$statusMsg) {
$statusMsg = ts('You can cancel your registration for %1 by clicking "Cancel Registration".', array(1 => $values['title']));
*
* @return void
*/
- function preProcess() {
+ public function preProcess() {
parent::preProcess();
$this->_id = NULL;
}
* @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) {
/**
* Retrieve the default payment processor
*
- * @param NULL
- *
* @return CRM_Financial_DAO_PaymentProcessor|null
* The default payment processor object on success,
* null otherwise
* (sort function for sortDefaultFirst)
* @param array $processor1
* @param array $processor2
- * @return number
+ *
+ * @return int
*/
public static function defaultComparison($processor1, $processor2) {
$p1 = CRM_Utils_Array::value('is_default', $processor1);
$retrievalParameters = array(
'is_active' => TRUE,
'options' => array('sort' => 'is_default DESC, name'),
- 'api.payment_processor_type.getsingle' => 1
+ 'api.payment_processor_type.getsingle' => 1,
);
if ($mode == 'test') {
$retrievalParameters['is_test'] = 1;
if (!in_array($component, array(
'membership',
'contribute',
- 'recur'
+ 'recur',
))
) {
return $result;
/**
* Get action Links
*
- * @return array
- * (reference) of action links
*/
public function &links() {
}
/**
* called when action is browse
*
- * @return null
*/
- function browse() {
+ public function browse() {
$controller = new CRM_Core_Controller_Simple('CRM_Grant_Form_Search', ts('Grants'), $this->_action);
$controller->setEmbedded(TRUE);
$controller->reset();
/**
* Attempt to match header labels with our mapper fields
*
- * @param header
- * @param mapperFields
+ * @param string $header
+ * @param array $patterns
*
* @return string
*/
/**
* Guess at the field names given the data and patterns from the schema
*
- * @param patterns
- * @param index
+ * @param array $patterns
+ * @param string $index
*
* @return string
*/
);
$this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array(
'CRM_Mailing_DAO_Component',
- $this->_id
+ $this->_id,
));
$this->add('select', 'component_type', ts('Component Type'), CRM_Core_SelectValues::mailingComponents());
$errors = array();
foreach (array(
'text',
- 'html'
+ 'html',
) as $type) {
$dataErrors = array();
foreach ($InvalidTokens as $token => $desc) {
if (preg_match('/' . preg_quote('{' . $token . '}') . '/', $params['body_' . $type])) {
$dataErrors[] = '<li>' . ts('This message is having a invalid token - %1: %2', array(
1 => $token,
- 2 => $desc
+ 2 => $desc,
)) . '</li>';
}
}
}
if (!empty($dataErrors)) {
$errors['body_' . $type] = ts('The following errors were detected in %1 message:', array(
- 1 => $type
+ 1 => $type,
)) . '<ul>' . implode('', $dataErrors) . '</ul><br /><a href="' . CRM_Utils_System::docURL2('Tokens', TRUE, NULL, NULL, NULL, "wiki") . '">' . ts('More information on tokens...') . '</a>';
}
}
if (CRM_Core_BAO_MailSettings::defaultDomain() == "EXAMPLE.ORG") {
CRM_Core_Error::fatal(ts('The <a href="%1">default mailbox</a> has not been configured. You will find <a href="%2">more info in our online user and administrator guide.</a>', array(
1 => CRM_Utils_System::url('civicrm/admin/mailSettings', 'reset=1'),
- 2 => "http://book.civicrm.org/user/advanced-configuration/email-system-configuration/"
+ 2 => "http://book.civicrm.org/user/advanced-configuration/email-system-configuration/",
)));
}
//get the mailing groups.
$groups = CRM_Core_PseudoConstant::nestedGroup('Mailing');
if ($hiddenMailingGroup) {
- $groups[$hiddenMailingGroup] =
- CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $hiddenMailingGroup, 'title');
+ $groups[$hiddenMailingGroup]
+ = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $hiddenMailingGroup, 'title');
}
$mailings = CRM_Mailing_PseudoConstant::completed();
$this->add('select', 'baseGroup',
ts('Unsubscription Group'),
array(
- '' => ts('- select -')
+ '' => ts('- select -'),
) + CRM_Contact_BAO_Group::getGroupsHierarchy($staticGroups, NULL, ' ', TRUE),
TRUE,
array('class' => 'crm-select2 huge')
'campaign_id',
'dedupe_email',
'location_type_id',
- 'email_selection_method'
+ 'email_selection_method',
) as $n
) {
if (!empty($values[$n])) {
$this->add('select', 'from_email_address',
ts('From Email Address'), array(
- '' => '- select -'
+ '' => '- select -',
) + $fromEmailAddress, TRUE
);
// set $header and $footer
foreach (array(
'header',
- 'footer'
+ 'footer',
) as $part) {
$$part = array();
if ($params["{$part}_id"]) {
foreach (array(
'text',
- 'html'
+ 'html',
) as $file) {
if (!$params['upload_type'] && !file_exists(CRM_Utils_Array::value('tmp_name', $files[$file . 'File']))) {
continue;
}
if (!empty($dataErrors)) {
$errors[$file . 'File'] = ts('The following errors were detected in %1:', array(
- 1 => $name
+ 1 => $name,
)) . ' <ul>' . implode('', $dataErrors) . '</ul><br /><a href="' . CRM_Utils_System::docURL2('Sample CiviMail Messages', TRUE, NULL, NULL, NULL, "wiki") . '" target="_blank">' . ts('More information on required tokens...') . '</a>';
}
}
'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'),
)));
}
*/
public function fetchNext($count = 0) {
$mails = array();
- $parser = new ezcMailParser;
+ $parser = new ezcMailParser();
//set property text attachment as file CRM-5408
$parser->options->parseTextAttachmentsAsFiles = TRUE;
foreach (array(
'cur',
- 'new'
+ 'new',
) as $subdir) {
$dir = $this->_dir . DIRECTORY_SEPARATOR . $subdir;
foreach (scandir($dir) as $file) {
if ($this->_context == 'standalone') {
$this->addEntityRef('contact_id', ts('Contact'), array(
'create' => TRUE,
- 'api' => array('extra' => array('email'))
+ 'api' => array('extra' => array('email')),
), TRUE);
}
}
$memTypeJs = array(
'onChange' =>
- "CRM.buildCustomData( 'Membership', this.value ); buildAutoRenew(this.value, null );",
+ "CRM.buildCustomData( 'Membership', this.value ); buildAutoRenew(this.value, null );",
);
}
}
if (empty($formValues['source'])) {
$params['contribution_source'] = ts('%1 Membership: Offline signup (by %2)', array(
1 => $membershipType,
- 2 => $userName
+ 2 => $userName,
));
}
else {
* @param object $membership
* Object.
*
- * @return boolean
+ * @return bool
* true if mail was sent successfully
*/
public static function emailReceipt(&$form, &$formValues, &$membership) {
* @param array $lineItemId
* An assoc array of lineItem.
*
- * @return number|void
+ * @return int|void
* tax rate
- *
*/
public static function calculateTaxRate($lineItemId) {
if ($lineItemId['unit_price'] == 0) {
- return;
+ return FALSE;
}
if ($lineItemId['html_type'] == 'Text') {
$tax = $lineItemId['tax_amount'] / ($lineItemId['unit_price'] * $lineItemId['qty']) * 100;
/**
* Set up variables to build the form
*
- * @param null
- *
* @return void
* @acess protected
*/
- function preProcess() {
+ public function preProcess() {
$this->_fid = $this->get('fid');
$this->_title = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField',
/**
* Build the form object
*
- * @param null
- *
* @return void
*/
public function buildQuickForm() {
/**
* Process the form when submitted
*
- * @param null
- *
* @return void
*/
public function postProcess() {
-
if (CRM_Price_BAO_PriceField::deleteField($this->_fid)) {
CRM_Core_Session::setStatus(ts('The Price Field \'%1\' has been deleted.', array(1 => $this->_title)), '', 'success');
}
* @return void
* @access protected
*/
- function preProcess() {
+ public function preProcess() {
$this->_sid = $this->get('sid');
$this->_title = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet',
/**
* 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() {
if (!isset(self::$_actionLinks)) {
self::$_actionLinks = array(
CRM_Core_Action::UPDATE => array(
/**
* Browse all price set fields.
*
- * @param null
- *
* @return void
*/
public function browse() {
* This method is called after the page is created. It checks for the
* type of action and executes that action.
*
- * @param null
- *
* @return void
*/
public function run() {
$contactIdClause = $join = '';
foreach (self::getSearchQueryObjects() as $obj) {
list($cidClause, $joinClause) = $obj->logDiffClause($reportObj, $table);
- if ($joinClause)
+ if ($joinClause) {
$join .= $joinClause;
- if ($cidClause)
+ }
+ if ($cidClause) {
$contactIdClause .= $cidClause;
+ }
}
return array($contactIdClause, $join);
}
/**
* Class constructor
*/
- function __construct(
+ public function __construct(
$title = NULL,
$action = CRM_Core_Action::NONE,
$modal = TRUE
*
* @return mixed
*/
- function invoke(
+ public function invoke(
$numParams,
&$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6,
$fnSuffix) {
* @return CRM_Core_DAO
* objet that holds the results of the query
*/
- static function &query(
+ public static function &query(
$queryType,
$daoName,
$fieldValues = NULL,
*
* @example CountryDelete.php Standard Delete Example
*
- * @return boolean
+ * @return bool
* | error true if successfull, error otherwise
- * {@getfields country_delete}
+ * {@getfields country_delete}
*/
function civicrm_api3_country_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_DAO(__FUNCTION__), $params);
/**
* Retrieve one or more countrys
*
- * @param array input parameters
- *
- *
* @example CountryGet.php Standard Get Example
*
* @param array $params
*
* @return array
* api result array
- * {@getfields country_get}
+ * {@getfields country_get}
*/
function civicrm_api3_country_get($params) {
*
* @return array
* API result array
- * {@getfields email_create}
+ * {@getfields email_create}
*/
function civicrm_api3_location_type_create($params) {
//set display_name equal to name if it's not defined
*
* @return array
* API result array
- * {@getfields LocationType_delete}
+ * {@getfields LocationType_delete}
*/
function civicrm_api3_location_type_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
/**
* Retrieve one or more Location Types
*
- * @param array input parameters
- *
- *
* @example LocationTypeGet.php Standard Get Example
*
* @param array $params
*
* @return array
* api result
- * {@getfields LocationType_get}
+ * {@getfields LocationType_get}
*/
function civicrm_api3_location_type_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
// Check our field length
if (is_string($fieldValue) && !empty($fieldInfo['maxlength']) && strlen($fieldValue) > $fieldInfo['maxlength']
) {
- throw new API_Exception( $fieldValue . " is " . strlen($fieldValue) . " characters - longer than $fieldName length" . $fieldInfo['maxlength'] . ' characters',
+ throw new API_Exception($fieldValue . " is " . strlen($fieldValue) . " characters - longer than $fieldName length" . $fieldInfo['maxlength'] . ' characters',
2100, array('field' => $fieldName, "max_length" => $fieldInfo['maxlength'])
);
}
* php bin/csv/import.php -e <entity> --file /path/to/csv/file [ -s site.org ]
* e.g.: php bin/csv/import.php -e Contact --file /tmp/import.csv
*
- **/
+ */
require_once dirname(__DIR__) . '/cli.class.php';
$entityImporter = new civicrm_cli_csv_importer();
class CiviReportMail {
/**
*/
- function __construct() {
+ public function __construct() {
$this->initialize();
CRM_Utils_System::authenticateScript(TRUE);
CRM_Core_Error::debug_log_message('CiviReportMail.php');
}
- function initialize() {
+ public function initialize() {
require_once '../civicrm.config.php';
require_once 'CRM/Core/Config.php';
$config = CRM_Core_Config::singleton();
}
- function run() {
+ public function run() {
require_once 'CRM/Core/Lock.php';
$lock = new CRM_Core_Lock('CiviReportMail');
}
session_start();
-$obj = new CiviReportMail;
+$obj = new CiviReportMail();
$obj->run();
class CRM_UpdateGreeting {
/**
*/
- function __construct() {
+ public function __construct() {
$this->initialize();
$config = CRM_Core_Config::singleton();
CRM_Core_Error::debug_log_message('UpdateGreeting.php');
}
- function initialize() {
+ public function initialize() {
require_once '../../civicrm.config.php';
require_once 'CRM/Core/Config.php';
}
if (in_array($greeting, array(
'email_greeting',
- 'postal_greeting'
+ 'postal_greeting',
)) && $contactType == 'Organization'
) {
CRM_Core_Error::fatal(ts('You cannot use %1 for contact type %2.', array(1 => $greeting, 2 => $contactType)));
$processAll = $processOnlyIdSet = FALSE;
if (in_array($force, array(
1,
- 'true'
+ 'true',
))) {
$processAll = TRUE;
}
'fv' => array(
'mailing_name' => 'First%',
'mailing_delivery_status'
- => 'N'
+ => 'N',
),
'id' => array(105),
),
'fv' => array(
'mailing_name' => 'First%',
'mailing_delivery_status'
- => 'Y'
+ => 'Y',
),
'id' => array(102, 103, 104, 108, 109, 110, 111, 112),
),
'fv' => array(
'mailing_name' => 'Second%',
'mailing_delivery_status'
- => 'N'
+ => 'N',
),
'id' => array(),
),
'fv' => array(
'mailing_name' => 'Second%',
'mailing_delivery_status'
- => 'Y'
+ => 'Y',
),
'id' => array(102, 103, 104, 108, 109, 110, 111, 112),
),
*/
private static function getInstance() {
if (is_null(self::$instance)) {
- self::$instance = new self;
+ self::$instance = new CRM_Queue_AllTests();
}
return self::$instance;
}
array(
'type' => 'Sql',
'name' => 'test-queue',
- )
+ ),
);
return $queueSpecs;
}
- /* ----------------------- Per-provider tests ----------------------- */
+ /**
+ * Per-provider tests
+ *
+ */
public function setUp() {
parent::setUp();
$this->queueService = CRM_Queue_Service::singleton(TRUE);
array('is_transactional' => TRUE, 'options' => array('force_rollback' => TRUE)),
TRUE,
TRUE,
- TRUE
+ TRUE,
);
$r[] = array(
3,
array('is_transactional' => TRUE, 'options' => array('force_rollback' => FALSE)),
TRUE,
FALSE,
- FALSE
+ FALSE,
);
$r[] = array(
3,
array('is_transactional' => FALSE, 'options' => array('force_rollback' => TRUE)),
TRUE,
TRUE,
- TRUE
+ TRUE,
);
$r[] = array(
3,
array('is_transactional' => FALSE, 'options' => array('force_rollback' => FALSE)),
FALSE,
FALSE,
- FALSE
+ FALSE,
);
$r[] = array(4, 'Widget', 'get', array(), FALSE, FALSE, FALSE);
/**
* Delete a Location Type
*
- * @param int locationTypeId
+ * @param int $locationTypeId
*/
public function locationTypeDelete($locationTypeId) {
$locationType = new CRM_Core_DAO_LocationType();
*/
public function activityTypeCreate($params) {
return $this->callAPISuccess('ActivityType', 'create', $params);
- }
+ }
/**
* Delete activity type
public function activityTypeDelete($activityTypeId) {
$params['activity_type_id'] = $activityTypeId;
return $this->callAPISuccess('ActivityType', 'delete', $params);
- }
+ }
/**
* Create custom group
* There is another function to this effect on the PaypalPro test but it appears to be silently failing
* & the best protection agains that is the functions this class affords
* @param array $params
- * @return
+ * @return int $result['id'] payment processor id
*/
public function paymentProcessorCreate($params = array()) {
$params = array_merge(array(
'CiviPledge' => array('pledge_frequency_interval', 'addPledgeSearchDetail'),
'relationship' => array(
"xpath=//div[@id='relationship']/table/tbody/tr//td/label[text()='Relationship Status']/../label[text()='All']",
- ''
+ '',
),
);
$this->waitForText("xpath=//form[@id='Advanced']/div[3]/div/div", "No matches found for");
}
- /*
+ /**
* Check for CRM-9873
*/
public function testActivitySearchByTypeTest() {
$this->click("xpath=//form[@id='Advanced']//div[2]/div/div[1]");
}
- /*
+ /**
* Check for CRM-14952
*/
public function testStateSorting() {
"Connecticut",
"Georgia",
"New Jersey",
- "Texas"
+ "Texas",
));
$this->clickLink("_qf_Advanced_refresh", "xpath=//div[@class='crm-search-results']//table/tbody/tr[1]/td[6]");
$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");
foreach (array(
'joinDate',
'startDate',
- 'endDate'
+ 'endDate',
) as $date) {
$$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull);
}
foreach (array(
'joinDate',
'startDate',
- 'endDate'
+ 'endDate',
) as $date) {
$$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull);
}
foreach (array(
'joinDate',
'startDate',
- 'endDate'
+ 'endDate',
) as $date) {
$$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull);
}
foreach (array(
'joinDate',
'startDate',
- 'endDate'
+ 'endDate',
) as $date) {
$$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull);
}
// Fetch case based on an activity id
$result = $this->callAPISuccess('case', 'get', array(
'activity_id' => $activity,
- 'return' => 'activities,contacts'
+ 'return' => 'activities,contacts',
));
$this->assertEquals(FALSE, empty($result['values'][$id]), 'in line ' . __LINE__);
$this->assertEquals($result['values'][$id], $case, 'in line ' . __LINE__);
// Fetch case based on client contact id
$result = $this->callAPISuccess('case', 'get', array(
'client_id' => $this->_params['contact_id'],
- 'return' => array('activities', 'contacts')
+ 'return' => array('activities', 'contacts'),
));
$this->assertAPIArrayComparison($result['values'][$id], $case);
}
// Fetch case based on client contact id
$result = $this->callAPISuccess('case', 'get', array(
'subject' => $this->_params['subject'],
- 'return' => array('activities', 'contacts')
+ 'return' => array('activities', 'contacts'),
));
$this->assertAPIArrayComparison($result['values'][$id], $case);
}
// Append 'wrong' to subject so that it is no longer the same
$result = $this->callAPISuccess('case', 'get', array(
'subject' => $this->_params['subject'] . 'wrong',
- 'return' => array('activities', 'contacts')
+ 'return' => array('activities', 'contacts'),
));
$this->assertEquals(0, $result['count'], 'in line ' . __LINE__);
}
//test get by contact id works
$result = $this->callAPISuccess('contribution_soft', 'get', array(
- 'contact_id' => $this->_softIndividual2Id
+ 'contact_id' => $this->_softIndividual2Id,
)
);
$this->assertEquals(1, $result['count'], 'In line ' . __LINE__);
}
- ///////////////// civicrm_contribution_soft
+ /**
+ * civicrm_contribution_soft
+ */
public function testCreateEmptyParamsContributionSoft() {
$softcontribution = $this->callAPIFailure('contribution_soft', 'create', array(),
'Mandatory key(s) missing from params array: contribution_id, amount, contact_id'
}
public function testCreateContributionSoftInvalidContact() {
-
$params = array(
'contact_id' => 999,
'contribution_id' => $this->_contributionId,
}
public function testCreateContributionSoftInvalidContributionId() {
-
$params = array(
'contribution_id' => 999999,
'contact_id' => $this->_softIndividual1Id,
$this->assertEquals($softcontribution['values'][$softcontribution['id']]['soft_credit_type_id'], 5, 'In line ' . __LINE__);
}
- //To Update Soft Contribution
+ /**
+ * To Update Soft Contribution
+ *
+ */
public function testCreateUpdateContributionSoft() {
//create a soft credit
$params = array(
$result = $this->callAPISuccess('contribution_soft', 'delete', $params);
}
- ///////////////// civicrm_contribution_soft_delete methods
+ /**
+ * civicrm_contribution_soft_delete methods
+ *
+ */
public function testDeleteEmptyParamsContributionSoft() {
$params = array();
$softcontribution = $this->callAPIFailure('contribution_soft', 'delete', $params);
$this->_checkFinancialRecords($contribution, 'pending');
}
- /*
+ /**
* Updation of contrbution
* Function tests that line items, financial records are updated when contribution amount is changed
*/