This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$API = new Gravity_Flow_API( '1' ); | |
$form = GFAPI::get_form( '1' ); | |
require_once( gravity_flow()->get_base_path() . '/includes/pages/class-entry-detail.php' ); | |
$notes = Gravity_Flow_Entry_Detail::get_timeline_notes( $entry ); | |
$output = "<H3>Timeline</h3><ul>"; | |
foreach( $notes as $note): | |
if( $note->user_name !== 'notification' && $note->value !== 'Step expired' ): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter("gform_after_submission", "post_form_anonymize", 10 , 2); | |
//Gravity Form Submission | |
function post_form_anonymize($entry, $form){ | |
$cssClasses = preg_split('/[\ \n\,]+/', $form['cssClass']); | |
if (in_array("anonymize", $cssClasses)) { | |
RGFormsModel::update_lead_property($entry['id'], "created_by","1"); | |
RGFormsModel::update_lead_property($entry['id'], "ip","XXX.YYY.XXX.YYY"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'gravityflow_columns_status_table', 'custom_column_titles', 10, 3 ); | |
function custom_column_titles( $columns, $args, $table ) { | |
$new_column = array( | |
'assignees' => 'Assignee(s)', | |
); | |
$pre_columns = array_slice( $columns, 0, 2 ); | |
$post_columns = array_slice( $columns, 2 ); | |
$columns = array_merge( $pre_columns, $new_column, $post_columns ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'gravityflow_validation_user_input', 'step_complete_data_check', 10, 3 ); | |
add_filter( 'gravityflow_validation_user_input', 'step_inprogress_bypass_required', 10, 3 ); | |
function step_complete_data_check( $validation_result, $step, $new_status ) { | |
if( ($validation_result['form']['id'] == "121" && rgpost( 'step_id' ) == 40 && $new_status == 'in_progress') ) { | |
foreach( $form['fields'] as &$field ) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'gravityflow_columns_status_table', 'custom_column_titles', 10, 3 ); | |
function custom_column_titles( $columns, $args, $table ) { | |
$new_column = array( | |
'user_action' => 'User Action', | |
); | |
$pre_columns = array_slice( $columns, 0, 2 ); | |
$post_columns = array_slice( $columns, 2 ); | |
$columns = array_merge( $pre_columns, $new_column, $post_columns ); | |
return $columns; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'gravityflow_discussion_items_display_limit', 'limit_discussion_display', 10, 2 ); | |
function limit_discussion_display( $display_limit, $discussion_field ) { | |
//Change to control which form / field the limit change is applied to | |
if ( $discussion_field['formId'] == '25' ) { | |
$display_limit = 2; | |
} | |
return $display_limit; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'gform_export_fields', 'add_step_updated', 10, 1 ); | |
function add_step_updated( $form ) { | |
array_push( $form['fields'], array( 'id' => 'step_updated', 'label' => __( 'Step Last Updated', 'gravityforms' ) ) ); | |
return $form; | |
} | |
add_filter( 'gform_export_field_value', 'set_step_updated', 10, 4 ); | |
function set_step_updated( $value, $form_id, $field_id, $entry ) { | |
switch ( $field_id ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'gravityflow_step_schedule_timestamp', 'schedule_business_hours', 10, 3 ); | |
function schedule_business_hours( $schedule_timestamp, $schedule_type, $step ) { | |
//Ensure you are only adjusting the desired form/step | |
if ( $step->get_id() !== 74 ) { | |
return $schedule_timestamp; | |
} | |
gravity_flow()->log_debug( __METHOD__ . '(): Original Scheduled: ' . date( 'Y-m-d H:i:s', $schedule_timestamp ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'gravityflow_step_assignees', 'bypass_step_assignee_on_email_change', 10, 2 ); | |
function bypass_step_assignee_on_email_change( $assignees, $step ) { | |
//Update with the ID of your specific step to apply the bypass against | |
if ( $step->get_id() == '76' ) { | |
if ( isset( $_POST['gforms_save_entry'] ) && count( $_POST ) > 0 ) { | |
$reset = false; | |
if ( $assignees ) { | |
foreach ( $assignees as $key => $assignee ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( "gravityflow_user_field", "gflow_request_manager", 10, 3 ); | |
function gflow_request_manager( $choices, $form_id, $field ) { | |
if ( $form_id == 1 && $field->id == 15 ) { | |
$manager = get_user_by('email', get_user_meta(get_current_user_id(), "manager_email", true) ); | |
if( false !== $manager ) { | |
$choices = array( | |
array('value' => $manager->ID, 'text' => $manager->first_name . ' ' . $manager->last_name) |