Skip to content

Commit

Permalink
Merge pull request #12844 from totten/5.6-asg-opt-group
Browse files Browse the repository at this point in the history
(dev/core#107) Fix regression which prevents editing CiviCase configuration
  • Loading branch information
eileenmcnaughton authored Sep 20, 2018
2 parents 9cf8e2e + 26cd8b0 commit 0434d0f
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 53 deletions.
30 changes: 15 additions & 15 deletions CRM/Upgrade/Incremental/php/FiveSix.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,21 @@ public function setPostUpgradeMessage(&$postUpgradeMessage, $rev) {
* (change the x in the function name):
*/

// /**
// * Upgrade function.
// *
// * @param string $rev
// */
// public function upgrade_5_0_x($rev) {
// $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => $rev)), 'runSql', $rev);
// $this->addTask('Do the foo change', 'taskFoo', ...);
// // Additional tasks here...
// // Note: do not use ts() in the addTask description because it adds unnecessary strings to transifex.
// // The above is an exception because 'Upgrade DB to %1: SQL' is generic & reusable.
// }
/**
* Upgrade function.
*
* @param string $rev
*/
public function upgrade_5_6_beta2($rev) {
$this->addTask(ts('Upgrade DB to %1: SQL', array(1 => $rev)), 'runSql', $rev);
$this->addTask('dev/core#107 - Add Activity\'s default assignee options', 'addActivityDefaultAssigneeOptions');
}

// public static function taskFoo(CRM_Queue_TaskContext $ctx, ...) {
// return TRUE;
// }
public static function addActivityDefaultAssigneeOptions() {
// This data was originally added via upgrader in 5.4.alpha1. However, it was omitted from the
// default data for new installations. Re-running the upgrader should fix sites initialized
// between 5.4.alpha1-5.6.beta1.
return CRM_Upgrade_Incremental_php_FiveFour::addActivityDefaultAssigneeOptions();
}

}
1 change: 1 addition & 0 deletions CRM/Upgrade/Incremental/sql/5.6.beta2.mysql.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{* file to handle db changes in 5.6.beta2 during upgrade *}
70 changes: 35 additions & 35 deletions sql/civicrm_generated.mysql

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions xml/templates/civicrm_data.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ VALUES
('wysiwyg_presets' , '{ts escape="sql"}WYSIWYG Editor Presets{/ts}' , NULL, 1, 1, 0),
('relative_date_filters' , '{ts escape="sql"}Relative Date Filters{/ts}' , NULL, 1, 1, 0),
('pledge_status' , '{ts escape="sql"}Pledge Status{/ts}' , NULL, 1, 1, 1),
('environment' , '{ts escape="sql"}Environment{/ts}' , NULL, 1, 1, 0);
('environment' , '{ts escape="sql"}Environment{/ts}' , NULL, 1, 1, 0),
('activity_default_assignee' , '{ts escape="sql"}Activity default assignee{/ts}' , NULL, 1, 1, 0);

SELECT @option_group_id_pcm := max(id) from civicrm_option_group where name = 'preferred_communication_method';
SELECT @option_group_id_act := max(id) from civicrm_option_group where name = 'activity_type';
Expand Down Expand Up @@ -294,6 +295,7 @@ SELECT @option_group_id_date_filter := max(id) from civicrm_option_group wher
SELECT @option_group_id_wysiwyg_presets := max(id) from civicrm_option_group where name = 'wysiwyg_presets';
SELECT @option_group_id_ps := max(id) from civicrm_option_group where name = 'pledge_status';
SELECT @option_group_id_env := max(id) from civicrm_option_group where name = 'environment';
SELECT @option_group_id_default_assignee := max(id) from civicrm_option_group where name = 'activity_default_assignee';

SELECT @contributeCompId := max(id) FROM civicrm_component where name = 'CiviContribute';
SELECT @eventCompId := max(id) FROM civicrm_component where name = 'CiviEvent';
Expand Down Expand Up @@ -1039,7 +1041,14 @@ VALUES
(@option_group_id_ps, '{ts escape="sql"}Pending{/ts}' , 2, 'Pending' , NULL, 0, NULL, 2, NULL, 0, 1, 1, NULL, NULL, NULL),
(@option_group_id_ps, '{ts escape="sql"}Cancelled{/ts}' , 3, 'Cancelled' , NULL, 0, NULL, 3, NULL, 0, 1, 1, NULL, NULL, NULL),
(@option_group_id_ps, '{ts escape="sql"}In Progress{/ts}', 5, 'In Progress', NULL, 0, NULL, 4, NULL, 0, 1, 1, NULL, NULL, NULL),
(@option_group_id_ps, '{ts escape="sql"}Overdue{/ts}' , 6, 'Overdue' , NULL, 0, NULL, 5, NULL, 0, 1, 1, NULL, NULL, NULL);
(@option_group_id_ps, '{ts escape="sql"}Overdue{/ts}' , 6, 'Overdue' , NULL, 0, NULL, 5, NULL, 0, 1, 1, NULL, NULL, NULL),

-- CiviCase - Activity Assignee Default
-- (`option_group_id`, `label`, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`, `description`, `is_optgroup`, `is_reserved`, `is_active`, `component_id`, `visibility_id`, `icon`)
(@option_group_id_default_assignee, '{ts escape="sql"}None{/ts}', '1', 'NONE', NULL, 0, 1, 1, NULL, 0, 0, 1, NULL, NULL, NULL),
(@option_group_id_default_assignee, '{ts escape="sql"}By relationship to case client{/ts}', '2', 'BY_RELATIONSHIP', NULL, 0, 0, 1, NULL, 0, 0, 1, NULL, NULL, NULL),
(@option_group_id_default_assignee, '{ts escape="sql"}Specific contact{/ts}', '3', 'SPECIFIC_CONTACT', NULL, 0, 0, 1, NULL, 0, 0, 1, NULL, NULL, NULL),
(@option_group_id_default_assignee, '{ts escape="sql"}User creating the case{/ts}', '4', 'USER_CREATING_THE_CASE', NULL, 0, 0, 1, NULL, 0, 0, 1, NULL, NULL, NULL);

-- financial accounts
SELECT @opval := value FROM civicrm_option_value WHERE name = 'Revenue' and option_group_id = @option_group_id_fat;
Expand Down
2 changes: 1 addition & 1 deletion xml/version.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="iso-8859-1" ?>
<version>
<version_no>5.6.beta1</version_no>
<version_no>5.6.beta2</version_no>
</version>

0 comments on commit 0434d0f

Please sign in to comment.