| @@ -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 " > |
| @@ -587,9 +587,9 @@ | ||
| 587 | 587 | |
| 588 | 588 | $subtabs['trash'] = array( |
| 589 | 589 | 'type' => 'subtab' // Required| Possible values: 'subtab' | 'separator' | 'button' | 'goto-link' | 'html' |
| 590 | 590 | , 'title' => '<span>' . esc_html__( 'Trash / Reject', 'booking' ) . $sufix . '</span>' // Title of TAB |
| 591 | - , 'page_title' => __('Emails Settings', 'booking') // Title of Page | |
| 591 | + , 'page_title' => __('Emails Settings', 'booking') . ' - <span>' . esc_html__( 'Trash / Reject', 'booking' ) . $sufix . '</span>' // Title of Page. | |
| 592 | 592 | , 'hint' => __('Customization of email template, which is sent to Visitor after rejecting of booking' ,'booking') //FixIn: 8.1.2.17.1 |
| 593 | 593 | , 'link' => '' // link |
| 594 | 594 | , 'position' => '' // 'left' || 'right' || '' |
| 595 | 595 | , 'css_classes' => 'wpbc_navigation_top_border' // CSS class(es) |
| @@ -594,14 +594,13 @@ | ||
| 594 | 594 | , 'position' => '' // 'left' || 'right' || '' |
| 595 | 595 | , 'css_classes' => 'wpbc_navigation_top_border' // CSS class(es) |
| 596 | 596 | //, 'icon' => 'http://.../icon.png' // Icon - link to the real PNG img |
| 597 | 597 | //, 'font_icon' => 'wpbc_icn_mail_outline' // CSS definition of Font Icon |
| 598 | - , 'header_font_icon' => 'wpbc_icn_mail_outline' // CSS definition of Font Icon // FixIn: 9.6.1.4. | |
| 599 | - , '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. | |
| 600 | 599 | , 'disabled' => false // Is this sub tab deactivated: true || false. |
| 601 | 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' ) |
| 602 | 601 | , 'content' => 'content' // Function to load as conten of this TAB |
| 603 | - , 'is_use_left_navigation' => true | |
| 602 | + , 'font_icon' => 'wpbc_icn_delete_outline' | |
| 604 | 603 | , 'show_checked_icon' => true |
| 605 | 604 | , 'checked_data' => WPBC_EMAIL_NEW_ADMIN_PREFIX . WPBC_EMAIL_TRASH_ID // This is where we get content |
| 606 | 605 | ); |
| 607 | 606 | |
| @@ -911,9 +910,14 @@ | ||
| 911 | 910 | $replace[ 'check_in_only_date' ] = $my_check_in_onlydate; |
| 912 | 911 | $replace[ 'check_out_only_date' ] = $my_check_out_onlydate; |
| 913 | 912 | |
| 914 | 913 | $replace[ 'check_out_plus1day'] = $my_check_out_plus1day; // FixIn: 6.0.1.11. |
| 915 | - $replace[ 'dates_count' ] = count( $my_dates4emeil_check_in_out ); | |
| 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 | + | |
| 916 | 920 | $replace['cost'] = $booking_cost; |
| 917 | 921 | $replace['cost_digits_only'] = $booking_cost_digits_only; |
| 918 | 922 | $replace[ 'siteurl' ] = htmlspecialchars_decode( '<a href="' . esc_url( home_url() ) . '">' . home_url() . '</a>' ); |
| 919 | 923 | $replace[ 'resource_title'] = wpbc_lang( $bk_title ); |
| @@ -939,9 +943,9 @@ | ||
| 939 | 943 | |
| 940 | 944 | // Links /////////////////////////////////////////////////////////////////// |
| 941 | 945 | $replace[ 'moderatelink' ] = htmlspecialchars_decode( |
| 942 | 946 | // '<a href="' . |
| 943 | - esc_url( wpbc_get_bookings_url() . '&view_mode=vm_listing&tab=actions&wh_booking_id=' . $booking_id ) | |
| 947 | + esc_url( wpbc_get_bookings_url() . '&tab=vm_booking_listing&wh_booking_id=' . $booking_id ) | |
| 944 | 948 | // . '">' . esc_html__('here', 'booking') . '</a>' |
| 945 | 949 | ); |
| 946 | 950 | $replace[ 'visitorbookingediturl' ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '[visitorbookingediturl]', $booking_id ); |
| 947 | 951 | $replace[ 'visitorbookingslisting' ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '[visitorbookingslisting]', $booking_id ); //FixIn: 8.1.3.5.1 |
| @@ -971,9 +975,9 @@ | ||
| 971 | 975 | function wpbc_send_email_trash( $trash_id_str, $is_send_emeils, $trashreason = '' ) { |
| 972 | 976 | |
| 973 | 977 | global $wpdb; |
| 974 | 978 | $sql = "SELECT * FROM {$wpdb->prefix}booking as bk WHERE bk.booking_id IN ({$trash_id_str})"; |
| 975 | - // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared | |
| 979 | + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter, PluginCheck.Security.DirectDB.UnescapedDBParameter | |
| 976 | 980 | $result = $wpdb->get_results( $sql ); |
| 977 | 981 | |
| 978 | 982 | |
| 979 | 983 | foreach ( $result as $res ) { |
| @@ -1016,11 +1020,11 @@ | ||
| 1016 | 1020 | |
| 1017 | 1021 | if ( $mail_api->fields_values['enabled'] == 'Off' ) return false; // Email template deactivated - exit. |
| 1018 | 1022 | |
| 1019 | 1023 | |
| 1020 | - $replace = wpbc__get_replace_shortcodes__email_trash( $booking_id, $bktype, $formdata ); | |
| 1021 | - $replace[ 'denyreason' ] = $trashreason; // FixIn: 7.0.1.1. | |
| 1022 | - | |
| 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; | |
| 1023 | 1027 | // Replace shortcodes with custom URL parameter, like: 'visitorbookingediturl', 'visitorbookingcancelurl', 'visitorbookingpayurl' |
| 1024 | 1028 | foreach ( array( 'visitorbookingediturl', 'visitorbookingcancelurl', 'visitorbookingpayurl' , 'visitorbookingslisting') as $url_shortcode ) { //FixIn: 7.0.1.8 //FixIn: 8.1.3.5.1 |
| 1025 | 1029 | |
| 1026 | 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 ). |