Skip to content

Commit

Permalink
Merge pull request #9629 from colemanw/CRM-19770
Browse files Browse the repository at this point in the history
CRM-19770 - Add is_star column to civicrm_activity
  • Loading branch information
totten authored Jan 4, 2017
2 parents 0587504 + 73c5338 commit a34e7e3
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 30 deletions.
19 changes: 18 additions & 1 deletion CRM/Activity/DAO/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*
* Generated from xml/schema/CRM/Activity/Activity.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:c9a4e687808af7624ecb22a5f328b3a4)
* (GenCodeChecksum:9f8fd18414364d34516134b9d931ac02)
*/
require_once 'CRM/Core/DAO.php';
require_once 'CRM/Utils/Type.php';
Expand Down Expand Up @@ -187,6 +187,12 @@ class CRM_Activity_DAO_Activity extends CRM_Core_DAO {
* @var int
*/
public $weight;
/**
* Activity marked as favorite.
*
* @var boolean
*/
public $is_star;
/**
* class constructor
*
Expand Down Expand Up @@ -524,6 +530,17 @@ static function &fields() {
'type' => 'Text',
) ,
) ,
'is_star' => array(
'name' => 'is_star',
'type' => CRM_Utils_Type::T_BOOLEAN,
'title' => ts('Is Starred') ,
'description' => 'Activity marked as favorite.',
'import' => true,
'where' => 'civicrm_activity.is_star',
'headerPattern' => '/(activity.)?(star|favorite)/i',
'dataPattern' => '',
'export' => true,
) ,
);
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
}
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/DAO/AllCoreTables.data.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
// (GenCodeChecksum:1f9e47fc8d0661ec0b31d4cbbba6783c)
// (GenCodeChecksum:91eca27988f62050330654fa6ce26ca2)
return array(
'CRM_Core_DAO_AddressFormat' => array(
'name' => 'AddressFormat',
Expand Down
16 changes: 9 additions & 7 deletions CRM/Upgrade/Incremental/php/FourSeven.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,8 @@ public function upgrade_4_7_14($rev) {
* @param string $rev
*/
public function upgrade_4_7_15($rev) {
$this->addTask('CRM-19723 - Add icon column to civicrm_option_value', 'addColumn',
'civicrm_option_value', 'icon', "varchar(255) COMMENT 'crm-i icon class' DEFAULT NULL");
$this->addTask('CRM-19626 - Add min_amount column to civicrm_price_set', 'addColumn',
'civicrm_price_set', 'min_amount', "INT(10) UNSIGNED DEFAULT '0' COMMENT 'Minimum Amount required for this set.'");
$this->addTask('CRM-19769 - Add color column to civicrm_tag', 'addColumn',
'civicrm_tag', 'color', "varchar(255) COMMENT 'Hex color value e.g. #ffffff' DEFAULT NULL");
$this->addTask('CRM-19779 - Add color column to civicrm_option_value', 'addColumn',
'civicrm_option_value', 'color', "varchar(255) COMMENT 'Hex color value e.g. #ffffff' DEFAULT NULL");
$this->addTask(ts('Upgrade DB to %1: SQL', array(1 => $rev)), 'runSql', $rev);
}

Expand All @@ -297,8 +291,16 @@ public function upgrade_4_7_15($rev) {
* @param string $rev
*/
public function upgrade_4_7_16($rev) {
$this->addTask(ts('Upgrade DB to %1: SQL', array(1 => $rev)), 'runSql', $rev);
$this->addTask('CRM-19723 - Add icon column to civicrm_option_value', 'addColumn',
'civicrm_option_value', 'icon', "varchar(255) COMMENT 'crm-i icon class' DEFAULT NULL");
$this->addTask('CRM-19769 - Add color column to civicrm_tag', 'addColumn',
'civicrm_tag', 'color', "varchar(255) COMMENT 'Hex color value e.g. #ffffff' DEFAULT NULL");
$this->addTask('CRM-19779 - Add color column to civicrm_option_value', 'addColumn',
'civicrm_option_value', 'color', "varchar(255) COMMENT 'Hex color value e.g. #ffffff' DEFAULT NULL");
$this->addTask('Add new CiviMail fields', 'addMailingTemplateType');
$this->addTask('CRM-19770 - Add is_star column to civicrm_activity', 'addColumn',
'civicrm_activity', 'is_star', "tinyint DEFAULT '0' COMMENT 'Activity marked as favorite.'");
$this->addTask(ts('Upgrade DB to %1: SQL', array(1 => $rev)), 'runSql', $rev);
}

/*
Expand Down
21 changes: 0 additions & 21 deletions CRM/Upgrade/Incremental/sql/4.7.15.mysql.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,3 @@

-- CRM-19685 (fix for inconsistencies)
UPDATE civicrm_contact SET preferred_mail_format = 'Both' WHERE preferred_mail_format IS NULL;

-- CRM-19723 add icons
SELECT @option_group_id_act := max(id) from civicrm_option_group where name = 'activity_type';
UPDATE civicrm_option_value SET icon = 'fa-slideshare' WHERE option_group_id = @option_group_id_act AND name = 'Meeting';
UPDATE civicrm_option_value SET icon = 'fa-phone' WHERE option_group_id = @option_group_id_act AND name = 'Phone Call';
UPDATE civicrm_option_value SET icon = 'fa-envelope-o' WHERE option_group_id = @option_group_id_act AND name = 'Email';
UPDATE civicrm_option_value SET icon = 'fa-mobile' WHERE option_group_id = @option_group_id_act AND name = 'SMS';
UPDATE civicrm_option_value SET icon = 'fa-file-pdf-o' WHERE option_group_id = @option_group_id_act AND name = 'Print PDF Letter';
UPDATE civicrm_option_value SET icon = 'fa-folder-open-o' WHERE option_group_id = @option_group_id_act AND name = 'Open Case';
UPDATE civicrm_option_value SET icon = 'fa-share-square-o' WHERE option_group_id = @option_group_id_act AND name = 'Follow up';
UPDATE civicrm_option_value SET icon = 'fa-random' WHERE option_group_id = @option_group_id_act AND name = 'Change Case Type';
UPDATE civicrm_option_value SET icon = 'fa-pencil-square-o' WHERE option_group_id = @option_group_id_act AND name = 'Change Case Status';
UPDATE civicrm_option_value SET icon = 'fa-calendar' WHERE option_group_id = @option_group_id_act AND name = 'Change Case Start Date';
UPDATE civicrm_option_value SET icon = 'fa-user-plus' WHERE option_group_id = @option_group_id_act AND name = 'Assign Case Role';
UPDATE civicrm_option_value SET icon = 'fa-user-times' WHERE option_group_id = @option_group_id_act AND name = 'Remove Case Role';
UPDATE civicrm_option_value SET icon = 'fa-file-pdf-o' WHERE option_group_id = @option_group_id_act AND name = 'Print PDF Letter';
UPDATE civicrm_option_value SET icon = 'fa-compress' WHERE option_group_id = @option_group_id_act AND name = 'Merge Case';
UPDATE civicrm_option_value SET icon = 'fa-user-circle-o' WHERE option_group_id = @option_group_id_act AND name = 'Reassigned Case';
UPDATE civicrm_option_value SET icon = 'fa-link' WHERE option_group_id = @option_group_id_act AND name = 'Link Cases';
UPDATE civicrm_option_value SET icon = 'fa-tags' WHERE option_group_id = @option_group_id_act AND name = 'Change Case Tags';
UPDATE civicrm_option_value SET icon = 'fa-users' WHERE option_group_id = @option_group_id_act AND name = 'Add Client To Case';
21 changes: 21 additions & 0 deletions CRM/Upgrade/Incremental/sql/4.7.16.mysql.tpl
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
{* file to handle db changes in 4.7.16 during upgrade *}

-- CRM-19723 add icons
SELECT @option_group_id_act := max(id) from civicrm_option_group where name = 'activity_type';
UPDATE civicrm_option_value SET icon = 'fa-slideshare' WHERE option_group_id = @option_group_id_act AND name = 'Meeting';
UPDATE civicrm_option_value SET icon = 'fa-phone' WHERE option_group_id = @option_group_id_act AND name = 'Phone Call';
UPDATE civicrm_option_value SET icon = 'fa-envelope-o' WHERE option_group_id = @option_group_id_act AND name = 'Email';
UPDATE civicrm_option_value SET icon = 'fa-mobile' WHERE option_group_id = @option_group_id_act AND name = 'SMS';
UPDATE civicrm_option_value SET icon = 'fa-file-pdf-o' WHERE option_group_id = @option_group_id_act AND name = 'Print PDF Letter';
UPDATE civicrm_option_value SET icon = 'fa-folder-open-o' WHERE option_group_id = @option_group_id_act AND name = 'Open Case';
UPDATE civicrm_option_value SET icon = 'fa-share-square-o' WHERE option_group_id = @option_group_id_act AND name = 'Follow up';
UPDATE civicrm_option_value SET icon = 'fa-random' WHERE option_group_id = @option_group_id_act AND name = 'Change Case Type';
UPDATE civicrm_option_value SET icon = 'fa-pencil-square-o' WHERE option_group_id = @option_group_id_act AND name = 'Change Case Status';
UPDATE civicrm_option_value SET icon = 'fa-calendar' WHERE option_group_id = @option_group_id_act AND name = 'Change Case Start Date';
UPDATE civicrm_option_value SET icon = 'fa-user-plus' WHERE option_group_id = @option_group_id_act AND name = 'Assign Case Role';
UPDATE civicrm_option_value SET icon = 'fa-user-times' WHERE option_group_id = @option_group_id_act AND name = 'Remove Case Role';
UPDATE civicrm_option_value SET icon = 'fa-file-pdf-o' WHERE option_group_id = @option_group_id_act AND name = 'Print PDF Letter';
UPDATE civicrm_option_value SET icon = 'fa-compress' WHERE option_group_id = @option_group_id_act AND name = 'Merge Case';
UPDATE civicrm_option_value SET icon = 'fa-user-circle-o' WHERE option_group_id = @option_group_id_act AND name = 'Reassigned Case';
UPDATE civicrm_option_value SET icon = 'fa-link' WHERE option_group_id = @option_group_id_act AND name = 'Link Cases';
UPDATE civicrm_option_value SET icon = 'fa-tags' WHERE option_group_id = @option_group_id_act AND name = 'Change Case Tags';
UPDATE civicrm_option_value SET icon = 'fa-users' WHERE option_group_id = @option_group_id_act AND name = 'Add Client To Case';
1 change: 1 addition & 0 deletions api/v3/examples/Activity/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ function activity_create_expectedresult() {
'campaign_id' => '',
'engagement_level' => '',
'weight' => '',
'is_star' => '',
),
),
);
Expand Down
10 changes: 10 additions & 0 deletions xml/schema/Activity/Activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -458,4 +458,14 @@
<type>Text</type>
</html>
</field>
<field>
<name>is_star</name>
<title>Is Starred</title>
<type>boolean</type>
<default>0</default>
<import>true</import>
<comment>Activity marked as favorite.</comment>
<headerPattern>/(activity.)?(star|favorite)/i</headerPattern>
<add>4.7</add>
</field>
</table>

0 comments on commit a34e7e3

Please sign in to comment.