PluginProbe
Booking Calendar / 11.8.4
Booking Calendar v11.8.4
11.8.4 11.8.3 11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 10.11 All 204 releases
← All changes | core/admin/page-email-trash.php +74 -51 10.1.311.8.4 View file →
@@ -28,9 +28,9 @@
28 28 - 'modification'
29 29 */
30 30
31 31
32 -require_once( WPBC_PLUGIN_DIR . '/core/any/api-emails.php' ); // API
32 +require_once WPBC_PLUGIN_DIR . '/core/any/api-emails.php'; // API
33 33
34 34
35 35
36 36 // <editor-fold defaultstate="collapsed" desc=" Import Old Data " >
@@ -193,9 +193,9 @@
193 193 , 'group' => 'general'
194 194
195 195 );
196 196
197 -//FixIn: 8.1.2.17
197 +// FixIn: 8.1.2.17.
198 198 $this->fields['to_html_prefix'] = array(
199 199 'type' => 'pure_html'
200 200 , 'group' => 'general'
201 201 , 'html' => '<tr valign="top" class="wpbc_tr_copy_to_admin_to">
@@ -334,15 +334,17 @@
334 334 , 'only_field' => true
335 335 );
336 336 $this->fields['subject_after'] = array( 'type' => 'pure_html', 'group' => 'general_content',
337 337 'html' => '<p style="text-align: right;font-size:12px;">'
338 - . sprintf(__('Type your email %ssubject%s for the booking confirmation message.' ,'booking'),'<b>','</b>') . ' ' . __('Required', 'booking')
338 + /* translators: 1: ... */
339 + . sprintf( __( 'Type your email %1$ssubject%2$s for the booking confirmation message.', 'booking' ),'<b>','</b>') . ' ' . __('Required', 'booking')
339 340 . '.</p>' . '</td></tr>' );
340 341
341 342 $blg_title = get_option( 'blogname' );
342 343 $blg_title = str_replace( array( '"', "'" ), '', $blg_title );
343 344
344 - $email_content = sprintf( __( 'Your booking %s for: %s has been canceled. %sThank you, %s', 'booking' ), '[bookingtype]', '[dates]', '<br/>[denyreason]<br/><br/>[content]<br/><br/>', $blg_title . '<br/>[siteurl]' );
345 + /* translators: 1: ... */
346 + $email_content = sprintf( __( 'Your booking %1$s for: %2$s has been canceled. %3$sThank you, %4$s', 'booking' ), '[bookingtype]', '[dates]', '<br/>[denyreason]<br/><br/>[content]<br/><br/>', $blg_title . '<br/>[siteurl]' );
345 347
346 348 $this->fields['content_before'] = array(
347 349 'type' => 'pure_html',
348 350 'group' => 'general_content',
@@ -413,9 +415,10 @@
413 415 );
414 416
415 417 $this->fields['template_file_help'] = array(
416 418 'type' => 'help'
417 - , 'value' => array( sprintf( __('You can override this email template in this folder %s', 'booking')
419 + /* translators: 1: ... */
420 + , 'value' => array( sprintf( __( 'You can override this email template in this folder %s', 'booking')
418 421 , '<code>' . realpath( dirname(__FILE__) . '/../any/emails_tpl/' ) . '</code>' )
419 422 )
420 423 , 'cols' => 2
421 424 , 'group' => 'style'
@@ -507,11 +510,12 @@
507 510 , 'visitorbookingediturl'
508 511 //, 'visitorbookingslisting' //FixIn: 8.1.3.5.1
509 512 , 'visitorbookingcancelurl'
510 513 , 'visitorbookingpayurl'
511 - , 'add_to_google_cal_button' //FixIn: 9.6.3.8
514 + , 'add_to_google_cal_button' // FixIn: 9.6.3.8.
512 515 );
513 - $email_example = sprintf(__('For example: "You have a new reservation %s on the following date(s): %s Contact information: %s You can approve or cancel this booking at: %s Thank you, Reservation service."' ,'booking'),'','[dates]&lt;br/&gt;&lt;br/&gt;','&lt;br/&gt; [content]&lt;br/&gt;&lt;br/&gt;', htmlentities( ' <a href="[moderatelink]">'.__('here' ,'booking').'</a> ') . '&lt;br/&gt;&lt;br/&gt; ');
516 + /* translators: 1: ... */
517 + $email_example = sprintf( __( 'For example: "You have a new reservation %1$s on the following date(s): %2$s Contact information: %3$s You can approve or cancel this booking at: %4$s Thank you, Reservation service."', 'booking' ),'','[dates]&lt;br/&gt;&lt;br/&gt;','&lt;br/&gt; [content]&lt;br/&gt;&lt;br/&gt;', htmlentities( ' <a href="[moderatelink]">'.__('here' ,'booking').'</a> ') . '&lt;br/&gt;&lt;br/&gt; ');
514 518
515 519 $help_fields = wpbc_get_email_help_shortcodes( $skip_shortcodes, $email_example );
516 520
517 521 foreach ( $help_fields as $help_fields_key => $help_fields_value ) {
@@ -582,10 +586,10 @@
582 586
583 587
584 588 $subtabs['trash'] = array(
585 589 'type' => 'subtab' // Required| Possible values: 'subtab' | 'separator' | 'button' | 'goto-link' | 'html'
586 - , 'title' => '<span>' . __( 'Trash / Reject', 'booking' ) . $sufix . '</span>' // Title of TAB
587 - , 'page_title' => __('Emails Settings', 'booking') // Title of Page
590 + , 'title' => '<span>' . esc_html__( 'Trash / Reject', 'booking' ) . $sufix . '</span>' // Title of TAB
591 + , 'page_title' => __('Emails Settings', 'booking') . ' - <span>' . esc_html__( 'Trash / Reject', 'booking' ) . $sufix . '</span>' // Title of Page.
588 592 , 'hint' => __('Customization of email template, which is sent to Visitor after rejecting of booking' ,'booking') //FixIn: 8.1.2.17.1
589 593 , 'link' => '' // link
590 594 , 'position' => '' // 'left' || 'right' || ''
591 595 , 'css_classes' => 'wpbc_navigation_top_border' // CSS class(es)
@@ -590,14 +594,13 @@
590 594 , 'position' => '' // 'left' || 'right' || ''
591 595 , 'css_classes' => 'wpbc_navigation_top_border' // CSS class(es)
592 596 //, 'icon' => 'http://.../icon.png' // Icon - link to the real PNG img
593 597 //, 'font_icon' => 'wpbc_icn_mail_outline' // CSS definition of Font Icon
594 - , 'header_font_icon' => 'wpbc_icn_mail_outline' // CSS definition of Font Icon //FixIn: 9.6.1.4
595 - , 'default' => false // Is this sub tab activated by default or not: true || false.
598 + , 'default' => false // Is this sub tab activated by default or not: true || false.
596 599 , 'disabled' => false // Is this sub tab deactivated: true || false.
597 600 , 'checkbox' => false // or definition array for specific checkbox: array( 'checked' => true, 'name' => 'feature1_active_status' ) //, 'checkbox' => array( 'checked' => $is_checked, 'name' => 'enabled_active_status' )
598 601 , 'content' => 'content' // Function to load as conten of this TAB
599 - , 'is_use_left_navigation' => true
602 + , 'font_icon' => 'wpbc_icn_delete_outline'
600 603 , 'show_checked_icon' => true
601 604 , 'checked_data' => WPBC_EMAIL_NEW_ADMIN_PREFIX . WPBC_EMAIL_TRASH_ID // This is where we get content
602 605 );
603 606
@@ -645,13 +648,13 @@
645 648 <div class="clear"></div>
646 649
647 650 <span class="metabox-holder">
648 651
649 - <form name="<?php echo $submit_form_name; ?>" id="<?php echo $submit_form_name; ?>" action="" method="post" autocomplete="off">
652 + <form name="<?php echo esc_attr( $submit_form_name ); ?>" id="<?php echo esc_attr( $submit_form_name ); ?>" action="" method="post" autocomplete="off">
650 653 <?php
651 654 // N o n c e field, and key for checking S u b m i t
652 655 wp_nonce_field( 'wpbc_settings_page_' . $submit_form_name );
653 - ?><input type="hidden" name="is_form_sbmitted_<?php echo $submit_form_name; ?>" id="is_form_sbmitted_<?php echo $submit_form_name; ?>" value="1" />
656 + ?><input type="hidden" name="is_form_sbmitted_<?php echo esc_attr( $submit_form_name ); ?>" id="is_form_sbmitted_<?php echo esc_attr( $submit_form_name ); ?>" value="1" />
654 657
655 658 <div class="clear"></div>
656 659 <?php
657 660
@@ -735,9 +738,9 @@
735 738
736 739 $init_fields_values = wpbc_import6_email__trash__get_fields_array_for_activation();
737 740
738 741 // Get Value of first element - array of default or imported OLD data, because need only array of values without key - name of options for wp_options table
739 - $init_fields_values_temp = array_values( $init_fields_values ); //FixIn: 7.0.1.32
742 + $init_fields_values_temp = array_values( $init_fields_values ); // FixIn: 7.0.1.32.
740 743 $init_fields_values = array_shift( $init_fields_values_temp );
741 744
742 745
743 746 $this->mail_api( WPBC_EMAIL_TRASH_ID, $init_fields_values );
@@ -750,8 +753,9 @@
750 753 $submit_form_name = 'wpbc_emails_template'; // Define form name
751 754
752 755 $this->mail_api()->validated_form_id = $submit_form_name; // Define ID of Form for ability to validate fields before submit.
753 756
757 + // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
754 758 if ( isset( $_POST['is_form_sbmitted_'. $submit_form_name ] ) ) {
755 759
756 760 // Nonce checking {Return false if invalid, 1 if generated between, 0-12 hours ago, 2 if generated between 12-24 hours ago. }
757 761 $nonce_gen_time = check_admin_referer( 'wpbc_settings_page_' . $submit_form_name ); // Its stop show anything on submiting, if its not refear to the original page
@@ -824,9 +828,9 @@
824 828 $js_script .= " jQuery('#trash_from_name').parent().append('<div class=\'updated\' style=\'border-left-color:#ffb900;padding:5px 10px;\'>". esc_js(__('If empty then title defined as WordPress', 'booking' ))."</div>')";
825 829 $js_script .= " }";
826 830 $js_script .= " }); ";
827 831
828 - //FixIn: 8.1.2.17
832 + // FixIn: 8.1.2.17.
829 833 $js_script .= " jQuery('#trash_copy_to_admin').on( 'change', function(){ ";
830 834 $js_script .= " if ( jQuery('#trash_copy_to_admin').is(':checked') ) {";
831 835 $js_script .= " jQuery('.wpbc_tr_copy_to_admin_to').show();";
832 836 $js_script .= " } else { ";
@@ -867,49 +871,64 @@
867 871 $replace = array();
868 872
869 873 // Resources ///////////////////////////////////////////////////////////////
870 874 $bk_title = wpbc_get_resource_title( $bktype );
875 + $parent_resource_title = wpbc_get_parent_resource_title( $bktype ); // FixIn: 10.9.2.4.
871 876
872 877 // Dates ///////////////////////////////////////////////////////////////////
873 878 $my_dates4emeil = wpbc_db__get_sql_dates__in_booking__as_str( $booking_id );
874 - if ( get_bk_option( 'booking_date_view_type' ) == 'short' )
875 - $my_dates_4_send = wpbc_get_dates_short_format( $my_dates4emeil );
876 - else
877 - $my_dates_4_send = wpbc_get_dates_comma_string_localized( $my_dates4emeil );
878 -
879 - $my_dates4emeil_check_in_out = explode(',', $my_dates4emeil );
880 879
881 - $my_check_in_date = wpbc_get_dates_comma_string_localized( $my_dates4emeil_check_in_out[0] );
882 - $my_check_out_date = wpbc_get_dates_comma_string_localized( $my_dates4emeil_check_in_out[ count( $my_dates4emeil_check_in_out ) - 1 ] );
883 - //FixIn: 8.7.2.5
884 - $my_check_in_onlydate = wpbc_get_dates_comma_string_localized( wpbc_datetime_localized( date( 'Y-m-d 00:00:00', strtotime( $my_dates4emeil_check_in_out[0] ) ), 'Y-m-d 00:00:00' ) );
885 - $my_check_out_onlydate = wpbc_get_dates_comma_string_localized( wpbc_datetime_localized( date( 'Y-m-d 00:00:00', strtotime( $my_dates4emeil_check_in_out[ count( $my_dates4emeil_check_in_out ) - 1 ] ) ), 'Y-m-d 00:00:00' ) );
880 + $my_dates_4_send = ( 'short' === get_bk_option( 'booking_date_view_type' ) )
881 + ? wpbc_get_dates_short_format( $my_dates4emeil )
882 + : wpbc_get_dates_comma_string_localized( $my_dates4emeil );
883 + $my_dates4emeil_check_in_out = explode( ',', $my_dates4emeil );
886 884
887 - $my_check_out_plus1day = wpbc_get_dates_comma_string_localized( wpbc_datetime_localized( date( 'Y-m-d H:i:s', strtotime( $my_dates4emeil_check_in_out[ count( $my_dates4emeil_check_in_out ) - 1 ] . " +1 day" ) ), 'Y-m-d H:i:s' ) ); //FixIn: 6.0.1.11
885 + $my_check_in_date = wpbc_get_dates_comma_string_localized( $my_dates4emeil_check_in_out[0] );
886 + $my_check_out_date = wpbc_get_dates_comma_string_localized( $my_dates4emeil_check_in_out[ count( $my_dates4emeil_check_in_out ) - 1 ] );
887 + $my_check_in_onlydate = wpbc_get_dates_comma_string_localized( wpbc_datetime_localized( gmdate( 'Y-m-d 00:00:00', strtotime( $my_dates4emeil_check_in_out[0] ) ), 'Y-m-d 00:00:00' ) ); // FixIn: 8.7.2.5.
888 + $my_check_out_onlydate = wpbc_get_dates_comma_string_localized( wpbc_datetime_localized( gmdate( 'Y-m-d 00:00:00', strtotime( $my_dates4emeil_check_in_out[ count( $my_dates4emeil_check_in_out ) - 1 ] ) ), 'Y-m-d 00:00:00' ) );
889 + $my_check_out_plus1day = wpbc_get_dates_comma_string_localized( wpbc_datetime_localized( gmdate( 'Y-m-d H:i:s', strtotime( $my_dates4emeil_check_in_out[ count( $my_dates4emeil_check_in_out ) - 1 ] . " +1 day" ) ), 'Y-m-d H:i:s' ) ); // FixIn: 6.0.1.11.
888 890
891 + // FixIn: 10.1.5.6.
892 + $dates_only_arr = wpbc_get_only_dates__from_dates_ymd_his_csv__as_arr( $my_dates4emeil ); // -> '2023-10-09, 2023-10-09'
893 + $dates_only_str = implode( ',', $dates_only_arr );
894 + $dates_only_str_formatted = ( 'short' === get_bk_option( 'booking_date_view_type' ) )
895 + ? wpbc_get_dates_short_format( $dates_only_str )
896 + : wpbc_get_dates_comma_string_localized( $dates_only_str );
897 +
889 898 // Cost ////////////////////////////////////////////////////////////////////
890 - $booking_cost_digits_only = apply_bk_filter( 'get_booking_cost_from_db', '', $booking_id ); //FixIn: 9.2.3.1
899 + $booking_cost_digits_only = apply_bk_filter( 'get_booking_cost_from_db', '', $booking_id ); // FixIn: 9.2.3.1.
891 900 $booking_cost = wpbc_get_cost_with_currency_for_user( $booking_cost_digits_only );
892 901 // Other ///////////////////////////////////////////////////////////////////
893 902 $replace[ 'booking_id' ] = $booking_id;
894 903 $replace[ 'id' ] = $replace[ 'booking_id' ];
895 904 $replace[ 'dates' ] = $my_dates_4_send;
905 + $replace[ 'only_dates' ] = $dates_only_str_formatted;
906 + $replace[ 'dates_only' ] = $dates_only_str_formatted;
896 907 $replace[ 'check_in_date' ] = $my_check_in_date;
897 908 $replace[ 'check_out_date' ] = $my_check_out_date;
898 - //FixIn: 8.7.2.5
909 + // FixIn: 8.7.2.5.
899 910 $replace[ 'check_in_only_date' ] = $my_check_in_onlydate;
900 911 $replace[ 'check_out_only_date' ] = $my_check_out_onlydate;
901 912
902 - $replace[ 'check_out_plus1day'] = $my_check_out_plus1day; //FixIn: 6.0.1.11
903 - $replace[ 'dates_count' ] = count( $my_dates4emeil_check_in_out );
913 + $replace[ 'check_out_plus1day'] = $my_check_out_plus1day; // FixIn: 6.0.1.11.
914 +
915 + $replace['dates_count'] = count( $my_dates4emeil_check_in_out );
916 + $replace['days_count'] = intval( $replace['dates_count'] ); // FixIn: 10.15.1.3.
917 + $replace['nights_count'] = ( $replace['days_count'] > 1 ) ? intval( $replace['days_count'] - 1 ) : 1;
918 + $replace['days_count_plus1day'] = intval( $replace['days_count'] + 1 );
919 +
904 920 $replace['cost'] = $booking_cost;
905 921 $replace['cost_digits_only'] = $booking_cost_digits_only;
906 - $replace[ 'siteurl' ] = htmlspecialchars_decode( '<a href="' . home_url() . '">' . home_url() . '</a>' );
922 + $replace[ 'siteurl' ] = htmlspecialchars_decode( '<a href="' . esc_url( home_url() ) . '">' . home_url() . '</a>' );
907 923 $replace[ 'resource_title'] = wpbc_lang( $bk_title );
924 + $replace[ 'parent_resource_title'] = wpbc_lang( $parent_resource_title ); // FixIn: 10.9.2.4.
908 925 $replace[ 'bookingtype' ] = $replace[ 'resource_title'];
909 - $replace[ 'remote_ip' ] = wpbc_get_user_ip(); //FixIn:7.1.2.4 // The IP address from which the user is viewing the current page.
910 - $replace[ 'user_agent' ] = $_SERVER['HTTP_USER_AGENT']; // Contents of the User-Agent: header from the current request, if there is one.
911 - $replace[ 'request_url' ] = ( isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : '' ); // The address of the page (if any) where action was occured. Because we are sending it in Ajax request, we need to use the REFERER HTTP
926 + $replace[ 'remote_ip' ] = wpbc_get_user_ip(); //FixIn:7.1.2.4 // The IP address from which the user is viewing the current page.
927 + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated, WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
928 + $replace[ 'user_agent' ] = ( ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) ? sanitize_text_field( $_SERVER['HTTP_USER_AGENT'] ) : '' ); // Contents of the User-Agent: header from the current request, if there is one.
929 + $server_http_referer_uri = ( ( isset( $_SERVER['HTTP_REFERER'] ) ) ? sanitize_text_field( $_SERVER['HTTP_REFERER'] ) : '' ); /* phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.MissingUnslash */ /* FixIn: sanitize_unslash */
930 + $replace['request_url'] = $server_http_referer_uri; // The address of the page (if any) where action was occured. Because we are sending it in Ajax request, we need to use the REFERER HTTP
912 931 $replace[ 'current_date' ] = date_i18n( get_bk_option( 'booking_date_format' ) );
913 932 $replace[ 'current_time' ] = date_i18n( get_bk_option( 'booking_time_format' ) );
914 933
915 934 // Form Fields /////////////////////////////////////////////////////////////
@@ -924,10 +943,10 @@
924 943
925 944 // Links ///////////////////////////////////////////////////////////////////
926 945 $replace[ 'moderatelink' ] = htmlspecialchars_decode(
927 946 // '<a href="' .
928 - esc_url( wpbc_get_bookings_url() . '&view_mode=vm_listing&tab=actions&wh_booking_id=' . $booking_id )
929 - // . '">' . __('here', 'booking') . '</a>'
947 + esc_url( wpbc_get_bookings_url() . '&tab=vm_booking_listing&wh_booking_id=' . $booking_id )
948 + // . '">' . esc_html__('here', 'booking') . '</a>'
930 949 );
931 950 $replace[ 'visitorbookingediturl' ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '[visitorbookingediturl]', $booking_id );
932 951 $replace[ 'visitorbookingslisting' ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '[visitorbookingslisting]', $booking_id ); //FixIn: 8.1.3.5.1
933 952 $replace[ 'visitorbookingcancelurl' ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '[visitorbookingcancelurl]', $booking_id );
@@ -933,11 +952,11 @@
933 952 $replace[ 'visitorbookingcancelurl' ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '[visitorbookingcancelurl]', $booking_id );
934 953 $replace[ 'visitorbookingpayurl' ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '[visitorbookingpayurl]', $booking_id );
935 954 $replace[ 'bookinghash' ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '[bookinghash]', $booking_id );
936 955
937 - ////////////////////////////////////////////////////////////////////////////
956 + // -----------------------------------------------------------------------------------------------------------------
938 957 // Get additional replace paramaters to the email shortcodes
939 - $replace = apply_filters( 'wpbc_replace_params_for_booking', $replace, $booking_id, $bktype, $formdata ); //FixIn: 8.0.1.7
958 + $replace = apply_filters( 'wpbc_replace_params_for_booking', $replace, $booking_id, $bktype, $formdata ); // FixIn: 8.0.1.7.
940 959
941 960
942 961 return $replace;
943 962
@@ -956,9 +975,10 @@
956 975 function wpbc_send_email_trash( $trash_id_str, $is_send_emeils, $trashreason = '' ) {
957 976
958 977 global $wpdb;
959 978 $sql = "SELECT * FROM {$wpdb->prefix}booking as bk WHERE bk.booking_id IN ({$trash_id_str})";
960 - $result = $wpdb->get_results( $sql );
979 + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter, PluginCheck.Security.DirectDB.UnescapedDBParameter
980 + $result = $wpdb->get_results( $sql );
961 981
962 982
963 983 foreach ( $result as $res ) {
964 984
@@ -966,9 +986,12 @@
966 986 $bktype = $res->booking_type;
967 987 $formdata = $res->form;
968 988
969 989 $previous_active_user = apply_bk_filter( 'wpbc_mu_set_environment_for_owner_of_resource', -1, $bktype ); // MU
970 -
990 +
991 + // Check for the ability to change HASH during Trash booking. //FixIn: 10.9.6.1.
992 + make_bk_action( 'booking_trash_send_email', $res, '' );
993 +
971 994 ////////////////////////////////////////////////////////////////////////
972 995 // Load Data
973 996 ////////////////////////////////////////////////////////////////////////
974 997
@@ -986,9 +1009,9 @@
986 1009
987 1010 $init_fields_values = wpbc_import6_email__trash__get_fields_array_for_activation();
988 1011
989 1012 // Get Value of first element - array of default or imported OLD data, because need only array of values without key - name of options for wp_options table
990 - $init_fields_values_temp = array_values( $init_fields_values ); //FixIn: 7.0.1.32
1013 + $init_fields_values_temp = array_values( $init_fields_values ); // FixIn: 7.0.1.32.
991 1014 $init_fields_values = array_shift( $init_fields_values_temp );
992 1015
993 1016
994 1017 $mail_api = new WPBC_Emails_API_Trash( WPBC_EMAIL_TRASH_ID, $init_fields_values );
@@ -997,11 +1020,11 @@
997 1020
998 1021 if ( $mail_api->fields_values['enabled'] == 'Off' ) return false; // Email template deactivated - exit.
999 1022
1000 1023
1001 - $replace = wpbc__get_replace_shortcodes__email_trash( $booking_id, $bktype, $formdata );
1002 - $replace[ 'denyreason' ] = $trashreason; //FixIn: 7.0.1.1
1003 -
1024 + $replace = wpbc__get_replace_shortcodes__email_trash( $booking_id, $bktype, $formdata );
1025 + $replace['denyreason'] = $trashreason; // FixIn: 7.0.1.1.
1026 + $replace['reason'] = $trashreason;
1004 1027 // Replace shortcodes with custom URL parameter, like: 'visitorbookingediturl', 'visitorbookingcancelurl', 'visitorbookingpayurl'
1005 1028 foreach ( array( 'visitorbookingediturl', 'visitorbookingcancelurl', 'visitorbookingpayurl' , 'visitorbookingslisting') as $url_shortcode ) { //FixIn: 7.0.1.8 //FixIn: 8.1.3.5.1
1006 1029
1007 1030 // Loop to search if we are having several such shortcodes in our $mail_api->fields_values['content'] (For example, if we have several languges ).
@@ -1014,15 +1037,15 @@
1014 1037 $pos = $shortcode_params['end'];
1015 1038
1016 1039 $exist_replace = substr( $mail_api->fields_values['content'], $shortcode_params['start'], ( $shortcode_params['end'] - $shortcode_params['start'] ) );
1017 1040
1018 - $new_replace = $url_shortcode . rand(1000,9000);
1041 + $new_replace = $url_shortcode . wp_rand(1000,9000);
1019 1042
1020 1043 $pos = $shortcode_params['start'] + strlen( $new_replace ); //FixIn: 9.7.3.5.1
1021 1044 $mail_api->fields_values['content'] = str_replace( $exist_replace, $new_replace ,$mail_api->fields_values['content'] );
1022 1045
1023 1046 $replace[ $new_replace ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '['.$exist_replace.']', $booking_id );
1024 - } else if ( //FixIn: 8.1.1.8
1047 + } else if ( // FixIn: 8.1.1.8.
1025 1048 ( ! empty( $shortcode_params ) )
1026 1049 && ( isset( $shortcode_params['end'] ) )
1027 1050 && ( $shortcode_params['end'] < strlen( $mail_api->fields_values['content'] ) )
1028 1051 ) {
@@ -1030,14 +1053,14 @@
1030 1053 } else {
1031 1054 $shortcode_params = false; //FixIn: 7.0.1.58
1032 1055 }
1033 1056
1034 - } while ( ! empty( $shortcode_params ) ); //FixIn: 7.0.1.52
1057 + } while ( ! empty( $shortcode_params ) ); // FixIn: 7.0.1.52.
1035 1058
1036 1059 }
1037 1060
1038 1061 $mail_api->set_replace( $replace );
1039 - $mail_api->fields_values['from_name'] = $mail_api->replace_shortcodes( $mail_api->fields_values['from_name'] ); //FixIn: 7.0.1.29
1062 + $mail_api->fields_values['from_name'] = $mail_api->replace_shortcodes( $mail_api->fields_values['from_name'] ); // FixIn: 7.0.1.29.
1040 1063
1041 1064
1042 1065 $to = ( isset( $replace['email'] ) ) ? $replace['email'] : ''; // Get To field
1043 1066
@@ -1044,9 +1067,9 @@
1044 1067 if ( ! empty( $replace['email'] ) ) {
1045 1068 $to = wpbc_email_prepand_person_name( $replace['email'], $replace );
1046 1069 }
1047 1070
1048 - $to = wpbc_check_for_several_emails_in_form( $to, $formdata, $bktype ); //FixIn: 6.0.1.9
1071 + $to = wpbc_check_for_several_emails_in_form( $to, $formdata, $bktype ); // FixIn: 6.0.1.9.
1049 1072
1050 1073 $to = str_replace( ';', ',', $to );
1051 1074
1052 1075 if ( wpbc_is_not_blank_email( $to, $replace['content'] ) ) {