$dao = new CRM_SMS_DAO_Provider();
$dao->id = $providerID;
- $dao->whereAdd = "(domain_id = " . CRM_Core_Config::domainID() . "OR domain_id IS NULL)";
+ $dao->whereAdd = "(domain_id = " . CRM_Core_Config::domainID() . "OR domain_id IS NULL)";
if (!$dao->find(TRUE)) {
return NULL;
}
<?php
/**
- +--------------------------------------------------------------------+
- | CiviCRM version 5 |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2019 |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM. |
- | |
- | CiviCRM is free software; you can copy, modify, and distribute it |
- | under the terms of the GNU Affero General Public License |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
- | |
- | CiviCRM is distributed in the hope that it will be useful, but |
- | WITHOUT ANY WARRANTY; without even the implied warranty of |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
- | See the GNU Affero General Public License for more details. |
- | |
- | You should have received a copy of the GNU Affero General Public |
- | License and the CiviCRM Licensing Exception along |
- | with this program; if not, contact CiviCRM LLC |
- | at info[AT]civicrm[DOT]org. If you have questions about the |
- | GNU Affero General Public License or the licensing of CiviCRM, |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
- +--------------------------------------------------------------------+
+ * +--------------------------------------------------------------------+
+ * | CiviCRM version 5 |
+ * +--------------------------------------------------------------------+
+ * | Copyright CiviCRM LLC (c) 2004-2019 |
+ * +--------------------------------------------------------------------+
+ * | This file is a part of CiviCRM. |
+ * | |
+ * | CiviCRM is free software; you can copy, modify, and distribute it |
+ * | under the terms of the GNU Affero General Public License |
+ * | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
+ * | |
+ * | CiviCRM is distributed in the hope that it will be useful, but |
+ * | WITHOUT ANY WARRANTY; without even the implied warranty of |
+ * | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
+ * | See the GNU Affero General Public License for more details. |
+ * | |
+ * | You should have received a copy of the GNU Affero General Public |
+ * | License and the CiviCRM Licensing Exception along |
+ * | with this program; if not, contact CiviCRM LLC |
+ * | at info[AT]civicrm[DOT]org. If you have questions about the |
+ * | GNU Affero General Public License or the licensing of CiviCRM, |
+ * | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+ * +--------------------------------------------------------------------+
*/
-
class CRM_SMS_Message {
/**
*
* @var array
*/
- static $_links = NULL;
+ public static $_links = NULL;
/**
* Get BAO Name.
// find sender by phone number if $fromContactID not set by hook
$formatFrom = '%' . $this->formatPhone($this->stripPhone($message->from), $like, "like");
$message->fromContactID = CRM_Core_DAO::singleValueQuery("SELECT contact_id FROM civicrm_phone JOIN civicrm_contact ON civicrm_contact.id = civicrm_phone.contact_id WHERE !civicrm_contact.is_deleted AND phone LIKE %1", array(
- 1 => array($formatFrom, 'String')));
+ 1 => array($formatFrom, 'String'),
+ ));
}
if (!$message->fromContactID) {
// find recipient if $toContactID not set by hook
if ($message->to) {
$message->toContactID = CRM_Core_DAO::singleValueQuery("SELECT contact_id FROM civicrm_phone JOIN civicrm_contact ON civicrm_contact.id = civicrm_phone.contact_id WHERE !civicrm_contact.is_deleted AND phone LIKE %1", array(
- 1 => array('%' . $message->to, 'String')));
+ 1 => array('%' . $message->to, 'String'),
+ ));
}
else {
$message->toContactID = $message->fromContactID;
CRM_Core_DAO::getAttribute('CRM_Core_DAO_Tag', 'name'), TRUE
);
$this->addRule('name', ts('Name already exists in Database.'), 'objectExists', [
- 'CRM_Core_DAO_Tag',
- $this->_id,
- ]);
+ 'CRM_Core_DAO_Tag',
+ $this->_id,
+ ]);
$this->add('text', 'description', ts('Description'),
CRM_Core_DAO::getAttribute('CRM_Core_DAO_Tag', 'description')
'type' => 'cancel',
'name' => ts('Cancel'),
],
- ]
- );
+ ]);
}
/**
*
* @return string
*/
+
/**
* @return string
*/
$fieldTypeValues = CRM_Core_BAO_UFGroup::groupTypeValues($gid, $fieldType);
if (empty($fieldTypeValues[$fieldType])) {
- return;
+ return $errors;
}
$disallowedTypes = array_diff($extendsColumnValues, $fieldTypeValues[$fieldType]);
$message = ts('For best results, the Country field should precede the State-Province field in your Profile form. You can use the up and down arrows on field listing page for this profile to change the order of these fields or manually edit weight for Country/State-Province Field.');
if (in_array($fieldName, [
- 'country',
- 'state_province',
- ]) && count(CRM_Core_Config::singleton()->countryLimit) > 1
+ 'country',
+ 'state_province',
+ ]) && count(CRM_Core_Config::singleton()->countryLimit) > 1
) {
// get state or country field weight if exists
$ufFieldDAO = new CRM_Core_DAO_UFField();
* widgets
*/
class CRM_UF_Page_ProfileEditor extends CRM_Core_Page {
+
/**
* Run page.
*
*/
const MINIMUM_PHP_VERSION = '5.6';
+ /**
+ * @var \CRM_Core_Config
+ */
protected $_config;
/**
*
* @return string
*/
+
/**
* @return string
*/
*
* @return string
*/
+
/**
* @return string
*/
* @param bool $enablePrint
*
* @throws Exception
- * @return array, with keys:
+ * @return array
+ * - with keys:
* - message: string, HTML-ish blob
*/
public function run($enablePrint = TRUE) {
if ($enablePrint) {
print ($errorMessage);
}
- throw $queueResult['exception']; // FIXME test
+ // FIXME test
+ throw $queueResult['exception'];
}
CRM_Upgrade_Form::doFinish();
if (version_compare(phpversion(), self::MIN_RECOMMENDED_PHP_VER) < 0) {
$preUpgradeMessage .= '<p>';
$preUpgradeMessage .= ts('You may proceed with the upgrade and CiviCRM %1 will continue working normally, but future releases will require PHP %2 or above. We recommend PHP version %3.', [
- 1 => $latestVer,
- 2 => self::MIN_RECOMMENDED_PHP_VER,
- 3 => self::RECOMMENDED_PHP_VER,
+ 1 => $latestVer,
+ 2 => self::MIN_RECOMMENDED_PHP_VER,
+ 3 => self::RECOMMENDED_PHP_VER,
]);
$preUpgradeMessage .= '</p>';
}
if (file_exists($ofcFile)) {
if (@unlink($ofcFile)) {
$preUpgradeMessage .= '<br />' . ts('This system included an outdated, insecure script (%1). The file was automatically deleted.', [
- 1 => $ofcFile,
- ]);
+ 1 => $ofcFile,
+ ]);
}
else {
$preUpgradeMessage .= '<br />' . ts('This system includes an outdated, insecure script (%1). Please delete it.', [
- 1 => $ofcFile,
- ]);
+ 1 => $ofcFile,
+ ]);
}
}
}, array_keys($messages), $messages);
$message .= '<br />' . ts("The default copies of the message templates listed below will be updated to handle new features or correct a problem. Your installation has customized versions of these message templates, and you will need to apply the updates manually after running this upgrade. <a href='%1' style='color:white; text-decoration:underline; font-weight:bold;' target='_blank'>Click here</a> for detailed instructions. %2", [
- 1 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Message+Templates#MessageTemplates-UpgradesandCustomizedSystemWorkflowTemplates',
- 2 => '<ul>' . implode('', $messagesHtml) . '</ul>',
- ]);
+ 1 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Message+Templates#MessageTemplates-UpgradesandCustomizedSystemWorkflowTemplates',
+ 2 => '<ul>' . implode('', $messagesHtml) . '</ul>',
+ ]);
$messageObj->updateTemplates();
}
$html = "<ul>" . $html . "<ul>";
$message .= '<br />' . ts("The default copies of the message templates listed below will be updated to handle new features or correct a problem. Your installation has customized versions of these message templates, and you will need to apply the updates manually after running this upgrade. <a href='%1' style='color:white; text-decoration:underline; font-weight:bold;' target='_blank'>Click here</a> for detailed instructions. %2", [
- 1 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Message+Templates#MessageTemplates-UpgradesandCustomizedSystemWorkflowTemplates',
- 2 => $html,
- ]);
+ 1 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Message+Templates#MessageTemplates-UpgradesandCustomizedSystemWorkflowTemplates',
+ 2 => $html,
+ ]);
}
}
['name' => 'event_online_receipt', 'type' => 'text'],
['name' => 'event_online_receipt', 'type' => 'html'],
['name' => 'event_online_receipt', 'type' => 'subject'],
- ]
+ ],
],
[
'version' => '5.7.alpha1',
'label' => ts('Contributions - Invoice'),
'templates' => [
['name' => 'contribution_invoice_receipt', 'type' => 'html'],
- ]
+ ],
],
[
'version' => '5.10.alpha1',
['name' => 'contribution_recurring_notify', 'type' => 'html'],
['name' => 'membership_online_receipt', 'type' => 'text'],
['name' => 'membership_online_receipt', 'type' => 'html'],
- ]
+ ],
],
[
'version' => '5.12.alpha1',
'templates' => [
['name' => 'payment_or_refund_notification', 'type' => 'text'],
['name' => 'payment_or_refund_notification', 'type' => 'html'],
- ]
+ ],
],
];
}
CRM_Core_DAO::executeQuery("
UPDATE civicrm_msg_template SET msg_{$template['type']} = %1 WHERE id IN (" . implode(',', $templatesToUpdate) . ")", [
- 1 => [$content, 'String']
- ]
+ 1 => [$content, 'String'],
+ ]
);
}
}
'grant_application_received_date',
'grant_decision_date',
'grant_money_transfer_date',
- 'grant_due_date'
- ]
+ 'grant_due_date',
+ ],
]);
if (Civi::settings()->get('civimail_multiple_bulk_emails')) {
$this->addTask('Update any on hold groups to reflect field change', 'updateOnHold', $rev);
$this->addTask('Update smart groups where jcalendar fields have been converted to datepicker', 'updateSmartGroups', [
'datepickerConversion' => [
'age_asof_date',
- 'activity_date_time'
- ]
+ 'activity_date_time',
+ ],
]);
}
for ($startId = $minId; $startId <= $maxId; $startId += self::BATCH_SIZE) {
$endId = $startId + self::BATCH_SIZE - 1;
$title = ts("Upgrade DB to 4.5.beta9: Fix line items for {$label} (%1 => %2)", [
- 1 => $startId,
- 2 => $endId,
- ]);
+ 1 => $startId,
+ 2 => $endId,
+ ]);
$this->addTask($title, 'task_4_5_0_fixLineItem', $startId, $endId, $label);
}
}
* the first/lowest entity ID to convert.
* @param int $endId
* the last/highest entity ID to convert.
- * @param
+ * @param string $entityTable
*
* @return bool
*/
}
if ($oversizedEntries > 0) {
$preUpgradeMessage .= '<br/>' . ts("WARNING: There are %1 word-replacement entries which will not be valid in v4.4+ (eg with over 255 characters). They will be dropped during upgrade. For details, consult the CiviCRM log.", [
- 1 => $oversizedEntries,
- ]);
+ 1 => $oversizedEntries,
+ ]);
}
}
}
$dao = CRM_Core_DAO::executeQuery($query);
if ($dao->N) {
$postUpgradeMessage .= '<br /><br /><strong>' . ts('Your database contains %1 financial transaction records with no payment instrument (Paid By is empty). If you use the Accounting Batches feature this may result in unbalanced transactions. If you do not use this feature, you can ignore the condition (although you will be required to select a Paid By value for new transactions). <a href="%2" target="_blank">You can review steps to correct transactions with missing payment instruments on the wiki.</a>', [
- 1 => $dao->N,
- 2 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Fixing+Transactions+Missing+a+Payment+Instrument+-+4.4.3+Upgrades',
- ]) . '</strong>';
+ 1 => $dao->N,
+ 2 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Fixing+Transactions+Missing+a+Payment+Instrument+-+4.4.3+Upgrades',
+ ]) . '</strong>';
}
}
if ($rev == '4.4.6') {
*/
public function upgrade_4_4_7($rev, $originalVer, $latestVer) {
// For WordPress/Joomla(?), cleanup broken image_URL from 4.4.6 upgrades - https://issues.civicrm.org/jira/browse/CRM-14971
- $exBackendUrl = CRM_Utils_System::url('civicrm/contact/imagefile', 'photo=XXX', TRUE); // URL formula from 4.4.6 upgrade
+ // URL formula from 4.4.6 upgrade
+ $exBackendUrl = CRM_Utils_System::url('civicrm/contact/imagefile', 'photo=XXX', TRUE);
$exFrontendUrl = CRM_Utils_System::url('civicrm/contact/imagefile', 'photo=XXX', TRUE, NULL, TRUE, TRUE);
if ($originalVer == '4.4.6' && $exBackendUrl != $exFrontendUrl) {
$minId = CRM_Core_DAO::singleValueQuery('SELECT coalesce(min(id),0) FROM civicrm_contact WHERE image_URL IS NOT NULL');
CRM_Core_BAO_WordReplacement::rebuild();
}
-
/**
* CRM-13998 missing alter statements for civicrm_report_instance
*/
$this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev);
$this->addTask('Add Data Type column to civicrm_option_group', 'addDataTypeColumnToOptionGroupTable');
}
+
/**
* Upgrade function.
*
* Update Invoice number for all completed contribution.
*
* @param \CRM_Queue_TaskContext $ctx
+ * @param int $startID
+ * @param int $endID
+ * @param string $invoicePrefix
*
* @return bool
*/
// construct basic where clauses
$where = [
+ //choose reminder older then 9 months
'reminder.action_date_time >= DATE_SUB(reminder.action_date_time, INTERVAL 9 MONTH)',
- ]; //choose reminder older then 9 months
+ ];
$dao = CRM_Core_DAO::executeQuery($query);
while ($dao->fetch()) {
// CRM-11823 - Make sure the D6 HTML HEAD technique will work on
// upgrade pages ... except when we're in Drush.
if (!function_exists('drush_main')) {
- theme('item_list', []); // force-load theme registry
+ // force-load theme registry
+ theme('item_list', []);
$theme_registry = theme_get_registry();
if (!isset($theme_registry['page']['preprocess functions']) || FALSE === array_search('civicrm_preprocess_page_inject', $theme_registry['page']['preprocess functions'])) {
CRM_Core_Error::fatal('Please reset the Drupal cache (Administer => Site Configuration => Performance => Clear cached data))');
* Class CRM_Upgrade_Page_Cleanup
*/
class CRM_Upgrade_Page_Cleanup extends CRM_Core_Page {
+
public function cleanup425() {
$rows = CRM_Upgrade_Incremental_php_FourTwo::deleteInvalidPairs();
$template = CRM_Core_Smarty::singleton();
CRM_Upgrade_Form::doFinish();
}
else {
- $postUpgradeMessage = ''; // Session was destroyed! Can't recover messages.
+ // Session was destroyed! Can't recover messages.
+ $postUpgradeMessage = '';
}
// do a version check - after doFinish() sets the final version