Skip to content

Commit

Permalink
Upgrade to CiviCRM 5.32.1
Browse files Browse the repository at this point in the history
Includes new features, bug fixes, and changes to the database schema. Requires database updates. Notes:

* https://github.com/civicrm/civicrm-core/blob/master/release-notes/5.31.1.md
* https://github.com/civicrm/civicrm-core/blob/master/release-notes/5.32.0.md
* https://github.com/civicrm/civicrm-core/blob/master/release-notes/5.32.1.md

Backup your site using Pantheon's backup tool first. Then either go to
http://<your_drupal_home>/civicrm/upgrade?reset=1 or use terminus drush site.env civicrm-upgrade-db.

Fully test on a dev environment before upgrading on live.

If you have questions contact https://civicrmstarterkit.org/contact. We provide
some basic general support for the public. If you require help with your
specific website there will likely be a cost.
  • Loading branch information
herbdool committed Dec 7, 2020
1 parent d566fba commit 265eae9
Show file tree
Hide file tree
Showing 1,462 changed files with 677,726 additions and 3,598 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,8 @@ public static function group(
if (empty($ids) && !empty($includedGroups) &&
is_array($includedGroups)
) {
// This is pretty alarming - we 'sometimes' include all included groups
// seems problematic per https://lab.civicrm.org/dev/core/-/issues/1879
$ids = $includedGroups;
}
if ($contactID) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Activity/Activity.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:c1b4cc908c0220abf69f57d281eeda95)
* (GenCodeChecksum:af42b47e95e8c7f47eb7a3ef53833383)
*/

/**
Expand Down Expand Up @@ -37,6 +37,18 @@ class CRM_Activity_DAO_Activity extends CRM_Core_DAO {
*/
public static $_log = TRUE;

/**
* Paths for accessing this entity in the UI.
*
* @var string[]
*/
protected static $_paths = [
'add' => 'civicrm/activity?reset=1&action=add&context=standalone',
'view' => 'civicrm/activity?reset=1&action=view&id=[id]',
'update' => 'civicrm/activity/add?reset=1&action=update&id=[id]',
'delete' => 'civicrm/activity?reset=1&action=delete&id=[id]',
];

/**
* Unique Other Activity ID
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php
/*
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC. All rights reserved. |
| |
| This work is published under the GNU AGPLv3 license with some |
| permitted exceptions and without any warranty. For full license |
| and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/

/**
*
* @package CRM
* @copyright CiviCRM LLC https://civicrm.org/licensing
*/

