PluginProbe
Booking Calendar / 11.9
Booking Calendar v11.9
11.9 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 All 205 releases
← All changes | core/admin/page-email-new-visitor.php +71 -58 10.1.3 → 11.9 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 " >
@@ -310,9 +310,10 @@
310 310 , 'only_field' => true
311 311 );
312 312 $this->fields['subject_after'] = array( 'type' => 'pure_html', 'group' => 'general_content',
313 313 'html' => '<p style="text-align: right;font-size:12px;">'
314 - . sprintf(__('Type your email %ssubject%s for the booking confirmation message.' ,'booking'),'<b>','</b>') . ' ' . __('Required', 'booking')
314 + /* translators: 1: ... */
315 + . sprintf( __( 'Type your email %1$ssubject%2$s for the booking confirmation message.', 'booking' ),'<b>','</b>') . ' ' . __('Required', 'booking')
315 316 . '.</p>' . '</td></tr>' );
316 317
317 318 $blg_title = get_option( 'blogname' );
318 319 $blg_title = str_replace( array( '"', "'" ), '', $blg_title );
@@ -317,11 +318,13 @@
317 318 $blg_title = get_option( 'blogname' );
318 319 $blg_title = str_replace( array( '"', "'" ), '', $blg_title );
319 320
320 321 if ( class_exists( 'wpdev_bk_personal' ) ) {
321 - $email_content = sprintf( __( 'Your reservation %s for: %s is processing now! We will send confirmation by email. %sYou can edit this booking at this page: %s Thank you, %s', 'booking' ), '[bookingtype]', '[dates]', '<br/><br/>[content]<br/><br/>', '[visitorbookingediturl]<br/><br/>', $blg_title . '<br/>[siteurl]' );
322 + /* translators: 1: ... */
323 + $email_content = sprintf( __( 'Your reservation %1$s for: %2$s is processing now! We will send confirmation by email. %3$sYou can edit this booking at this page: %4$s Thank you, %5$s', 'booking' ), '[bookingtype]', '[dates]', '<br/><br/>[content]<br/><br/>', '[visitorbookingediturl]<br/><br/>', $blg_title . '<br/>[siteurl]' );
322 324 } else {
323 - $email_content = sprintf( __( 'Your reservation %s for: %s is processing now! We will send confirmation by email. %s Thank you, %s', 'booking' ), '[bookingtype]', '[dates]', '<br/><br/>[content]<br/><br/>', $blg_title . '<br/>[siteurl]' );
325 + /* translators: 1: ... */
326 + $email_content = sprintf( __( 'Your reservation %1$s for: %2$s is processing now! We will send confirmation by email. %3$s Thank you, %4$s', 'booking' ), '[bookingtype]', '[dates]', '<br/><br/>[content]<br/><br/>', $blg_title . '<br/>[siteurl]' );
324 327 }
325 328 $this->fields['content_before'] = array(
326 329 'type' => 'pure_html',
327 330 'group' => 'general_content',
@@ -392,9 +395,10 @@
392 395 );
393 396
394 397 $this->fields['template_file_help'] = array(
395 398 'type' => 'help'
396 - , 'value' => array( sprintf( __('You can override this email template in this folder %s', 'booking')
399 + /* translators: 1: ... */
400 + , 'value' => array( sprintf( __( 'You can override this email template in this folder %s', 'booking')
397 401 , '<code>' . realpath( dirname(__FILE__) . '/../any/emails_tpl/' ) . '</code>' )
398 402 )
399 403 , 'cols' => 2
400 404 , 'group' => 'style'
@@ -487,9 +491,10 @@
487 491 //, 'visitorbookingcancelurl'
488 492 //, 'visitorbookingslisting' //FixIn: 8.1.3.5.1
489 493 , 'visitorbookingpayurl'
490 494 );
491 - $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; ');
495 + /* translators: 1: ... */
496 + $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; ');
492 497
493 498 $help_fields = wpbc_get_email_help_shortcodes( $skip_shortcodes, $email_example );
494 499
495 500 foreach ( $help_fields as $help_fields_key => $help_fields_value ) {
@@ -555,9 +560,9 @@
555 560
556 561 $subtabs['new-visitor'] = array(
557 562 'type' => 'subtab' // Required| Possible values: 'subtab' | 'separator' | 'button' | 'goto-link' | 'html'
558 563 , 'title' => __('New Booking' ,'booking') . ' (' . __('visitor' ,'booking') . ')' // Title of TAB //__('New for Visitor' ,'booking') // Title of TAB
559 - , 'page_title' => __('Emails Settings', 'booking') // Title of Page
564 + , 'page_title' => __('Emails Settings', 'booking') . ' - <span>' . esc_html(__('New Booking' ,'booking') . ' - ' . ucfirst( __('visitor' ,'booking') ) ) . '</span>' // Title of Page.
560 565 , 'hint' => __('Customization of email template, which is sending to Visitor after new booking' ,'booking') // Hint
561 566 , 'link' => '' // link
562 567 , 'position' => '' // 'left' || 'right' || ''
563 568 , 'css_classes' => '' // CSS class(es)
@@ -562,14 +567,13 @@
562 567 , 'position' => '' // 'left' || 'right' || ''
563 568 , 'css_classes' => '' // CSS class(es)
564 569 //, 'icon' => 'http://.../icon.png' // Icon - link to the real PNG img
565 570 //, 'font_icon' => 'wpbc_icn_mail_outline' // CSS definition of Font Icon
566 - , 'header_font_icon' => 'wpbc_icn_mail_outline' // CSS definition of Font Icon //FixIn: 9.5.5.3
567 - , 'default' => false // Is this sub tab activated by default or not: true || false.
571 + , 'default' => false // Is this sub tab activated by default or not: true || false.
568 572 , 'disabled' => false // Is this sub tab deactivated: true || false.
569 573 , 'checkbox' => false // or definition array for specific checkbox: array( 'checked' => true, 'name' => 'feature1_active_status' ) //, 'checkbox' => array( 'checked' => $is_checked, 'name' => 'enabled_active_status' )
570 574 , 'content' => 'content' // Function to load as conten of this TAB
571 - , 'is_use_left_navigation' => true
575 + , 'font_icon' => 'wpbc-bi-envelope-plus 0wpbc_icn_mark_email_unread'
572 576 , 'show_checked_icon' => true
573 577 , 'checked_data' => WPBC_EMAIL_NEW_ADMIN_PREFIX . WPBC_EMAIL_NEW_VISITOR_ID // This is where we get content
574 578 );
575 579
@@ -617,13 +621,13 @@
617 621 <div class="clear"></div>
618 622
619 623 <span class="metabox-holder">
620 624
621 - <form name="<?php echo $submit_form_name; ?>" id="<?php echo $submit_form_name; ?>" action="" method="post" autocomplete="off">
625 + <form name="<?php echo esc_attr( $submit_form_name ); ?>" id="<?php echo esc_attr( $submit_form_name ); ?>" action="" method="post" autocomplete="off">
622 626 <?php
623 627 // N o n c e field, and key for checking S u b m i t
624 628 wp_nonce_field( 'wpbc_settings_page_' . $submit_form_name );
625 - ?><input type="hidden" name="is_form_sbmitted_<?php echo $submit_form_name; ?>" id="is_form_sbmitted_<?php echo $submit_form_name; ?>" value="1" /><?php
629 + ?><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" /><?php
626 630
627 631 ?><div class="clear"></div><?php
628 632
629 633 wpbc_email_troubleshooting_help_notice();
@@ -706,13 +710,13 @@
706 710
707 711 $init_fields_values = wpbc_import6_email__new_visitor__get_fields_array_for_activation();
708 712
709 713 // 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
710 - $init_fields_values_temp = array_values( $init_fields_values ); //FixIn: 7.0.1.32
714 + $init_fields_values_temp = array_values( $init_fields_values ); // FixIn: 7.0.1.32.
711 715 $init_fields_values = array_shift( $init_fields_values_temp );
712 716
713 717
714 - $this->mail_api( WPBC_EMAIL_NEW_VISITOR_ID, $init_fields_values ); //FixIn: 9.8.2.1
718 + $this->mail_api( WPBC_EMAIL_NEW_VISITOR_ID, $init_fields_values ); // FixIn: 9.8.2.1.
715 719
716 720
717 721 // -------------------------------------------------------------------------------------------------------------
718 722 // Maybe Update Data
@@ -721,8 +725,9 @@
721 725 $submit_form_name = 'wpbc_emails_template'; // Define form name
722 726
723 727 $this->mail_api()->validated_form_id = $submit_form_name; // Define ID of Form for ability to validate fields before submit.
724 728
729 + // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
725 730 if ( isset( $_POST['is_form_sbmitted_'. $submit_form_name ] ) ) {
726 731
727 732 // Nonce checking {Return false if invalid, 1 if generated between, 0-12 hours ago, 2 if generated between 12-24 hours ago. }
728 733 $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
@@ -819,10 +824,11 @@
819 824 $replace = array();
820 825
821 826 // Resources ///////////////////////////////////////////////////////////////
822 827 $bk_title = wpbc_get_resource_title( $bktype );
828 + $parent_resource_title = wpbc_get_parent_resource_title( $bktype ); // FixIn: 10.9.2.4.
823 829
824 - //FixIn: 9.6.3.10
830 + // FixIn: 9.6.3.10.
825 831 if ( class_exists( 'wpdev_bk_biz_l' ) ) {
826 832 $booking_data_arr = wpbc_api_get_booking_by_id( $booking_id );
827 833
828 834 $child_resource_id = (int) $booking_data_arr['booking_type'];
@@ -829,58 +835,66 @@
829 835
830 836 $bk_title = wpbc_get_resource_title( $child_resource_id );
831 837 }
832 838
833 -
834 839 // Dates ///////////////////////////////////////////////////////////////////
835 840 $my_dates4emeil = wpbc_db__get_sql_dates__in_booking__as_str( $booking_id );
836 841
837 -//debuge($my_dates4emeil);
838 - if ( get_bk_option( 'booking_date_view_type' ) == 'short' )
839 - $my_dates_4_send = wpbc_get_dates_short_format( $my_dates4emeil );
840 - else
841 - $my_dates_4_send = wpbc_get_dates_comma_string_localized( $my_dates4emeil );
842 -//debuge($my_dates_4_send);
843 -//die;
844 -
845 - $my_dates4emeil_check_in_out = explode(',', $my_dates4emeil );
842 + $my_dates_4_send = ( 'short' === get_bk_option( 'booking_date_view_type' ) )
843 + ? wpbc_get_dates_short_format( $my_dates4emeil )
844 + : wpbc_get_dates_comma_string_localized( $my_dates4emeil );
845 + $my_dates4emeil_check_in_out = explode( ',', $my_dates4emeil );
846 846
847 - $my_check_in_date = wpbc_get_dates_comma_string_localized( $my_dates4emeil_check_in_out[0] );
848 - $my_check_out_date = wpbc_get_dates_comma_string_localized( $my_dates4emeil_check_in_out[ count( $my_dates4emeil_check_in_out ) - 1 ] );
849 - //FixIn: 8.7.2.5
850 - $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' ) );
851 - $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' ) );
847 + $my_check_in_date = wpbc_get_dates_comma_string_localized( $my_dates4emeil_check_in_out[0] );
848 + $my_check_out_date = wpbc_get_dates_comma_string_localized( $my_dates4emeil_check_in_out[ count( $my_dates4emeil_check_in_out ) - 1 ] );
849 + $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.
850 + $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' ) );
851 + $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.
852 + $my_check_out_minus1day = 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: 7.2.1.6.
852 853
853 - $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
854 - $my_check_out_minus1day = 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: 7.2.1.6
854 + // FixIn: 10.1.5.6.
855 + $dates_only_arr = wpbc_get_only_dates__from_dates_ymd_his_csv__as_arr( $my_dates4emeil ); // -> '2023-10-09, 2023-10-09'
856 + $dates_only_str = implode( ',', $dates_only_arr );
857 + $dates_only_str_formatted = ( 'short' === get_bk_option( 'booking_date_view_type' ) )
858 + ? wpbc_get_dates_short_format( $dates_only_str )
859 + : wpbc_get_dates_comma_string_localized( $dates_only_str );
855 860
856 861 // Cost ////////////////////////////////////////////////////////////////////
857 - $booking_cost_digits_only = apply_bk_filter( 'get_booking_cost_from_db', '', $booking_id ); //FixIn: 9.2.3.1
862 + $booking_cost_digits_only = apply_bk_filter( 'get_booking_cost_from_db', '', $booking_id ); // FixIn: 9.2.3.1.
858 863 $booking_cost = wpbc_get_cost_with_currency_for_user( $booking_cost_digits_only );
859 864
860 -
861 865 // Other ///////////////////////////////////////////////////////////////////
862 866 $replace[ 'booking_id' ] = $booking_id;
863 867 $replace[ 'id' ] = $replace[ 'booking_id' ];
864 868 $replace[ 'dates' ] = $my_dates_4_send;
869 + $replace[ 'only_dates' ] = $dates_only_str_formatted;
870 + $replace[ 'dates_only' ] = $dates_only_str_formatted;
865 871 $replace[ 'check_in_date' ] = $my_check_in_date;
866 872 $replace[ 'check_out_date' ] = $my_check_out_date;
867 - //FixIn: 8.7.2.5
873 + // FixIn: 8.7.2.5.
868 874 $replace[ 'check_in_only_date' ] = $my_check_in_onlydate;
869 875 $replace[ 'check_out_only_date' ] = $my_check_out_onlydate;
870 876
871 - $replace[ 'check_out_plus1day'] = $my_check_out_plus1day; //FixIn: 6.0.1.11
877 + $replace[ 'check_out_plus1day'] = $my_check_out_plus1day; // FixIn: 6.0.1.11.
872 878
873 - $replace[ 'check_out_minus1day'] = $my_check_out_minus1day; //FixIn: 7.2.1.6
874 - $replace[ 'dates_count' ] = count( $my_dates4emeil_check_in_out );
879 + $replace[ 'check_out_minus1day'] = $my_check_out_minus1day; // FixIn: 7.2.1.6.
880 +
881 + $replace['dates_count'] = count( $my_dates4emeil_check_in_out );
882 + $replace['days_count'] = intval( $replace['dates_count'] ); // FixIn: 10.15.1.3.
883 + $replace['nights_count'] = ( $replace['days_count'] > 1 ) ? intval( $replace['days_count'] - 1 ) : 1;
884 + $replace['days_count_plus1day'] = intval( $replace['days_count'] + 1 );
885 +
875 886 $replace['cost'] = $booking_cost;
876 887 $replace['cost_digits_only'] = $booking_cost_digits_only;
877 - $replace[ 'siteurl' ] = htmlspecialchars_decode( '<a href="' . home_url() . '">' . home_url() . '</a>' );
888 + $replace[ 'siteurl' ] = htmlspecialchars_decode( '<a href="' . esc_url( home_url() ) . '">' . home_url() . '</a>' );
878 889 $replace[ 'resource_title'] = wpbc_lang( $bk_title );
890 + $replace[ 'parent_resource_title'] = wpbc_lang( $parent_resource_title ); // FixIn: 10.9.2.4.
879 891 $replace[ 'bookingtype' ] = $replace[ 'resource_title'];
880 - $replace[ 'remote_ip' ] = wpbc_get_user_ip(); //FixIn:7.1.2.4 // The IP address from which the user is viewing the current page.
881 - $replace[ 'user_agent' ] = $_SERVER['HTTP_USER_AGENT']; // Contents of the User-Agent: header from the current request, if there is one.
882 - $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
892 + $replace[ 'remote_ip' ] = wpbc_get_user_ip(); //FixIn:7.1.2.4 // The IP address from which the user is viewing the current page.
893 + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated, WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
894 + $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.
895 + $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 */
896 + $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
883 897 $replace[ 'current_date' ] = date_i18n( get_bk_option( 'booking_date_format' ) );
884 898 $replace[ 'current_time' ] = date_i18n( get_bk_option( 'booking_time_format' ) );
885 899
886 900 // Form Fields /////////////////////////////////////////////////////////////
@@ -895,10 +909,10 @@
895 909
896 910 // Links ///////////////////////////////////////////////////////////////////
897 911 $replace[ 'moderatelink' ] = htmlspecialchars_decode(
898 912 // '<a href="' .
899 - esc_url( wpbc_get_bookings_url() . '&view_mode=vm_listing&tab=actions&wh_booking_id=' . $booking_id )
900 - // . '">' . __('here', 'booking') . '</a>'
913 + esc_url( wpbc_get_bookings_url() . '&tab=vm_booking_listing&wh_booking_id=' . $booking_id )
914 + // . '">' . esc_html__('here', 'booking') . '</a>'
901 915 );
902 916 $replace[ 'visitorbookingediturl' ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '[visitorbookingediturl]', $booking_id );
903 917 $replace[ 'visitorbookingslisting' ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '[visitorbookingslisting]', $booking_id ); //FixIn: 8.1.3.5.1
904 918 $replace[ 'visitorbookingcancelurl' ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '[visitorbookingcancelurl]', $booking_id );
@@ -904,15 +918,15 @@
904 918 $replace[ 'visitorbookingcancelurl' ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '[visitorbookingcancelurl]', $booking_id );
905 919 $replace[ 'visitorbookingpayurl' ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '[visitorbookingpayurl]', $booking_id );
906 920 $replace[ 'bookinghash' ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '[bookinghash]', $booking_id );
907 921
908 - //FixIn: 8.8.2.4
922 + // FixIn: 8.8.2.4.
909 923 $booking_data = array( 'form_data' => $booking_form_show_array );
910 924 // $replace[ 'add_to_google_cal_url' ] = htmlspecialchars_decode( esc_url( wpbc_btn_add_booking_to_google_calendar( $booking_data , array( 'is_only_url' => true ), false ) ) );
911 - //FixIn: 9.6.3.8
925 + // FixIn: 9.6.3.8.
912 926 $google_calendar_link = wpbc_booking_do_action__get_google_calendar_link( array(
913 927 'form_data' => $booking_form_show_array['_all_fields_'],
914 - 'form_show' => $booking_form_show_array['content'], //strip_tags( $parsed_form_show ),
928 + 'form_show' => $booking_form_show_array['content'], //wp_strip_all_tags( $parsed_form_show ),
915 929 'dates_short' => array(
916 930 $my_dates4emeil_check_in_out[0]
917 931 , '-'
918 932 , $my_dates4emeil_check_in_out[ count( $my_dates4emeil_check_in_out ) - 1 ]
@@ -918,14 +932,14 @@
918 932 , $my_dates4emeil_check_in_out[ count( $my_dates4emeil_check_in_out ) - 1 ]
919 933 )
920 934 ) );
921 935 $replace['add_to_google_cal_url'] = htmlspecialchars_decode( esc_url( $google_calendar_link ) );
922 - $replace['add_to_google_cal_button'] = '<a href="' . esc_attr( $replace['add_to_google_cal_url'] ) . '" target="_blank" rel="nofollow">Add to Google Calendar</a>';
936 + $replace['add_to_google_cal_button'] = '<a href="' . esc_attr( $replace['add_to_google_cal_url'] ) . '" target="_blank" rel="nofollow">' . esc_attr__( 'Add to Google Calendar', 'booking' ) . '</a>';
923 937
924 938
925 - ////////////////////////////////////////////////////////////////////////////
939 + // -----------------------------------------------------------------------------------------------------------------
926 940 // Get additional replace paramaters to the email shortcodes
927 - $replace = apply_filters( 'wpbc_replace_params_for_booking', $replace, $booking_id, $bktype, $formdata ); //FixIn: 8.0.1.7
941 + $replace = apply_filters( 'wpbc_replace_params_for_booking', $replace, $booking_id, $bktype, $formdata ); // FixIn: 8.0.1.7.
928 942
929 943
930 944 return $replace;
931 945
@@ -962,15 +976,14 @@
962 976
963 977 $init_fields_values = wpbc_import6_email__new_visitor__get_fields_array_for_activation();
964 978
965 979 // 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
966 - $init_fields_values_temp = array_values( $init_fields_values ); //FixIn: 7.0.1.32
980 + $init_fields_values_temp = array_values( $init_fields_values ); // FixIn: 7.0.1.32.
967 981 $init_fields_values = array_shift( $init_fields_values_temp );
968 982
969 983 $mail_api = new WPBC_Emails_API_NewVisitor( WPBC_EMAIL_NEW_VISITOR_ID, $init_fields_values );
970 984
971 - ////////////////////////////////////////////////////////////////////////////
972 -
985 + // -----------------------------------------------------------------------------------------------------------------
973 986 if ( $mail_api->fields_values['enabled'] == 'Off' ) return false; // Email template deactivated - exit.
974 987
975 988
976 989 $replace = wpbc__get_replace_shortcodes__email_new_visitor( $booking_id, $bktype, $formdata );
@@ -988,15 +1001,15 @@
988 1001 $pos = $shortcode_params['end'];
989 1002
990 1003 $exist_replace = substr( $mail_api->fields_values['content'], $shortcode_params['start'], ( $shortcode_params['end'] - $shortcode_params['start'] ) );
991 1004
992 - $new_replace = $url_shortcode . rand(1000,9000);
1005 + $new_replace = $url_shortcode . wp_rand(1000,9000);
993 1006
994 1007 $pos = $shortcode_params['start'] + strlen( $new_replace ); //FixIn: 9.7.3.5.1
995 1008 $mail_api->fields_values['content'] = str_replace( $exist_replace, $new_replace ,$mail_api->fields_values['content'] );
996 1009
997 1010 $replace[ $new_replace ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '['.$exist_replace.']', $booking_id );
998 - } else if ( //FixIn: 8.1.1.8
1011 + } else if ( // FixIn: 8.1.1.8.
999 1012 ( ! empty( $shortcode_params ) )
1000 1013 && ( isset( $shortcode_params['end'] ) )
1001 1014 && ( $shortcode_params['end'] < strlen( $mail_api->fields_values['content'] ) )
1002 1015 ) {
@@ -1004,13 +1017,13 @@
1004 1017 } else {
1005 1018
1006 1019 $shortcode_params = false; //FixIn: 7.0.1.58
1007 1020 }
1008 - } while ( ! empty( $shortcode_params ) ); //FixIn: 7.0.1.52
1021 + } while ( ! empty( $shortcode_params ) ); // FixIn: 7.0.1.52.
1009 1022 }
1010 1023
1011 1024 $mail_api->set_replace( $replace );
1012 - $mail_api->fields_values['from_name'] = $mail_api->replace_shortcodes( $mail_api->fields_values['from_name'] ); //FixIn: 7.0.1.29
1025 + $mail_api->fields_values['from_name'] = $mail_api->replace_shortcodes( $mail_api->fields_values['from_name'] ); // FixIn: 7.0.1.29.
1013 1026
1014 1027
1015 1028 $to = ( isset( $replace['email'] ) ) ? $replace['email'] : ''; // Get To field
1016 1029
@@ -1017,9 +1030,9 @@
1017 1030 if ( ! empty( $replace['email'] ) ) {
1018 1031 $to = wpbc_email_prepand_person_name( $replace['email'], $replace );
1019 1032 }
1020 1033
1021 - $to = wpbc_check_for_several_emails_in_form( $to, $formdata, $bktype ); //FixIn: 6.0.1.9
1034 + $to = wpbc_check_for_several_emails_in_form( $to, $formdata, $bktype ); // FixIn: 6.0.1.9.
1022 1035
1023 1036 $to = str_replace( ';', ',', $to );
1024 1037
1025 1038 if ( wpbc_is_not_blank_email( $to, $replace['content'] ) ) {