# CM Employment — recordview action override.
# Deploy to: extensions/defaultExt/config/services/module/recordview/cm_employment_actions.yaml
#
# Symfony REPLACES (not deep-merges) a parameter, and this file loads after core, so it must be a
# FULL copy of core module.recordview.actions PLUS our addition. Source: config/services/module/
# recordview/actions.yaml (SuiteCRM 8.8.0, copied 2026-06-16). Re-sync if core defaults change.
#
# Adds "Add Employment" to the Participant (C_PI) record Actions menu. The action key matches the
# process type CmEmploymentLaunchAction::PROCESS_TYPE; asyncProcess: true routes the click to that
# handler, which returns an 'export' async-action that navigates the tab to the wizard entryPoint.
parameters:
  module.recordview.actions:
    default:
      actions:
        edit:
          key: edit
          labelKey: LBL_EDIT
          params:
            expanded: true
          modes:
            - detail
          acl:
            - edit
        save:
          key: save
          labelKey: LBL_SAVE_BUTTON_LABEL
          params:
            expanded: true
          modes:
            - edit
          acl:
            - edit
        saveNew:
          key: saveNew
          labelKey: LBL_SAVE_BUTTON_LABEL
          params:
            expanded: true
          modes:
            - create
          acl:
            - edit
        cancel:
          key: cancel
          labelKey: LBL_CANCEL
          params:
            expanded: true
          modes:
            - edit
        cancelCreate:
          key: cancelCreate
          labelKey: LBL_CANCEL
          params:
            expanded: true
          modes:
            - create
        saveContinue:
          key: saveContinue
          labelKey: LBL_SAVE_CONTINUE_LABEL
          params:
            expanded: true
            collapsedMobile: true
          modes:
            - edit
          acl:
            - edit
        delete:
          key: delete
          labelKey: LBL_DELETE
          asyncProcess: true
          params:
            displayConfirmation: true
            confirmationLabel: NTC_DELETE_CONFIRMATION
          modes:
            - detail
          acl:
            - delete
        duplicate:
          key: duplicate
          labelKey: LBL_DUPLICATE_BUTTON
          asyncProcess: true
          params:
          modes:
            - detail
          acl:
            - export
            - edit
        audit:
          key: audit
          labelKey: LNK_VIEW_CHANGE_LOG
          asyncProcess: true
          params:
          modes:
            - detail
            - edit
          availability:
            - audited
            - acls
        duplicate-merge:
          key: duplicate-merge
          labelKey: LBL_DUP_MERGE
          asyncProcess: true
          params:
          modes:
            - detail
            - edit
          availability:
            - duplicate-merge
            - acls
          acl:
            - edit
            - delete
    modules:
      employees:
        exclude:
          - delete
      # --- our custom action: Add Employment wizard, on the Participant record ---
      C_PI_ID_CSR_PARTICIPANT_INFO:
        actions:
          cm-employment-launch:
            key: cm-employment-launch
            labelKey: LBL_CM_ADD_EMPLOYMENT
            asyncProcess: true
            params:
            modes:
              - detail
            acl:
              - view
