36 add_filter(
'gravityview/search/searchable_fields', array( $this,
'modify_search_bar_fields_dropdown'), 10, 2 );
38 add_filter(
'gravityview/admin/available_fields', array( $this,
'maybe_add_non_default_fields' ), 10, 3 );
40 add_filter(
'gravityview/adv_filter/field_filters', array( $this,
'maybe_add_non_default_filter_fields' ), 10, 2 );
42 add_action(
'gravityflow_post_process_workflow', array( $this,
'clear_cache_after_workflow' ), 10, 4 );
56 do_action(
'gravityview_clear_form_cache',
$form[
'id'] );
77 $entry_meta = gravity_flow()->get_entry_meta( array(),
$form_id );
79 return (array)
\GV\Utils::get( $entry_meta, $status_key .
'/filter/choices' );
97 $GFlow =
new Gravity_Flow_API(
$form_id );
99 $workflow_steps = $GFlow->get_steps();
101 if( $workflow_steps ) {
103 foreach ( $workflow_steps as $step ) {
105 $step_id = sprintf(
'workflow_step_status_%d', $step->get_id() );
107 $fields[ $step_id ] = array(
108 'label' => sprintf( _x(
'Status: %s',
'Gravity Flow Workflow Step Status',
'gk-gravityview' ), $step->get_name() ),
113 $fields[
'workflow_step'] = array(
114 'label' => esc_html__(
'Workflow Step',
'gk-gravityview' ),
118 $fields[
'workflow_final_status'] = array(
119 'label' => esc_html__(
'Workflow Status',
'gk-gravityview' ),
131 if ( ( $insert_at = array_search(
'workflow_final_status', wp_list_pluck( $fields,
'key' ) ) ) !==
false ) {
132 $fields_end = array_splice( $fields, $insert_at + 1 );
135 'text' => __(
'Workflow Current Status Timestamp',
'gk-gravityview' ),
136 'operators' => array(
'>',
'<' ),
137 'placeholder' =>
'yyyy-mm-dd',
138 'cssClass' =>
'datepicker ymd_dash',
139 'key' =>
'workflow_current_status_timestamp',
140 'preventMultiple' =>
false,
143 $fields = array_merge( $fields, $fields_end );
152 if ( strpos( implode(
' ', array_keys( $fields ) ),
'workflow' ) !==
false ) {
153 $keys = array_keys( $fields );
154 $values = array_values( $fields );
156 if ( ( $insert_at = array_search(
'workflow_final_status', $keys ) ) !==
false ) {
157 $keys_end = array_splice( $keys, $insert_at + 1 );
158 $values_end = array_splice( $values, $insert_at + 1 );
160 $keys[] =
'workflow_current_status_timestamp';
162 'label' => __(
'Workflow Current Status Timestamp',
'gk-gravityview' ),
163 'type' =>
'workflow_current_status_timestamp',
166 $fields = array_combine( $keys, $values ) + array_combine( $keys_end, $values_end );
maybe_add_non_default_fields( $fields, $form, $zone)
Add the current status timestamp field to available View configuration fields.
static getInstance( $passed_post=NULL)
clear_cache_after_workflow( $form, $entry_id, $step_id, $starting_step_id)
Clears GravityView entry cache after running a Gravity Flow Workflow.
static get_status_options( $form_id=0, $status_key='workflow_final_status')
Get the available status choices from Gravity Flow.
if(gravityview() ->plugin->is_GF_25()) $form
if(empty( $created_by)) $form_id
static get( $array, $key, $default=null)
Grab a value from an array or an object or default.
modify_search_bar_fields_dropdown( $fields, $form_id)
Get the list of active Workflow Steps and Workflow Step Statuses.
Abstract class that makes it easy for plugins and themes to register no-conflict scripts and styles...
new GravityView_Plugin_Hooks_Gravity_Flow
add_hooks()
Filter the values shown in GravityView frontend.
maybe_add_non_default_filter_fields( $fields, $view_id)
Add the current status timestamp field to available Advanced Filters.