Details
Description
Rationale
========
Some activities are recorded 'outside' of a case OR are recorded to the wrong case (including some Inbound Emails that aren't properly 'filed'). Users need a way to associate these activities with a newly selected case.
NOTE
=====
This functionality REPLACES the existing "File on Case" feature added to 'View Activity' page by Dave D for 3.0. (That feature was only exposed for "Inbound Email" activities). You may be able to adapt some of the code in CRM/Activity/Form/Activity.php (see lines 612+) and Activity.tpl (jQuery fileOnCaseDialog).
Implementation
============
1. For non-case activities - add action link to activity selector: "File on Case" ... IF CiviCase is enabled, and user has 'access CiviCase' permission.
2. For case activities - add 2 new action to both activity selectors (normal selector via drilldown in Case Dashboard and Find Cases, + grid selector in Case Activities section of Manage Case page): "Move to Case", "Copy to Case" .... IF CiviCase is enabed, and user has 'access CiviCase' permission.
3. When clicked, open a dialog (jquery) with the following elements:
- Dialog title should be 'File on Case', 'Move to Case', or 'Copy to Case' based on requested action
- Select case (dropdown list of unclosed cases): I think we can use the existing code in Activity.php for this select list which invokes CRM_Case_BAO_Case::getUnclosedCases - although displaying and sorting on sort_name rather than display names seems more scalable - and we may need an autocomplete style look here to better handle sites with large number of cases.
- Subject (defaults to existing activity subject, user can modify as needed)
- With (defaults to existing target_contact, user can modify as needed)
- Ok / Cancel
4. Post process
4.1 For all 3 actions:
- insert a copy of the 'original' activity
- copy should reflect any updates to Subject and / or Target Contact(s)
- copy is added to destination case (insert case_activity record)
4.2 File on Case and Move to Case:
- original activity is marked deleted (is_deleted=1)
4.3 Copy to Case:
- no additional processing (original activity is still present in original case)
5. User should stay on the same page after processing. Inject div with status on that page which includes link to target case so user can navigate to that case easily if they need to OR they can select additional activities to file. Status:
"$activitySubject" has been filed to selected case: $clientSortName-casetypeString. Click here to view that case."
Attachments
Issue Links
- is supplemented by
-
CRM-6249 File to Case link does not work on Find Activities selector
- Done/Fixed