- Approval Base
- This module is just a base for writing approval extension
- PHP 8.0
This extension does not do anything, it's just a basis for
Two Combodo extensions use it.
It's not possible to reuse the ActionEmailApprovalRequest from a different trigger, as $oApprovalScheme, $oApprover,
approval_urlare expected to be provided in the $aContext parameter.
It's not possible to get the approvers with an OQL query
It's not possible to notify the approvers, outside of the initial notification and the manual reminder
It's not possible to define different
reply_tousing the classical fields of a Email Action, it can be customized by overwriting ApprovalScheme methods, but this is weird.
How does the Approval Notification part works?
class ApprovalBasePlugin implements iApplicationUIExtension, iApplicationObjectExtension OnDBInsert() and OnDBUpdate() ApprovalBasePlugin::OnReachingState($oObject, $sReachingState) // Check if there is an approval process applicable on the current object // when it is reaching a particular state, // Then if there isn't an ongoing ApprovalScheme on this object, created it // Then follow the scheme _ApprovalScheme_::StartNextStep() // If it's time to notify approvers, then for each approver, send an Approval Request ApprovalScheme::SendApprovalRequest($oApprover, $oObject, $aApproverData['passcode']);
ApprovalScheme::SendApprovalRequest($oToPerson, $oObj, $sPassCode, ...) // Prepare the placeholders which will be used in the email message, such as ''approval_link'' // which depends if the Person has an iTop account or not, and put them in $aContext // Put the ApprovalScheme, the Approver and the current Object in $aContext TriggerOnApprovalRequest::DoActivate($aContext) ActionEmailApprovalRequest::DoExecute($oTrigger, $aContext)
ActionEmailApprovalRequest::DoExecute($oTrigger, $aContext) // Extract the objects from $aContext // Set ActionEmail fields, such as ''to'' with an OQL searching for the approver by its id // ''from'' and ''reply_to'' are computed by the ApprovalScheme // Ask the standard Email action to create the email and send it ActionEmail::DoExecute($oTrigger, $aContext)
extensions/approval_base.txt · Last modified: 2023/01/17 13:43 (external edit)