/** * This returns the content for a registration step * * @access protected * @return string html */ protected function _get_registration_step_content() { $template_path = REG_TEMPLATE_PATH . 'reg_admin_register_new_attendee_step_content.template.php'; $template_args = array('title' => '', 'content' => '', 'step_button_text' => ''); //to indicate we're processing a new registration $hidden_fields = array('processing_registration' => array('type' => 'hidden', 'value' => 1), 'event_id' => array('type' => 'hidden', 'value' => $this->_reg_event->ID())); //if the cart is empty then we know we're at step one so we'll display ticket selector $cart = EE_Registry::instance()->SSN->get_session_data('cart'); $step = empty($cart) ? 'ticket' : 'questions'; switch ($step) { case 'ticket': $template_args['title'] = __('Step One: Select the Ticket for this registration', 'event_espresso'); $template_args['content'] = EED_Ticket_Selector::instance()->display_ticket_selector($this->_reg_event); $template_args['step_button_text'] = __('Add Tickets and Continue to Registrant Details', 'event_espresso'); $template_args['show_notification_toggle'] = FALSE; break; case 'questions': $template_args['title'] = __('Step Two: Add Registrant Details for this Registration', 'event_espresso'); //in theory we should be able to run EED_SPCO at this point because the cart should have been setup properly by the first process_reg_step run. $template_args['content'] = EED_Single_Page_Checkout::registration_checkout_for_admin(); $template_args['step_button_text'] = __('Save Registration and Continue to Details', 'event_espresso'); $template_args['show_notification_toggle'] = TRUE; break; } $this->_set_add_edit_form_tags('process_reg_step', $hidden_fields); //we come back to the process_registration_step route. return EEH_Template::display_template($template_path, $template_args, TRUE); }
/** * This returns the content for a registration step * * @access protected * @return string html */ protected function _get_registration_step_content() { if (isset($_COOKIE['ee_registration_added']) && $_COOKIE['ee_registration_added']) { $warning_msg = sprintf(__('%2$sWARNING!!!%3$s%1$sPlease do not use the back button to return to this page for the purpose of adding another registration.%1$sThis can result in lost and/or corrupted data.%1$sIf you wish to add another registration, then please click the%1$s%7$s"Add Another New Registration to Event"%8$s button%1$son the Transaction details page, after you are redirected.%1$s%1$s%4$s redirecting in %5$s seconds %6$s', 'event_espresso'), '<br />', '<h3 class="important-notice">', '</h3>', '<div class="float-right">', '<span id="redirect_timer" class="important-notice">30</span>', '</div>', '<b>', '</b>'); return ' <div id="ee-add-reg-back-button-dv"><p>' . $warning_msg . '</p></div> <script > // WHOAH !!! it appears that someone is using the back button from the Transaction admin page // after just adding a new registration... we gotta try to put a stop to that !!! var timer = 30; setInterval( function () { jQuery("#redirect_timer").html( parseInt( timer ) ); if ( --timer < 0 ) { window.history.forward() } }, 800 ); </script >'; } $template_args = array('title' => '', 'content' => '', 'step_button_text' => '', 'show_notification_toggle' => false); //to indicate we're processing a new registration $hidden_fields = array('processing_registration' => array('type' => 'hidden', 'value' => 0), 'event_id' => array('type' => 'hidden', 'value' => $this->_reg_event->ID())); //if the cart is empty then we know we're at step one so we'll display ticket selector $cart = EE_Registry::instance()->SSN->cart(); $step = !$cart instanceof EE_Cart ? 'ticket' : 'questions'; switch ($step) { case 'ticket': $hidden_fields['processing_registration']['value'] = 1; $template_args['title'] = __('Step One: Select the Ticket for this registration', 'event_espresso'); $template_args['content'] = EED_Ticket_Selector::instance()->display_ticket_selector($this->_reg_event); $template_args['step_button_text'] = __('Add Tickets and Continue to Registrant Details', 'event_espresso'); $template_args['show_notification_toggle'] = FALSE; break; case 'questions': $hidden_fields['processing_registration']['value'] = 2; $template_args['title'] = __('Step Two: Add Registrant Details for this Registration', 'event_espresso'); //in theory we should be able to run EED_SPCO at this point because the cart should have been setup properly by the first process_reg_step run. $template_args['content'] = EED_Single_Page_Checkout::registration_checkout_for_admin(); $template_args['step_button_text'] = __('Save Registration and Continue to Details', 'event_espresso'); $template_args['show_notification_toggle'] = TRUE; break; } $this->_set_add_edit_form_tags('process_reg_step', $hidden_fields); //we come back to the process_registration_step route. return EEH_Template::display_template(REG_TEMPLATE_PATH . 'reg_admin_register_new_attendee_step_content.template.php', $template_args, TRUE); }