CRM-17504 Case activities reporting

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Critical
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.6.9
    • Fix Version/s: 4.6.16
    • Component/s: None
    • Labels:
    • Documentation Required?:
      None
    • Funding Source:
      Paid Issue Queue
    • Payment Status:
      Paid

      Description

      Case activities are not shown in the usual activity report.

      I know its been like this for a while but is there a reason for this? Can we size up having the case activity types included in the activity report?

      thanks

        Attachments

          Activity

          [CRM-17504] Case activities reporting
          Coleman Watts added a comment -

          Seems like the solution might be to add an option to the report criteria to toggle inclusion of case activities.
          Note that case activities are a little more complex to query b/c of the way their revision history is stored, so the report might need updating to deal with that.

          Jamie Novick added a comment - - edited

          Was there a security aspect to this? i.e. those with civi report access could then see case activities that they shouldnt have access to?

          nb. hopefully the where current_revision = 1 isn't a big inclusion for the above? Dont think activity report needs to show history.

          David Greenberg added a comment -

          RE: security aspect, definitely. Case activities will need to be permissioned based on the users CiviCase / specific case access.

          David Greenberg added a comment -

          Assigning to you for QA - assuming confirmation w/ Jamie Novick re: permissioning requirements.

          David Greenberg added a comment -

          IMPORTANT: The proposed PR provides access to case activities in the activity report ONLY for users with 'access all cases and activities'. If this meets your requirements, then please go ahead and test the PR. If not, then we'll need additional specification on requirements (and we'll need to get approval for a budget increase).

          Jamie Novick added a comment -

          yes that is fine for now. please go ahead. thanks

          David Greenberg added a comment -
          Jitendra Purohit added a comment -

          I've done the style fixes. Merge build runs clean now.

          David Greenberg added a comment -

          Two bugs ...
          1. With CiviCase enabled, cases exist, user has access all cases and activities:
          Filters:

          • Include Case Activities = NO
          • Subject: <some string that exists in a case activity>

          Result - the case activity w/ matching subject is returned in results.
          Expected - no case activities should be returned

          2. With CiviCase component disabled.
          View report and add any filter. Click Preview.
          FATAL error -
          SELECT v.label as label ,v.value as value, v.grouping as grouping
          FROM civicrm_option_value v,
          civicrm_option_group g
          WHERE v.option_group_id = g.id
          AND g.name = 'activity_type'
          AND g.is_active = 1 AND v.is_active = 1 AND v.component_id= ORDER BY v.weight [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY v.weight' at line 6]

          Jitendra Purohit added a comment -

          Fixed the above two bugs mentioned and created a PR at https://github.com/civicrm/civicrm-core/pull/7216

          Phil Nelms added a comment -

          Hi Dave and Co,

          Is it possible for this fix to be applied to 4.6.X?

          Thanks,

          Phil

          David Greenberg added a comment -

          Phil Nelms We're already 1.25 hours over budget on this. Backport probably adds another 1.5 - 2 hrs. We can do it but need approval from your side first.

          David Greenberg added a comment -

          Reopening for backport to 4.6. Please track hours - but just put them in a comment so we an track the backport hours separately. Thanks.

          Jitendra Purohit added a comment -

          Submitted a PR - https://github.com/civicrm/civicrm-core/pull/7357. Total hours spent - 1 hr.

          David Greenberg added a comment -

          Backport patch looks good. Ok to merge and close this issue on tests passing.

          David Greenberg added a comment -

          Reopening and assigning to Compucorp pending specific details on testing exceptions in 4.6 version from Madura

          Madura added a comment -

          Test was conducted in 4.6.10.
          The filter toggle for “include case activities” in case activities report is not functioning correctly. When you move between the Yes, No options nothing changes in the results.
          Replication Steps: First preview report. Default option is No on the filter, but the case activities are still listed.

          David Greenberg added a comment -

          Madura reports that the Case Activities filter is not working in the 4.6 backport so it looks like the fix you added in https://github.com/civicrm/civicrm-core/pull/7216 might not be completely applied in the 4.6 version.

          Please track additional time spent and record as a comment.

          Jitendra Purohit added a comment -

          This doesn't seem to replicate for me. Following are the steps I followed:

          1) Enable Case Component.
          2) Create a new Case so that activities gets created.
          3) Navigate to Activity Reports (case activities are not shown).
          4) Click Preview Report - (case activities are not shown).
          5) Enable `Include Case Activities` -> Click Preview Report -> Case Activities gets displayed.
          6) Disable `Include Case Activities` -> Click Preview Report -> No Activities from case.

          I checked this on 4.6. Please comment If I'm missing something here.

          Thanks.

          David Greenberg added a comment -

          Madura Neither Jitendra nor I can reproduce the behavior you're reporting. You said you tested on 4.6.10. The backport for this will be part of 4.6.11 - so in the meantime you would have needed to patch your site with the PR ( ). Did you do that?

          If you are seeing this with a patched version of 4.6.10, then you'll need to provide much more detailed steps and screenshots to help us understand what's happening.

          David Greenberg added a comment -

          Changing assignee to Guanhuan Chen since we may need more tech details depending on report back from Madura

          Madura added a comment -

          Yes Phil's team have patched the site with the PR. I have followed exact steps as Jitendra and still seeing the problem. We are planning to apply the patch on a different site and test again and also verify if its site specific. Will write back to you with detailed steps if I am still seeing the problem. Thank you for your time.

          Yashodha Chaku added a comment -

          Closing this as we haven't heard back. Please reopen if the problem persists.

            People

            • Assignee:
              Jamie Novick
              Reporter:
              Jamie Novick

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours, 30 minutes
                4h 30m