/**
* This class gets the name of the file to upload
*/
class CRM_Activity_Export_Form_Map extends CRM_Export_Form_Map {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php
/*
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC. All rights reserved. |
| |
| This work is published under the GNU AGPLv3 license with some |
| permitted exceptions and without any warranty. For full license |
| and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/

/**
*
* @package CRM
* @copyright CiviCRM LLC https://civicrm.org/licensing
*/

/**
* This class gets the name of the file to upload
*/
class CRM_Activity_Export_Form_Select extends CRM_Export_Form_Select {

/**
* Call the pre-processing function.
*/
protected function callPreProcessing(): void {
CRM_Activity_Form_Task::preProcessCommon($this);
}

/**
* Does this export offer contact merging.
*
* @return bool
*/
protected function isShowContactMergeOptions() {
return FALSE;
}

/**
* Get the name of the table for the relevant entity.
*
* @return string
*/
public function getTableName() {
return 'civicrm_activity';
}

/**
* Get the group by clause for the component.
*
* @return string
*/
public function getEntityAliasField() {
return 'activity_id';
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,8 @@ public static function preProcessCommon(&$form) {
$form->_task = $values['task'];

$ids = [];
if ($values['radio_ts'] == 'ts_sel') {
foreach ($values as $name => $value) {
if (substr($name, 0, CRM_Core_Form::CB_PREFIX_LEN) == CRM_Core_Form::CB_PREFIX) {
$ids[] = substr($name, CRM_Core_Form::CB_PREFIX_LEN);
}
}
if ($values['radio_ts'] === 'ts_sel') {
$ids = $form->getSelectedIDs($values);
}
else {
$queryParams = $form->get('queryParams');
Expand Down Expand Up @@ -83,24 +79,7 @@ public static function preProcessCommon(&$form) {
}

$form->_activityHolderIds = $form->_componentIds = $ids;

// Set the context for redirection for any task actions.
$qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $form);
$urlParams = 'force=1';
if (CRM_Utils_Rule::qfKey($qfKey)) {
$urlParams .= "&qfKey=$qfKey";
}

$session = CRM_Core_Session::singleton();
$searchFormName = strtolower($form->get('searchFormName'));
if ($searchFormName == 'search') {
$session->replaceUserContext(CRM_Utils_System::url('civicrm/activity/search', $urlParams));
}
else {
$session->replaceUserContext(CRM_Utils_System::url("civicrm/contact/search/$searchFormName",
$urlParams
));
}
$form->setNextUrl('activity');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public static function tasks() {
self::TASK_EXPORT => [
'title' => ts('Export activities'),
'class' => [
'CRM_Export_Form_Select',
'CRM_Export_Form_Map',
'CRM_Activity_Export_Form_Select',
'CRM_Activity_Export_Form_Map',
],
'result' => FALSE,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
*/
class CRM_Admin_Form_MailSettings extends CRM_Admin_Form {

protected $_testButtonName;

/**
* Build the form object.
*/
Expand All @@ -32,6 +34,16 @@ public function buildQuickForm() {
return;
}

$this->_testButtonName = $this->getButtonName('refresh', 'test');
$buttons = $this->getElement('buttons')->getElements();
$buttons[] = $this->createElement(
'xbutton',
$this->_testButtonName,
CRM_Core_Page::crmIcon('fa-chain') . ' ' . ts('Save & Test'),
['type' => 'submit', 'class' => 'crm-button']
);
$this->getElement('buttons')->setElements($buttons);

$this->applyFilter('__ALL__', 'trim');

//get the attributes.
Expand Down Expand Up @@ -79,7 +91,7 @@ public function buildQuickForm() {
* Add local and global form rules.
*/
public function addRules() {
$this->addFormRule(['CRM_Admin_Form_MailSettings', 'formRule']);
$this->addFormRule(['CRM_Admin_Form_MailSettings', 'formRule'], $this);
}

public function getDefaultEntity() {
Expand Down Expand Up @@ -107,15 +119,21 @@ public function setDefaultValues() {
*
* @param array $fields
* Posted values of the form.
* @param array $files
* Not used here.
* @param CRM_Core_Form $form
* This form.
*
* @return array
* list of errors to be posted back to the form
*/
public static function formRule($fields) {
public static function formRule($fields, $files, $form) {
$errors = [];
// Check for default from email address and organization (domain) name. Force them to change it.
if ($fields['domain'] == 'EXAMPLE.ORG') {
$errors['domain'] = ts('Please enter a valid domain for this mailbox account (the part after @).');
if ($form->_action != CRM_Core_Action::DELETE) {
// Check for default from email address and organization (domain) name. Force them to change it.
if ($fields['domain'] == 'EXAMPLE.ORG') {
$errors['domain'] = ts('Please enter a valid domain for this mailbox account (the part after @).');
}
}

return empty($errors) ? TRUE : $errors;
Expand Down Expand Up @@ -185,6 +203,14 @@ public function postProcess() {
else {
CRM_Core_Session::setStatus("", ts('Changes Not Saved.'), "info");
}

if ($this->controller->getButtonName() == $this->_testButtonName) {
$test = civicrm_api4('MailSettings', 'testConnection', [
'where' => [['id', '=', $mailSettings->id]],
])->single();
CRM_Core_Session::setStatus($test['details'], $test['title'],
$test['error'] ? 'error' : 'success');
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ public static function formRule($params, $files, $self) {
public function postProcess() {
if ($this->_action & CRM_Core_Action::DELETE) {
CRM_Core_BAO_MessageTemplate::del($this->_id);

$this->postProcessHook();
}
elseif ($this->_action & CRM_Core_Action::VIEW) {
// currently, the above action is used solely for previewing default workflow templates
Expand Down Expand Up @@ -309,6 +311,11 @@ public function postProcess() {
}

$messageTemplate = MessageTemplate::save()->setDefaults($params)->setRecords([['id' => $this->_id]])->execute()->first();

// set the id on save, so it can be used in a extension using the posProcess hook
$this->_id = $messageTemplate['id'];
$this->postProcessHook();

CRM_Core_Session::setStatus(ts('The Message Template \'%1\' has been saved.', [1 => $messageTemplate['msg_title']]), ts('Saved'), 'success');

if (isset($this->_submitValues['_qf_MessageTemplates_upload'])) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ public function browse() {
}

$this->assign('rows', $allMailSettings);

$setupActions = CRM_Core_BAO_MailSettings::getSetupActions();
if (count($setupActions) > 1 || !isset($setupActions['standard'])) {
$this->assign('setupActions', $setupActions);
}
}

/**
Expand Down
Loading

0 comments on commit 265eae9

Please sign in to comment.