From d3a2d720e34953a180e73e20966e2352b713baa8 Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@enhancesoft.com>
Date: Mon, 9 Apr 2018 02:44:57 +0000
Subject: [PATCH] DefaultData:  Active vs. Archive

Commit 3944b51d59 added ability to archive help topics and departments but
failed to port changes default data (yaml files) loaded on install.

This commits adds the correct bits to flags field for both help topics and
departments. It also removes retired 'isactive' field for help topics.
---
 include/i18n/en_US/department.yaml |  4 ++++
 include/i18n/en_US/help_topic.yaml | 11 ++++++-----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/include/i18n/en_US/department.yaml b/include/i18n/en_US/department.yaml
index 3de7de70b..aa0e6ddc7 100644
--- a/include/i18n/en_US/department.yaml
+++ b/include/i18n/en_US/department.yaml
@@ -3,6 +3,7 @@
 #
 # Fields:
 # id - (int:optional) id number in the database
+# flags - (bitmask: 0x0004 Active 0x0008 Archived)
 # name - (string) Short name of the department
 # signature - (string) Descriptive name of the department
 #
@@ -17,6 +18,7 @@
   signature: |
     Support Department
   ispublic: 1
+  flags: 0x0004
   group_membership: 1
 
 - id: 2
@@ -24,6 +26,7 @@
   signature: |
     Sales and Customer Retention
   ispublic: 1
+  flags: 0x0004
   sla_id: 1
   group_membership: 1
 
@@ -32,4 +35,5 @@
   signature: |
     Maintenance Department
   ispublic: 0
+  flags: 0x0004
   group_membership: 0
diff --git a/include/i18n/en_US/help_topic.yaml b/include/i18n/en_US/help_topic.yaml
index 76faba0c0..acf674a3b 100644
--- a/include/i18n/en_US/help_topic.yaml
+++ b/include/i18n/en_US/help_topic.yaml
@@ -4,7 +4,7 @@
 # Fields:
 # id - (int:optional) id number in the database
 # topic - (string) descriptive name of the help topic
-# isactive - (bool:0|1) if the help topic should be initially usable
+# flags - (bitmask: Active | Disabled | Archived)
 # ispublic - (bool:0|1) true or false if end users should be able to see the
 #       help topic. In other words, true or false if the help topic is _not_
 #       for internal use only
@@ -19,7 +19,7 @@
 #
 ---
 - topic_id: 1
-  isactive: 1
+  flags: 0x02
   ispublic: 1
   priority_id: 2
   forms: [2]
@@ -27,7 +27,8 @@
   notes: |
     Questions about products or services
 
-- isactive: 1
+- topic_id: 2
+  flags: 0x02
   ispublic: 1
   priority_id: 1
   forms: [2]
@@ -36,7 +37,7 @@
     Tickets that primarily concern the sales and billing departments
 
 - topic_id: 10
-  isactive: 1
+  flags: 0x02
   ispublic: 1
   dept_id: 3
   priority_id: 2
@@ -46,7 +47,7 @@
     Product, service, or equipment related issues
 
 - topic_pid: 10
-  isactive: 1
+  flags: 0x02
   ispublic: 1
   sla_id: 1
   priority_id: 3
-- 
GitLab