Gravity_Flow_Step_Approval
Class Gravity_Flow_Step_Approval
Source: includes/steps/class-step-approval.php:19
Details
- Kind:
class - Namespace:
(global) - Extends: Gravity_Flow_Step
Properties
| Property | Type | Description |
|---|---|---|
$_step_type | string | The step type. |
Methods
| Method | Description |
|---|---|
get_status_config() | Returns an array of statuses and their properties. |
get_actions() | Returns an array of quick actions to be displayed on the inbox. |
rest_process_step() | Process the REST request for an entry. |
supports_due_date() | Indicates this step supports due date. |
supports_expiration() | Indicates this step supports expiration. |
get_label() | Returns the step label. |
get_icon_url() | Returns the HTML for the step icon. |
get_settings() | Returns an array of settings for this step type. |
process() | Set the assignees for this step. |
is_complete() | Determines if the current step has been completed. |
status_evaluation() | Determines the current status of the step. |
is_valid_token() | Decodes and validates the supplied token. |
maybe_process_status_update() | Handles POSTed values from the workflow detail page. |
process_assignee_status() | Validates and performs the assignees status update. |
process_revert_status() | If the revert settings are configured end the current step and start the specified step. |
add_status_update_note() | If applicable add a note to the current entry. |
get_status_update_feedback() | Get the feedback for this status update. |
validate_status_update() | Determine if this step is valid. |
validate_note_mode() | Determine if the note is valid. |
maybe_filter_validation_result() | Allow the validation result to be overridden using the gravityflow_validation_approval filter. |
workflow_detail_box() | Displays content inside the Workflow metabox on the workflow detail page. |
workflow_detail_status_box_status() | Display the assignee status in the workflow detail status box. |
workflow_detail_status_box_actions() | Displays the note input and step action buttons in the workflow detail status box. |
entry_detail_status_box() | Displays content inside the Workflow metabox on the Gravity Forms Entry Detail page. |
send_approval_notification() | Triggers sending of the approval notification. |
send_rejection_notification() | Triggers sending of the rejection notification. |
send_revert_notification() | Triggers sending of the revert notification. |
maybe_process_token_action() | Provides a way for a step to process a token action before anything else. If feedback is returned it is displayed and nothing else with be rendered. |
end() | Triggers actions to be performed when this step ends. |
maybe_perform_post_action() | If a post exists for the entry perform the configured approval or rejection action. |
get_approve_icon() | Returns the HTML for the approve icon. |
get_reject_icon() | Returns the HTML for the reject icon. |
get_revert_icon() | Returns the HTML for the revert icon. |
filter_gravityflow_notification() | Ensure User Input assignee notification does not send if an approval revert notification exists with override |
Method Reference
get_status_config()
public function get_status_config()
Returns an array of statuses and their properties.
Returns
array
Source: includes/steps/class-step-approval.php:36
get_actions()
public function get_actions()
Returns an array of quick actions to be displayed on the inbox.
Returns
array
Source: includes/steps/class-step-approval.php:58
rest_process_step()
public function rest_process_step( $request )
Process the REST request for an entry.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$request | WP_REST_Request | Full data about the request. |
Returns
mixed— | WP_Error Returns the result of the status update or a WP_Error if validation fails.
Since: 1.7.1
Source: includes/steps/class-step-approval.php:95
supports_due_date()
public function supports_due_date()
Indicates this step supports due date.
Returns
bool
Since: 2.5
Source: includes/steps/class-step-approval.php:132
supports_expiration()
public function supports_expiration()
Indicates this step supports expiration.
Returns
bool
Source: includes/steps/class-step-approval.php:141
get_label()
public function get_label()
Returns the step label.
Returns
string
Source: includes/steps/class-step-approval.php:150
get_icon_url()
public function get_icon_url()
Returns the HTML for the step icon.
Returns
string
Source: includes/steps/class-step-approval.php:159
get_settings()
public function get_settings()
Returns an array of settings for this step type.
Returns
array
Source: includes/steps/class-step-approval.php:168
process()
public function process()
Set the assignees for this step.
Returns
bool
Source: includes/steps/class-step-approval.php:432
is_complete()
public function is_complete()
Determines if the current step has been completed.
Returns
bool
Source: includes/steps/class-step-approval.php:441
status_evaluation()
public function status_evaluation()
Determines the current status of the step.
Returns
string
Source: includes/steps/class-step-approval.php:452
is_valid_token()
public function is_valid_token( $token )
Decodes and validates the supplied token.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$token | array | The token properties. |
Returns
bool
Source: includes/steps/class-step-approval.php:497
maybe_process_status_update()
public function maybe_process_status_update( $form, $entry )
Handles POSTed values from the workflow detail page.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | array | The current form. | |
$entry | array | The current entry. |
Returns
string|bool| WP_Error — Return a success feedback message safe for page output or a WP_Error instance with an error.
Source: includes/steps/class-step-approval.php:538
process_assignee_status()
public function process_assignee_status( $assignee, $new_status, $form )
Validates and performs the assignees status update.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$assignee | Gravity_Flow_Assignee | The assignee properties. | |
$new_status | string | The new status for this step. | |
$form | array | The current form. |
Returns
bool|string— Return a success feedback message safe for page output or false.
Source: includes/steps/class-step-approval.php:595
process_revert_status()
public function process_revert_status()
If the revert settings are configured end the current step and start the specified step.
Returns
bool|string
Source: includes/steps/class-step-approval.php:654
add_status_update_note()
public function add_status_update_note( $new_status, $assignee )
If applicable add a note to the current entry.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$new_status | string | The new status for the step. | |
$assignee | Gravity_Flow_Assignee | The step assignee. |
Source: includes/steps/class-step-approval.php:703
get_status_update_feedback()
public function get_status_update_feedback( $new_status )
Get the feedback for this status update.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$new_status | string | The new status for the step. |
Returns
bool|string
Source: includes/steps/class-step-approval.php:724
validate_status_update()
public function validate_status_update( $new_status, $form )
Determine if this step is valid.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$new_status | string | The new status for the current step. | |
$form | array | The form currently being processed. |
Returns
bool
Source: includes/steps/class-step-approval.php:748
validate_note_mode()
public function validate_note_mode( $new_status, $note )
Determine if the note is valid.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$new_status | string | The new status for the current step. | |
$note | string | The submitted note. |
Returns
bool
Source: includes/steps/class-step-approval.php:762
maybe_filter_validation_result()
public function maybe_filter_validation_result( $validation_result, $new_status )
Allow the validation result to be overridden using the gravityflow_validation_approval filter.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$validation_result | array | The validation result and form currently being processed. | |
$new_status | string | The new status for the current step. |
Returns
array
Source: includes/steps/class-step-approval.php:819
workflow_detail_box()
public function workflow_detail_box( $form, $args )
Displays content inside the Workflow metabox on the workflow detail page.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | array | The Form array which may contain validation details. | |
$args | array | Additional args which may affect the display. |
Source: includes/steps/class-step-approval.php:831
workflow_detail_status_box_status()
public function workflow_detail_status_box_status()
Display the assignee status in the workflow detail status box.
Source: includes/steps/class-step-approval.php:861
workflow_detail_status_box_actions()
public function workflow_detail_status_box_actions( $form )
Displays the note input and step action buttons in the workflow detail status box.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | array | The current form. |
Source: includes/steps/class-step-approval.php:882
entry_detail_status_box()
public function entry_detail_status_box( $form )
Displays content inside the Workflow metabox on the Gravity Forms Entry Detail page.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | array | The current form. |
Source: includes/steps/class-step-approval.php:1041
send_approval_notification()
public function send_approval_notification()
Triggers sending of the approval notification.
Source: includes/steps/class-step-approval.php:1068
send_rejection_notification()
public function send_rejection_notification()
Triggers sending of the rejection notification.
Source: includes/steps/class-step-approval.php:1075
send_revert_notification()
public function send_revert_notification()
Triggers sending of the revert notification.
Source: includes/steps/class-step-approval.php:1082
maybe_process_token_action()
public function maybe_process_token_action( $action, $token, $form, $entry )
Provides a way for a step to process a token action before anything else. If feedback is returned it is displayed and nothing else with be rendered.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$action | array | The action properties. | |
$token | array | The assignee token properties. | |
$form | array | The current form. | |
$entry | array | The current entry. |
Returns
bool|string| WP_Error
Source: includes/steps/class-step-approval.php:1096
end()
public function end()
Triggers actions to be performed when this step ends.
Source: includes/steps/class-step-approval.php:1162
maybe_perform_post_action()
public function maybe_perform_post_action( $entry, $action )
If a post exists for the entry perform the configured approval or rejection action.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$entry | array | The current entry. | |
$action | string | The action to perform. |
Source: includes/steps/class-step-approval.php:1184
get_approve_icon()
public function get_approve_icon()
Returns the HTML for the approve icon.
Returns
string
Source: includes/steps/class-step-approval.php:1216
get_reject_icon()
public function get_reject_icon()
Returns the HTML for the reject icon.
Returns
string
Source: includes/steps/class-step-approval.php:1226
get_revert_icon()
public function get_revert_icon()
Returns the HTML for the revert icon.
Returns
string
Source: includes/steps/class-step-approval.php:1236
filter_gravityflow_notification()
public function filter_gravityflow_notification( $notification, $form, $entry, $step )
Ensure User Input assignee notification does not send if an approval revert notification exists with override
selected
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$notification | string | The potential notification | |
$form | array | The current form array. | |
$entry | array | The current entry. | |
$step | Gravity_Flow_Step | The current step |
Returns
bool|string
Since: 2.3.2
Source: includes/steps/class-step-approval.php:1254