//CRM-14466 initialize variable to avoid php notice
$sortSQL = "";
if ($sort && $sortOrder) {
- $sortSQL = $sort . ' ' . $sortOrder;
+ $sortSQL = $sort . ' ' . $sortOrder;
}
// get the activities related to given case
$params = $_POST;
if ($sort && $sortOrder) {
- $sortSQL = $sort . ' ' . $sortOrder;
+ $sortSQL = $sort . ' ' . $sortOrder;
}
// Retrieve ALL client relationships
$params = $_POST;
if ($sort && $sortOrder) {
- $sortSQL = $sort . ' ' . $sortOrder;
+ $sortSQL = $sort . ' ' . $sortOrder;
}
$caseRelationships = CRM_Case_BAO_Case::getCaseRoles($contactID, $caseID);
list($typeLabel) = explode('<', $row['relation']);
// view user links
if (!empty($row['cid'])) {
- $row['name'] = '<a class="view-contact" title="' . ts('View Contact') . '" href=' . CRM_Utils_System::url('civicrm/contact/view',
+ $row['name'] = '<a class="view-contact" title="' . ts('View Contact') . '" href=' . CRM_Utils_System::url('civicrm/contact/view',
'action=view&reset=1&cid=' . $row['cid']) . '>' . $row['name'] . '</a>';
}
// email column links/icon
if ($row['email']) {
- $row['email'] = '<a class="crm-hover-button crm-popup" href="' . CRM_Utils_System::url('civicrm/activity/email/add', 'reset=1&action=add&atype=3&cid=' . $row['cid']) . '&caseid=' . $caseID . '" title="' . ts('Send an Email') . '"><span class="icon ui-icon-mail-closed"></span></a>';
+ $row['email'] = '<a class="crm-hover-button crm-popup" href="' . CRM_Utils_System::url('civicrm/activity/email/add', 'reset=1&action=add&atype=3&cid=' . $row['cid']) . '&caseid=' . $caseID . '" title="' . ts('Send an Email') . '"><span class="icon ui-icon-mail-closed"></span></a>';
}
// edit links
$row['actions'] = '';
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') . '">' .
+ '<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') . '">' .
+ '<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') . '">' .
'<span class="icon delete-icon"></span>' .
'</a>';
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') . '">' .
+ '<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;
switch ($this->_action) {
case CRM_Core_Action::ADD:
$buttonName = ts('Install');
- $title = ts('Install ' . $extName . '?');
+ $title = ts('Install ' . $extName . '?');
break;
case CRM_Core_Action::UPDATE:
$buttonName = ts('Download and Install');
- $title = ts('Download and Install ' . $extName . '?');
+ $title = ts('Download and Install ' . $extName . '?');
break;
case CRM_Core_Action::DELETE:
$resources = CRM_Core_Resources::singleton();
$resources->addSetting(
array(
- 'kcfinderPath' => $config->userFrameworkResourceURL . 'packages' . DIRECTORY_SEPARATOR
+ 'kcfinderPath' => $config->userFrameworkResourceURL . 'packages' . DIRECTORY_SEPARATOR
)
);
$resources->addScriptFile('civicrm', 'templates/CRM/Badge/Form/Layout.js', 1, 'html-header');
public static function getBatchNames($batchIds) {
$query = 'SELECT id, title
FROM civicrm_batch
- WHERE id IN (' . $batchIds . ')';
+ WHERE id IN (' . $batchIds . ')';
$batches = array();
$dao = CRM_Core_DAO::executeQuery($query);
// build line item params
$this->_priceSet['fields'][$priceFieldID]['options'][$priceFieldValueID]['amount'] = $value['total_amount'];
- $value['price_' . $priceFieldID] = 1;
+ $value['price_' . $priceFieldID] = 1;
$lineItem = array();
CRM_Price_BAO_PriceSet::processAmount($this->_priceSet['fields'], $value, $lineItem[$priceSetId]);
}
// omitting contactImage from title for now since the summary overlay css doesn't work outside of our crm-container
- CRM_Utils_System::setTitle(ts('View Contribution from') . ' ' . $displayName);
+ CRM_Utils_System::setTitle(ts('View Contribution from') . ' ' . $displayName);
// add viewed contribution to recent items list
$url = CRM_Utils_System::url('civicrm/contact/view/contribution',
public static function &financialAccount($id = NULL, $financialAccountTypeId = NULL, $retrieveColumn = 'name', $key = 'id') {
$condition = NULL;
if ($financialAccountTypeId) {
- $condition = " financial_account_type_id = " . $financialAccountTypeId;
+ $condition = " financial_account_type_id = " . $financialAccountTypeId;
}
$cacheKey = "{$id}_{$financialAccountTypeId}_{$retrieveColumn}_{$key}";
if (!isset(self::$financialAccount[$cacheKey])) {
$date = $operator . "({$dateField}, INTERVAL {$actionSchedule->start_action_offset} {$actionSchedule->start_action_unit})";
$startDateClause[] = "'{$now}' >= {$date}";
if ($mapping->entity == 'civicrm_participant') {
- $startDateClause[] = $operator . "({$now}, INTERVAL 1 DAY ) {$op} " . $dateField;
+ $startDateClause[] = $operator . "({$now}, INTERVAL 1 DAY ) {$op} " . $dateField;
}
else {
$startDateClause[] = "DATE_SUB({$now}, INTERVAL 1 DAY ) <= {$date}";
}
if (!empty($excludeIds)) {
- $clause = "AND {$field} NOT IN ( " . implode(', ', $excludeIds) . ' ) ';
+ $clause = "AND {$field} NOT IN ( " . implode(', ', $excludeIds) . ' ) ';
return $clause;
}
return NULL;
<ul id='civicrm-home'>
<li><a href='$homeURL'>$homeLabel</a></li>
<li><a href='#' class='crm-hidemenu'>$hideLabel</a></li>
- <li><a href='$logoutURL' class='crm-logout-link'>" . ts('Log out') . "</a></li>
+ <li><a href='$logoutURL' class='crm-logout-link'>" . ts('Log out') . "</a></li>
</ul>";
// <li> tag doesn't need to be closed
}
$settingsMetadata = CRM_Core_BAO_Cache::getItem('CiviCRM setting Spec', 'All', $componentID);
if (empty($settingsMetadata)) {
global $civicrm_root;
- $metaDataFolders = array($civicrm_root . '/settings');
+ $metaDataFolders = array($civicrm_root . '/settings');
CRM_Utils_Hook::alterSettingsFolders($metaDataFolders);
$settingsMetadata = self::loadSettingsMetaDataFolders($metaDataFolders);
CRM_Core_BAO_Cache::setItem($settingsMetadata,'CiviCRM setting Spec', 'All', $componentID);
$formattedTags = array();
foreach ($tags as $key => $tag) {
if (!empty($tag[2])) {
- $key = $tag[2] . "-" . $key;
+ $key = $tag[2] . "-" . $key;
}
$formattedTags[$key] = $tag[0] . $tag[1];
}
unlink($this->digestPath);
}
- echo "\ncivicrm_domain.version := " . $this->db_version . "\n\n";
+ echo "\ncivicrm_domain.version := " . $this->db_version . "\n\n";
if ($this->buildVersion < 1.1) {
echo "The Database is not compatible for this version";
exit();
}
foreach ($inputs as $infile) {
// FIXME: does not beautify. Document.
- file_put_contents($outpath, $this->smarty->fetch($infile) . "\n", FILE_APPEND);
+ file_put_contents($outpath, $this->smarty->fetch($infile) . "\n", FILE_APPEND);
}
}
break;
case 'string':
- $args[] = '"' . CRM_Utils_String::ellipsify(addcslashes((string) $arg, "\r\n\t\""), $maxArgLen) . '"';
+ $args[] = '"' . CRM_Utils_String::ellipsify(addcslashes((string) $arg, "\r\n\t\""), $maxArgLen) . '"';
break;
case 'array':
$display[] = $val['label'];
}
- $el['html'] = implode('; ', $display) . '<input type="hidden" value="' . $field->getValue() . '" name="' . $field->getAttribute('name') . '">';
+ $el['html'] = implode('; ', $display) . '<input type="hidden" value="' . $field->getValue() . '" name="' . $field->getAttribute('name') . '">';
}
/**
* @return array - array of all payment processor types
*/
public static function &paymentProcessorType($all = FALSE, $id = NULL, $return = 'title') {
- $cacheKey = $id . '_' . $return;
+ $cacheKey = $id . '_' . $return;
if (empty(self::$paymentProcessorType[$cacheKey])) {
self::populate(self::$paymentProcessorType[$cacheKey], 'CRM_Financial_DAO_PaymentProcessorType', $all, $return, 'is_active', NULL, "is_default, $return", 'id');
}
// also add location name to the array
$params["address_name-{$this->_bltID}"] =
- CRM_Utils_Array::value('billing_first_name', $params) . ' ' .
+ CRM_Utils_Array::value('billing_first_name', $params) . ' ' .
CRM_Utils_Array::value('billing_middle_name', $params) . ' ' .
CRM_Utils_Array::value('billing_last_name', $params);
}
$this->assign('displayName', $displayName);
// omitting contactImage from title for now since the summary overlay css doesn't work outside of our crm-container
- CRM_Utils_System::setTitle(ts('View Event Registration for') . ' ' . $displayName);
+ CRM_Utils_System::setTitle(ts('View Event Registration for') . ' ' . $displayName);
$roleId = CRM_Utils_Array::value('role_id', $values[$participantID]);
$title = $displayName . ' (' . CRM_Utils_Array::value($roleId, $participantRoles) . ' - ' . $eventTitle . ')';
$details = '<p>' . ts('Record:') . ' ' . $values['title'] . '</p><p>' . ts('Description:') . '</p><p>' . ts('Created By:') . " $createdBy" . '</p><p>' . ts('Created Date:') . ' ' . $values['created_date'] . '</p><p>' . ts('Last Modified By:') . ' ' . $modifiedBy . '</p><p>' . ts('Payment Instrument:') . ' ' . $values['payment_instrument_id'] . '</p>';
$subject = '';
if (!empty($values['total'])) {
- $subject .= ts('Total') . '[' . CRM_Utils_Money::format($values['total']) . '],';
+ $subject .= ts('Total') . '[' . CRM_Utils_Money::format($values['total']) . '],';
}
if (!empty($values['item_count'])) {
- $subject .= ' ' . ts('Count') . '[' . $values['item_count'] . '],';
+ $subject .= ' ' . ts('Count') . '[' . $values['item_count'] . '],';
}
//create activity.
- $subject .= ' ' . ts('Batch') . '[' . $values['title'] . ']';
+ $subject .= ' ' . ts('Batch') . '[' . $values['title'] . ']';
$activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, FALSE, FALSE, 'name');
$activityParams = array(
'activity_type_id' => array_search('Export Accounting Batch', $activityTypes),
'trxn_date' => $this->format($itemDAO->transaction_date, 'date'),
'spl_id' => $this->format($itemDAO->financial_item_id),
'account_name' => $this->format($itemDAO->account_name),
- 'amount' => '-' . $this->format($itemDAO->amount, 'money'),
+ 'amount' => '-' . $this->format($itemDAO->amount, 'money'),
'contact_name' => $this->format($itemDAO->contact_name),
'payment_instrument' => $this->format($itemDAO->payment_instrument),
'description' => $this->format($itemDAO->description),
$errorStatus = '<ul><li>' . implode('</li><li>', $not_deleted) . '</li></ul>';
}
- $error['_qf_default'] = $errorStatus . ts('This contact(s) can not be permanently deleted because the contact record is linked to one or more live financial transactions. Deleting this contact would result in the loss of financial data.');
+ $error['_qf_default'] = $errorStatus . ts('This contact(s) can not be permanently deleted because the contact record is linked to one or more live financial transactions. Deleting this contact would result in the loss of financial data.');
return $error;
}
}
if (isset($this->_id)) {
$this->_title = CRM_Core_DAO::getFieldValue('CRM_Batch_DAO_Batch', $this->_id, 'title');
- CRM_Utils_System::setTitle($this->_title . ' - ' . ts('Accounting Batch'));
+ CRM_Utils_System::setTitle($this->_title . ' - ' . ts('Accounting Batch'));
$this->assign('batchTitle', $this->_title);
$contactID = CRM_Core_DAO::getFieldValue('CRM_Batch_DAO_Batch', $this->_id, 'created_id');
$contactName = CRM_Contact_BAO_Contact::displayName($contactID);
//create activity.
$activityParams = array(
'activity_type_id' => array_search($activityTypeName, $activityTypes),
- 'subject' => $batch->title . "- Batch",
+ 'subject' => $batch->title . "- Batch",
'status_id' => 2,
'priority_id' => 2,
'activity_date_time' => date('YmdHis'),
if ($this->_id) {
$financialAccount = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_EntityFinancialAccount', $this->_id, 'financial_account_id');
$fieldTitle = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialAccount', $financialAccount, 'name');
- CRM_Utils_System::setTitle($fieldTitle . ' - ' . ts('Financial Type Accounts'));
+ CRM_Utils_System::setTitle($fieldTitle . ' - ' . ts('Financial Type Accounts'));
}
$breadCrumb = array(
if ($statusID == CRM_Core_OptionGroup::getValue('batch_status', 'Open')) {
if (isset($notPresent)) {
$js = "enableActions('x')";
- $row[$financialItem->id]['check'] = "<input type='checkbox' id='mark_x_" . $financialItem->id . "' name='mark_x_" . $financialItem->id . "' value='1' onclick={$js}></input>";
+ $row[$financialItem->id]['check'] = "<input type='checkbox' id='mark_x_" . $financialItem->id . "' name='mark_x_" . $financialItem->id . "' value='1' onclick={$js}></input>";
$row[$financialItem->id]['action'] = CRM_Core_Action::formLink(
CRM_Financial_Form_BatchTransaction::links(),
NULL,
}
else {
$js = "enableActions('y')";
- $row[$financialItem->id]['check'] = "<input type='checkbox' id='mark_y_" . $financialItem->id . "' name='mark_y_" . $financialItem->id . "' value='1' onclick={$js}></input>";
+ $row[$financialItem->id]['check'] = "<input type='checkbox' id='mark_y_" . $financialItem->id . "' name='mark_y_" . $financialItem->id . "' value='1' onclick={$js}></input>";
$row[$financialItem->id]['action'] = CRM_Core_Action::formLink(
CRM_Financial_Page_BatchTransaction::links(),
NULL,
if ($this->_aid) {
$relationTypeId = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE 'Accounts Receivable Account is' "));
$this->_title = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialType', $this->_aid, 'name');
- CRM_Utils_System::setTitle($this->_title . ' - ' . ts('Assigned Financial Accounts'));
+ CRM_Utils_System::setTitle($this->_title . ' - ' . ts('Assigned Financial Accounts'));
$financialAccountType = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_FinancialAccount', 'financial_account_type_id');
$accountRelationship = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_EntityFinancialAccount', 'account_relationship');
$dao->copyValues($params);
if (is_array($value)) {
$query->_where[$grouping][] = "$tableName.$fieldName $op (" . implode(',', $value) . ")";
- $query->_qill[$grouping][] = "$fieldTitle $op " . implode(', ', array_intersect_key($valueTitles, array_flip($value)));
+ $query->_qill[$grouping][] = "$fieldTitle $op " . implode(', ', array_intersect_key($valueTitles, array_flip($value)));
}
else {
$query->_qill[$grouping][] = $fieldTitle . ' - ' . $valueTitles[$value];
$displayName .= ' (' . ts('default organization') . ')';
}
// omitting contactImage from title for now since the summary overlay css doesn't work outside of our crm-container
- CRM_Utils_System::setTitle(ts('View Pledge by') . ' ' . $displayName);
+ CRM_Utils_System::setTitle(ts('View Pledge by') . ' ' . $displayName);
//do check for campaigns
if ($campaignId = CRM_Utils_Array::value('campaign_id', $values)) {
}
else {
$opt['label'] = '<span class="crm-price-amount-label">' . $opt['label'] . '</span>' . '<span class="crm-price-amount-amount">' . CRM_Utils_Money::format($opt[$valueFieldName]) . '</span>';
- $opt['label'] .= '<span class="crm-price-amount-tax"> + ' . CRM_Utils_Money::format($opt['tax_amount']) . ' ' . $taxTerm . '</span>';
+ $opt['label'] .= '<span class="crm-price-amount-tax"> + ' . CRM_Utils_Money::format($opt['tax_amount']) . ' ' . $taxTerm . '</span>';
}
}
else {
}
else {
$label = CRM_Utils_Money::format($opt[$valueFieldName]);
- $label .= '<span class="crm-price-amount-tax"> + ' . CRM_Utils_Money::format($opt['tax_amount']) . ' ' . $taxTerm . '</span>';
+ $label .= '<span class="crm-price-amount-tax"> + ' . CRM_Utils_Money::format($opt['tax_amount']) . ' ' . $taxTerm . '</span>';
}
return $label;
'key' => CRM_Core_Key::get('civicrm/ajax/customvalue'),
);
$links[CRM_Core_Action::DELETE]['url'] = '#';
- $links[CRM_Core_Action::DELETE]['extra'] = ' data-delete_params="' . htmlspecialchars(json_encode($deleteData)) . '"';
+ $links[CRM_Core_Action::DELETE]['extra'] = ' data-delete_params="' . htmlspecialchars(json_encode($deleteData)) . '"';
$links[CRM_Core_Action::DELETE]['class'] = 'delete-custom-row';
}
if (!empty($pageCheckSum)) {
$date = CRM_Utils_Date::isoToMysql($row['log_civicrm_entity_log_date']);
if ('Update' == CRM_Utils_Array::value('log_civicrm_entity_log_action', $row)) {
- $q = "reset=1&log_conn_id={$row['log_civicrm_entity_log_conn_id']}&log_date=" . $date;
+ $q = "reset=1&log_conn_id={$row['log_civicrm_entity_log_conn_id']}&log_date=" . $date;
if ($this->cid) {
$q .= '&cid=' . $this->cid;
}
}
}
if ($rev == '4.4.6') {
- $postUpgradeMessage .= '<br /><br /><strong>' . ts('Your contact image urls have been upgraded. If your contact image urls did not follow the standard format for image Urls they have not been upgraded. Please check the log to see image urls that were not upgraded.');
+ $postUpgradeMessage .= '<br /><br /><strong>' . ts('Your contact image urls have been upgraded. If your contact image urls did not follow the standard format for image Urls they have not been upgraded. Please check the log to see image urls that were not upgraded.');
}
}
}
elseif ($urlElements[1] == 'report') {
$url = explode('&', $urlElements[3]);
- $name = 'report/' . $url[0];
+ $name = 'report/' . $url[0];
}
$values .= "
WHEN {$dashboard->id} THEN '{$name}'
// add civicrm_report_instance.name
$sql = "SELECT count(*) FROM information_schema.columns "
- . "WHERE table_schema = database() AND table_name = 'civicrm_report_instance' AND COLUMN_NAME = 'name' ";
+ . "WHERE table_schema = database() AND table_name = 'civicrm_report_instance' AND COLUMN_NAME = 'name' ";
$res = CRM_Core_DAO::singleValueQuery($sql);
cfi.description = %5,
cli.financial_type_id = %6
WHERE cfi.entity_table = 'civicrm_line_item'
-AND cli.entity_table = 'civicrm_contribution' AND cli.id IN (" . implode(',', $value) . ');';
+AND cli.entity_table = 'civicrm_contribution' AND cli.id IN (" . implode(',', $value) . ');';
$params = array(
1 => array($financialTrxn[$key]['label'], 'String'),
2 => array($financialTrxn[$key]['price_field_id'], 'Integer'),
INNER JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id AND cps.name <>'default_membership_type_amount' ";
$dao = CRM_Core_DAO::executeQuery($query);
if ($dao->N) {
- $preUpgradeMessage .= "<br /><strong>" . ts('We have identified extraneous data in your database that a previous upgrade likely introduced. We STRONGLY recommend making a backup of your site before continuing. We also STRONGLY suggest fixing this issue with unneeded records BEFORE you upgrade. You can find more information about this issue and the way to fix it by visiting <a href="http://forum.civicrm.org/index.php/topic,26181.0.html">http://forum.civicrm.org/index.php/topic,26181.0.html</a>.') . "</strong>";
+ $preUpgradeMessage .= "<br /><strong>" . ts('We have identified extraneous data in your database that a previous upgrade likely introduced. We STRONGLY recommend making a backup of your site before continuing. We also STRONGLY suggest fixing this issue with unneeded records BEFORE you upgrade. You can find more information about this issue and the way to fix it by visiting <a href="http://forum.civicrm.org/index.php/topic,26181.0.html">http://forum.civicrm.org/index.php/topic,26181.0.html</a>.') . "</strong>";
}
}
*/
public function fileName ($key) {
if (strlen($key) > 50) {
- return CIVICRM_TEMPLATE_COMPILEDIR . "CRM_" . md5($key) . ".php";
+ return CIVICRM_TEMPLATE_COMPILEDIR . "CRM_" . md5($key) . ".php";
}
- return CIVICRM_TEMPLATE_COMPILEDIR . $key . ".php";
+ return CIVICRM_TEMPLATE_COMPILEDIR . $key . ".php";
}
/**
$store = CRM_Mailing_MailStore::getStore($dao->name);
}
catch(Exception$e) {
- $message = ts('Could not connect to MailStore for ') . $dao->username . '@' . $dao->server . '<p>';
+ $message = ts('Could not connect to MailStore for ') . $dao->username . '@' . $dao->server . '<p>';
$message .= ts('Error message: ');
$message .= '<pre>' . $e->getMessage() . '</pre><p>';
CRM_Core_Error::fatal($message);
FROM civicrm_contact
WHERE id IN (' . implode(', ', $contactIds) . ' )';
if (count($contactIds) != CRM_Core_DAO::singleValueQuery($sql)) {
- throw new API_Exception('Invalid ' . ' Contact Id');
+ throw new API_Exception('Invalid ' . ' Contact Id');
}
}
$ids = CRM_Dedupe_Finder::dupesByParams($dedupeParams, $params['contact_type'], 'Unsupervised', array());
if (count($ids) > 0) {
- throw new API_Exception("Found matching contacts: " . implode(',', $ids), "duplicate", array("ids" => $ids));
+ throw new API_Exception("Found matching contacts: " . implode(',', $ids), "duplicate", array("ids" => $ids));
}
}
}
if (!empty($result['api.email.get.1']['count'])) {
- $values['billing-email' . '-' . $locationTypeID] = $result['api.email.get.1']['values'][0]['email'];
+ $values['billing-email' . '-' . $locationTypeID] = $result['api.email.get.1']['values'][0]['email'];
}
elseif(!empty($result['api.email.get.2']['count'])) {
- $values['billing-email' . '-' . $locationTypeID] = $result['api.email.get.2']['values'][0]['email'];
+ $values['billing-email' . '-' . $locationTypeID] = $result['api.email.get.2']['values'][0]['email'];
}
else{
- $values['billing-email' . '-' . $locationTypeID] = $result['email'];
+ $values['billing-email' . '-' . $locationTypeID] = $result['email'];
}
// return both variants of email to reflect inconsistencies in form layer
- $values['email' . '-' . $locationTypeID] = $values['billing-email' . '-' . $locationTypeID];
+ $values['email' . '-' . $locationTypeID] = $values['billing-email' . '-' . $locationTypeID];
return $values;
}
$legacyreturnProperties[substr($n, 7)] = $v;
}
elseif ($n == 'id') {
- $inputParams[$entity . '_id'] = $v;
+ $inputParams[$entity . '_id'] = $v;
}
elseif (in_array($n, $otherVars)) {
}
* Test works but not both due to some form of caching going on in the SmartySingleton
*/
public function testCreateSingleNowDated() {
- $firstName = 'John_' . substr(sha1(rand()), 0, 7);
+ $firstName = 'John_' . substr(sha1(rand()), 0, 7);
$lastName = 'Smith_' . substr(sha1(rand()), 0, 7);
$nameParams = array('first_name' => $firstName, 'last_name' => $lastName);
$contactId = $this->individualCreate($nameParams);
public function testCreateSinglePostDated() {
$start_date = date('Ymd', strtotime("+ 1 week"));
- $firstName = 'John_' . substr(sha1(rand()), 0, 7);
+ $firstName = 'John_' . substr(sha1(rand()), 0, 7);
$lastName = 'Smith_' . substr(sha1(rand()), 0, 7);
$nameParams = array('first_name' => $firstName, 'last_name' => $lastName);
$contactId = $this->individualCreate($nameParams);
}
public function testCheckRequirements_BadCachedir_false() {
- $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) . '/dataset/good-repository', '/index.html', FALSE);
+ $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) . '/dataset/good-repository', '/index.html', FALSE);
$this->assertEquals(TRUE, $browser->isEnabled());
$reqs = $browser->checkRequirements();
$this->assertEquals(1, count($reqs));
}
public function testCheckRequirements_BadCachedir_nonexistent() {
- $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) . '/dataset/good-repository', '/index.html', '/tot/all/yin/v/alid');
+ $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) . '/dataset/good-repository', '/index.html', '/tot/all/yin/v/alid');
$this->assertEquals(TRUE, $browser->isEnabled());
$reqs = $browser->checkRequirements();
$this->assertEquals(1, count($reqs));
}
public function testGetExtensions_good() {
- $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) . '/dataset/good-repository', '/index.html', $this->createTempDir('ext-cache-'));
+ $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) . '/dataset/good-repository', '/index.html', $this->createTempDir('ext-cache-'));
$this->assertEquals(TRUE, $browser->isEnabled());
$this->assertEquals(array(), $browser->checkRequirements());
$exts = $browser->getExtensions();
}
public function testGetExtension_good() {
- $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) . '/dataset/good-repository', '/index.html', $this->createTempDir('ext-cache-'));
+ $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) . '/dataset/good-repository', '/index.html', $this->createTempDir('ext-cache-'));
$this->assertEquals(TRUE, $browser->isEnabled());
$this->assertEquals(array(), $browser->checkRequirements());
}
public function testGetExtension_nonexistent() {
- $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) . '/dataset/good-repository', '/index.html', $this->createTempDir('ext-cache-'));
+ $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) . '/dataset/good-repository', '/index.html', $this->createTempDir('ext-cache-'));
$this->assertEquals(TRUE, $browser->isEnabled());
$this->assertEquals(array(), $browser->checkRequirements());
$this->assertEquals(
count($actualCsvArray[$intKey]),
count($expectedCsvArray[$intKey]),
- 'Arrays have different number of columns at row ' . $intKey . '; in line ' . __LINE__ . '; data: ' . $rowData
+ 'Arrays have different number of columns at row ' . $intKey . '; in line ' . __LINE__ . '; data: ' . $rowData
);
$this->assertEquals($expectedCsvArray[$intKey], $strVal);
}
// ADAPTED FROM tools/scripts/phpunit
$GLOBALS['base_dir'] = dirname(dirname(dirname(__DIR__)));
-$tests_dir = $GLOBALS['base_dir'] . DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR . 'phpunit';
-$civi_pkgs_dir = $GLOBALS['base_dir'] . DIRECTORY_SEPARATOR . 'packages';
+$tests_dir = $GLOBALS['base_dir'] . DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR . 'phpunit';
+$civi_pkgs_dir = $GLOBALS['base_dir'] . DIRECTORY_SEPARATOR . 'packages';
ini_set('safe_mode', 0);
ini_set('include_path',
"{$GLOBALS['base_dir']}" . PATH_SEPARATOR .
$this->clickLink('_qf_Search_refresh');
- $targetContacts = array("Summerson, " . $firstName1, "Andersonnn, " . $firstName2, "Anderson, " . $firstName3);
+ $targetContacts = array("Summerson, " . $firstName1, "Andersonnn, " . $firstName2, "Anderson, " . $firstName3);
//check whether separate activities are created for the target contacts
foreach ($targetContacts as $contact) {
$this->openCiviPage('a/#/caseType/new');
- $caseTypeLabel = "Case Type" . substr(sha1(rand()), 0, 7);
+ $caseTypeLabel = "Case Type" . substr(sha1(rand()), 0, 7);
$this->waitForElementPresent('title');
$this->type('title', $caseTypeLabel);
$this->click("xpath=//table/tbody//tr/td[1][text()='{$caseTypeLabel}']/../td[5]/span/a[text()='Edit']");
$this->waitForElementPresent("xpath=//div[@class='crm-submit-buttons']/span/input[@value='Save']");
- $editCaseTypeLabel = "Case Type Edit" . substr(sha1(rand()), 0, 7);
+ $editCaseTypeLabel = "Case Type Edit" . substr(sha1(rand()), 0, 7);
$this->waitForElementPresent('title');
$this->type('title', $editCaseTypeLabel);
//test for individual contact and household subtype contact
//relationship
- $typeb = "Household__" . $householdSubtypeName;
+ $typeb = "Household__" . $householdSubtypeName;
//create a relationship type between different contact types
$params = array(
$this->click("link=Add Field");
$this->waitForElementPresent('_qf_Field_next-bottom');
$this->select('field_name[0]', 'value=Membership');
- $label = $checkboxFieldLabel . ' :: ' . $customGroupTitle;
+ $label = $checkboxFieldLabel . ' :: ' . $customGroupTitle;
$this->select('field_name[1]', "label=$label");
$this->click('field_name[1]');
$this->click('_qf_Field_next_new-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->select('field_name[0]', 'value=Membership');
- $label = $radioFieldLabel . ' :: ' . $customGroupTitle;
+ $label = $radioFieldLabel . ' :: ' . $customGroupTitle;
$this->select('field_name[1]', "label=$label");
$this->click('field_name[1]');
$this->click('_qf_Field_next-bottom');
$this->assertTrue($this->isTextPresent("Your CiviCRM Profile Field '{$radioFieldLabel}' has been saved to 'On Behalf Of Organization'."));
//create organisation
- $orgName = "Org WebAccess " . substr(sha1(rand()), 0, 7);
- $orgEmail = "org" . substr(sha1(rand()), 0, 7) . "@web.com";
+ $orgName = "Org WebAccess " . substr(sha1(rand()), 0, 7);
+ $orgEmail = "org" . substr(sha1(rand()), 0, 7) . "@web.com";
$this->webtestAddOrganization($orgName, $orgEmail);
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->waitForPageToLoad($this->getTimeoutMsec());
//create organisation
- $orgName = "Org WebAccess " . substr(sha1(rand()), 0, 7);
- $orgEmail = "org" . substr(sha1(rand()), 0, 7) . "@web.com";
+ $orgName = "Org WebAccess " . substr(sha1(rand()), 0, 7);
+ $orgEmail = "org" . substr(sha1(rand()), 0, 7) . "@web.com";
$this->webtestAddOrganization($orgName, $orgEmail);
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->webtestLogin();
//create organisation
- $orgName = "Org WebAccess " . substr(sha1(rand()), 0, 7);
- $orgEmail = "org" . substr(sha1(rand()), 0, 7) . "@web.com";
+ $orgName = "Org WebAccess " . substr(sha1(rand()), 0, 7);
+ $orgEmail = "org" . substr(sha1(rand()), 0, 7) . "@web.com";
$contactSubType = 'Sponsor';
$this->webtestAddOrganization($orgName, $orgEmail, $contactSubType);
// Adding contact with randomized first name (so we can then select that contact when creating event registration)
// We're using Quick Add block on the main page for this.
$firstName = substr(sha1(rand()), 0, 7);
- $lastName = 'Anderson' . substr(sha1(rand()), 0, 7);
+ $lastName = 'Anderson' . substr(sha1(rand()), 0, 7);
$this->webtestAddContact($firstName, $lastName, TRUE);
$contactName = "$lastName, $firstName";
$displayName = "$firstName $lastName";
// Adding contact with randomized first name (so we can then select that contact when creating event registration)
// We're using Quick Add block on the main page for this.
$firstName = substr(sha1(rand()), 0, 7);
- $lastName = 'Anderson' . substr(sha1(rand()), 0, 7);
+ $lastName = 'Anderson' . substr(sha1(rand()), 0, 7);
$this->webtestAddContact($firstName, $lastName, TRUE);
$contactName = "$lastName, $firstName";
$displayName = "$firstName $lastName";
$email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
$this->type('first_name', 'Mary');
- $this->type('last_name', 'Jones' . substr(sha1(rand()), 0, 5));
+ $this->type('last_name', 'Jones' . substr(sha1(rand()), 0, 5));
$this->type('email-Primary', $email);
// fill billing details and register
$this->click("xpath=//input[@class='crm-form-radio']");
$email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
$this->type('first_name', 'Mary');
- $this->type('last_name', 'Jones' . substr(sha1(rand()), 0, 5));
+ $this->type('last_name', 'Jones' . substr(sha1(rand()), 0, 5));
$this->type('email-Primary', $email);
// fill billing details and register
$this->select("price_{$selectFieldId}", "value={$selectFieldOp1}");
$this->type('first_name', 'Mary');
- $this->type('last_name', 'Jones' . substr(sha1(rand()), 0, 5));
+ $this->type('last_name', 'Jones' . substr(sha1(rand()), 0, 5));
$email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
$this->type('email-Primary', $email);
// exceed maximun count for text field, check for form rule
$this->type("xpath=//input[@id='price_{$textFieldId}']", '2');
$this->type('first_name', 'Mary');
- $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
+ $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
$email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
$this->type('email-Primary', $email);
$this->type("xpath=//input[@id='price_{$textFieldId}']", '3');
$this->type('first_name', 'Mary');
- $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
+ $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
$email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
$this->type('email-Primary', $email);
// check for form rule
$this->type("xpath=//input[@id='price_{$textFieldId}']", '2');
$this->type('first_name', 'Mary');
- $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
+ $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
$email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
$this->type('email-Primary', $email);
$this->type("xpath=//input[@id='price_{$textFieldId}']", '7');
$this->type('first_name', 'Mary');
- $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
+ $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
$email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
$this->type('email-Primary', $email);
$this->type("xpath=//input[@id='price_{$textFieldId}']", '6');
$this->type('first_name', 'Mary Add 2');
- $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
+ $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
$email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
$this->type('email-Primary', $email);
$this->type("xpath=//input[@id='price_{$textFieldId}']", '3');
$this->type('first_name', 'Mary Add 2');
- $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
+ $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
$email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
$this->type('email-Primary', $email);
$this->type("xpath=//input[@id='price_{$textFieldId}']", '3');
$this->type('first_name', 'Mary');
- $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
+ $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
$email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
$this->type('email-Primary', $email);
$this->type("xpath=//input[@id='price_{$textFieldId}']", '2');
$this->type('first_name', 'Mary Add 1');
- $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
+ $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
$email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
$this->type('email-Primary', $email);
$this->type("xpath=//input[@id='price_{$textFieldId}']", '7');
$this->type('first_name', 'Mary');
- $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
+ $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
$email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
$this->type('email-Primary', $email);
$this->type("xpath=//input[@id='price_{$textFieldId}']", '6');
$this->type('first_name', 'Mary Add 1');
- $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
+ $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
$email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
$this->type('email-Primary', $email);
$this->type("xpath=//input[@id='price_{$textFieldId}']", '3');
$this->type('first_name', 'Mary Add 2');
- $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
+ $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
$email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
$this->type('email-Primary', $email);
$this->type("xpath=//input[@id='price_{$textFieldId}']", '3');
$this->type('first_name', 'Mary');
- $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
+ $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
$email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
$this->type('email-Primary', $email);
$this->type("xpath=//input[@id='price_{$textFieldId}']", '2');
$this->type('first_name', 'Mary Add 1');
- $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
+ $this->type('last_name', 'Jane' . substr(sha1(rand()), 0, 5));
$email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
$this->type('email-Primary', $email);
$this->open($registerUrl);
$this->waitForElementPresent('_qf_Register_upload-bottom');
- $firstName = 'Jane' . substr(sha1(rand()), 0, 7);
+ $firstName = 'Jane' . substr(sha1(rand()), 0, 7);
$lastName = 'Doe' . substr(sha1(rand()), 0, 7);
$this->type('first_name', "$firstName");
$this->type('last_name', "$lastName");
$this->assertEquals($expectedValue, $savedValue);
//let's try with 2 params already separated
- $expectedValue = CRM_Core_DAO::VALUE_SEPARATOR . 'valley' . CRM_Core_DAO::VALUE_SEPARATOR . 'goat' . CRM_Core_DAO::VALUE_SEPARATOR;
+ $expectedValue = CRM_Core_DAO::VALUE_SEPARATOR . 'valley' . CRM_Core_DAO::VALUE_SEPARATOR . 'goat' . CRM_Core_DAO::VALUE_SEPARATOR;
$this->params[$customFieldLabel] = $expectedValue;
$result = $this->callAPISuccess($this->_entity, 'create', $this->params);
$savedValue = CRM_Core_DAO::singleValueQuery("SELECT {$columnName} FROM $customTable WHERE entity_id = {$result['id']}");
$reportTemplates[] = array($report['value']);
}
else {
- $reportTemplates[] = array($report['value'] . " has existing issues : " . $reportsToSkip[$report['value']]);
+ $reportTemplates[] = array($report['value'] . " has existing issues : " . $reportsToSkip[$report['value']]);
}
}