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

Create a hook to alter option values

    Details

    • Type: New Feature
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.1.3
    • Fix Version/s: 3.1.NYSS
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      Immediate use case for this is to allow permissioning on Case Activity Types (which are option value records).

      You need to know the option_value.value of the activity type you want to remove / alter.

      Usage examples:
      // for case activities (e.g. New Activity drop-down in Manage Case)
      function mymodule_civicrm_optionValues( &$values, $name ) {
      if ( $name == 'case_activity_type' )

      { unset( $values[30] ); }

      }

      // for regular activities (e.g. new activity and activity type dropdowns)
      function mymodule_civicrm_optionValues( &$values, $name ) {
      if ( $name == 'activity_type' )

      { unset( $values[1] ); }

      }

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1 hour
                1h
                Remaining:
                Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified