/** * Allow custom meta boxes to be added to the entry detail page. * * @since 2.0-beta-3 * * @param array $meta_boxes The properties for the meta boxes. * @param array $entry The entry currently being viewed/edited. * @param array $form The form object used to process the current entry. */ $meta_boxes = apply_filters( 'gform_entry_detail_meta_boxes', $meta_boxes, $entry, $form );
/** * Caches the current form. * * @since 2.4.4.1 * * @param array $form The form to be cached. */ public static function set_current_form( $form ) { self::$_form = $form; }
/** * Allow the entry list search criteria to be overridden. * * @since 1.9.14.30 * * @param array $search_criteria An array containing the search criteria. * @param int $form_id The ID of the current form. */ $search_criteria = gf_apply_filters( array( 'gform_search_criteria_entry_list', $form_id ), $search_criteria, $form_id );
/** * Fires before the entry detail page is shown or any processing is handled. * * @param array $form The form object for the entry. * @param array $lead The entry object. * * @since 2.3.3.9 */ gf_do_action( array( 'gform_pre_entry_detail', $form['id'] ), $form, $lead );
// unread filter requires special handling for pagination since entries are filter out of the query as they are read if ( $filter == 'unread' ) { $next_pos = $position;
// Set files that have been uploaded to temp folder GFFormsModel::set_uploaded_files( $form_id );
GFFormsModel::save_lead( $form, $lead );
/** * Fires after the Entry is updated from the entry detail page. * * @param array $form The form object for the entry. * @param integer $lead['id'] The entry ID. * @param array $original_entry The entry object before being updated. */ gf_do_action( array( 'gform_after_update_entry', $form['id'] ), $form, $lead['id'], $original_entry );
$headers = "From: \"$email_from\" <$email_from> \r\n"; GFCommon::log_debug( "GFEntryDetail::lead_detail_page(): Emailing notes - TO: $email_to SUBJECT: $email_subject BODY: $body HEADERS: $headers" ); $is_success = wp_mail( $email_to, $email_subject, $body, $headers ); $result = is_wp_error( $is_success ) ? $is_success->get_error_message() : $is_success; GFCommon::log_debug( "GFEntryDetail::lead_detail_page(): Result from wp_mail(): {$result}" ); if ( ! is_wp_error( $is_success ) && $is_success ) { GFCommon::log_debug( 'GFEntryDetail::lead_detail_page(): Mail was passed from WordPress to the mail server.' ); } else { GFCommon::log_error( 'GFEntryDetail::lead_detail_page(): The mail message was passed off to WordPress for processing, but WordPress was unable to send the message.' ); }
if ( has_filter( 'phpmailer_init' ) ) { GFCommon::log_debug( __METHOD__ . '(): The WordPress phpmailer_init hook has been detected, usually used by SMTP plugins, it can impact mail delivery.' ); }
/** * Fires after a note is attached to an entry and sent as an email * * @param string $result The Error message or success message when the entry note is sent * @param string $email_to The email address to send the entry note to * @param string $email_from The email address from which the email is sent from * @param string $email_subject The subject of the email that is sent * @param mixed $body The Full body of the email containing the message after the note is sent * @param array $form The current form object * @param array $lead The Current lead object */ do_action( 'gform_post_send_entry_note', $result, $email_to, $email_from, $email_subject, $body, $form, $lead ); } break;
function createCookie(name, value, days) { if (days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); var expires = "; expires=" + date.toGMTString(); } else var expires = ""; document.cookie = name + "=" + value + expires + "; path=/"; }
function eraseCookie(name) { createCookie(name, "", -1); }
function ResendNotifications() { var selectedNotifications = new Array(); jQuery(".gform_notifications:checked").each(function () { selectedNotifications.push(jQuery(this).val()); });
var sendTo = jQuery('#notification_override_email').val();
if (selectedNotifications.length <= 0) { displayMessage(<?php echo json_encode( __( 'You must select at least one type of notification to resend.', 'gravityforms' ) ); ?>, 'error', '#notifications'); return; }
<?php /** * Inserts information into the middle of the entry detail sidebar * * @param array $form The Form object * @param array $lead The Entry object */ do_action( 'gform_entry_detail_sidebar_middle', $form, $lead );
/** * Fires after the entry detail sidebar information. * * @param array $form The Form object * @param array $lead The Entry object */ do_action( 'gform_entry_detail_sidebar_after', $form, $lead ); ?> </div>
if ( is_array( $field->fields ) ) { // Ensure the top level repeater has the right nesting level so the label is not duplicated. $field->nestingLevel = 0; $field_label = ''; } else { $field_label = "<label class='detail-label'>" . esc_html( GFCommon::get_label( $field ) ) . '</label>'; }
/** * Filters the field content. * * @since 2.1.2.14 Added form and field ID modifiers. * * @param string $content The field content. * @param array $field The Field Object. * @param string $value The field value. * @param int $lead['id'] The entry ID. * @param int $form['id'] The form ID. */ $content = gf_apply_filters( array( 'gform_field_content', $form['id'], $field->id ), $content, $field, $value, $lead['id'], $form['id'] );
/** * Allows for modification of the "Add Note" button for Entry Notes * * @param string $note_button The HTML for the "Add Note" Button */ echo apply_filters( 'gform_addnote_button', $note_button );
case 'captcha': case 'html': case 'password': case 'page': // Ignore captcha, html, password, page field. break;
default : // Ignore product fields as they will be grouped together at the end of the grid. if ( GFCommon::is_product_field( $field->type ) ) { $has_product_fields = true; break; }
if ( is_array( $field->fields ) ) { // Ensure the top level repeater has the right nesting level so the label is not duplicated. $field->nestingLevel = 0; }
/** * Filters a field value displayed within an entry. * * @since 1.5 * * @param string $display_value The value to be displayed. * @param GF_Field $field The Field Object. * @param array $lead The Entry Object. * @param array $form The Form Object. */ $display_value = apply_filters( 'gform_entry_field_value', $display_value, $field, $lead, $form );
/** * Filters the field content. * * @since 2.1.2.14 Added form and field ID modifiers. * * @param string $content The field content. * @param array $field The Field Object. * @param string $value The field value. * @param int $lead['id'] The entry ID. * @param int $form['id'] The form ID. */ $content = gf_apply_filters( array( 'gform_field_content', $form['id'], $field->id ), $content, $field, $value, $lead['id'], $form['id'] );
echo $content; }
$products = array(); if ( $has_product_fields ) { $products = GFCommon::get_product_fields( $form, $lead, false, true ); $order_summary_markup = GF_Order_Summary::render( $form, $lead, 'order-summary', false, true ); if ( $order_summary_markup ) { /** * Filter the markup of the order summary which appears on the Entry Detail, the {all_fields} merge tag and the {pricing_fields} merge tag. * * @since 2.1.2.5 * @see https://docs.gravityforms.com/gform_order_summary/ * * @var string $markup The order summary markup. * @var array $form Current form object. * @var array $lead Current entry object. * @var array $products Current order summary object. * @var string $format Format that should be used to display the summary ('html' or 'text'). */ $order_summary_markup = gf_apply_filters( array( 'gform_order_summary', $form['id'] ), trim( $order_summary_markup ), $form, $lead, $products, 'html' );
/** * Allows for modification on the form payment date format * * @param array $form The Form object to filter through * @param array $entry The Lead object to filter through */ $payment_date = apply_filters( 'gform_payment_date', GFCommon::format_date( $entry['payment_date'], false, 'Y/m/d', $entry['transaction_type'] != 2 ), $form, $entry ); if ( ! empty( $payment_date ) ) { ?> <div id="gf_payment_date" class="gf_payment_detail"> <?php echo $entry['transaction_type'] == 2 ? esc_html__( 'Start Date', 'gravityforms' ) : esc_html__( 'Date', 'gravityforms' ) ?>: <span id='gform_payment_date'><?php echo $payment_date; // May contain HTML ?></span> </div> <?php }
/** * Allows filtering through a payment transaction ID * * @param int $entry['transaction_id'] The transaction ID that can be modified * @param array $form The Form object to be filtered when modifying the transaction ID * @param array $entry The Lead object to be filtered when modifying the transaction ID */ $transaction_id = apply_filters( 'gform_payment_transaction_id', $entry['transaction_id'], $form, $entry ); if ( ! empty( $transaction_id ) ) { ?> <div id="gf_payment_transaction_id" class="gf_payment_detail"> <?php echo $entry['transaction_type'] == 2 ? esc_html__( 'Subscription Id', 'gravityforms' ) : esc_html__( 'Transaction Id', 'gravityforms' ); ?>: <span id='gform_payment_transaction_id'><?php echo $transaction_id; // May contain HTML ?></span> </div> <?php }
/** * Filter through the way the Payment Amount is rendered * * @param string $entry['payment_amount'] The payment amount taken from the lead object * @param string $entry['currency'] The payment currency taken from the lead object * @param array $form The Form object to filter through * @param array $entry The lead object to filter through */ $payment_amount = apply_filters( 'gform_payment_amount', GFCommon::to_money( $entry['payment_amount'], $entry['currency'] ), $form, $entry ); if ( ! rgblank( $payment_amount ) ) { ?> <div id="gf_payment_amount" class="gf_payment_detail"> <?php echo $entry['transaction_type'] == 2 ? esc_html__( 'Recurring Amount', 'gravityforms' ) : esc_html__( 'Amount', 'gravityforms' ); ?>: <span id='gform_payment_amount'><?php echo $payment_amount; // May contain HTML ?></span> </div> <?php }
$order = GF_Order_Factory::create_from_entry( $form, $entry ); $trial_item = $order->get_item_by_property( 'is_trial', true ); if ( $trial_item && $trial_item->description ) { /** * Filter through the way the trial description is rendered. * * @param string $trial_description The trial description. * @param array $form The Form object to filter through * @param array $entry The lead object to filter through */ $trial_description = apply_filters( 'gform_subscription_details_trial_description', $trial_item->description, $form, $entry ); if ( ! rgblank( $trial_description ) ) { ?> <div id="gf_trial_description" class="gf_payment_detail"> <?php echo esc_html( $trial_description ); ?> </div> <?php } } }
/** * Fires after the Form Payment Details (The type of payment, the cost, the ID, etc) * * @param int $form['id'] The current Form ID * @param array $entry The current Lead object */ do_action( 'gform_payment_details', $form['id'], $entry );
?> </div> </div>
<?php }
/** * Display the button to print an entry. * * @since 2.5 * * @param array $args */ public static function meta_box_print_entry( $args ) {
$lead = $args['entry']; $form = $args['form'];
?> <!-- begin print button --> <div class="detail-view-print"> <?php if ( GFCommon::current_user_can_any( 'gravityforms_view_entry_notes' ) ) { ?>
/** * Adds additional information to the entry details * * @param int $form['id'] The form ID * @param array $lead The Entry object */ do_action( 'gform_entry_info', $form['id'], $entry );
if ( ! is_array( $notifications ) || count( $form['notifications'] ) <= 0 ) { ?> <p class="description"><?php esc_html_e( 'You cannot resend notifications for this entry because this form does not currently have any notifications configured.', 'gravityforms' ); ?></p>
<p class="description" style="padding-top:0; margin-top:0; width:99%;">You may override the default notification settings by entering a comma delimited list of emails to which the selected notifications should be sent.</p> <label for="notification_override_email"><?php esc_html_e( 'Send To', 'gravityforms' ); ?> <?php gform_tooltip( 'notification_override_email' ) ?></label> <input type="text" name="notification_override_email" id="notification_override_email" style="width:99%;" /> <br /><br />
/** * Helper to determine if empty fields should be displayed when the lead detail grid is processed. * * @param bool $allow_display_empty_fields Determines if the value of the 'show empty fields' checkbox should be used. True when viewing the entry and false when in edit mode. * @param array $form The Form object for the current Entry. * @param array|bool $lead The current Entry object or false. * * @return bool */ public static function maybe_display_empty_fields( $allow_display_empty_fields, $form, $lead = false ) { $display_empty_fields = false; if ( $allow_display_empty_fields ) { $display_empty_fields = (bool) rgget( 'gf_display_empty_fields', $_COOKIE ); }
if ( ! $lead ) { $lead = self::get_current_entry(); }
/** * A filter to determine if empty fields should be displayed in the entry details. * * @param bool $display_empty_fields True or false to show the fields * @param array $form The Form object to filter * @param array $lead The Entry object to filter */ return apply_filters( 'gform_entry_detail_grid_display_empty_fields', $display_empty_fields, $form, $lead ); }