WordPress.org

Plugin Directory

Changeset 1655537


Ignore:
Timestamp:
05/11/17 22:58:49 (4 months ago)
Author:
netweblogic
Message:

(dev) 5.6.8

Location:
events-manager/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • events-manager/trunk/classes/em-booking.php

    r1651260 r1655537  
    606606        return $summary; 
    607607    } 
     608     
     609    /** 
     610     * Returns the amount paid for this booking. By default, a booking is considered either paid in full or not at all depending on whether the booking is confirmed or not. 
     611     * @param boolean $format If set to true a currency-formatted string value is returned 
     612     * @return string|float 
     613     */ 
     614    function get_total_paid( $format = false ){ 
     615        $status = ($this->booking_status == 0 && !get_option('dbem_bookings_approval') ) ? 1:$this->booking_status; 
     616        $total = $status ? $this->get_price() : 0; 
     617        $total = apply_filters('em_booking_get_total_paid', $total, $this); 
     618        if( $format ){ 
     619            return $this->format_price($total); 
     620        } 
     621        return $total; 
     622    } 
     623     
    608624     
    609625    /* Get Objects linked to booking */ 
  • events-manager/trunk/classes/em-event-post.php

    r1651260 r1655537  
    131131                    $EM_Event = em_get_event($post); 
    132132                    if( $EM_Event->event_rsvp && (!defined('EM_DISABLE_AUTO_BOOKINGSFORM') || !EM_DISABLE_AUTO_BOOKINGSFORM) ){ 
    133                         $content .= $EM_Event->output('<h2>Bookings</h2>#_BOOKINGFORM'); 
     133                        $content .= '<h2>'.esc_html__('Bookings','events-manager').'</h2>'; 
     134                        $content .= $EM_Event->output('#_BOOKINGFORM'); 
    134135                    } 
    135136                } 
  • events-manager/trunk/classes/em-ticket.php

    r1651260 r1655537  
    250250    } 
    251251     
    252     function is_available( $include_members_only = false, $include_guests_only = false ){ 
     252    function is_available( $ignore_member_restrictions = false, $ignore_guest_restrictions = false ){ 
    253253        $timestamp = current_time('timestamp'); 
    254         if( isset($this->is_available) && !$include_members_only && !$include_guests_only ) return apply_filters('em_ticket_is_available',  $this->is_available, $this); //save extra queries if doing a standard check 
     254        if( isset($this->is_available) && !$ignore_member_restrictions && !$ignore_guest_restrictions ) return apply_filters('em_ticket_is_available',  $this->is_available, $this); //save extra queries if doing a standard check 
    255255        $is_available = false; 
    256256        $EM_Event = $this->get_event(); 
     
    259259        $condition_2 = $this->end_timestamp >= $timestamp || empty($this->ticket_end); 
    260260        $condition_3 = (empty($EM_Event->event_rsvp_date) && $EM_Event->start > $timestamp) || $EM_Event->rsvp_end > $timestamp; 
    261         $condition_4 = !$this->ticket_members || ($this->ticket_members && is_user_logged_in()) || $include_members_only; 
     261        $condition_4 = !$this->ticket_members || ($this->ticket_members && is_user_logged_in()) || $ignore_member_restrictions; 
    262262        $condition_5 = true; 
    263263        if( !EM_Bookings::$disable_restrictions && $this->ticket_members && !empty($this->ticket_members_roles) ){ 
     
    271271            } 
    272272        } 
    273         $condition_6 = !$this->ticket_guests || ($this->ticket_guests && !is_user_logged_in()) || $include_guests_only; 
     273        $condition_6 = !$this->ticket_guests || ($this->ticket_guests && !is_user_logged_in()) || $ignore_guest_restrictions; 
    274274        if( $condition_1 && $condition_2 && $condition_3 && $condition_4 && $condition_5 && $condition_6 ){ 
    275275            //Time Constraints met, now quantities 
     
    278278            } 
    279279        } 
    280         if( !$include_members_only && !$include_guests_only ){ //$this->is_available is only stored for the viewing user 
     280        if( !$ignore_member_restrictions && !$ignore_guest_restrictions ){ //$this->is_available is only stored for the viewing user 
    281281            $this->is_available = $is_available; 
    282282        } 
    283         return apply_filters('em_ticket_is_available', $is_available, $this); 
     283        return apply_filters('em_ticket_is_available', $is_available, $this, $ignore_guest_restrictions, $ignore_member_restrictions); 
    284284    } 
    285285     
     
    288288     * @return boolean 
    289289     */ 
    290     function is_displayable(){ 
     290    function is_displayable( $ignore_member_restrictions = false, $ignore_guest_restrictions = false ){ 
    291291        $return = false; 
    292         if( $this->is_available() ){ 
     292        if( $this->is_available($ignore_member_restrictions, $ignore_guest_restrictions) ){ 
    293293            $return = true; 
    294294        }else{ 
     
    300300            } 
    301301        } 
    302         return apply_filters('em_ticket_is_displayable', $return, $this);; 
     302        return apply_filters('em_ticket_is_displayable', $return, $this, $ignore_guest_restrictions, $ignore_member_restrictions); 
    303303    } 
    304304     
  • events-manager/trunk/events-manager.php

    r1651260 r1655537  
    22/* 
    33Plugin Name: Events Manager 
    4 Version: 5.6.7 
     4Version: 5.6.8 
    55Plugin URI: http://wp-events-plugin.com 
    66Description: Event registration and booking management for WordPress. Recurring events, locations, google maps, rss, ical, booking registration and more! 
  • events-manager/trunk/includes/js/bookingsform.js

    r1651260 r1655537  
    2727                $('.em-booking-login').hide(); 
    2828                $(document).trigger('em_booking_success', [response]); 
     29                if( response.redirect ){ //custom redirect hook 
     30                    window.location.href = response.redirect; 
     31                } 
    2932            }else{ 
    3033                if( response.errors != null ){ 
  • events-manager/trunk/readme.txt

    r1651260 r1655537  
    100100 
    101101== Changelog == 
    102 = 5.6.7 (dev) = 
     102= 5.6.8 (dev) = 
    103103* added em_events_admin_args filter allowing modification of event search arguments 
    104104* removed jQuery UI localize files for the datepicker in favor of WP 4.6 native localization 
     
    161161* improved google maps JS for multiple events/locations maps and auto-zooming of included locations (kudos @benklocek) 
    162162* fixed minor php warning on user profile page 
     163* tweaked booking JS to allow a redirect variable passed on with a successful response 
     164* fixed 'Bookings' header not being translated when formats are disabled and booking form is added just after content 
     165* fixed ticket availability status indicator showing false to admins when ticket is restricted to guests 
     166* added get_total_paid function (mainly for hooking purposes in Pro add-ons) 
    163167 
    164168= 5.6.6.1 = 
  • events-manager/trunk/templates/forms/event/bookings.php

    r1651260 r1655537  
    8383                        <tbody id="em-ticket-<?php echo $col_count ?>" <?php if( $col_count == 0 ) echo 'style="display:none;"' ?>> 
    8484                            <tr class="em-tickets-row"> 
    85                                 <td class="ticket-status"><span class="<?php if($EM_Ticket->ticket_id && $EM_Ticket->is_available()){ echo 'ticket_on'; }elseif($EM_Ticket->ticket_id > 0){ echo 'ticket_off'; }else{ echo 'ticket_new'; } ?>"></span></td>                                                  
     85                                <td class="ticket-status"><span class="<?php if($EM_Ticket->ticket_id && $EM_Ticket->is_available(true, true)){ echo 'ticket_on'; }elseif($EM_Ticket->ticket_id > 0){ echo 'ticket_off'; }else{ echo 'ticket_new'; } ?>"></span></td>                                                    
    8686                                <td class="ticket-name"> 
    8787                                    <span class="ticket_name"><?php if($EM_Ticket->ticket_members) echo '* ';?><?php echo wp_kses_data($EM_Ticket->ticket_name); ?></span> 
Note: See TracChangeset for help on using the changeset viewer.