| @@ -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 " > |
| @@ -579,9 +579,9 @@ | ||
| 579 | 579 | |
| 580 | 580 | $subtabs['deleted'] = array( |
| 581 | 581 | 'type' => 'subtab' // Required| Possible values: 'subtab' | 'separator' | 'button' | 'goto-link' | 'html' |
| 582 | 582 | , 'title' => '<span>' . esc_html__( 'Deleted', 'booking' ) . $sufix . '</span>' // Title of TAB |
| 583 | - , 'page_title' => __('Emails Settings', 'booking') // Title of Page | |
| 583 | + , 'page_title' => __('Emails Settings', 'booking') . ' - <span>' . esc_html__( 'Deleted', 'booking' ) . $sufix . '</span>' // Title of Page. | |
| 584 | 584 | , 'hint' => __('Customization of email template, which is sent to Visitor after Cancellation of booking' ,'booking') //FixIn: 8.1.2.17.1 |
| 585 | 585 | , 'link' => '' // link |
| 586 | 586 | , 'position' => '' // 'left' || 'right' || '' |
| 587 | 587 | , 'css_classes' => '' // CSS class(es) |
| @@ -586,14 +586,13 @@ | ||
| 586 | 586 | , 'position' => '' // 'left' || 'right' || '' |
| 587 | 587 | , 'css_classes' => '' // CSS class(es) |
| 588 | 588 | //, 'icon' => 'http://.../icon.png' // Icon - link to the real PNG img |
| 589 | 589 | //, 'font_icon' => 'wpbc_icn_mail_outline' // CSS definition of Font Icon |
| 590 | - , 'header_font_icon' => 'wpbc_icn_mail_outline' // CSS definition of Font Icon // FixIn: 9.6.1.4. | |
| 591 | - , 'default' => false // Is this sub tab activated by default or not: true || false. | |
| 590 | + , 'default' => false // Is this sub tab activated by default or not: true || false. | |
| 592 | 591 | , 'disabled' => false // Is this sub tab deactivated: true || false. |
| 593 | 592 | , 'checkbox' => false // or definition array for specific checkbox: array( 'checked' => true, 'name' => 'feature1_active_status' ) //, 'checkbox' => array( 'checked' => $is_checked, 'name' => 'enabled_active_status' ) |
| 594 | 593 | , 'content' => 'content' // Function to load as conten of this TAB |
| 595 | - , 'is_use_left_navigation' => true | |
| 594 | + , 'font_icon' => 'wpbc_icn_close' | |
| 596 | 595 | , 'show_checked_icon' => true |
| 597 | 596 | , 'checked_data' => WPBC_EMAIL_NEW_ADMIN_PREFIX . WPBC_EMAIL_DELETED_ID // This is where we get content |
| 598 | 597 | ); |
| 599 | 598 | |
| @@ -903,9 +902,15 @@ | ||
| 903 | 902 | $replace[ 'check_in_only_date' ] = $my_check_in_onlydate; |
| 904 | 903 | $replace[ 'check_out_only_date' ] = $my_check_out_onlydate; |
| 905 | 904 | |
| 906 | 905 | $replace[ 'check_out_plus1day'] = $my_check_out_plus1day; // FixIn: 6.0.1.11. |
| 907 | - $replace[ 'dates_count' ] = count( $my_dates4emeil_check_in_out ); | |
| 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 | + | |
| 908 | 913 | $replace['cost'] = $booking_cost; |
| 909 | 914 | $replace['cost_digits_only'] = $booking_cost_digits_only; |
| 910 | 915 | $replace[ 'siteurl' ] = htmlspecialchars_decode( '<a href="' . esc_url( home_url() ) . '">' . home_url() . '</a>' ); |
| 911 | 916 | $replace[ 'resource_title'] = wpbc_lang( $bk_title ); |
| @@ -931,9 +936,9 @@ | ||
| 931 | 936 | |
| 932 | 937 | // Links /////////////////////////////////////////////////////////////////// |
| 933 | 938 | $replace[ 'moderatelink' ] = htmlspecialchars_decode( |
| 934 | 939 | // '<a href="' . |
| 935 | - esc_url( wpbc_get_bookings_url() . '&view_mode=vm_listing&tab=actions&wh_booking_id=' . $booking_id ) | |
| 940 | + esc_url( wpbc_get_bookings_url() . '&tab=vm_booking_listing&wh_booking_id=' . $booking_id ) | |
| 936 | 941 | // . '">' . esc_html__('here', 'booking') . '</a>' |
| 937 | 942 | ); |
| 938 | 943 | $replace[ 'visitorbookingediturl' ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '[visitorbookingediturl]', $booking_id ); |
| 939 | 944 | $replace[ 'visitorbookingslisting' ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '[visitorbookingslisting]', $booking_id ); //FixIn: 8.1.3.5.1 |
| @@ -963,9 +968,9 @@ | ||
| 963 | 968 | function wpbc_send_email_deleted( $deleted_id_str, $is_send_emeils, $deletedreason = '' ) { |
| 964 | 969 | |
| 965 | 970 | global $wpdb; |
| 966 | 971 | $sql = "SELECT * FROM {$wpdb->prefix}booking as bk WHERE bk.booking_id IN ({$deleted_id_str})"; |
| 967 | - // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared | |
| 972 | + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter | |
| 968 | 973 | $result = $wpdb->get_results( $sql ); |
| 969 | 974 | |
| 970 | 975 | foreach ( $result as $res ) { |
| 971 | 976 | |
| @@ -1004,10 +1009,11 @@ | ||
| 1004 | 1009 | |
| 1005 | 1010 | if ( $mail_api->fields_values['enabled'] == 'Off' ) return false; // Email template deactivated - exit. |
| 1006 | 1011 | |
| 1007 | 1012 | |
| 1008 | - $replace = wpbc__get_replace_shortcodes__email_deleted( $booking_id, $bktype, $formdata ); | |
| 1009 | - $replace[ 'denyreason' ] = $deletedreason; // FixIn: 7.0.1.1. | |
| 1013 | + $replace = wpbc__get_replace_shortcodes__email_deleted( $booking_id, $bktype, $formdata ); | |
| 1014 | + $replace['denyreason'] = $deletedreason; // FixIn: 7.0.1.1. | |
| 1015 | + $replace['reason'] = $deletedreason; | |
| 1010 | 1016 | |
| 1011 | 1017 | // Replace shortcodes with custom URL parameter, like: 'visitorbookingediturl', 'visitorbookingcancelurl', 'visitorbookingpayurl' |
| 1012 | 1018 | foreach ( array( 'visitorbookingediturl', 'visitorbookingcancelurl', 'visitorbookingpayurl' , 'visitorbookingslisting' ) as $url_shortcode ) { //FixIn: 7.0.1.8 //FixIn: 8.1.3.5.1 |
| 1013 | 1019 | |