Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-19776

CaseTypes hook doesn't allow you to specify the component for child activity types

    Details

    • Versioning Impact:
      None (no code merged)
    • Documentation Required?:
      Developer Doc
    • Funding Source:
      Contributed Code
    • Verified?:
      No

      Description

      Problem

      The current problem with created case types via hook_civicrm_caseTypes or hook_civicrm_managed is that it doesn't allow you to specify the component ID for the attached activity types and CiviCase component will be used by default when these activity types get created by one of these hooks.

      Suggested solution

      developers should be able to specify the component for managed case types in the XML file , so if it is defined in the xml file , it will be used to specify the component for the managed activities for that case type .. otherwise ; the default CiviCase component will be used so none of exiting extensions would break because of this change.

      Example 1 :

      <?xml version="1.0" encoding="iso-8859-1" ?>
      
      <CaseType>
        <name>TestCase</name>
        <weight>100</weight>
        <componentName>CiviMail</componentName>
        <ActivityTypes>
          <ActivityType>
            <name>Background Check</name>
          </ActivityType>
          <ActivityType>
            <name>References Check</name>
          </ActivityType>
        </ActivityTypes>
      </CaseType>
      

      so all child activity types for this case types will be attached to CiviMail component instead of the default CiviCase.

      Example 2:

      <?xml version="1.0" encoding="iso-8859-1" ?>
      
      <CaseType>
        <name>TestCase</name>
        <weight>100</weight>
        <ActivityTypes>
          <ActivityType>
            <name>Background Check</name>
          </ActivityType>
          <ActivityType>
            <name>References Check</name>
          </ActivityType>
        </ActivityTypes>
      </CaseType>
      

      Since <componentName> tag is not used here , then these activity types will be attached to CiviCase component as normal.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              omarabuhussein omar abu hussein
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: