Details
Description
1. Site admins want access to view and manage case statuses. Also a few case level processes are based on detecting statuses which 'mean' case is 'closed' or case is 'opened'. We will provide menu access, and over-ride the 'option_value.grouping' column to use it to store a string for the status class. Status class options for now are 'Opened' and 'Closed'.
1.1 Add navigation menu link - Case Statuses - under Administer >> CiviCase
1.2 For this option_group selector, expose the 'grouping' column values - column header = 'Status Class'.
1.3. Upgrade should set status class = 'Opened' for status.name = 'Opened' and status_name = 'Urgent'. Status class = 'Closed' for status.name = 'Closed'
1.4 Grouping field should be included in Add / Edit Case Status (option value) form. Label s/b 'Status Class'. This field is frozen (read-only) for is_reserved case statuses option value records. Also make sure we have formRule which prevents duplicate 'value' values in this option_group (i.e. each case_status must have a unique option_value.value integer value.
2. The code in Modify CRM_Case_Form_Activity_ChangeCaseStatus::endPostProcess() needs to be modified to use the status classes ('Opened' and 'Closed' - rather than specific status ID's to decide whether to set or clear the case end_date. Current logic also has a 'flaw' - we should set end_date back to NULL when case status is changed to ANY status which does NOT belong to the 'Closed' status class. (Current logic only sets end_date to NULL when the specific status_id with name = 'Open' is detected. Since Phys Health has > 1 status which 'means' Open - this is faulty logic.)