Update delivery process fields and sample form
This commit is contained in:
@@ -62,22 +62,16 @@ class Wiaas_Delivery_Process_Step extends Gravity_Flow_Step {
|
||||
|
||||
public function start() {
|
||||
|
||||
$complete = parent::start();
|
||||
parent::start();
|
||||
|
||||
if ($complete) {
|
||||
$this->update_step_status('pending');
|
||||
|
||||
$this->update_step_status('complete');
|
||||
} else {
|
||||
|
||||
$this->update_step_status('pending');
|
||||
}
|
||||
|
||||
return $complete;
|
||||
return false;
|
||||
}
|
||||
|
||||
public function evaluate_status() {
|
||||
|
||||
return 'pending';
|
||||
return $this->get_status();
|
||||
}
|
||||
|
||||
public function get_status_label($status) {
|
||||
|
||||
@@ -32,6 +32,19 @@ class Wiaas_Field_Order_Bundle_Document extends GF_Field_FileUpload {
|
||||
return 'fileupload';
|
||||
}
|
||||
|
||||
public function add_button( $field_groups ) {
|
||||
$field_groups = Wiaas_Order_Fields::maybe_add_order_field_group($field_groups);
|
||||
|
||||
return parent::add_button( $field_groups );
|
||||
}
|
||||
|
||||
public function get_form_editor_button() {
|
||||
return array(
|
||||
'group' => 'wiaas_order_fields',
|
||||
'text' => $this->get_form_editor_field_title(),
|
||||
);
|
||||
}
|
||||
|
||||
public function get_form_editor_field_title() {
|
||||
return esc_attr__( 'Bundle Document', 'wiaas' );
|
||||
}
|
||||
|
||||
@@ -8,6 +8,19 @@ class Wiaas_Field_Order_Bundle extends GF_Field_Text {
|
||||
return esc_attr__( 'Bundle', 'wiaas' );
|
||||
}
|
||||
|
||||
public function add_button( $field_groups ) {
|
||||
$field_groups = Wiaas_Order_Fields::maybe_add_order_field_group($field_groups);
|
||||
|
||||
return parent::add_button( $field_groups );
|
||||
}
|
||||
|
||||
public function get_form_editor_button() {
|
||||
return array(
|
||||
'group' => 'wiaas_order_fields',
|
||||
'text' => $this->get_form_editor_field_title(),
|
||||
);
|
||||
}
|
||||
|
||||
public function get_value_entry_list( $value, $entry, $field_id, $columns, $form ) {
|
||||
return $this->get_bundle_display_name($value);
|
||||
}
|
||||
|
||||
@@ -36,6 +36,19 @@ class Wiaas_Field_Order_Document extends GF_Field_FileUpload {
|
||||
return esc_attr__( 'Order Document', 'wiaas' );
|
||||
}
|
||||
|
||||
public function add_button( $field_groups ) {
|
||||
$field_groups = Wiaas_Order_Fields::maybe_add_order_field_group($field_groups);
|
||||
|
||||
return parent::add_button( $field_groups );
|
||||
}
|
||||
|
||||
public function get_form_editor_button() {
|
||||
return array(
|
||||
'group' => 'wiaas_order_fields',
|
||||
'text' => $this->get_form_editor_field_title(),
|
||||
);
|
||||
}
|
||||
|
||||
public function get_download_url( $file, $force_download = false ) {
|
||||
|
||||
$upload_root = GFFormsModel::get_upload_url( $this->formId );
|
||||
|
||||
@@ -13,6 +13,19 @@ class Wiaas_Order_Installation_Select extends GF_Field_Select {
|
||||
return 'workflow_assignee_select';
|
||||
}
|
||||
|
||||
public function add_button( $field_groups ) {
|
||||
$field_groups = Wiaas_Order_Fields::maybe_add_order_field_group($field_groups);
|
||||
|
||||
return parent::add_button( $field_groups );
|
||||
}
|
||||
|
||||
public function get_form_editor_button() {
|
||||
return array(
|
||||
'group' => 'wiaas_order_fields',
|
||||
'text' => $this->get_form_editor_field_title(),
|
||||
);
|
||||
}
|
||||
|
||||
public function get_field_input( $form, $value = '', $entry = null ) {
|
||||
|
||||
if ( empty($entry) ) {
|
||||
|
||||
@@ -36,6 +36,19 @@ class Wiaas_Field_Order_Number extends GF_Field_Number {
|
||||
return esc_attr__( 'Order Number', 'wiaas' );
|
||||
}
|
||||
|
||||
public function add_button( $field_groups ) {
|
||||
$field_groups = Wiaas_Order_Fields::maybe_add_order_field_group($field_groups);
|
||||
|
||||
return parent::add_button( $field_groups );
|
||||
}
|
||||
|
||||
public function get_form_editor_button() {
|
||||
return array(
|
||||
'group' => 'wiaas_order_fields',
|
||||
'text' => $this->get_form_editor_field_title(),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function get_value_entry_list( $value, $entry, $field_id, $columns, $form ) {
|
||||
return "#100000$value";
|
||||
|
||||
@@ -13,6 +13,29 @@ class Wiaas_Order_Fields {
|
||||
add_filter('gform_fileupload_entry_value_file_path', array( __CLASS__, 'display_order_document_fields' ), 999, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the Order Fields group to the form editor.
|
||||
*
|
||||
* @param array $field_groups The properties for the field groups.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function maybe_add_order_field_group( $field_groups ) {
|
||||
foreach ( $field_groups as $field_group ) {
|
||||
if ( $field_group['name'] == 'wiaas_order_fields' ) {
|
||||
return $field_groups;
|
||||
}
|
||||
}
|
||||
|
||||
$field_groups[] = array(
|
||||
'name' => 'wiaas_order_fields',
|
||||
'label' => __( 'Order Fields', 'wiaas' ),
|
||||
'fields' => array()
|
||||
);
|
||||
|
||||
return $field_groups;
|
||||
}
|
||||
|
||||
|
||||
public static function display_order_document_fields($file_path, $field) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user