Project

General

Profile

Actions

Feature proposal #8315

closed

Family Plans: implement triggers for accepting shared subscriptions

Added by krileon over 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
28 December 2020
Due date:
% Done:

100%

Estimated time:

Description

This should allow extending the accept checks so a shared subscription can have custom conditions applied to it or custom behavior after a shared subscription has been accepted.

Actions #1

Updated by krileon over 3 years ago

  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100

Implemented in MR !224

The following triggers have been implemented.

$_PLUGINS->trigger( 'familyplans_onCanAcceptSharedSub', array( &$this, $userId, $subscription ) )
$_PLUGINS->trigger( 'familyplans_onBeforeAcceptSharedSub', array( &$this, $user, $subscription ) )
$_PLUGINS->trigger( 'familyplans_onAfterAcceptSharedSub', array( $this, $user, $subscription ) )
$_PLUGINS->trigger( 'familyplans_onAfterDeleteSharedSub', array( $this, $user, $subscription ) )

These can be used to add custom behavior to the shared subscription process. onCanAcceptSharedSub can be used to add custom conditions to block accepting a subscription (simply return false in trigger usage to block the accept). onBeforeAcceptSharedSub can be used to modify the shared subscription before accepting or adding custom conditions (again, simply return false). onAfterAcceptSharedSub can be used to add custom behavior after a shared subscription has been fully accepted (e.g. add custom usergroups, change field values, etc..). onAfterDeleteSharedSub can be used to reverse any changes made by onAfterAcceptSharedSub when a shared subscription is deleted/cancelled.

Actions #2

Updated by beat almost 3 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF