/** * Display a notice if an upgrade is required. * * @since 1.4 */ function mdjm_show_upgrade_notice() { if (isset($_GET['page']) && $_GET['page'] == 'mdjm-upgrades') { return; } $mdjm_version = get_option('mdjm_version'); $mdjm_version = preg_replace('/[^0-9.].*/', '', $mdjm_version); // Check if there is an incomplete upgrade routine. $resume_upgrade = mdjm_maybe_resume_upgrade(); if (!empty($resume_upgrade)) { $resume_url = add_query_arg($resume_upgrade, admin_url('index.php')); printf('<div class="notice notice-error"><p>' . __('MDJM Event Management needs to complete an upgrade that was previously started. Click <a href="%s">here</a> to resume the upgrade.', 'mobile-dj-manager') . '</p></div>', esc_url($resume_url)); } else { if (version_compare($mdjm_version, '1.4', '<') || !mdjm_has_upgrade_completed('upgrade_event_packages')) { printf('<div class="notice notice-error"><p>' . __('MDJM Event Management needs to perform an upgrade to %s Packages and Add-ons. Click <a href="%s">here</a> to start the upgrade.', 'mobile-dj-manager') . '</p></div>', mdjm_get_label_singular(true), esc_url(admin_url('index.php?page=mdjm-upgrades&mdjm-upgrade=upgrade_event_packages&message=1&redirect=' . mdjm_get_current_page_url()))); } /* * NOTICE: * * When adding new upgrade notices, please be sure to put the action into the upgrades array during install: * /includes/install.php @ Appox Line 783 * */ } }
/** * Get AJAX URL * * @since 1.3 * @return str */ function mdjm_get_ajax_url() { $scheme = defined('FORCE_SSL_ADMIN') && FORCE_SSL_ADMIN ? 'https' : 'admin'; $current_url = mdjm_get_current_page_url(); $ajax_url = admin_url('admin-ajax.php', $scheme); if (preg_match('/^https/', $current_url) && !preg_match('/^https/', $ajax_url)) { $ajax_url = preg_replace('/^http/', 'https', $ajax_url); } return apply_filters('mdjm_ajax_url', $ajax_url); }
<?php $disabled = ' disabled="disabled"'; ?> <p class="mdjm-contract-notready"><?php printf(__('You cannot yet sign your contract as you have not indicated that you would like to proceed with your %s. Please return to the <a href="%s">event details</a> screen to confirm that you wish to proceed.', 'mobile-dj-manager'), mdjm_get_label_singular(true), '{event_url}'); ?> </p> <?php } // endif( $mdjm_event->post_status != 'mdjm-contract' ) ?> <div id="mdjm-contract-signature-form"> <form name="mdjm-signature-form" id="mdjm-signature-form" method="post" action="<?php echo mdjm_get_current_page_url(); ?> "> <?php wp_nonce_field('sign_contract', 'mdjm_nonce', true, true); ?> <?php mdjm_action_field('sign_event_contract'); ?> <input type="hidden" id="event_id" name="event_id" value="<?php echo $mdjm_event->ID; ?> " /> <div class="row mdjm-contract-signatory-name"> <div class="col first-name">
/** * Renders the payment mode form by getting all the enabled payment gateways and * outputting them as radio buttons for the user to choose the payment gateway. If * a default payment gateway has been chosen from the MDJM Settings, it will be * automatically selected. * * @since 1.3.8 * @return void */ function mdjm_payment_mode_select() { $gateways = mdjm_get_enabled_payment_gateways(true); $page_URL = mdjm_get_current_page_url(); do_action('mdjm_payment_mode_top'); ?> <fieldset id="mdjm_payment_mode_select"> <legend><?php _e('Select Payment Method', 'mobile-dj-manager'); ?> </legend> <?php do_action('mdjm_payment_mode_before_gateways_wrap'); ?> <div id="mdjm-payment-mode-wrap"> <?php do_action('mdjm_payment_mode_before_gateways'); foreach ($gateways as $gateway_id => $gateway) { $checked = checked($gateway_id, mdjm_get_default_gateway(), false); $checked_class = $checked ? ' mdjm-gateway-option-selected' : ''; echo '<label for="mdjm-gateway-' . esc_attr($gateway_id) . '" class="mdjm-gateway-option' . $checked_class . '" id="mdjm-gateway-option-' . esc_attr($gateway_id) . '">'; echo '<input type="radio" name="payment-mode" class="mdjm-gateway" id="mdjm-gateway-' . esc_attr($gateway_id) . '" value="' . esc_attr($gateway_id) . '"' . $checked . '>' . esc_html($gateway['payment_label']); echo '</label>'; } do_action('mdjm_payment_mode_after_gateways'); ?> </div> <?php do_action('mdjm_payment_mode_after_gateways_wrap'); ?> </fieldset> <div id="mdjm_payment_form_wrap"></div><!-- the fields are loaded into this--> <?php do_action('mdjm_payment_mode_bottom'); }
/** * MDJM Quote Shortcode. * * Displays the online quotation to the client. * * @since 1.3 * @param arr $atts Arguments passed with the shortcode * @return string */ function mdjm_shortcode_quote($atts) { $atts = shortcode_atts(array('button_text' => sprintf(__('Book this %s', 'mobile-dj-manager'), mdjm_get_label_singular())), $atts, 'mdjm-quote'); $event_id = ''; if (!empty($_GET['event_id'])) { $event_id = $_GET['event_id']; } else { $next_event = mdjm_get_clients_next_event(get_current_user_id()); if ($next_event) { $event_id = $next_event[0]->ID; } } if (isset($event_id) && mdjm_event_exists($event_id)) { if (is_user_logged_in()) { global $mdjm_event, $mdjm_quote_button_atts; $mdjm_quote_button_atts = $atts; $mdjm_event = new MDJM_Event($event_id); ob_start(); if ($mdjm_event) { // Some verification if (get_current_user_id() != $mdjm_event->client) { mdjm_get_template_part('quote', 'noevent'); } else { mdjm_get_template_part('quote'); } $output = mdjm_do_content_tags(ob_get_contents(), $mdjm_event->ID, $mdjm_event->client); } else { mdjm_get_template_part('quote', 'noevent'); $output = mdjm_do_content_tags(ob_get_contents(), '', get_current_user_id()); } ob_get_clean(); // Reset global var $mdjm_event = ''; return $output; } else { echo mdjm_login_form(mdjm_get_current_page_url()); } } else { ob_start(); mdjm_get_template_part('quote', 'noevent'); $output = mdjm_do_content_tags(ob_get_contents(), '', get_current_user_id()); ob_get_clean(); } }