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-deny.php +82 -58 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 " >
@@ -195,9 +195,9 @@
195 195 );
196 196
197 197
198 198
199 -//FixIn: 8.1.2.17
199 +// FixIn: 8.1.2.17.
200 200 $this->fields['to_html_prefix'] = array(
201 201 'type' => 'pure_html'
202 202 , 'group' => 'general'
203 203 , 'html' => '<tr valign="top" class="wpbc_tr_copy_to_admin_to">
@@ -329,15 +329,17 @@
329 329 , 'only_field' => true
330 330 );
331 331 $this->fields['subject_after'] = array( 'type' => 'pure_html', 'group' => 'general_content',
332 332 'html' => '<p style="text-align: right;font-size:12px;">'
333 - . sprintf(__('Type your email %ssubject%s for the booking confirmation message.' ,'booking'),'<b>','</b>') . ' ' . __('Required', 'booking')
333 + /* translators: 1: ... */
334 + . sprintf( __( 'Type your email %1$ssubject%2$s for the booking confirmation message.', 'booking' ),'<b>','</b>') . ' ' . __('Required', 'booking')
334 335 . '.</p>' . '</td></tr>' );
335 336
336 337 $blg_title = get_option( 'blogname' );
337 338 $blg_title = str_replace( array( '"', "'" ), '', $blg_title );
338 339
339 - $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]' );
340 + /* translators: 1: ... */
341 + $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]' );
340 342
341 343 $this->fields['content_before'] = array(
342 344 'type' => 'pure_html',
343 345 'group' => 'general_content',
@@ -408,9 +410,10 @@
408 410 );
409 411
410 412 $this->fields['template_file_help'] = array(
411 413 'type' => 'help'
412 - , 'value' => array( sprintf( __('You can override this email template in this folder %s', 'booking')
414 + /* translators: 1: ... */
415 + , 'value' => array( sprintf( __( 'You can override this email template in this folder %s', 'booking')
413 416 , '<code>' . realpath( dirname(__FILE__) . '/../any/emails_tpl/' ) . '</code>' )
414 417 )
415 418 , 'cols' => 2
416 419 , 'group' => 'style'
@@ -503,9 +506,10 @@
503 506 //, 'visitorbookingslisting' //FixIn: 8.1.3.5.1
504 507 , 'visitorbookingcancelurl'
505 508 , 'visitorbookingpayurl'
506 509 );
507 - $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; ');
510 + /* translators: 1: ... */
511 + $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; ');
508 512
509 513 $help_fields = wpbc_get_email_help_shortcodes( $skip_shortcodes, $email_example );
510 514
511 515 foreach ( $help_fields as $help_fields_key => $help_fields_value ) {
@@ -575,10 +579,10 @@
575 579
576 580
577 581 $subtabs['deny'] = array(
578 582 'type' => 'subtab' // Required| Possible values: 'subtab' | 'separator' | 'button' | 'goto-link' | 'html'
579 - , 'title' => '<span>' . __( 'Pending', 'booking' ) . $sufix . '</span>' // Title of TAB
580 - , 'page_title' => __('Emails Settings', 'booking') // Title of Page
583 + , 'title' => '<span>' . esc_html__( 'Pending', 'booking' ) . $sufix . '</span>' // Title of TAB
584 + , 'page_title' => __('Emails Settings', 'booking') . ' - <span>' . esc_html__( 'Pending', 'booking' ) . $sufix . '</span>' // Title of Page.
581 585 , 'hint' => __('Customization of email template, which is sent to Visitor, when booking status is set to Pending' ,'booking') //FixIn: 8.1.2.17.1
582 586 , 'link' => '' // link
583 587 , 'position' => '' // 'left' || 'right' || ''
584 588 , 'css_classes' => 'wpbc_navigation_top_border' // CSS class(es)
@@ -583,14 +587,13 @@
583 587 , 'position' => '' // 'left' || 'right' || ''
584 588 , 'css_classes' => 'wpbc_navigation_top_border' // CSS class(es)
585 589 //, 'icon' => 'http://.../icon.png' // Icon - link to the real PNG img
586 590 //, 'font_icon' => 'wpbc_icn_mail_outline' // CSS definition of Font Icon
587 - , 'header_font_icon' => 'wpbc_icn_mail_outline' // CSS definition of Font Icon //FixIn: 9.6.1.4
588 - , 'default' => false // Is this sub tab activated by default or not: true || false.
591 + , 'default' => false // Is this sub tab activated by default or not: true || false.
589 592 , 'disabled' => false // Is this sub tab deactivated: true || false.
590 593 , 'checkbox' => false // or definition array for specific checkbox: array( 'checked' => true, 'name' => 'feature1_active_status' ) //, 'checkbox' => array( 'checked' => $is_checked, 'name' => 'enabled_active_status' )
591 594 , 'content' => 'content' // Function to load as conten of this TAB
592 - , 'is_use_left_navigation' => true
595 + , 'font_icon' => 'wpbc_icn_hourglass_empty'
593 596 , 'show_checked_icon' => true
594 597 , 'checked_data' => WPBC_EMAIL_NEW_ADMIN_PREFIX . WPBC_EMAIL_DENY_ID // This is where we get content
595 598 );
596 599
@@ -638,13 +641,13 @@
638 641 <div class="clear"></div>
639 642
640 643 <span class="metabox-holder">
641 644
642 - <form name="<?php echo $submit_form_name; ?>" id="<?php echo $submit_form_name; ?>" action="" method="post" autocomplete="off">
645 + <form name="<?php echo esc_attr( $submit_form_name ); ?>" id="<?php echo esc_attr( $submit_form_name ); ?>" action="" method="post" autocomplete="off">
643 646 <?php
644 647 // N o n c e field, and key for checking S u b m i t
645 648 wp_nonce_field( 'wpbc_settings_page_' . $submit_form_name );
646 - ?><input type="hidden" name="is_form_sbmitted_<?php echo $submit_form_name; ?>" id="is_form_sbmitted_<?php echo $submit_form_name; ?>" value="1" />
649 + ?><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" />
647 650
648 651 <div class="clear"></div>
649 652 <?php
650 653
@@ -728,9 +731,9 @@
728 731
729 732 $init_fields_values = wpbc_import6_email__deny__get_fields_array_for_activation();
730 733
731 734 // 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
732 - $init_fields_values_temp = array_values( $init_fields_values ); //FixIn: 7.0.1.32
735 + $init_fields_values_temp = array_values( $init_fields_values ); // FixIn: 7.0.1.32.
733 736 $init_fields_values = array_shift( $init_fields_values_temp );
734 737
735 738
736 739 $this->mail_api( WPBC_EMAIL_DENY_ID, $init_fields_values );
@@ -743,8 +746,9 @@
743 746 $submit_form_name = 'wpbc_emails_template'; // Define form name
744 747
745 748 $this->mail_api()->validated_form_id = $submit_form_name; // Define ID of Form for ability to validate fields before submit.
746 749
750 + // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
747 751 if ( isset( $_POST['is_form_sbmitted_'. $submit_form_name ] ) ) {
748 752
749 753 // Nonce checking {Return false if invalid, 1 if generated between, 0-12 hours ago, 2 if generated between 12-24 hours ago. }
750 754 $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
@@ -816,9 +820,9 @@
816 820 $js_script .= " jQuery('#deny_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>')";
817 821 $js_script .= " }";
818 822 $js_script .= " }); ";
819 823
820 - //FixIn: 8.1.2.17
824 + // FixIn: 8.1.2.17.
821 825 $js_script .= " jQuery('#deny_copy_to_admin').on( 'change', function(){ ";
822 826 $js_script .= " if ( jQuery('#deny_copy_to_admin').is(':checked') ) {";
823 827 $js_script .= " jQuery('.wpbc_tr_copy_to_admin_to').show();";
824 828 $js_script .= " } else { ";
@@ -859,49 +863,65 @@
859 863 $replace = array();
860 864
861 865 // Resources ///////////////////////////////////////////////////////////////
862 866 $bk_title = wpbc_get_resource_title( $bktype );
867 + $parent_resource_title = wpbc_get_parent_resource_title( $bktype ); // FixIn: 10.9.2.4.
863 868
864 869 // Dates ///////////////////////////////////////////////////////////////////
865 870 $my_dates4emeil = wpbc_db__get_sql_dates__in_booking__as_str( $booking_id );
866 - if ( get_bk_option( 'booking_date_view_type' ) == 'short' )
867 - $my_dates_4_send = wpbc_get_dates_short_format( $my_dates4emeil );
868 - else
869 - $my_dates_4_send = wpbc_get_dates_comma_string_localized( $my_dates4emeil );
870 -
871 - $my_dates4emeil_check_in_out = explode(',', $my_dates4emeil );
872 871
873 - $my_check_in_date = wpbc_get_dates_comma_string_localized( $my_dates4emeil_check_in_out[0] );
874 - $my_check_out_date = wpbc_get_dates_comma_string_localized( $my_dates4emeil_check_in_out[ count( $my_dates4emeil_check_in_out ) - 1 ] );
875 - //FixIn: 8.7.2.5
876 - $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' ) );
877 - $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' ) );
872 + $my_dates_4_send = ( 'short' === get_bk_option( 'booking_date_view_type' ) )
873 + ? wpbc_get_dates_short_format( $my_dates4emeil )
874 + : wpbc_get_dates_comma_string_localized( $my_dates4emeil );
875 + $my_dates4emeil_check_in_out = explode( ',', $my_dates4emeil );
878 876
879 - $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
877 + $my_check_in_date = wpbc_get_dates_comma_string_localized( $my_dates4emeil_check_in_out[0] );
878 + $my_check_out_date = wpbc_get_dates_comma_string_localized( $my_dates4emeil_check_in_out[ count( $my_dates4emeil_check_in_out ) - 1 ] );
879 + $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.
880 + $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' ) );
881 + $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.
880 882
883 + // FixIn: 10.1.5.6.
884 + $dates_only_arr = wpbc_get_only_dates__from_dates_ymd_his_csv__as_arr( $my_dates4emeil ); // -> '2023-10-09, 2023-10-09'
885 + $dates_only_str = implode( ',', $dates_only_arr );
886 + $dates_only_str_formatted = ( 'short' === get_bk_option( 'booking_date_view_type' ) )
887 + ? wpbc_get_dates_short_format( $dates_only_str )
888 + : wpbc_get_dates_comma_string_localized( $dates_only_str );
889 +
881 890 // Cost ////////////////////////////////////////////////////////////////////
882 - $booking_cost_digits_only = apply_bk_filter( 'get_booking_cost_from_db', '', $booking_id ); //FixIn: 9.2.3.1
891 + $booking_cost_digits_only = apply_bk_filter( 'get_booking_cost_from_db', '', $booking_id ); // FixIn: 9.2.3.1.
883 892 $booking_cost = wpbc_get_cost_with_currency_for_user( $booking_cost_digits_only );
884 893 // Other ///////////////////////////////////////////////////////////////////
885 894 $replace[ 'booking_id' ] = $booking_id;
886 895 $replace[ 'id' ] = $replace[ 'booking_id' ];
887 896 $replace[ 'dates' ] = $my_dates_4_send;
897 + $replace[ 'only_dates' ] = $dates_only_str_formatted;
898 + $replace[ 'dates_only' ] = $dates_only_str_formatted;
888 899 $replace[ 'check_in_date' ] = $my_check_in_date;
889 900 $replace[ 'check_out_date' ] = $my_check_out_date;
890 - //FixIn: 8.7.2.5
901 + // FixIn: 8.7.2.5.
891 902 $replace[ 'check_in_only_date' ] = $my_check_in_onlydate;
892 903 $replace[ 'check_out_only_date' ] = $my_check_out_onlydate;
893 904
894 - $replace[ 'check_out_plus1day'] = $my_check_out_plus1day; //FixIn: 6.0.1.11
895 - $replace[ 'dates_count' ] = count( $my_dates4emeil_check_in_out );
905 + $replace[ 'check_out_plus1day'] = $my_check_out_plus1day; // FixIn: 6.0.1.11.
906 +
907 + $replace['dates_count'] = count( $my_dates4emeil_check_in_out );
908 + $replace['days_count'] = intval( $replace['dates_count'] ); // FixIn: 10.15.1.3.
909 + $replace['nights_count'] = ( $replace['days_count'] > 1 ) ? intval( $replace['days_count'] - 1 ) : 1;
910 + $replace['days_count_plus1day'] = intval( $replace['days_count'] + 1 );
911 +
912 +
896 913 $replace['cost'] = $booking_cost;
897 914 $replace['cost_digits_only'] = $booking_cost_digits_only;
898 - $replace[ 'siteurl' ] = htmlspecialchars_decode( '<a href="' . home_url() . '">' . home_url() . '</a>' );
915 + $replace[ 'siteurl' ] = htmlspecialchars_decode( '<a href="' . esc_url( home_url() ) . '">' . home_url() . '</a>' );
899 916 $replace[ 'resource_title'] = wpbc_lang( $bk_title );
917 + $replace[ 'parent_resource_title'] = wpbc_lang( $parent_resource_title ); // FixIn: 10.9.2.4.
900 918 $replace[ 'bookingtype' ] = $replace[ 'resource_title'];
901 - $replace[ 'remote_ip' ] = wpbc_get_user_ip(); //FixIn:7.1.2.4 // The IP address from which the user is viewing the current page.
902 - $replace[ 'user_agent' ] = $_SERVER['HTTP_USER_AGENT']; // Contents of the User-Agent: header from the current request, if there is one.
903 - $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
919 + $replace[ 'remote_ip' ] = wpbc_get_user_ip(); //FixIn:7.1.2.4 // The IP address from which the user is viewing the current page.
920 + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated, WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
921 + $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.
922 + $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 */
923 + $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
904 924 $replace[ 'current_date' ] = date_i18n( get_bk_option( 'booking_date_format' ) );
905 925 $replace[ 'current_time' ] = date_i18n( get_bk_option( 'booking_time_format' ) );
906 926
907 927 // Form Fields /////////////////////////////////////////////////////////////
@@ -916,10 +936,10 @@
916 936
917 937 // Links ///////////////////////////////////////////////////////////////////
918 938 $replace[ 'moderatelink' ] = htmlspecialchars_decode(
919 939 // '<a href="' .
920 - esc_url( wpbc_get_bookings_url() . '&view_mode=vm_listing&tab=actions&wh_booking_id=' . $booking_id )
921 - // . '">' . __('here', 'booking') . '</a>'
940 + esc_url( wpbc_get_bookings_url() . '&tab=vm_booking_listing&wh_booking_id=' . $booking_id )
941 + // . '">' . esc_html__('here', 'booking') . '</a>'
922 942 );
923 943 $replace[ 'visitorbookingediturl' ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '[visitorbookingediturl]', $booking_id );
924 944 $replace[ 'visitorbookingslisting' ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '[visitorbookingslisting]', $booking_id ); //FixIn: 8.1.3.5.1
925 945 $replace[ 'visitorbookingcancelurl' ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '[visitorbookingcancelurl]', $booking_id );
@@ -924,12 +944,12 @@
924 944 $replace[ 'visitorbookingslisting' ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '[visitorbookingslisting]', $booking_id ); //FixIn: 8.1.3.5.1
925 945 $replace[ 'visitorbookingcancelurl' ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '[visitorbookingcancelurl]', $booking_id );
926 946 $replace[ 'visitorbookingpayurl' ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '[visitorbookingpayurl]', $booking_id );
927 947 $replace[ 'bookinghash' ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '[bookinghash]', $booking_id );
928 - //FixIn: 9.6.3.8
948 + // FixIn: 9.6.3.8.
929 949 $google_calendar_link = wpbc_booking_do_action__get_google_calendar_link( array(
930 950 'form_data' => $booking_form_show_array['_all_fields_'],
931 - 'form_show' => $booking_form_show_array['content'], //strip_tags( $parsed_form_show ),
951 + 'form_show' => $booking_form_show_array['content'], //wp_strip_all_tags( $parsed_form_show ),
932 952 'dates_short' => array(
933 953 $my_dates4emeil_check_in_out[0]
934 954 , '-'
935 955 , $my_dates4emeil_check_in_out[ count( $my_dates4emeil_check_in_out ) - 1 ]
@@ -935,15 +955,15 @@
935 955 , $my_dates4emeil_check_in_out[ count( $my_dates4emeil_check_in_out ) - 1 ]
936 956 )
937 957 ) );
938 958 $replace['add_to_google_cal_url'] = htmlspecialchars_decode( esc_url( $google_calendar_link ) );
939 - $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>';
959 + $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>';
940 960
941 961
942 962
943 - ////////////////////////////////////////////////////////////////////////////
963 + // -----------------------------------------------------------------------------------------------------------------
944 964 // Get additional replace paramaters to the email shortcodes
945 - $replace = apply_filters( 'wpbc_replace_params_for_booking', $replace, $booking_id, $bktype, $formdata ); //FixIn: 8.0.1.7
965 + $replace = apply_filters( 'wpbc_replace_params_for_booking', $replace, $booking_id, $bktype, $formdata ); // FixIn: 8.0.1.7.
946 966
947 967
948 968 return $replace;
949 969
@@ -962,19 +982,23 @@
962 982 function wpbc_send_email_deny( $deny_id_str, $is_send_emeils, $denyreason = '' ) {
963 983
964 984 global $wpdb;
965 985 $sql = "SELECT * FROM {$wpdb->prefix}booking as bk WHERE bk.booking_id IN ({$deny_id_str})";
966 - $result = $wpdb->get_results( $sql );
986 + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter
987 + $result = $wpdb->get_results( $sql );
967 988
968 -
969 989 foreach ( $result as $res ) {
970 990
971 991 $booking_id = $res->booking_id;
972 992 $bktype = $res->booking_type;
973 993 $formdata = $res->form;
974 -
975 - $previous_active_user = apply_bk_filter( 'wpbc_mu_set_environment_for_owner_of_resource', -1, $bktype ); // MU
976 -
994 +
995 + $previous_active_user = apply_bk_filter( 'wpbc_mu_set_environment_for_owner_of_resource', - 1, $bktype ); // MU
996 +
997 + // Check for ability to change HASH during Decline (set pending) booking. //FixIn: 10.9.6.1.
998 + make_bk_action( 'booking_pending_send_email', $res, '' );
999 +
1000 +
977 1001 ////////////////////////////////////////////////////////////////////////
978 1002 // Load Data
979 1003 ////////////////////////////////////////////////////////////////////////
980 1004
@@ -992,9 +1016,9 @@
992 1016
993 1017 $init_fields_values = wpbc_import6_email__deny__get_fields_array_for_activation();
994 1018
995 1019 // 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
996 - $init_fields_values_temp = array_values( $init_fields_values ); //FixIn: 7.0.1.32
1020 + $init_fields_values_temp = array_values( $init_fields_values ); // FixIn: 7.0.1.32.
997 1021 $init_fields_values = array_shift( $init_fields_values_temp );
998 1022
999 1023
1000 1024 $mail_api = new WPBC_Emails_API_Deny( WPBC_EMAIL_DENY_ID, $init_fields_values );
@@ -1003,16 +1027,16 @@
1003 1027
1004 1028 if ( $mail_api->fields_values['enabled'] == 'Off' ) return false; // Email template deactivated - exit.
1005 1029
1006 1030
1007 - $replace = wpbc__get_replace_shortcodes__email_deny( $booking_id, $bktype, $formdata );
1008 - $replace[ 'denyreason' ] = $denyreason; //FixIn: 7.0.1.1
1009 -
1031 + $replace = wpbc__get_replace_shortcodes__email_deny( $booking_id, $bktype, $formdata );
1032 + $replace['denyreason'] = $denyreason; // FixIn: 7.0.1.1.
1033 + $replace['reason'] = $denyreason;
1010 1034 // Replace shortcodes with custom URL parameter, like: 'visitorbookingediturl', 'visitorbookingcancelurl', 'visitorbookingpayurl'
1011 1035 foreach ( array( 'visitorbookingediturl', 'visitorbookingcancelurl', 'visitorbookingpayurl' , 'visitorbookingslisting') as $url_shortcode ) { //FixIn: 7.0.1.8 //FixIn: 8.1.3.5.1
1012 1036
1013 1037 // 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 - $pos = 0; //FixIn: 7.0.1.52
1038 + $pos = 0; // FixIn: 7.0.1.52.
1015 1039 do {
1016 1040 $shortcode_params = wpbc_get_params_of_shortcode_in_string( $url_shortcode, $mail_api->fields_values['content'] , $pos );
1017 1041
1018 1042 if ( ( ! empty( $shortcode_params ) ) && ( isset( $shortcode_params['url'] ) ) ){
@@ -1020,15 +1044,15 @@
1020 1044 $pos = $shortcode_params['end'];
1021 1045
1022 1046 $exist_replace = substr( $mail_api->fields_values['content'], $shortcode_params['start'], ( $shortcode_params['end'] - $shortcode_params['start'] ) );
1023 1047
1024 - $new_replace = $url_shortcode . rand(1000,9000);
1048 + $new_replace = $url_shortcode . wp_rand(1000,9000);
1025 1049
1026 1050 $pos = $shortcode_params['start'] + strlen( $new_replace ); //FixIn: 9.7.3.5.1
1027 1051 $mail_api->fields_values['content'] = str_replace( $exist_replace, $new_replace ,$mail_api->fields_values['content'] );
1028 1052
1029 1053 $replace[ $new_replace ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '['.$exist_replace.']', $booking_id );
1030 - } else if ( //FixIn: 8.1.1.8
1054 + } else if ( // FixIn: 8.1.1.8.
1031 1055 ( ! empty( $shortcode_params ) )
1032 1056 && ( isset( $shortcode_params['end'] ) )
1033 1057 && ( $shortcode_params['end'] < strlen( $mail_api->fields_values['content'] ) )
1034 1058 ) {
@@ -1033,17 +1057,17 @@
1033 1057 && ( $shortcode_params['end'] < strlen( $mail_api->fields_values['content'] ) )
1034 1058 ) {
1035 1059 $pos = $shortcode_params['end'];
1036 1060 } else {
1037 - $shortcode_params = false; //FixIn: 7.0.1.58
1061 + $shortcode_params = false; // FixIn: 7.0.1.58.
1038 1062 }
1039 1063
1040 - } while ( ! empty( $shortcode_params ) ); //FixIn: 7.0.1.52
1064 + } while ( ! empty( $shortcode_params ) ); // FixIn: 7.0.1.52.
1041 1065
1042 1066 }
1043 1067
1044 1068 $mail_api->set_replace( $replace );
1045 - $mail_api->fields_values['from_name'] = $mail_api->replace_shortcodes( $mail_api->fields_values['from_name'] ); //FixIn: 7.0.1.29
1069 + $mail_api->fields_values['from_name'] = $mail_api->replace_shortcodes( $mail_api->fields_values['from_name'] ); // FixIn: 7.0.1.29.
1046 1070
1047 1071
1048 1072 $to = ( isset( $replace['email'] ) ) ? $replace['email'] : ''; // Get To field
1049 1073
@@ -1050,9 +1074,9 @@
1050 1074 if ( ! empty( $replace['email'] ) ) {
1051 1075 $to = wpbc_email_prepand_person_name( $replace['email'], $replace );
1052 1076 }
1053 1077
1054 - $to = wpbc_check_for_several_emails_in_form( $to, $formdata, $bktype ); //FixIn: 6.0.1.9
1078 + $to = wpbc_check_for_several_emails_in_form( $to, $formdata, $bktype ); // FixIn: 6.0.1.9.
1055 1079
1056 1080 $to = str_replace( ';', ',', $to );
1057 1081
1058 1082