GravityView  1.19.4
The best, easiest way to display Gravity Forms entries on your website.
class-gravityview-field-workflow_final_status.php
Go to the documentation of this file.
1 <?php
2 /**
3  * @file class-gravityview-field-workflow_final_status.php
4  * @since 1.17.2
5  * @package GravityView
6  * @subpackage includes\fields
7  */
8 
10 
11  var $name = 'workflow_final_status';
12 
13  var $group = 'meta';
14 
15  public function __construct() {
16  $this->label = esc_html__( 'Workflow Status', 'gravityview' );
17  $this->default_search_label = $this->label;
18  $this->add_hooks();
19  parent::__construct();
20  }
21 
22  function add_hooks() {
23  add_filter( 'gravityview_widget_search_filters', array( $this, 'modify_search_filters' ), 10, 3 );
24 
25  add_filter( 'gravityview_field_entry_value_workflow_final_status', array( $this, 'modify_entry_value_workflow_final_status' ), 10, 4 );
26  }
27 
28  /**
29  * Convert the status key with the full status label. Uses custom labels, if set.
30  *
31  * @uses Gravity_Flow::translate_status_label()
32  *
33  * @param string $output HTML value output
34  * @param array $entry The GF entry array
35  * @param array $field_settings Settings for the particular GV field
36  * @param array $field Current field being displayed
37  *
38  * @since 1.17
39  *
40  * @return string If Gravity Flow not found, or entry not processed yet, returns initial value. Otherwise, returns name of workflow step.
41  */
43 
44  if( ! empty( $output ) ) {
45  $output = gravity_flow()->translate_status_label( $output );
46  }
47 
48  return $output;
49  }
50 
51 
52  /**
53  * Populate the Final Status Search Bar field dropdown with all the statuses in Gravity Flow
54  *
55  * @since 1.17.3
56  *
57  * @param array $search_fields
58  * @param GravityView_Widget_Search $widget
59  * @param array $widget_args
60  *
61  * @return array
62  */
63  function modify_search_filters( $search_fields = array(), GravityView_Widget_Search $widget, $widget_args = array() ) {
64 
65  foreach ( $search_fields as & $search_field ) {
66  if ( $this->name === $search_field['key'] ) {
68  }
69  }
70 
71  return $search_fields;
72  }
73 
74 }
75 
Modify field settings by extending this class.
$field_settings['content']
Definition: custom.php:27
static get_status_options($form_id=0, $status_key= 'workflow_final_status')
Get the available status choices from Gravity Flow.
modify_entry_value_workflow_final_status($output, $entry, $field_settings, $field)
Convert the status key with the full status label.
$entry
Definition: notes.php:27
modify_search_filters($search_fields=array(), GravityView_Widget_Search $widget, $widget_args=array())
Populate the Final Status Search Bar field dropdown with all the statuses in Gravity Flow...
$field
Definition: gquiz_grade.php:11