| @@ -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 " > |
| @@ -585,9 +585,9 @@ | ||
| 585 | 585 | |
| 586 | 586 | $subtabs['approved'] = array( |
| 587 | 587 | 'type' => 'subtab' // Required| Possible values: 'subtab' | 'separator' | 'button' | 'goto-link' | 'html' |
| 588 | 588 | , 'title' => '<span>' . esc_html__( 'Approved', 'booking' ) . $sufix . '</span>' // Title of TAB |
| 589 | - , 'page_title' => __('Emails Settings', 'booking') // Title of Page | |
| 589 | + , 'page_title' => __('Emails Settings', 'booking') . ' - <span>' . esc_html__( 'Approved', 'booking' ) . $sufix . '</span>' // Title of Page. | |
| 590 | 590 | , 'hint' => __('Customization of email template, which is sent to Visitor after approval of booking' ,'booking') //FixIn: 8.1.2.17.1 |
| 591 | 591 | , 'link' => '' // link |
| 592 | 592 | , 'position' => '' // 'left' || 'right' || '' |
| 593 | 593 | , 'css_classes' => '' // CSS class(es) |
| @@ -592,14 +592,13 @@ | ||
| 592 | 592 | , 'position' => '' // 'left' || 'right' || '' |
| 593 | 593 | , 'css_classes' => '' // CSS class(es) |
| 594 | 594 | //, 'icon' => 'http://.../icon.png' // Icon - link to the real PNG img |
| 595 | 595 | //, 'font_icon' => 'wpbc_icn_mail_outline' // CSS definition of Font Icon |
| 596 | - , 'header_font_icon' => 'wpbc_icn_mail_outline' // CSS definition of Font Icon // FixIn: 9.6.1.4. | |
| 597 | - , 'default' => false // Is this sub tab activated by default or not: true || false. | |
| 596 | + , 'default' => false // Is this sub tab activated by default or not: true || false. | |
| 598 | 597 | , 'disabled' => false // Is this sub tab deactivated: true || false. |
| 599 | 598 | , 'checkbox' => false // or definition array for specific checkbox: array( 'checked' => true, 'name' => 'feature1_active_status' ) //, 'checkbox' => array( 'checked' => $is_checked, 'name' => 'enabled_active_status' ) |
| 600 | 599 | , 'content' => 'content' // Function to load as conten of this TAB |
| 601 | - , 'is_use_left_navigation' => true | |
| 600 | + , 'font_icon' => 'wpbc_icn_done_all' | |
| 602 | 601 | , 'show_checked_icon' => true |
| 603 | 602 | , 'checked_data' => WPBC_EMAIL_NEW_ADMIN_PREFIX . WPBC_EMAIL_APPROVED_ID // This is where we get content |
| 604 | 603 | ); |
| 605 | 604 | |
| @@ -908,9 +907,15 @@ | ||
| 908 | 907 | $replace[ 'check_in_only_date' ] = $my_check_in_onlydate; |
| 909 | 908 | $replace[ 'check_out_only_date' ] = $my_check_out_onlydate; |
| 910 | 909 | |
| 911 | 910 | $replace[ 'check_out_plus1day'] = $my_check_out_plus1day; // FixIn: 6.0.1.11. |
| 912 | - $replace[ 'dates_count' ] = count( $my_dates4emeil_check_in_out ); | |
| 911 | + | |
| 912 | + $replace['dates_count'] = count( $my_dates4emeil_check_in_out ); | |
| 913 | + $replace['days_count'] = intval( $replace['dates_count'] ); // FixIn: 10.15.1.3. | |
| 914 | + $replace['nights_count'] = ( $replace['days_count'] > 1 ) ? intval( $replace['days_count'] - 1 ) : 1; | |
| 915 | + $replace['days_count_plus1day'] = intval( $replace['days_count'] + 1 ); | |
| 916 | + | |
| 917 | + | |
| 913 | 918 | $replace['cost'] = $booking_cost; |
| 914 | 919 | $replace['cost_digits_only'] = $booking_cost_digits_only; |
| 915 | 920 | $replace[ 'siteurl' ] = htmlspecialchars_decode( '<a href="' . esc_url( home_url() ) . '">' . home_url() . '</a>' ); |
| 916 | 921 | $replace[ 'resource_title'] = wpbc_lang( $bk_title ); |
| @@ -936,9 +941,9 @@ | ||
| 936 | 941 | |
| 937 | 942 | // Links /////////////////////////////////////////////////////////////////// |
| 938 | 943 | $replace[ 'moderatelink' ] = htmlspecialchars_decode( |
| 939 | 944 | // '<a href="' . |
| 940 | - esc_url( wpbc_get_bookings_url() . '&view_mode=vm_listing&tab=actions&wh_booking_id=' . $booking_id ) | |
| 945 | + esc_url( wpbc_get_bookings_url() . '&tab=vm_booking_listing&wh_booking_id=' . $booking_id ) | |
| 941 | 946 | // . '">' . esc_html__('here', 'booking') . '</a>' |
| 942 | 947 | ); |
| 943 | 948 | $replace[ 'visitorbookingediturl' ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '[visitorbookingediturl]', $booking_id ); |
| 944 | 949 | $replace[ 'visitorbookingslisting' ] = apply_bk_filter( 'wpdev_booking_set_booking_edit_link_at_email', '[visitorbookingslisting]', $booking_id ); //FixIn: 8.1.3.5.1 |
| @@ -987,9 +992,9 @@ | ||
| 987 | 992 | function wpbc_send_email_approved( $approved_id_str, $is_send_emeils, $denyreason = '' ) { |
| 988 | 993 | |
| 989 | 994 | global $wpdb; |
| 990 | 995 | $sql = "SELECT * FROM {$wpdb->prefix}booking as bk WHERE bk.booking_id IN ({$approved_id_str})"; |
| 991 | - // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared | |
| 996 | + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter | |
| 992 | 997 | $result = $wpdb->get_results( $sql ); |
| 993 | 998 | |
| 994 | 999 | foreach ( $result as $res ) { |
| 995 | 1000 | |
| @@ -1031,14 +1036,15 @@ | ||
| 1031 | 1036 | |
| 1032 | 1037 | if ( $mail_api->fields_values['enabled'] == 'Off' ) return false; // Email template deactivated - exit. |
| 1033 | 1038 | |
| 1034 | 1039 | |
| 1035 | - $replace = wpbc__get_replace_shortcodes__email_approved( $booking_id, $bktype, $formdata ); | |
| 1036 | - $replace[ 'denyreason' ] = $denyreason; // FixIn: 7.0.1.1. | |
| 1037 | - $replace[ 'approvereason' ] = $denyreason; // FixIn: 7.0.1.1. | |
| 1038 | - $replace[ 'reason' ] = $denyreason; // FixIn: 7.0.1.1. | |
| 1039 | - if ( ! empty( $res->remark ) ) // FixIn: 8.1.2.6. | |
| 1040 | - $replace[ 'remark' ] = $res->remark; // FixIn: 7.2.1.19. | |
| 1040 | + $replace = wpbc__get_replace_shortcodes__email_approved( $booking_id, $bktype, $formdata ); | |
| 1041 | + $replace['denyreason'] = $denyreason; // FixIn: 7.0.1.1. | |
| 1042 | + $replace['approvereason'] = $denyreason; // FixIn: 7.0.1.1. | |
| 1043 | + $replace['reason'] = $denyreason; // FixIn: 7.0.1.1. | |
| 1044 | + if ( ! empty( $res->remark ) ) { | |
| 1045 | + $replace['remark'] = $res->remark; | |
| 1046 | + } // FixIn: 7.2.1.19. | |
| 1041 | 1047 | |
| 1042 | 1048 | // Replace shortcodes with custom URL parameter, like: 'visitorbookingediturl', 'visitorbookingcancelurl', 'visitorbookingpayurl' |
| 1043 | 1049 | foreach ( array( 'visitorbookingediturl', 'visitorbookingcancelurl', 'visitorbookingpayurl' , 'visitorbookingslisting' ) as $url_shortcode ) { //FixIn: 7.0.1.8 //FixIn: 8.1.3.5.1 |
| 1044 | 1050 | |