Plugin Directory

Changeset 3400977


Ignore:
Timestamp:
11/22/2025 02:40:38 PM (4 months ago)
Author:
benitolopez
Message:

Releasing version 2.17.0

Location:
wp-hotelier/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • wp-hotelier/trunk/hotelier.php

    r3381523 r3400977  
    44 * Plugin URI:        https://wphotelier.com/?utm_source=wpadmin&utm_medium=plugin&utm_campaign=wphotelierplugin
    55 * Description:       Hotel booking plugin for WordPress.
    6  * Version:           2.16.0
     6 * Version:           2.17.0
    77 * Author:            WP Hotelier
    88 * Author URI:        https://wphotelier.com/
     
    3232     * @var string
    3333     */
    34     public $version = '2.16.0';
     34    public $version = '2.17.0';
    3535
    3636    /**
  • wp-hotelier/trunk/includes/admin/class-htl-admin-post-types.php

    r2575390 r3400977  
    66 * @category Admin
    77 * @package  Hotelier/Admin
    8  * @version  2.6.0
     8 * @version  2.17.0
    99 */
    1010
     
    167167        $columns                = array();
    168168        $columns[ 'title' ]     = esc_html__( 'Guest', 'wp-hotelier' );
     169        $columns[ 'rooms' ]     = esc_html__( 'Rooms', 'wp-hotelier' );
    169170        $columns[ 'nights' ]    = esc_html__( 'Nights', 'wp-hotelier' );
    170171        $columns[ 'check_in' ]  = esc_html__( 'Check-in', 'wp-hotelier' );
     
    187188
    188189        switch ( $column ) {
     190            case 'rooms' :
     191                $line_items = $the_reservation->get_items();
     192                $room_links = array();
     193
     194                foreach ( $line_items as $item_id => $item ) {
     195                    $_room = $the_reservation->get_room_from_item( $item );
     196
     197                    if ( $_room->exists() ) {
     198                        $room_links[] = sprintf( '<a href="%s">%s</a>', get_edit_post_link( $item['room_id'] ), $item['name'] );
     199                    } else {
     200                        $room_links[] = $item['name'];
     201                    }
     202                }
     203
     204                echo '<span>' . implode( ', ', $room_links ) . '</span>';
     205                break;
     206
    189207            case 'nights' :
    190208                echo '<span>' . absint( $the_reservation->get_nights() ) . '</span>';
  • wp-hotelier/trunk/includes/admin/meta-boxes/class-htl-meta-box-reservation-data.php

    r2958683 r3400977  
    66 * @category Admin
    77 * @package  Hotelier/Admin/Meta Boxes
    8  * @version  2.10.0
     8 * @version  2.17.0
    99 */
    1010
     
    196196
    197197                <?php if ( ( get_post_meta( $post->ID, '_created_via', true ) == 'admin' ) ) : ?>
    198                     <span class="booking-details__created-by-admin"><?php esc_html_e( '(created by admin)', 'wp-hotelier' ); ?></span>
     198                    <?php
     199                    $admin_name = esc_html__( 'admin', 'wp-hotelier' );
     200                    $creator_id = get_post_meta( $post->ID, '_admin_creator', true );
     201
     202                    if ( $creator_id ) {
     203                        $creator_obj = get_user_by( 'id', $creator_id );
     204
     205                        if ( isset( $creator_obj->display_name ) ) {
     206                            $admin_name = $creator_obj->display_name;
     207                        }
     208                    }
     209                    ?>
     210                    <span class="booking-details__created-by-admin"><?php echo sprintf( esc_html__( '(created by %s)', 'wp-hotelier' ), $admin_name ); ?></span>
    199211                <?php endif; ?>
    200212
  • wp-hotelier/trunk/includes/admin/new-reservation/class-htl-admin-new-reservation.php

    r2681452 r3400977  
    66 * @category Admin
    77 * @package  Hotelier/Admin
    8  * @version  2.7.1
     8 * @version  2.17.0
    99 */
    1010
     
    231231
    232232        try {
     233            $current_user = wp_get_current_user();
     234
    233235            // Start transaction if available
    234236            $wpdb->query( 'START TRANSACTION' );
     
    239241                'email'            => self::get_form_data_field( 'email' ),
    240242                'special_requests' => self::get_form_data_field( 'special_requests' ),
    241                 'created_via'      => 'admin'
     243                'created_via'      => 'admin',
     244                'admin_creator'    => $current_user->ID
    242245            );
    243246
     
    371374
    372375            // Add a note to the reservation
    373             $reservation->add_reservation_note( esc_html__( 'Reservation manually created by admin.', 'wp-hotelier' ) );
     376            $admin_name = $current_user->display_name ? $current_user->display_name : esc_html__( 'admin', 'wp-hotelier' );
     377            $reservation->add_reservation_note( sprintf( esc_html__( 'Reservation manually created by %s.', 'wp-hotelier' ), $admin_name ) );
    374378
    375379            // If we got here, the reservation was created without problems!
  • wp-hotelier/trunk/includes/htl-reservation-functions.php

    r2260556 r3400977  
    66 * @category Core
    77 * @package  Hotelier/Functions
    8  * @version  2.2.0
     8 * @version  2.17.0
    99 */
    1010
     
    3838        'reservation_id'   => 0,
    3939        'created_via'      => '',
     40        'admin_creator'    => '',
    4041        'parent'           => 0
    4142    );
     
    8889        update_post_meta( $reservation_id, '_reservation_currency', htl_get_currency() );
    8990        update_post_meta( $reservation_id, '_created_via', sanitize_text_field( $args[ 'created_via' ] ) );
     91
     92        if ( isset( $args[ 'admin_creator' ] ) ) {
     93            update_post_meta( $reservation_id, '_admin_creator', sanitize_text_field( $args[ 'admin_creator' ] ) );
     94        }
    9095    }
    9196
  • wp-hotelier/trunk/readme.txt

    r3381523 r3400977  
    44Requires at least: 4.1
    55Tested up to: 6.8
    6 Stable tag: 2.16.0
     6Stable tag: 2.17.0
    77License: GPLv3
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    131131== Changelog ==
    132132
     133= 2.17.0 - 2025-11-22 =
     134* Add - Display rooms included in reservation
     135* Add - Display creator name for manual reservations
     136
    133137= 2.16.0 - 2025-10-18 =
    134138* Add - Ability to clear logs from admin.
Note: See TracChangeset for help on using the changeset viewer.