WordPress.org

Plugin Directory

Changeset 633834


Ignore:
Timestamp:
12/04/12 05:09:00 (17 months ago)
Author:
kovshenin
Message:

Preserve the original reservation name

Currently, if we use non-ASCII name for a
reservation, in the listing we get url urlencoded
unreadable gibberish.

That's why we keep the original name in a different
field in the reservation and build the id from
it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • camptix/trunk/camptix.php

    r633832 r633834  
    29452945            <?php foreach ( $reservations as $reservation ) : ?> 
    29462946                <tr> 
    2947                     <td><span><?php echo esc_html( $reservation['id'] ); ?></span></td> 
     2947                    <td><span><?php echo esc_html( isset( $reservation['name'] ) ? $reservation['name'] : urldecode( $reservation['id'] ) ); ?></span></td> 
    29482948                    <td class="column-quantity"><span><?php echo intval( $reservation['quantity'] ); ?></span></td> 
    29492949                    <td class="column-used"><span><?php echo $this->get_purchased_tickets_count( get_the_ID(), $reservation['token'] ); ?></span></td> 
     
    29642964            <input type="hidden" name="tix_doing_reservations" value="1" /> 
    29652965            <label><?php _e( 'Reservation Name', 'camptix' ); ?></label> 
    2966             <input type="text" name="tix_reservation_id" autocomplete="off" /> 
     2966            <input type="text" name="tix_reservation_name" autocomplete="off" /> 
    29672967            <label><?php _e( 'Quantity', 'camptix' ); ?></label> 
    29682968            <input type="text" name="tix_reservation_quantity" autocomplete="off" /> 
     
    34763476 
    34773477            // Make a new reservation 
    3478             if ( isset( $_POST['tix_reservation_id'], $_POST['tix_reservation_quantity'] ) 
    3479                 && ! empty( $_POST['tix_reservation_id'] ) && intval( $_POST['tix_reservation_quantity'] ) > 0 ) { 
    3480  
    3481                 $reservation_id = sanitize_title_with_dashes( $_POST['tix_reservation_id'] ); 
     3478            if ( isset( $_POST['tix_reservation_name'], $_POST['tix_reservation_quantity'] ) 
     3479                && ! empty( $_POST['tix_reservation_name'] ) && intval( $_POST['tix_reservation_quantity'] ) > 0 ) { 
     3480 
     3481                $reservation_id = sanitize_title_with_dashes( $_POST['tix_reservation_name'] ); 
     3482                $reservation_name = $_POST['tix_reservation_name']; 
    34823483                $reservation_quantity = intval( $_POST['tix_reservation_quantity'] ); 
    34833484                $reservation_token = md5( 'caMptix-r353rv4t10n' . rand( 1, 9999 ) . time() . $reservation_id . $post_id ); 
    34843485                $reservation = array( 
    34853486                    'id' => $reservation_id, 
     3487                    'name' => $reservation_name, 
    34863488                    'quantity' => $reservation_quantity, 
    34873489                    'token' => $reservation_token, 
Note: See TracChangeset for help on using the changeset viewer.