Details

    • Type: Sub-task
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 4.1.0
    • Fix Version/s: Unscheduled
    • Component/s: CiviCase, Core CiviCRM
    • Labels:
      None
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding

      Description

      Currently you can over-ride the query used by the facebook token widget for finding / selecting Activity Assignee, Activity Target and Case Roles contacts using contactListQuery hooks (CRM-8748). However, this is a common requirement (see rationale below) and should be available as administrator settings (using contact api 'lookup' method).

      This issue is dependent on refactoring the getContactList method to support the data format required by the facebook token widget (CRM-9143).


      You can use these 'sample' inserts to put in settings values to retrieve for the filters (using the 'group_name' and 'name' columns as the key -> group_name = 'CiviCRM Preferences'
      name = 'activity_assignee_filter' for assignee field, 'activity_target_filter' for target field, 'case_role_filter' for case roles dialog widget (probably use 'CiviCase Preferences' as group_name for this row).

      Grab the filter 'value' from the row - which we'll expect to be a Contact api 'lookup' statement. This is the same approach as we've taken for Contact Reference custom fields - but for now we will skip building the fancy UI which hides the API string for the simplest case in the Custom Field form class.

      INSERT INTO civicrm_setting
      (group_name, name, value, domain_id, is_domain)
      VALUES
      ('CiviCRM Preferences', 'activity_assignee_filter', 'action=lookup&group=1', 1, 1),
      ('CiviCRM Preferences', 'activity_target_filter', 'action=lookup&group=1', 1, 1),
      ('CiviCRM Preferences', 'case_role_filter', 'action=lookup&group=1', 1, 1);
      — original issue —
      "I'd like to be able to limit the contacts available to case roles to a group, similar to what we can do to case resources via the settings.xml file. Since the case roles are people directly involved (staff) and likely very limited in number, it can be cumbersome to use the quick search field to cycle through the entire database of contacts. Currently this can be done with hooks, but I suspect it would be a commonly used feature, so it would be great to make it part of the case configuration. And ideally both the case roles and case resources group selection could happen through the interface, rather than in settings.xml.
      > On a similar and related note, I think the activity assignees contact search should also be easily limitable to a group, as that too will likely only be used for internal staff."
      > Similar to CRM-8356 (Limit contact reference custom fields by group with advanced mode to use other filters)
      > Xavier suggested that we could follow the Advanced example in CRM-8356, "allows administrators to specify more complex filters using available parameters to API v3 Contact Get api. " - I.e. rather than a group id, we allow specifying an arbitrary combination of filters.

        Attachments

          Activity

            People

            • Assignee:
              kurund Kurund Jalmi
              Reporter:
              dgg David Greenberg
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: