function output_field_input($field, $post = true) { $output = parent::output_field_input($field, $post); if (in_array($field['type'], array('radio', 'checkboxes', 'multiselect')) && is_numeric($this->attendee_number)) { $output = str_replace('[%n]', '[' . $this->attendee_number . ']', $output); } return $output; }
public static function em_booking_save($result, $EM_Booking) { $EM_Form = self::get_form($EM_Booking->event_id, $EM_Booking); if (!empty($EM_Booking->booking_meta['registration']) && is_array($EM_Booking->booking_meta['registration'])) { //assign the common registration fields to person object in case used in this instance foreach ($EM_Booking->booking_meta['registration'] as $fieldid => $field_value) { if (!empty($EM_Form->form_fields[$fieldid]['type']) && array_key_exists($EM_Form->form_fields[$fieldid]['type'], $EM_Form->core_user_fields) && EM_Form::show_reg_fields($EM_Form->form_fields[$fieldid])) { $user_field_type = $EM_Form->form_fields[$fieldid]['type']; $EM_Booking->get_person()->{$user_field_type} = $field_value; } } } return $result; }
public static function admin_page_actions() { global $EM_Notices; $EM_Form = self::get_form(); if (!empty($_REQUEST['page']) && $_REQUEST['page'] == 'events-manager-forms-editor') { if (!empty($_REQUEST['form_name']) && $EM_Form->form_name == $_REQUEST['form_name']) { //set up booking form field map and save/retreive previous data if (empty($_REQUEST['bookings_form_action']) && $EM_Form->editor_get_post()) { //Update Values if (count($EM_Form->get_errors()) == 0) { //prefix all with dbem $form_fields = array(); foreach ($EM_Form->form_fields as $field_id => $field) { if (substr($field_id, 0, 5) != 'dbem_' && (!defined('EMP_SHARED_CUSTOM_FIELDS') || !EMP_SHARED_CUSTOM_FIELDS)) { $field_id = $field['fieldid'] = 'dbem_' . $field_id; } $form_fields[$field_id] = $field; } update_option('em_user_fields', $form_fields); $EM_Notices->add_confirm(__('Changes Saved', 'em-pro')); self::$form = false; //reset form $EM_Form = new EM_Form($form_fields); } else { $EM_Notices->add_error($EM_Form->get_errors()); } } } } //enable dbem_bookings_tickets_single_form if enabled }