/** * Triggered by the em_booking_add_yourgateway action, modifies the booking status if the event isn't free and also adds a filter to modify user feedback returned. * @param EM_Event $EM_Event * @param EM_Booking $EM_Booking * @param boolean $post_validation */ function booking_add($EM_Event, $EM_Booking, $post_validation = false) { global $wpdb, $wp_rewrite, $EM_Notices; $this->registered_timer = current_time('timestamp', 1); parent::booking_add($EM_Event, $EM_Booking, $post_validation); if ($post_validation && empty($EM_Booking->booking_id)) { if (get_option('dbem_multiple_bookings') && get_class($EM_Booking) == 'EM_Multiple_Booking') { add_filter('em_multiple_booking_save', array(&$this, 'em_booking_save'), 2, 2); } else { add_filter('em_booking_save', array(&$this, 'em_booking_save'), 2, 2); } } }
/** * Triggered by the em_booking_add_yourgateway action, hooked in EM_Gateway. Overrides EM_Gateway to account for non-ajax bookings (i.e. broken JS on site). * @param EM_Event $EM_Event * @param EM_Booking $EM_Booking * @param boolean $post_validation */ function booking_add($EM_Event, $EM_Booking, $post_validation = false) { parent::booking_add($EM_Event, $EM_Booking, $post_validation); if (!defined('DOING_AJAX')) { //we aren't doing ajax here, so we should provide a way to edit the $EM_Notices ojbect. add_action('option_dbem_booking_feedback', array(&$this, 'booking_form_feedback_fallback')); } if (get_option('dbem_multiple_bookings')) { add_filter('em_multiple_booking_save', array(&$this, 'em_booking_save'), 1, 2); } else { add_filter('em_booking_save', array(&$this, 'em_booking_save'), 1, 2); } }
/** * Add Booking * @since 1.3 * @version 1.0 */ function booking_add($EM_Event, $EM_Booking, $post_validation = false) { parent::booking_add($EM_Event, $EM_Booking, $post_validation); if ($post_validation && empty($EM_Booking->booking_id)) { if (get_option('dbem_multiple_bookings') && get_class($EM_Booking) == 'EM_Multiple_Booking') { add_filter('em_multiple_booking_save', array(&$this, 'booking_payment'), 2, 2); } else { add_filter('em_booking_save', array(&$this, 'booking_payment'), 2, 2); } } }
/** * Modifies the booking status if the event isn't free and also adds a filter to modify user feedback returned. * Triggered by the em_booking_add_yourgateway action. * @param EM_Event $EM_Event * @param EM_Booking $EM_Booking * @param boolean $post_validation */ function booking_add($EM_Event, $EM_Booking, $post_validation = false) { global $wpdb, $wp_rewrite, $EM_Notices; //manual bookings if (!empty($_REQUEST['manual_booking']) && wp_verify_nonce($_REQUEST['manual_booking'], 'em_manual_booking_' . $_REQUEST['event_id'])) { //validate post if (!empty($_REQUEST['payment_amount']) && !is_numeric($_REQUEST['payment_amount'])) { $EM_Booking->add_error('Invalid payment amount, please provide a number only.', 'em-pro'); } //add em_event_save filter to log transactions etc. add_filter('em_booking_save', array(&$this, 'em_booking_save'), 10, 2); //set flag that we're manually booking here, and set gateway to offline if (empty($_REQUEST['person_id']) || $_REQUEST['person_id'] < 0) { EM_Bookings::$force_registration = EM_Bookings::$disable_restrictions = true; } } parent::booking_add($EM_Event, $EM_Booking, $post_validation); }