Example #1
0
/**
 * Define the columns to be displayed for venue posts
 *
 * @since	0.5
 * @param	arr		$columns	Array of column names
 * @return	arr		$columns	Filtered array of column names
 */
function mdjm_venue_post_columns($columns)
{
    $columns = array('cb' => '<input type="checkbox" />', 'title' => __('Venue', 'mobile-dj-manager'), 'contact' => __('Contact', 'mobile-dj-manager'), 'phone' => __('Phone', 'mobile-dj-manager'), 'town' => __('Town', 'mobile-dj-manager'), 'county' => __('County', 'mobile-dj-manager'), 'event_count' => sprintf(__('%s', 'mobile-dj-manager'), mdjm_get_label_plural()), 'info' => __('Information', 'mobile-dj-manager'), 'details' => __('Details', 'mobile-dj-manager'));
    if (!mdjm_employee_can('add_venues') && isset($columns['cb'])) {
        unset($columns['cb']);
    }
    return $columns;
}
 /**
  * Get things started
  *
  * @since	1.4
  * @see WP_List_Table::__construct()
  */
 public function __construct()
 {
     global $status, $page;
     // Set parent defaults
     parent::__construct(array('singular' => mdjm_get_label_singular(), 'plural' => mdjm_get_label_plural(), 'ajax' => false));
     $this->label_single = mdjm_get_label_singular();
     $this->label_plural = mdjm_get_label_plural();
 }
 /**
  * Get things started
  *
  * @since	1.4
  * @see WP_List_Table::__construct()
  */
 public function __construct()
 {
     global $status, $page;
     // Set parent defaults
     parent::__construct(array('singular' => __('Transaction', 'mobile-dj-manager'), 'plural' => __('Transactions', 'mobile-dj-manager'), 'ajax' => false));
     $this->label_single = mdjm_get_label_singular();
     $this->label_plural = mdjm_get_label_plural();
     add_action('mdjm_reports_txn_types_additional_stats', array($this, 'graph_totals'));
 }
 /**
  * Get things started
  *
  * @since	1.4
  * @see WP_List_Table::__construct()
  */
 public function __construct()
 {
     global $status, $page;
     // Set parent defaults
     parent::__construct(array('singular' => mdjm_get_label_singular(), 'plural' => mdjm_get_label_plural(), 'ajax' => false));
     $this->label_single = mdjm_get_label_singular();
     $this->label_plural = mdjm_get_label_plural();
     add_action('mdjm_reports_conversions_graph_additional_stats', array($this, 'graph_totals'));
 }
Example #5
0
/**
 * Registers and sets up the MDJM Event Management custom post types
 *
 * @since	1.3
 * @return	void
 */
function mdjm_register_post_types()
{
    // Event Post Type
    $event_labels = apply_filters('mdjm_event_labels', array('name' => _x('%2$s', 'post type general name', 'mobile-dj-manager'), 'singular_name' => _x('%1$s', 'post type singular name', 'mobile-dj-manager'), 'menu_name' => _x('MDJM %2$s', 'admin menu', 'mobile-dj-manager'), 'name_admin_bar' => _x('%1$s', 'add new on admin bar', 'mobile-dj-manager'), 'add_new' => __('Create %1$s', 'mobile-dj-manager'), 'add_new_item' => __('Create New %1$s', 'mobile-dj-manager'), 'new_item' => __('New %1$s', 'mobile-dj-manager'), 'edit_item' => __('Edit %1$s', 'mobile-dj-manager'), 'view_item' => __('View %1$s', 'mobile-dj-manager'), 'all_items' => __('All %2$s', 'mobile-dj-manager'), 'search_items' => __('Search %2$s', 'mobile-dj-manager'), 'not_found' => __('No %3$s found.', 'mobile-dj-manager'), 'not_found_in_trash' => __('No %3$s found in Trash.', 'mobile-dj-manager')));
    foreach ($event_labels as $key => $value) {
        $event_labels[$key] = sprintf($value, mdjm_get_label_singular(), mdjm_get_label_plural(), mdjm_get_label_plural(true));
    }
    $event_args = array('labels' => $event_labels, 'description' => __('MDJM Events', 'mobile-dj-manager'), 'show_ui' => true, 'show_in_menu' => true, 'menu_position' => defined('MDJM_MENU_POS') ? MDJM_MENU_POS : 58.4, 'show_in_admin_bar' => true, 'capability_type' => 'mdjm_event', 'capabilities' => apply_filters('mdjm_event_caps', array('publish_posts' => 'publish_mdjm_events', 'edit_posts' => 'edit_mdjm_events', 'edit_others_posts' => 'edit_others_mdjm_events', 'delete_posts' => 'delete_mdjm_events', 'delete_others_posts' => 'delete_others_mdjm_events', 'read_private_posts' => 'read_private_mdjm_events', 'edit_post' => 'edit_mdjm_event', 'delete_post' => 'delete_mdjm_event', 'read_post' => 'read_mdjm_event')), 'map_meta_cap' => true, 'has_archive' => true, 'supports' => apply_filters('mdjm_event_supports', array('title')), 'menu_icon' => plugins_url('mobile-dj-manager/assets/images/mdjm-menu-16x16.jpg'), 'taxonomies' => array('mdjm-event'));
    register_post_type('mdjm-event', apply_filters('mdjm_event_post_type_args', $event_args));
    if (mdjm_packages_enabled()) {
        // Packages Post Type
        $package_labels = apply_filters('mdjm_package_labels', array('name' => _x('Packages', 'post type general name', 'mobile-dj-manager'), 'singular_name' => _x('Package', 'post type singular name', 'mobile-dj-manager'), 'menu_name' => _x('Packages', 'admin menu', 'mobile-dj-manager'), 'name_admin_bar' => _x('Package', 'add new on admin bar', 'mobile-dj-manager'), 'add_new' => __('Add Package', 'mobile-dj-manager'), 'add_new_item' => __('Add New Package', 'mobile-dj-manager'), 'new_item' => __('New Package', 'mobile-dj-manager'), 'edit_item' => __('Edit Package', 'mobile-dj-manager'), 'view_item' => __('View Package', 'mobile-dj-manager'), 'all_items' => __('All Packages', 'mobile-dj-manager'), 'search_items' => __('Search Packages', 'mobile-dj-manager'), 'not_found' => __('No packages found.', 'mobile-dj-manager'), 'not_found_in_trash' => __('No packages found in Trash.', 'mobile-dj-manager')));
        $package_args = array('labels' => $package_labels, 'description' => __('Equipment Packages for the MDJM Event Management plugin', 'mobile-dj-manager'), 'public' => true, 'show_in_menu' => 'edit.php?post_type=mdjm-package', 'has_archive' => true, 'rewrite' => array('slug' => 'packages'), 'supports' => apply_filters('mdjm_package_supports', array('title', 'editor', 'revisions', 'excerpt', 'thumbnail')));
        register_post_type('mdjm-package', apply_filters('mdjm_package_post_type_args', $package_args));
        // Addons Post Type
        $addon_labels = apply_filters('mdjm_addon_labels', array('name' => _x('Addons', 'post type general name', 'mobile-dj-manager'), 'singular_name' => _x('Addon', 'post type singular name', 'mobile-dj-manager'), 'menu_name' => _x('Addons', 'admin menu', 'mobile-dj-manager'), 'name_admin_bar' => _x('Addon', 'add new on admin bar', 'mobile-dj-manager'), 'add_new' => __('Add Addon', 'mobile-dj-manager'), 'add_new_item' => __('Add New Addon', 'mobile-dj-manager'), 'new_item' => __('New Addon', 'mobile-dj-manager'), 'edit_item' => __('Edit Addon', 'mobile-dj-manager'), 'view_item' => __('View Addon', 'mobile-dj-manager'), 'all_items' => __('All Addons', 'mobile-dj-manager'), 'search_items' => __('Search Addons', 'mobile-dj-manager'), 'not_found' => __('No addons found.', 'mobile-dj-manager'), 'not_found_in_trash' => __('No addons found in Trash.', 'mobile-dj-manager')));
        $addon_args = array('labels' => $addon_labels, 'description' => __('Equipment Addons for the MDJM Event Management plugin', 'mobile-dj-manager'), 'public' => true, 'show_in_menu' => 'edit.php?post_type=mdjm-addon', 'has_archive' => true, 'rewrite' => array('slug' => 'addons'), 'supports' => apply_filters('mdjm_addon_supports', array('title', 'editor', 'revisions', 'excerpt', 'thumbnail')));
        register_post_type('mdjm-addon', apply_filters('mdjm_addon_post_type_args', $addon_args));
    }
    // Communication History Post Type
    $email_history_labels = apply_filters('mdjm_email_history_labels', array('name' => _x('Email History', 'post type general name', 'mobile-dj-manager'), 'singular_name' => _x('Email History', 'post type singular name', 'mobile-dj-manager'), 'menu_name' => _x('Email History', 'admin menu', 'mobile-dj-manager'), 'name_admin_bar' => _x('Email History', 'add new on admin bar', 'mobile-dj-manager'), 'add_new' => __('Add Communication', 'mobile-dj-manager'), 'add_new_item' => __('Add New Communication', 'mobile-dj-manager'), 'new_item' => __('New Communication', 'mobile-dj-manager'), 'edit_item' => __('Review Email', 'mobile-dj-manager'), 'view_item' => __('View Email', 'mobile-dj-manager'), 'all_items' => __('All Emails', 'mobile-dj-manager'), 'search_items' => __('Search Emails', 'mobile-dj-manager'), 'not_found' => __('No Emails found.', 'mobile-dj-manager'), 'not_found_in_trash' => __('No Emails found in Trash.', 'mobile-dj-manager')));
    $email_history_args = array('labels' => $email_history_labels, 'description' => __('Communication used by the MDJM Event Management for WordPress plugin', 'mobile-dj-manager'), 'exclude_from_search' => true, 'show_ui' => true, 'show_in_menu' => 'edit.php?post_type=mdjm_communication', 'show_in_admin_bar' => false, 'rewrite' => array('slug' => 'mdjm-communications'), 'capability_type' => 'mdjm_comm', 'capabilities' => apply_filters('mdjm_communications_caps', array('edit_post' => 'edit_mdjm_comm', 'read_post' => 'read_mdjm_comm', 'delete_post' => 'delete_mdjm_comm', 'edit_posts' => 'edit_mdjm_comms', 'edit_others_posts' => 'edit_others_mdjm_comms', 'publish_posts' => 'publish_mdjm_comms', 'read_private_posts' => 'read_private_mdjm_comms')), 'map_meta_cap' => true, 'has_archive' => true, 'supports' => apply_filters('mdjm_email_history_supports', array('title')));
    register_post_type('mdjm_communication', apply_filters('mdjm_email_history_post_type_args', $email_history_args));
    // Contract Post Type
    $contract_labels = apply_filters('mdjm_contract_labels', array('name' => _x('Contract Templates', 'post type general name', 'mobile-dj-manager'), 'singular_name' => _x('Contract Template', 'post type singular name', 'mobile-dj-manager'), 'menu_name' => _x('Contract Templates', 'admin menu', 'mobile-dj-manager'), 'name_admin_bar' => _x('Contract Template', 'add new on admin bar', 'mobile-dj-manager'), 'add_new' => __('Add Contract Template', 'mobile-dj-manager'), 'add_new_item' => __('Add New Contract Template', 'mobile-dj-manager'), 'new_item' => __('New Contract Template', 'mobile-dj-manager'), 'edit_item' => __('Edit Contract Template', 'mobile-dj-manager'), 'view_item' => __('View Contract Template', 'mobile-dj-manager'), 'all_items' => __('All Contract Templates', 'mobile-dj-manager'), 'search_items' => __('Search Contract Templates', 'mobile-dj-manager'), 'not_found' => __('No contract templates found.', 'mobile-dj-manager'), 'not_found_in_trash' => __('No contract templates found in Trash.', 'mobile-dj-manager')));
    $contract_args = array('labels' => $contract_labels, 'description' => __('Contracts used by the MDJM plugin', 'mobile-dj-manager'), 'exclude_from_search' => true, 'show_ui' => true, 'show_in_menu' => 'edit.php?post_type=contract', 'rewrite' => array('slug' => 'contract-templates'), 'capability_type' => array('mdjm_template', 'mdjm_templates'), 'capabilities' => apply_filters('mdjm_contract_caps', array('edit_post' => 'edit_mdjm_template', 'read_post' => 'read_mdjm_template', 'delete_post' => 'delete_mdjm_template', 'edit_posts' => 'edit_mdjm_templates', 'edit_others_posts' => 'edit_others_mdjm_templates', 'publish_posts' => 'publish_mdjm_templates', 'read_private_posts' => 'read_private_mdjm_templates')), 'map_meta_cap' => true, 'has_archive' => true, 'supports' => apply_filters('mdjm_contract_supports', array('title', 'editor', 'revisions')));
    register_post_type('contract', apply_filters('mdjm_contract_post_type_args', $contract_args));
    // Signed Contract Post Type
    $signed_contract_labels = apply_filters('mdjm_signed_contract_labels', array('name' => _x('Signed Contracts', 'post type general name', 'mobile-dj-manager'), 'singular_name' => _x('Signed Contract', 'post type singular name', 'mobile-dj-manager'), 'menu_name' => _x('Signed Contracts', 'admin menu', 'mobile-dj-manager'), 'name_admin_bar' => _x('Signed Contract', 'add new on admin bar', 'mobile-dj-manager'), 'add_new' => __('Add Signed Contract', 'mobile-dj-manager'), 'add_new_item' => __('Add New Signed Contract', 'mobile-dj-manager'), 'new_item' => __('New Signed Contract', 'mobile-dj-manager'), 'edit_item' => __('Edit Signed Contract', 'mobile-dj-manager'), 'view_item' => __('View Signed Contract', 'mobile-dj-manager'), 'all_items' => __('All Signed Contracts', 'mobile-dj-manager'), 'search_items' => __('Search Signed Contracts', 'mobile-dj-manager'), 'not_found' => __('No signed contracts found.', 'mobile-dj-manager'), 'not_found_in_trash' => __('No signed contracts found in Trash.', 'mobile-dj-manager')));
    $signed_contract_args = array('labels' => $signed_contract_labels, 'description' => __('Signed Contracts used by the MDJM plugin', 'mobile-dj-manager'), 'rewrite' => array('slug' => 'mdjm-signed-contract'), 'capability_type' => array('mdjm_signed_contract', 'mdjm_signed_contracts'), 'map_meta_cap' => true, 'has_archive' => true, 'supports' => array(''));
    register_post_type('mdjm-signed-contract', apply_filters('mdjm_signed_contract_post_type_args', $signed_contract_args));
    // Custom Field Post Type
    $custom_field_labels = apply_filters('mdjm_custom_field_contract_labels', array('name' => _x('Custom Event Fields', 'post type general name', 'mobile-dj-manager'), 'singular_name' => _x('Custom Event Field', 'post type singular name', 'mobile-dj-manager'), 'menu_name' => _x('Custom Event Fields', 'admin menu', 'mobile-dj-manager'), 'add_new' => _x('Add Custom Event Field', 'add new on admin bar', 'mobile-dj-manager'), 'add_new_item' => __('Add New Custom Event Field'), 'edit' => __('Edit Custom Event Field'), 'edit_item' => __('Edit Custom Event Field'), 'new_item' => __('New Hosted Plugin'), 'view' => __('View Custom Event Field'), 'view_item' => __('View Custom Event Field'), 'search_items' => __('Search Custom Event Field'), 'not_found' => __('No Custom Event Fields found'), 'not_found_in_trash' => __('No Custom Event Fields found in trash')));
    $custom_field_args = array('labels' => $custom_field_labels, 'description' => __('This is where you can add Custom Event Fields for use in the event screen.', 'mobile-dj-manager'), 'rewrite' => array('slug' => 'mdjm-custom-fields'), 'supports' => array('title'));
    register_post_type('mdjm-custom-field', apply_filters('mdjm_custom_field_post_type_args', $custom_field_args));
    // Email Template Post Type
    $email_template_labels = apply_filters('mdjm_email_template_labels', array('name' => _x('Email Templates', 'post type general name', 'mobile-dj-manager'), 'singular_name' => _x('Email Template', 'post type singular name', 'mobile-dj-manager'), 'menu_name' => _x('Email Templates', 'admin menu', 'mobile-dj-manager'), 'name_admin_bar' => _x('Email Template', 'add new on admin bar', 'mobile-dj-manager'), 'add_new' => __('Add Template', 'mobile-dj-manager'), 'add_new_item' => __('Add New Template', 'mobile-dj-manager'), 'new_item' => __('New Template', 'mobile-dj-manager'), 'edit_item' => __('Edit Template', 'mobile-dj-manager'), 'view_item' => __('View Template', 'mobile-dj-manager'), 'all_items' => __('All Templates', 'mobile-dj-manager'), 'search_items' => __('Search Templates', 'mobile-dj-manager'), 'not_found' => __('No templates found.', 'mobile-dj-manager'), 'not_found_in_trash' => __('No templates found in Trash.', 'mobile-dj-manager')));
    $email_template_args = array('labels' => $email_template_labels, 'description' => __('Email Templates for the MDJM Event Management plugin', 'mobile-dj-manager'), 'show_ui' => true, 'show_in_menu' => 'edit.php?post_type=email_template', 'show_in_admin_bar' => true, 'rewrite' => array('slug' => 'email-template'), 'capability_type' => 'mdjm_template', 'capabilities' => apply_filters('mdjm_email_template_caps', array('publish_posts' => 'publish_mdjm_templates', 'edit_posts' => 'edit_mdjm_templates', 'edit_others_posts' => 'edit_others_mdjm_templates', 'delete_posts' => 'delete_mdjm_templates', 'delete_others_posts' => 'delete_others_mdjm_templates', 'read_private_posts' => 'read_private_mdjm_templates', 'edit_post' => 'edit_mdjm_template', 'delete_post' => 'delete_mdjm_template', 'read_post' => 'read_mdjm_template')), 'map_meta_cap' => true, 'has_archive' => true, 'supports' => apply_filters('mdjm_email_template_supports', array('title', 'editor', 'revisions')));
    register_post_type('email_template', apply_filters('mdjm_email_template_post_type_args', $email_template_args));
    // Playlist Post Type
    $playlist_labels = apply_filters('mdjm_playlist_labels', array('name' => _x('Playlist Entries', 'post type general name', 'mobile-dj-manager'), 'singular_name' => _x('Playlist Entry', 'post type singular name', 'mobile-dj-manager'), 'menu_name' => _x('Playlist Entries', 'admin menu', 'mobile-dj-manager'), 'name_admin_bar' => _x('Playlist Entry', 'add new on admin bar', 'mobile-dj-manager'), 'add_new' => __('Add Playlist Entry', 'mobile-dj-manager'), 'add_new_item' => __('Add New Playlist Entry', 'mobile-dj-manager'), 'new_item' => __('New Entry', 'mobile-dj-manager'), 'edit_item' => __('Edit Entry', 'mobile-dj-manager'), 'view_item' => __('View Entry', 'mobile-dj-manager'), 'all_items' => __('All Entries', 'mobile-dj-manager'), 'search_items' => __('Search Entries', 'mobile-dj-manager'), 'not_found' => __('No entries found.', 'mobile-dj-manager'), 'not_found_in_trash' => __('No entries found in Trash.', 'mobile-dj-manager')));
    $playlist_args = array('labels' => $playlist_labels, 'description' => __('MDJM Event Management Playlist Entries', 'mobile-dj-manager'), 'show_ui' => true, 'show_in_menu' => false, 'capability_type' => 'mdjm_playlist', 'capabilities' => apply_filters('mdjm_playlist_caps', array('edit_post' => 'edit_mdjm_playlist', 'read_post' => 'read_mdjm_playlist', 'delete_post' => 'delete_mdjm_playlist', 'edit_posts' => 'edit_mdjm_playlists', 'edit_others_posts' => 'edit_others_mdjm_playlists', 'publish_posts' => 'publish_mdjm_playlists', 'read_private_posts' => 'read_private_mdjm_playlists')), 'map_meta_cap' => true, 'supports' => apply_filters('mdjm_playlist_supports', array('title')), 'taxonomies' => array('mdjm-playlist'));
    register_post_type('mdjm-playlist', apply_filters('mdjm_playlist_post_type_args', $playlist_args));
    // Quote Post Type
    $quote_labels = apply_filters('mdjm_quote_labels', array('name' => _x('Quotes', 'post type general name', 'mobile-dj-manager'), 'singular_name' => _x('Quote', 'post type singular name', 'mobile-dj-manager'), 'menu_name' => _x('Quotes', 'admin menu', 'mobile-dj-manager'), 'name_admin_bar' => _x('Quote', 'add new on admin bar', 'mobile-dj-manager'), 'add_new' => __('Create Quote', 'mobile-dj-manager'), 'add_new_item' => __('Create New Quote', 'mobile-dj-manager'), 'new_item' => __('New Quote', 'mobile-dj-manager'), 'edit_item' => __('Edit Quote', 'mobile-dj-manager'), 'view_item' => __('View Quote', 'mobile-dj-manager'), 'all_items' => __('All Quotes', 'mobile-dj-manager'), 'search_items' => __('Search Quotes', 'mobile-dj-manager'), 'not_found' => __('No quotes found.', 'mobile-dj-manager'), 'not_found_in_trash' => __('No quotes found in Trash.', 'mobile-dj-manager')));
    $quote_args = array('labels' => $quote_labels, 'description' => __('MDJM Event Management Quotes', 'mobile-dj-manager'), 'show_ui' => true, 'show_in_menu' => 'edit.php?post_type=mdjm-quotes', 'show_in_admin_bar' => false, 'rewrite' => array('slug' => 'mdjm-quotes'), 'capability_type' => 'mdjm_quote', 'capabilities' => apply_filters('mdjm_quote_caps', array('edit_post' => 'edit_mdjm_quote', 'read_post' => 'read_mdjm_quote', 'delete_post' => 'delete_mdjm_quote', 'edit_posts' => 'edit_mdjm_quotes', 'edit_others_posts' => 'edit_others_mdjm_quotes', 'publish_posts' => 'publish_mdjm_quotes', 'read_private_posts' => 'read_private_mdjm_quotes')), 'map_meta_cap' => true, 'has_archive' => true, 'supports' => apply_filters('mdjm_quote_supports', array('title')));
    register_post_type('mdjm-quotes', apply_filters('mdjm_quotes_post_type_args', $quote_args));
    // Transaction Post Type
    $txn_labels = apply_filters('mdjm_txn_labels', array('name' => _x('Transactions', 'post type general name', 'mobile-dj-manager'), 'singular_name' => _x('Transaction', 'post type singular name', 'mobile-dj-manager'), 'menu_name' => _x('Transactions', 'admin menu', 'mobile-dj-manager'), 'name_admin_bar' => _x('Transaction', 'add new on admin bar', 'mobile-dj-manager'), 'add_new' => __('Add Transaction', 'mobile-dj-manager'), 'add_new_item' => __('Add New Transaction', 'mobile-dj-manager'), 'new_item' => __('New Transaction', 'mobile-dj-manager'), 'edit_item' => __('Edit Transaction', 'mobile-dj-manager'), 'view_item' => __('View Transaction', 'mobile-dj-manager'), 'all_items' => __('All Transactions', 'mobile-dj-manager'), 'search_items' => __('Search Transactions', 'mobile-dj-manager'), 'not_found' => __('No Transactions found.', 'mobile-dj-manager'), 'not_found_in_trash' => __('No Transactions found in Trash.')));
    $txn_args = array('labels' => $txn_labels, 'description' => __('Transactions for the MDJM Event Management plugin', 'mobile-dj-manager'), 'show_ui' => true, 'show_in_menu' => 'edit.php?post_type=mdjm-transaction', 'show_in_admin_bar' => true, 'rewrite' => array('slug' => 'mdjm-transaction'), 'capability_type' => 'mdjm_txn', 'capabilities' => apply_filters('mdjm_transaction_caps', array('edit_post' => 'edit_mdjm_txn', 'read_post' => 'read_mdjm_txn', 'delete_post' => 'delete_mdjm_txn', 'edit_posts' => 'edit_mdjm_txns', 'edit_others_posts' => 'edit_others_mdjm_txns', 'publish_posts' => 'publish_mdjm_txns', 'read_private_posts' => 'read_private_mdjm_txns')), 'map_meta_cap' => true, 'has_archive' => true, 'supports' => apply_filters('mdjm_transaction_supports', array('title')), 'taxonomies' => array('mdjm-transaction'));
    register_post_type('mdjm-transaction', apply_filters('mdjm_transaction_post_type_args', $txn_args));
    // Venue Post Type
    $venue_labels = apply_filters('mdjm_txn_labels', array('name' => _x('Venues', 'post type general name', 'mobile-dj-manager'), 'singular_name' => _x('Venue', 'post type singular name', 'mobile-dj-manager'), 'menu_name' => _x('Venues', 'admin menu', 'mobile-dj-manager'), 'name_admin_bar' => _x('Venue', 'add new on admin bar', 'mobile-dj-manager'), 'add_new' => __('Add Venue', 'mobile-dj-manager'), 'add_new_item' => __('Add New Venue', 'mobile-dj-manager'), 'new_item' => __('New Venue', 'mobile-dj-manager'), 'edit_item' => __('Edit Venue', 'mobile-dj-manager'), 'view_item' => __('View Venue', 'mobile-dj-manager'), 'all_items' => __('All Venues', 'mobile-dj-manager'), 'search_items' => __('Search Venues', 'mobile-dj-manager'), 'not_found' => __('No Venues found.', 'mobile-dj-manager'), 'not_found_in_trash' => __('No Venues found in Trash.', 'mobile-dj-manager')));
    $venue_args = array('labels' => $venue_labels, 'description' => __('Venues stored for the MDJM Event Management plugin', 'mobile-dj-manager'), 'show_ui' => true, 'show_in_menu' => 'edit.php?post_type=mdjm-venue', 'show_in_admin_bar' => true, 'rewrite' => array('slug' => 'mdjm-venue'), 'capability_type' => 'mdjm_venue', 'capabilities' => apply_filters('mdjm_venue_caps', array('edit_post' => 'edit_mdjm_venue', 'read_post' => 'read_mdjm_venue', 'delete_post' => 'delete_mdjm_venue', 'edit_posts' => 'edit_mdjm_venues', 'edit_others_posts' => 'edit_others_mdjm_venues', 'publish_posts' => 'publish_mdjm_venues', 'read_private_posts' => 'read_private_mdjm_venues')), 'map_meta_cap' => true, 'has_archive' => true, 'supports' => apply_filters('mdjm_venue_supports', array('title')), 'taxonomies' => array('mdjm-venue'));
    register_post_type('mdjm-venue', apply_filters('mdjm_venue_post_type_args', $venue_args));
}
/**
 * Communications contextual help.
 *
 * @since       1.3
 * @return      void
 */
function mdjm_comms_email_contextual_help()
{
    $screen = get_current_screen();
    if ($screen->id != 'mdjm-event_page_mdjm-comms') {
        return;
    }
    $screen->set_help_sidebar('<p><strong>' . __('For more information:', 'mobile-dj-manager') . '</strong></p>' . '<p>' . sprintf(__('Visit the <a href="%s">documentation</a> on the MDJM Event Management website.', 'mobile-dj-manager'), esc_url('http://mdjm.co.uk/support/')) . '</p>' . '<p>' . sprintf(__('Join our <a href="%s">Facebook Group</a>.', 'mobile-dj-manager'), esc_url('https://www.facebook.com/groups/mobiledjmanager/')) . '</p>' . '<p>' . sprintf(__('<a href="%s">Post an issue</a> on <a href="%s">GitHub</a>.', 'mobile-dj-manager'), esc_url('https://github.com/mdjm/mobile-dj-manager/issues'), esc_url('https://github.com/mdjm/mobile-dj-manager/')) . '</p>' . '<p>' . sprintf(__('View <a href="%s">add-ons</a>.', 'mobile-dj-manager'), esc_url('http://mdjm.co.uk/add-ons/')) . '</p>');
    do_action('mdjm_pre_comms_email_contextual_help', $screen);
    $screen->add_help_tab(array('id' => 'mdjm-comm-email', 'title' => __('Communications', 'mobile-dj-manager'), 'content' => '<p>' . sprintf(__('<strong>Select a Recipient</strong> - Choose from the dropdown list who your email is to. Users are grouped into Clients and Employees. Once you have selected a recipient the Associated %s list will be updated with their active %s. This is a required field.', 'mobile-dj-manager'), mdjm_get_label_plural(), mdjm_get_label_plural(true)) . '</p>' . '<p>' . __('<strong>Subject</strong> - Enter the subject of your email. If you select a template the subject will be updated to the title of the template. This is a required field.', 'mobile-dj-manager') . '</p>' . '<p>' . __('<strong>Copy Yourself?</strong> - Select this option if you wish to receive a copy of the email. If the settings options have been enabled to copy Admin and/or Employee into Client emails, you may receive a copy regardless of whether or not this option is selected.', 'mobile-dj-manager') . '</p>' . '<p>' . __('<strong>Select a Template</strong> - Choose a pre-defined email or contract template to populate the content field. Anything you have already entered into the content field will be overwritten. If you do not select a template, you will need to manually enter content into the content field.', 'mobile-dj-manager') . '</p>' . '<p>' . sprintf(__('<strong>Associated %s</strong> - If the Client or Employee you have selected within the <strong>Select a Recipient</strong> field has active %s it is displayed here. Select it to tell MDJM that the email you are sending is associated to this %s and %1$s content tags can be used within the email content.', 'mobile-dj-manager'), mdjm_get_label_singular(), mdjm_get_label_plural(true), mdjm_get_label_singular(true)) . '</p>' . '<p>' . __('<strong>Attach a File</strong> - Enables you to select a file from your computer to the email.', 'mobile-dj-manager') . '</p>' . '<p>' . __('<strong>Content</strong> - If you have selected a template within the <strong>Select a Template</strong> field, this field will be populated with that templates content. You can adjust this content as required. Alternatively, if no template is selected, use this as a free text field for your email content. Content tags are supported and can be entered via the <strong>MDJM</strong> button on the text editor toolbar. Remember this field is resizeable. Drag from the bottom right hand corner to make bigger if necessary. This is a required field.', 'mobile-dj-manager') . '</p>'));
    do_action('mdjm_post_comms_email_contextual_help', $screen);
}
 public function create_tasks()
 {
     global $mdjm_options;
     $time = current_time('timestamp');
     if (isset($mdjm_options['upload_playlists'])) {
         $playlist_nextrun = strtotime('+1 day', $time);
     } else {
         $playlist_nextrun = 'N/A';
     }
     $mdjm_schedules = array('complete-events' => array('slug' => 'complete-events', 'name' => 'Complete Events', 'active' => 'Y', 'desc' => sprintf(__('Mark %s as completed once the %s date has passed', 'mobile-dj-manager'), mdjm_get_label_plural(true), mdjm_get_label_singular(true)), 'frequency' => 'Daily', 'nextrun' => $time, 'lastran' => 'Never', 'options' => array('email_client' => 'N', 'email_template' => '0', 'email_subject' => sprintf(__('Task Complete %s has finished', 'mobile-dj-manager'), mdjm_get_label_plural()), 'email_from' => 'admin', 'run_when' => 'after_event', 'age' => '1 HOUR', 'notify_admin' => 'Y', 'notify_dj' => 'N'), 'function' => 'complete_event', 'totalruns' => '0', 'default' => 'Y'), 'request-deposit' => array('slug' => 'request-deposit', 'name' => 'Request Deposit', 'active' => 'N', 'desc' => sprintf(__('Send reminder email to client requesting deposit payment if %s status is Approved and deposit has not been received', 'mobile-dj-manager'), mdjm_get_label_singular(true)), 'frequency' => 'Daily', 'nextrun' => 'N/A', 'lastran' => 'Never', 'options' => array('email_client' => 'Y', 'email_template' => '0', 'email_subject' => __('Request Deposit Task Complete', 'mobile-dj-manager'), 'email_from' => 'admin', 'run_when' => 'after_approval', 'age' => '3 DAY', 'notify_admin' => 'Y', 'notify_dj' => 'N'), 'function' => 'request_deposit', 'totalruns' => '0', 'default' => 'Y'), 'balance-reminder' => array('slug' => 'balance-reminder', 'name' => __('Balance Reminder', 'mobile-dj-manager'), 'active' => 'N', 'desc' => sprintf(__('Send email to client requesting they pay remaining balance for %s', 'mobile-dj-manager'), mdjm_get_label_singular(true)), 'frequency' => 'Daily', 'nextrun' => 'N/A', 'lastran' => 'Never', 'options' => array('email_client' => 'Y', 'email_template' => '0', 'email_subject' => __('Balance Reminder Task Complete', 'mobile-dj-manager'), 'email_from' => 'admin', 'run_when' => 'before_event', 'age' => '2 WEEK', 'notify_admin' => 'Y', 'notify_dj' => 'N'), 'function' => 'balance_reminder', 'totalruns' => '0', 'default' => 'Y'), 'fail-enquiry' => array('slug' => 'fail-enquiry', 'name' => __('Fail Enquiry', 'mobile-dj-manager'), 'active' => 'N', 'desc' => __('Automatically fail enquiries that have not been updated within the specified amount of time', 'mobile-dj-manager'), 'frequency' => 'Daily', 'nextrun' => 'N/A', 'lastran' => 'Never', 'options' => array('email_client' => 'N', 'email_template' => '0', 'email_subject' => __('Fail Enquiry Task Complete', 'mobile-dj-manager'), 'email_from' => 'admin', 'run_when' => 'event_created', 'age' => '2 WEEK', 'notify_admin' => 'Y', 'notify_dj' => 'N'), 'function' => 'fail_enquiry', 'totalruns' => '0', 'default' => 'Y'), 'upload-playlists' => array('slug' => 'upload-playlists', 'name' => __('Upload Playlists', 'mobile-dj-manager'), 'active' => 'Y', 'desc' => __('Transmit playlist information back to the MDJM servers to help build an information library. This option is updated the MDJM Settings pages.', 'mobile-dj-manager'), 'frequency' => 'Twice Daily', 'nextrun' => $playlist_nextrun, 'lastran' => 'Never', 'options' => array('email_client' => 'N', 'email_template' => '0', 'email_subject' => '0', 'email_from' => '0', 'run_when' => 'after_event', 'age' => '1 HOUR', 'notify_admin' => 'N', 'notify_dj' => 'N'), 'function' => 'submit_playlist', 'totalruns' => '0', 'default' => 'Y'));
     update_option('mdjm_schedules', $mdjm_schedules);
 }
/**
 * Contracts contextual help.
 *
 * @since       1.3
 * @return      void
 */
function mdjm_contract_contextual_help()
{
    $screen = get_current_screen();
    if ($screen->id != 'contract') {
        return;
    }
    $screen->set_help_sidebar('<p><strong>' . __('For more information:', 'mobile-dj-manager') . '</strong></p>' . '<p>' . sprintf(__('Visit the <a href="%s">documentation</a> on the MDJM Event Management website.', 'mobile-dj-manager'), esc_url('http://mdjm.co.uk/support/')) . '</p>' . '<p>' . sprintf(__('Join our <a href="%s">Facebook Group</a>.', 'mobile-dj-manager'), esc_url('https://www.facebook.com/groups/mobiledjmanager/')) . '</p>' . '<p>' . sprintf(__('<a href="%s">Post an issue</a> on <a href="%s">GitHub</a>.', 'mobile-dj-manager'), esc_url('https://github.com/mdjm/mobile-dj-manager/issues'), esc_url('https://github.com/mdjm/mobile-dj-manager/')) . '</p>' . '<p>' . sprintf(__('View <a href="%s">add-ons</a>.', 'mobile-dj-manager'), esc_url('http://mdjm.co.uk/add-ons/')) . '</p>');
    do_action('mdjm_pre_contract_contextual_help', $screen);
    $screen->add_help_tab(array('id' => 'mdjm-contract-add', 'title' => __('Add New Template', 'mobile-dj-manager'), 'content' => '<p>' . __('<strong>Title</strong> - Enter a title for your contract. A good title is short but descriptive of the type of contract.', 'mobile-dj-manager') . '</p>' . '<p>' . __('<strong>Content</strong> - Enter the content for your template. HTML, images, and MDJM content tags are supported. Use the MDJM button on the content editor toolbar for easy access to the content tags.', 'mobile-dj-manager') . '</p>'));
    $screen->add_help_tab(array('id' => 'mdjm-contract-save', 'title' => __('Save Contract', 'mobile-dj-manager'), 'content' => '<p>' . __("Save a draft if you've still got content to add, click preview to see what your contract looks like when formatted and click Save Contract when you are ready to publish.", 'mobile-dj-manager') . '</p>'));
    $screen->add_help_tab(array('id' => 'mdjm-contract-details', 'title' => sprintf(__('%s Details', 'mobile-dj-manager'), mdjm_get_label_singular()), 'content' => '<p>' . sprintf(__('Displays general information regarding this contract such as Author, whether it is the default contract used for %1$s, and the number of %1$s it is assigned to. Enter a description if necessary to describe the type of contract and for which type of %1$s it should be used. The description will not be seen by clients.', 'mobile-dj-manager'), mdjm_get_label_plural(true)) . '</p>'));
    do_action('mdjm_post_contract_contextual_help', $screen);
}
Example #9
0
/**
 * Output for the Contract Details meta box.
 *
 * @since	1.3
 * @param	obj		$post		The post object (WP_Post).
 * @return
 */
function mdjm_contract_details_metabox($post)
{
    do_action('mdjm_pre_contract_details_metabox', $post);
    wp_nonce_field(basename(__FILE__), 'mdjm-contract' . '_nonce');
    $contract_events = get_posts(array('post_type' => 'mdjm-event', 'posts_per_page' => -1, 'meta_key' => '_mdjm_event_contract', 'meta_value_num' => $post->ID, 'post_status' => 'any'));
    $event_count = count($contract_events);
    $total_events = sprintf(_n(' %s', ' %s', $event_count), mdjm_get_label_singular(), mdjm_get_label_plural());
    $default_contract = mdjm_get_option('default_contract') == $post->ID ? __('Yes') : __('No');
    ?>
	<script type="text/javascript">
	document.getElementById("title").className += " required";
	document.getElementById("content").className += " required";
	</script>
	
	<p><?php 
    printf(__('<strong>Author</strong>: <a href="%s">%s</a>', 'mobile-dj-manager'), admin_url("user-edit.php?user_id={$post->post_author}"), get_the_author_meta('display_name', $post->post_author));
    ?>
	</p>
	
	<p><?php 
    _e('<strong>Default</strong>?', 'mobile-dj-manager');
    echo ' ' . $default_contract;
    ?>
    </p>
	
	<p><?php 
    _e('<strong>Assigned To</strong>: ', 'mobile-dj-manager');
    printf(_n($event_count . ' %1$s', $event_count . ' %2$s', $event_count), mdjm_get_label_singular(), mdjm_get_label_plural());
    ?>
    </p>
	
	<p><?php 
    _e('<strong>Description</strong>: <span class="description">(optional)</span>', 'mobile-dj-manager');
    ?>
    	<br />
        <input type="hidden" name="mdjm_update_custom_post" id="mdjm_update_custom_post" value="mdjm_update" />
        <textarea name="contract_description" id="contract_description" class="widefat" rows="5" placeholder="<?php 
    _e('i.e To be used for Pubs/Clubs', 'mobile-dj-manager');
    ?>
"><?php 
    echo esc_attr(get_post_meta($post->ID, '_contract_description', true));
    ?>
</textarea>
    </p>
	
	<?php 
    do_action('mdjm_post_contract_details_metabox', $post);
}
 /**
  * Set the CSV columns
  *
  * @access	public
  * @since	1.4
  * @return	arr		$cols	All the columns
  */
 public function csv_cols()
 {
     if (!empty($_POST['mdjm_export_event'])) {
         $cols = array('first_name' => __('First Name', 'mobile-dj-manager'), 'last_name' => __('Last Name', 'mobile-dj-manager'), 'email' => __('Email', 'mobile-dj-manager'), 'date' => sprintf(__('%s Date', 'mobile-dj-manager'), mdjm_get_label_singular()));
     } else {
         $cols = array();
         if ('emails' != $_POST['mdjm_export_option']) {
             $cols['name'] = __('Name', 'mobile-dj-manager');
         }
         $cols['email'] = __('Email', 'mobile-dj-manager');
         if ('full' == $_POST['mdjm_export_option']) {
             $cols['events'] = sprintf(__('Total %s', 'mobile-dj-manager'), mdjm_get_label_plural());
             $cols['amount'] = __('Total Value', 'mobile-dj-manager') . ' (' . html_entity_decode(mdjm_currency_filter('')) . ')';
         }
     }
     return $cols;
 }
/**
 * Settings contextual help.
 *
 * @since       1.3
 * @return      void
 */
function mdjm_settings_contextual_help()
{
    $screen = get_current_screen();
    if ($screen->id != 'mdjm-event_page_mdjm-settings') {
        return;
    }
    $screen->set_help_sidebar('<p><strong>' . __('For more information:', 'mobile-dj-manager') . '</strong></p>' . '<p>' . sprintf(__('Visit the <a href="%s">documentation</a> on the MDJM Event Management website.', 'mobile-dj-manager'), esc_url('http://mdjm.co.uk/support/')) . '</p>' . '<p>' . sprintf(__('Join our <a href="%s">Facebook Group</a>.', 'mobile-dj-manager'), esc_url('https://www.facebook.com/groups/mobiledjmanager/')) . '</p>' . '<p>' . sprintf(__('<a href="%s">Post an issue</a> on <a href="%s">GitHub</a>.', 'mobile-dj-manager'), esc_url('https://github.com/mdjm/mobile-dj-manager/issues'), esc_url('https://github.com/mdjm/mobile-dj-manager/')) . '</p>' . '<p>' . sprintf(__('View <a href="%s">add-ons</a>.', 'mobile-dj-manager'), esc_url('http://mdjm.co.uk/add-ons/')) . '</p>');
    do_action('mdjm_pre_settings_contextual_help', $screen);
    $screen->add_help_tab(array('id' => 'mdjm-settings-general', 'title' => __('General', 'mobile-dj-manager'), 'content' => '<p>' . __('This screen provides the most basic settings for configuring MDJM. Set your company name and preferred date and time format.', 'mobile-dj-manager') . '</p>'));
    $screen->add_help_tab(array('id' => 'mdjm-settings-events', 'title' => mdjm_get_label_plural(), 'content' => '<p>' . sprintf(__('This screen enables to you configure options %1$s and playlists. Select your %1$s default contract template, whether or not you are an employer and enable equipment packages.', 'mobile-dj-manager') . '</p>' . '<p>' . __('You can also toggle playlists on or off, select when a playlist should close choose whether or not to upload your playlists to the MDJM servers.', 'mobile-dj-manager'), mdjm_get_label_plural(true)) . '</p>'));
    $screen->add_help_tab(array('id' => 'mdjm-settings-emails-templates', 'title' => __('Emails &amp; Templates', 'mobile-dj-manager'), 'content' => '<p>' . __('This screen allows you to adjust options for emails, toggle on or off the email tracking feature and select which templates to use as content for emails.', 'mobile-dj-manager') . '</p>'));
    $screen->add_help_tab(array('id' => 'mdjm-settings-client-zone', 'title' => mdjm_get_option('app_name', __('Client Zone', 'mobile-dj-manager')), 'content' => '<p>' . sprintf(__("This screen allows you to configure settings associated with the %s as well as set various pages and configure the Availability Checker.", 'mobile-dj-manager'), mdjm_get_option('app_name', __('Client Zone', 'mobile-dj-manager'))) . '</p>'));
    $screen->add_help_tab(array('id' => 'mdjm-settings-payments', 'title' => __('Payments', 'mobile-dj-manager'), 'content' => '<p>' . __('This screen allows you to configure the payment settings. Specify your currency, format currency display, set default deposits and select whether or not to apply tax.', 'mobile-dj-manager') . '</p>'));
    $screen->add_help_tab(array('id' => 'mdjm-settings-extensions', 'title' => __('Extensions', 'mobile-dj-manager'), 'content' => '<p>' . __('This screen provides access to settings added by most MDJM Event Management extensions.', 'mobile-dj-manager') . '</p>'));
    $screen->add_help_tab(array('id' => 'mdjm-settings-licenses', 'title' => __('Licenses', 'mobile-dj-manager'), 'content' => '<p>' . sprintf(__('If you have any <a href="%s">MDJM Event Management paid add-ons</a> installed, this screen is where you should add the license to enable automatic updates whilst your license is valid.', 'mobile-dj-manager'), esc_url('http://mdjm.co.uk/add-ons/')) . '</p>'));
    do_action('mdjm_post_settings_contextual_help', $screen);
}
Example #12
0
/**
 * Define the data to be displayed in each of the custom columns for the Contract post types
 *
 * @since	0.9
 * @param	str		$column_name	The name of the column to display
 * @param	int		$post_id		The current post ID
 * @return
 */
function mdjm_contract_posts_custom_column($column_name, $post_id)
{
    switch ($column_name) {
        // Is Default?
        case 'event_default':
            $event_default = mdjm_get_option('default_contract');
            if ($event_default == $post_id) {
                echo '<span style="color: green; font-weight: bold;">' . __('Yes');
            } else {
                _e('No');
            }
            break;
            // Assigned To
        // Assigned To
        case 'assigned':
            $contract_events = get_posts(array('post_type' => 'mdjm-event', 'posts_per_page' => -1, 'meta_key' => '_mdjm_event_contract', 'meta_value' => $post_id, 'post_status' => 'any'));
            $total = count($contract_events);
            echo $total . sprintf(_n(' %1$s', ' %2$s', $total, 'mobile-dj-manager'), mdjm_get_label_singular(), mdjm_get_label_plural());
            break;
    }
    // switch
}
/**
 * Show report graphs for earnings.
 *
 * @since	1.4
 * @return	void
*/
function mdjm_transactions_reports_graph()
{
    // Retrieve the queried dates
    $dates = mdjm_get_report_dates();
    $stats = new MDJM_Stats();
    // Determine graph options
    switch ($dates['range']) {
        case 'today':
        case 'yesterday':
            $day_by_day = true;
            break;
        case 'last_year':
        case 'this_year':
            $day_by_day = false;
            break;
        case 'last_quarter':
        case 'this_quarter':
            $day_by_day = true;
            break;
        case 'other':
            if ($dates['m_end'] - $dates['m_start'] >= 3 || $dates['year_end'] > $dates['year'] && $dates['m_start'] - $dates['m_end'] != 10) {
                $day_by_day = false;
            } else {
                $day_by_day = true;
            }
            break;
        default:
            $day_by_day = true;
            break;
    }
    $income_totals = 0.0;
    // Total income for time period shown
    $expense_totals = 0.0;
    // Total expense for time period shown
    $events_totals = 0;
    // Total events for the time period shown
    if ($dates['range'] == 'today' || $dates['range'] == 'yesterday') {
        // Hour by hour
        $hour = 1;
        $month = $dates['m_start'];
        while ($hour <= 23) {
            $income = $stats->get_income_by_date($dates['day'], $month, $dates['year'], $hour);
            $expense = $stats->get_expenses_by_date($dates['day'], $month, $dates['year'], $hour);
            $events = $stats->get_events_by_date($dates['day'], $month, $dates['year'], $hour);
            $income_totals += $income;
            $expense_totals += $expense;
            $events_totals += $events;
            $date = mktime($hour, 0, 0, $month, $dates['day'], $dates['year']) * 1000;
            $income_data[] = array($date, $income);
            $expense_data[] = array($date, $expense);
            $events_data[] = array($date, $events);
            $hour++;
        }
    } elseif ($dates['range'] == 'this_week' || $dates['range'] == 'last_week') {
        $num_of_days = cal_days_in_month(CAL_GREGORIAN, $dates['m_start'], $dates['year']);
        $report_dates = array();
        $i = 0;
        while ($i <= 6) {
            if ($dates['day'] + $i <= $num_of_days) {
                $report_dates[$i] = array('day' => (string) $dates['day'] + $i, 'month' => $dates['m_start'], 'year' => $dates['year']);
            } else {
                $report_dates[$i] = array('day' => (string) $i, 'month' => $dates['m_end'], 'year' => $dates['year_end']);
            }
            $i++;
        }
        foreach ($report_dates as $report_date) {
            $income = $stats->get_income_by_date($report_date['day'], $report_date['month'], $report_date['year']);
            $income_totals += $income;
            $expense = $stats->get_expenses_by_date($report_date['day'], $report_date['month'], $report_date['year']);
            $expense_totals += $expense;
            $events = $stats->get_events_by_date($report_date['day'], $report_date['month'], $report_date['year']);
            $events_totals += $events;
            $date = mktime(0, 0, 0, $report_date['month'], $report_date['day'], $report_date['year']) * 1000;
            $income_data[] = array($date, $income);
            $expense_data[] = array($date, $expense);
            $events_data[] = array($date, $events);
        }
    } else {
        $y = $dates['year'];
        $temp_data = array('income' => array(), 'expense' => array());
        while ($y <= $dates['year_end']) {
            $last_year = false;
            if ($dates['year'] == $dates['year_end']) {
                $month_start = $dates['m_start'];
                $month_end = $dates['m_end'];
                $last_year = true;
            } elseif ($y == $dates['year']) {
                $month_start = $dates['m_start'];
                $month_end = 12;
            } elseif ($y == $dates['year_end']) {
                $month_start = 1;
                $month_end = $dates['m_end'];
            } else {
                $month_start = 1;
                $month_end = 12;
            }
            $i = $month_start;
            while ($i <= $month_end) {
                $d = $dates['day'];
                if ($i == $month_end) {
                    $num_of_days = $dates['day_end'];
                    if ($month_start < $month_end) {
                        $d = 1;
                    }
                } else {
                    $num_of_days = cal_days_in_month(CAL_GREGORIAN, $i, $y);
                }
                while ($d <= $num_of_days) {
                    $income = $stats->get_income_by_date($d, $i, $y);
                    $income_totals += $income;
                    $expense = $stats->get_expenses_by_date($d, $i, $y);
                    $expense_totals += $expense;
                    $events = $stats->get_events_by_date($d, $i, $y);
                    $events_totals += $events;
                    $temp_data['income'][$y][$i][$d] = $income;
                    $temp_data['expense'][$y][$i][$d] = $expense;
                    $temp_data['events'][$y][$i][$d] = $events;
                    $d++;
                }
                $i++;
            }
            $y++;
        }
        $income_data = array();
        $expense_data = array();
        // When using 3 months or smaller as the custom range, show each day individually on the graph
        if ($day_by_day) {
            foreach ($temp_data['income'] as $year => $months) {
                foreach ($months as $month => $days) {
                    foreach ($days as $day => $income) {
                        $date = mktime(0, 0, 0, $month, $day, $year) * 1000;
                        $income_data[] = array($date, $income);
                    }
                }
            }
            foreach ($temp_data['expense'] as $year => $months) {
                foreach ($months as $month => $days) {
                    foreach ($days as $day => $expense) {
                        $date = mktime(0, 0, 0, $month, $day, $year) * 1000;
                        $expense_data[] = array($date, $expense);
                    }
                }
            }
            foreach ($temp_data['events'] as $year => $months) {
                foreach ($months as $month => $days) {
                    foreach ($days as $day => $events) {
                        $date = mktime(0, 0, 0, $month, $day, $year) * 1000;
                        $events_data[] = array($date, $events);
                    }
                }
            }
            // When showing more than 3 months of results, group them by month, by the first (except for the last month, group on the last day of the month selected)
        } else {
            foreach ($temp_data['income'] as $year => $months) {
                $month_keys = array_keys($months);
                $last_month = end($month_keys);
                foreach ($months as $month => $days) {
                    $day_keys = array_keys($days);
                    $last_day = end($day_keys);
                    $consolidated_date = $month === $last_month ? $last_day : 1;
                    $income = array_sum($days);
                    $date = mktime(0, 0, 0, $month, $consolidated_date, $year) * 1000;
                    $income_data[] = array($date, $income);
                }
            }
            foreach ($temp_data['expense'] as $year => $months) {
                $month_keys = array_keys($months);
                $last_month = end($month_keys);
                foreach ($months as $month => $days) {
                    $day_keys = array_keys($days);
                    $last_day = end($day_keys);
                    $consolidated_date = $month === $last_month ? $last_day : 1;
                    $expense = array_sum($days);
                    $date = mktime(0, 0, 0, $month, $consolidated_date, $year) * 1000;
                    $expense_data[] = array($date, $expense);
                }
            }
            foreach ($temp_data['events'] as $year => $months) {
                $month_keys = array_keys($months);
                $last_month = end($month_keys);
                foreach ($months as $month => $days) {
                    $day_keys = array_keys($days);
                    $last_day = end($day_keys);
                    $consolidated_date = $month === $last_month ? $last_day : 1;
                    $events = array_sum($days);
                    $date = mktime(0, 0, 0, $month, $consolidated_date, $year) * 1000;
                    $events_data[] = array($date, $events);
                }
            }
        }
    }
    $data = array(__('Income', 'mobile-dj-manager') => $income_data, __('Expense', 'mobile-dj-manager') => $expense_data, mdjm_get_label_plural() => $events_data);
    // start our own output buffer
    ob_start();
    ?>
	<div id="mdjm-dashboard-widgets-wrap">
		<div class="metabox-holder" style="padding-top: 0;">
			<div class="postbox">
				<h3><span><?php 
    _e('Transactions Over Time', 'mobile-dj-manager');
    ?>
</span></h3>

				<div class="inside">
					<?php 
    mdjm_reports_graph_controls();
    $graph = new MDJM_Graph($data);
    $graph->set('x_mode', 'time');
    $graph->set('multiple_y_axes', false);
    $graph->display();
    ?>

					<p class="mdjm_graph_totals">
						<strong>
							<?php 
    _e('Total income for period shown: ', 'mobile-dj-manager');
    echo mdjm_currency_filter(mdjm_format_amount($income_totals));
    ?>
						</strong>
					</p>
					<p class="mdjm_graph_totals">
						<strong>
							<?php 
    _e('Total expense for period shown: ', 'mobile-dj-manager');
    echo mdjm_currency_filter(mdjm_format_amount($expense_totals));
    ?>
						</strong>
					</p>
                    <p class="mdjm_graph_totals">
						<strong>
							<?php 
    _e('Total earnings for period shown: ', 'mobile-dj-manager');
    echo mdjm_currency_filter(mdjm_format_amount($income_totals - $expense_totals));
    ?>
						</strong>
					</p>
					<p class="mdjm_graph_totals">
						<strong>
							<?php 
    printf(__('Total %s for period shown: ', 'mobile-dj-manager'), mdjm_get_label_plural());
    echo $events_totals;
    ?>
						</strong>
					</p>

					<?php 
    do_action('mdjm_reports_transactions_graph_additional_stats');
    ?>

					<p class="mdjm-graph-notes">
                        <span>
                            <em><sup>&dagger;</sup> <?php 
    printf(__('Stats include all %s taking place within the date period selected.', 'mobile-dj-manager'), mdjm_get_label_plural(true));
    ?>
</em>
                        </span>
                    </p>

				</div>
			</div>
		</div>
	</div>
	<?php 
    // get output buffer contents and end our own buffer
    $output = ob_get_contents();
    ob_end_clean();
    echo $output;
}
/**
 * Renders the 'Export' tab on the Reports Page
 *
 * @since	1.4
 * @return	void
 */
function mdjm_reports_tab_export()
{
    if (!mdjm_employee_can('run_reports')) {
        wp_die(__('You do not have permission to export reports', 'mobile-dj-manager'), __('Error', 'mobile-dj-manager'), array('response' => 403));
    }
    $label_single = mdjm_get_label_singular();
    $label_plural = mdjm_get_label_plural();
    ?>
	<div id="mdjm-dashboard-widgets-wrap">
		<div class="metabox-holder">
			<div id="post-body">
				<div id="post-body-content">

					<?php 
    do_action('mdjm_reports_tab_export_content_top');
    ?>

					<div class="postbox mdjm-export-events-earnings">
						<h3><span><?php 
    _e('Export Transaction History', 'mobile-dj-manager');
    ?>
</span></h3>
						<div class="inside">
							<p><?php 
    _e('Download a CSV of all transactions recorded.');
    ?>
</p>
							<form id="mdjm-export-txns" class="mdjm-export-form mdjm-import-export-form" method="post">
								<?php 
    mdjm_insert_datepicker(array('id' => 'mdjm-txn-export-start', 'altfield' => 'txn_start'));
    ?>
                                <?php 
    echo MDJM()->html->date_field(array('id' => 'mdjm-txn-export-start', 'name' => 'display_start_date', 'placeholder' => __('Select Start Date', 'mobile-dj-manager')));
    ?>
								<?php 
    echo MDJM()->html->hidden(array('name' => 'txn_start'));
    ?>
                                <?php 
    mdjm_insert_datepicker(array('id' => 'mdjm-txn-export-end', 'altfield' => 'txn_end'));
    ?>
                                <?php 
    echo MDJM()->html->date_field(array('id' => 'mdjm-txn-export-end', 'name' => 'display_end_date', 'placeholder' => __('Select End Date', 'mobile-dj-manager')));
    ?>
								<?php 
    echo MDJM()->html->hidden(array('name' => 'txn_end'));
    ?>
								<select name="txn_status">
									<option value=""><?php 
    _e('All Statuses', 'mobile-dj-manager');
    ?>
</option>
                                    <option value="Completed"><?php 
    _e('Completed', 'mobile-dj-manager');
    ?>
</option>
                                    <option value="Pending"><?php 
    _e('Pending', 'mobile-dj-manager');
    ?>
</option>
                                    <option value="Cancelled"><?php 
    _e('Cancelled', 'mobile-dj-manager');
    ?>
</option>
								</select>
								<?php 
    wp_nonce_field('mdjm_ajax_export', 'mdjm_ajax_export');
    ?>
								<input type="hidden" name="mdjm-export-class" value="MDJM_Batch_Export_Txns"/>
								<span>
									<input type="submit" value="<?php 
    _e('Generate CSV', 'mobile-dj-manager');
    ?>
" class="button-secondary"/>
									<span class="spinner"></span>
								</span>
							</form>
						</div><!-- .inside -->
					</div><!-- .postbox -->

					<div class="postbox mdjm-export-events">
						<h3><span><?php 
    printf(__('Export %s', 'mobile-dj-manager'), $label_plural);
    ?>
</span></h3>
						<div class="inside">
							<p><?php 
    printf(__('Download a CSV of %s data.'), $label_plural);
    ?>
</p>
							<form id="mdjm-export-events" class="mdjm-export-form mdjm-import-export-form" method="post">
								<?php 
    mdjm_insert_datepicker(array('id' => 'mdjm-event-export-start', 'altfield' => 'event_start'));
    ?>
                                <?php 
    echo MDJM()->html->date_field(array('id' => 'mdjm-event-export-start', 'name' => 'display_start_date', 'placeholder' => __('Select Start Date', 'mobile-dj-manager')));
    ?>
								<?php 
    echo MDJM()->html->hidden(array('name' => 'event_start'));
    ?>
                                <?php 
    mdjm_insert_datepicker(array('id' => 'mdjm-event-export-end', 'altfield' => 'event_end'));
    ?>
                                <?php 
    echo MDJM()->html->date_field(array('id' => 'mdjm-event-export-end', 'name' => 'display_end_date', 'placeholder' => __('Select End Date', 'mobile-dj-manager')));
    ?>
								<?php 
    echo MDJM()->html->hidden(array('name' => 'event_end'));
    ?>
								<select name="event_status">
									<option value="any"><?php 
    _e('All Statuses', 'mobile-dj-manager');
    ?>
</option>
                                    <?php 
    foreach (mdjm_all_event_status() as $status => $label) {
        ?>
                                    	<option value="<?php 
        echo $status;
        ?>
"><?php 
        echo $label;
        ?>
</option>
                                    <?php 
    }
    ?>
								</select>
								<?php 
    wp_nonce_field('mdjm_ajax_export', 'mdjm_ajax_export');
    ?>
								<input type="hidden" name="mdjm-export-class" value="MDJM_Batch_Export_Events"/>
								<span>
									<input type="submit" value="<?php 
    _e('Generate CSV', 'mobile-dj-manager');
    ?>
" class="button-secondary"/>
									<span class="spinner"></span>
								</span>
							</form>
						</div><!-- .inside -->
					</div><!-- .postbox -->

					<div class="postbox mdjm-export-clients">
						<h3><span><?php 
    _e('Export Clients', 'mobile-dj-manager');
    ?>
</span></h3>
						<div class="inside">
							<p><?php 
    _e('Download a CSV of clients.', 'mobile-dj-manager');
    ?>
</p>
							<form id="mdjm-export-clients" class="mdjm-export-form mdjm-import-export-form" method="post">
								<?php 
    wp_nonce_field('mdjm_ajax_export', 'mdjm_ajax_export');
    ?>
								<input type="hidden" name="mdjm-export-class" value="MDJM_Batch_Export_Clients"/>
								<input type="submit" value="<?php 
    _e('Generate CSV', 'mobile-dj-manager');
    ?>
" class="button-secondary"/>
							</form>
						</div><!-- .inside -->
					</div><!-- .postbox -->

					<?php 
    if (mdjm_is_employer()) {
        ?>
                        <div class="postbox mdjm-export-employees">
                            <h3><span><?php 
        _e('Export Employees', 'mobile-dj-manager');
        ?>
</span></h3>
                            <div class="inside">
                                <p><?php 
        _e('Download a CSV of employees.', 'mobile-dj-manager');
        ?>
</p>
                                <form id="mdjm-export-employees" class="mdjm-export-form mdjm-import-export-form" method="post">
                                    <?php 
        wp_nonce_field('mdjm_ajax_export', 'mdjm_ajax_export');
        ?>
                                    <input type="hidden" name="mdjm-export-class" value="MDJM_Batch_Export_Employees"/>
                                    <input type="submit" value="<?php 
        _e('Generate CSV', 'mobile-dj-manager');
        ?>
" class="button-secondary"/>
                                </form>
                            </div><!-- .inside -->
                        </div><!-- .postbox -->
                    <?php 
    }
    ?>

				</div><!-- .post-body-content -->
			</div><!-- .post-body -->
		</div><!-- .metabox-holder -->
	</div><!-- #mdjm-dashboard-widgets-wrap -->

	<?php 
}
Example #15
0
/**
 * Admin Messages
 *
 * @since	1.3
 * @global	$mdjm_options	Array of all the MDJM Options
 * @return void
 */
function mdjm_admin_notices()
{
    global $mdjm_options;
    // Unattended events
    if (mdjm_employee_can('manage_all_events') && mdjm_get_option('warn_unattended')) {
        $unattended = MDJM()->events->mdjm_count_event_status('mdjm-unattended');
        if (!empty($unattended) && $unattended > 0) {
            echo '<div class="notice notice-info is-dismissible">';
            echo '<p>' . sprintf(__('You have unattended enquiries. <a href="%s">Click here</a> to manage.', 'mobile-dj-manager'), admin_url('edit.php?post_type=mdjm-event&post_status=mdjm-unattended')) . '</p>';
            echo '</div>';
        }
    }
    if (isset($_GET['mdjm-message']) && 'upgrade-completed' == $_GET['mdjm-message']) {
        add_settings_error('mdjm-notices', 'mdjm-upgraded', __('MDJM Event Management has been upgraded successfully.', 'mobile-dj-manager'), 'updated');
    }
    if (isset($_GET['mdjm-message']) && 'song_added' == $_GET['mdjm-message']) {
        add_settings_error('mdjm-notices', 'mdjm-added-song', __('Entry added to playlist.', 'mobile-dj-manager'), 'updated');
    }
    if (isset($_GET['mdjm-message']) && 'adding_song_failed' == $_GET['mdjm-message']) {
        add_settings_error('mdjm-notices', 'mdjm-adding-song-failed', __('Could not add entry to playlist.', 'mobile-dj-manager'), 'error');
    }
    if (isset($_GET['mdjm-message']) && 'song_removed' == $_GET['mdjm-message']) {
        add_settings_error('mdjm-notices', 'mdjm-removed-song', __('The selected songs were removed.', 'mobile-dj-manager'), 'updated');
    }
    if (isset($_GET['mdjm-message']) && 'song_remove_failed' == $_GET['mdjm-message']) {
        add_settings_error('mdjm-notices', 'mdjm-remove-faled', __('The songs count not be removed.', 'mobile-dj-manager'), 'error');
    }
    if (isset($_GET['mdjm-message']) && 'security_failed' == $_GET['mdjm-message']) {
        add_settings_error('mdjm-notices', 'mdjm-security-failed', __('Security verification failed. Action not completed.', 'mobile-dj-manager'), 'error');
    }
    if (isset($_GET['mdjm-message']) && 'playlist_emailed' == $_GET['mdjm-message']) {
        add_settings_error('mdjm-notices', 'mdjm-playlist-emailed', __('The playlist was emailed successfully.', 'mobile-dj-manager'), 'updated');
    }
    if (isset($_GET['mdjm-message']) && 'playlist_email_failed' == $_GET['mdjm-message']) {
        add_settings_error('mdjm-notices', 'mdjm-playlist-email-failed', __('The playlist could not be emailed.', 'mobile-dj-manager'), 'error');
    }
    if (isset($_GET['mdjm-message']) && 'employee_added' == $_GET['mdjm-message']) {
        add_settings_error('mdjm-notices', 'mdjm-employee_added', __('Employee added.', 'mobile-dj-manager'), 'updated');
    }
    if (isset($_GET['mdjm-message']) && 'employee_add_failed' == $_GET['mdjm-message']) {
        add_settings_error('mdjm-notices', 'mdjm-employee_add-failed', __('Could not add employee.', 'mobile-dj-manager'), 'updated');
    }
    if (isset($_GET['mdjm-message']) && 'employee_info_missing' == $_GET['mdjm-message']) {
        add_settings_error('mdjm-notices', 'mdjm-employee_info-missing', __('Insufficient information to create employee.', 'mobile-dj-manager'), 'error');
    }
    if (isset($_GET['mdjm-message']) && 'comm_missing_content' == $_GET['mdjm-message']) {
        add_settings_error('mdjm-notices', 'mdjm-comm_content-missing', __('Not all required fields have been completed.', 'mobile-dj-manager'), 'error');
    }
    if (isset($_GET['mdjm-message']) && 'comm_sent' == $_GET['mdjm-message']) {
        add_settings_error('mdjm-notices', 'mdjm-comm_sent', __('Email sent successfully.', 'mobile-dj-manager'), 'updated');
    }
    if (isset($_GET['mdjm-message']) && 'comm_not_sent' == $_GET['mdjm-message']) {
        add_settings_error('mdjm-notices', 'mdjm-comm_not_sent', __('Email not sent.', 'mobile-dj-manager'), 'error');
    }
    if (isset($_GET['mdjm-action']) && 'get_event_availability' == $_GET['mdjm-action']) {
        if (!wp_verify_nonce($_GET['mdjm_nonce'], 'get_event_availability')) {
            return;
        } elseif (!isset($_GET['event_id'])) {
            return;
        } else {
            $date = get_post_meta($_GET['event_id'], '_mdjm_event_date', true);
            $result = mdjm_do_availability_check($date);
            if (!empty($result['available'])) {
                $notice = '<ul>';
                foreach ($result['available'] as $employee_id) {
                    $notice .= '<li>' . sprintf(__('<a href="%s" title="Assign &amp; Respond to Enquiry">Assign %s &amp; respond to enquiry</a>', 'mobile-dj-manager'), add_query_arg('primary_employee', $employee_id, get_edit_post_link($_GET['event_id'])), mdjm_get_employee_display_name($employee_id)) . '</li>';
                }
                $notice .= '</ul>';
                echo '<div class="notice notice-info is-dismissible">';
                echo '<p>' . sprintf(__('You have %d employees available to work %s %s on %s.', 'mobile-dj-manager'), count($result['available']), mdjm_get_label_singular(true), mdjm_get_event_contract_id($_GET['event_id']), mdjm_get_event_long_date($_GET['event_id'])) . $notice . '</p>';
                echo '</div>';
            } else {
                echo '<div class="notice notice-error is-dismissible">';
                echo '<p>' . sprintf(__('There are no employees available to work %s %s on %s', 'mobile-dj-manager'), mdjm_get_label_singular(true), mdjm_get_event_contract_id($_GET['event_id']), mdjm_get_event_long_date($_GET['event_id'])) . '</p>';
                echo '</div>';
            }
        }
    }
    if (isset($_GET['mdjm-message']) && 'payment_event_missing' == $_GET['mdjm-message']) {
        add_settings_error('mdjm-notices', 'mdjm-payment_event_missing', __('Event not identified.', 'mobile-dj-manager'), 'error');
    }
    if (isset($_GET['mdjm-message']) && 'pay_employee_failed' == $_GET['mdjm-message']) {
        add_settings_error('mdjm-notices', 'mdjm-payment_employee_failed', __('Unable to make payment to employee.', 'mobile-dj-manager'), 'error');
    }
    if (isset($_GET['mdjm-message']) && 'pay_all_employees_failed' == $_GET['mdjm-message']) {
        add_settings_error('mdjm-notices', 'mdjm-payment_employees_failed', __('Unable to make payment to employees.', 'mobile-dj-manager'), 'error');
    }
    if (isset($_GET['mdjm-message']) && 'pay_all_employees_some_success' == $_GET['mdjm-message']) {
        add_settings_error('mdjm-notices', 'mdjm-payment_all_employees_some_success', __('Not all employees could be paid.', 'mobile-dj-manager'), 'notice-info');
    }
    if (isset($_GET['mdjm-message']) && 'pay_employee_success' == $_GET['mdjm-message']) {
        add_settings_error('mdjm-notices', 'mdjm-payment_employeee_success', __('Employee successfully paid.', 'mobile-dj-manager'), 'updated');
    }
    if (isset($_GET['mdjm-message']) && 'pay_all_employees_success' == $_GET['mdjm-message']) {
        add_settings_error('mdjm-notices', 'mdjm-payment_all_employeees_success', __('Employees successfully paid.', 'mobile-dj-manager'), 'updated');
    }
    if (isset($_GET['mdjm-message']) && 'unattended_enquiries_rejected_success' == $_GET['mdjm-message']) {
        add_settings_error('mdjm-notices', 'mdjm-unattended_enquiries_rejected_success', sprintf(_n('%1$s %2$s successfully rejected.', '%1$s %3$s successfully rejected.', $_GET['mdjm-count'], 'mobile-dj-manager'), $_GET['mdjm-count'], mdjm_get_label_singular(), mdjm_get_label_plural()), 'updated');
    }
    if (isset($_GET['mdjm-message']) && 'unattended_enquiries_rejected_failed' == $_GET['mdjm-message']) {
        add_settings_error('mdjm-notices', 'mdjm-unattended_enquiries_rejected_failed', __('Errors were encountered.', 'mobile-dj-manager'), 'error');
    }
    if (isset($_GET['mdjm-message']) && 'api-key-generated' == $_GET['mdjm-message']) {
        add_settings_error('mdjm-notices', 'mdjm-api-key-generated', __('API keys generated.', 'mobile-dj-manager'), 'updated');
    }
    if (isset($_GET['mdjm-message']) && 'api-key-regenerated' == $_GET['mdjm-message']) {
        add_settings_error('mdjm-notices', 'mdjm-api-key-regenerated', __('API keys re-generated.', 'mobile-dj-manager'), 'updated');
    }
    if (isset($_GET['mdjm-message']) && 'api-key-revoked' == $_GET['mdjm-message']) {
        add_settings_error('mdjm-notices', 'mdjm-api-key-revoked', __('API keys revoked.', 'mobile-dj-manager'), 'updated');
    }
    if (isset($_GET['mdjm-message']) && 'api-key-failed' == $_GET['mdjm-message']) {
        add_settings_error('mdjm-notices', 'mdjm-api-key-failed', __('Generating API keys failed.', 'mobile-dj-manager'), 'error');
    }
    settings_errors('mdjm-notices');
}
Example #16
0
/**
 * Output the event options save row
 *
 * @since	1.3.7
 * @global	obj		$mdjm_event			MDJM_Event class object
 * @global	bool	$mdjm_event_update	True if this event is being updated, false if new.
 * @param	int		$event_id			The event ID.
 * @return	str
 */
function mdjm_event_metabox_options_save_row($event_id)
{
    global $mdjm_event, $mdjm_event_update;
    if (!mdjm_employee_can('manage_events')) {
        return;
    }
    $button_text = __('Add %s', 'mobile-dj-manager');
    if ($mdjm_event_update) {
        $button_text = __('Update %s', 'mobile-dj-manager');
    }
    $class = '';
    $url = add_query_arg(array('post_type' => 'mdjm-event'), admin_url('edit.php'));
    $a = sprintf(__('Back to %s', 'mobile-dj-manager'), mdjm_get_label_plural());
    if (mdjm_employee_can('manage_all_events') && (!$mdjm_event_update || $mdjm_event->post_status == 'mdjm-unattended')) {
        $class = 'mdjm-delete';
        $url = wp_nonce_url(add_query_arg(array('post' => $event_id, 'action' => 'trash'), admin_url('post.php')), 'trash-post_' . $event_id);
        $a = sprintf(__('Delete %s', 'mobile-dj-manager'), mdjm_get_label_singular());
    }
    ?>
	<div id="major-publishing-actions">
        <div id="delete-action">
            <a class="<?php 
    echo $class;
    ?>
" href="<?php 
    echo $url;
    ?>
"><?php 
    echo $a;
    ?>
</a>
        </div>
        
        <div id="publishing-action">
            <?php 
    submit_button(sprintf($button_text, mdjm_get_label_singular()), 'primary', 'save', false, array('id' => 'save-post'));
    ?>
        </div>
        <div class="clear"></div>
    </div>

	<?php 
}
Example #17
0
/**
 * Define the data to be displayed in each of the custom columns for the Addon post types
 *
 * @since	1.4
 * @param	str		$column_name	The name of the column to display
 * @param	int		$post_id		The current post ID
 * @return
 */
function mdjm_addon_posts_custom_column($column_name, $post_id)
{
    global $post;
    switch ($column_name) {
        // Category
        case 'addon_category':
            echo get_the_term_list($post_id, 'addon-category', '', ', ', '');
            break;
            // Availability
        // Availability
        case 'availability':
            $output = array();
            if (!mdjm_addon_is_restricted_by_date($post_id)) {
                $output[] = __('Always', 'mobile-dj-manager');
            } else {
                $availability = mdjm_get_addon_months_available($post_id);
                if (!$availability) {
                    $output[] = __('Always', 'mobile-dj-manager');
                } else {
                    $i = 0;
                    foreach ($availability as $month) {
                        $output[] = mdjm_month_num_to_name($availability[$i]);
                        $i++;
                    }
                }
            }
            echo implode(', ', $output);
            break;
            // Event Types
        // Event Types
        case 'event_types':
            $output = array();
            $event_label = mdjm_get_label_singular();
            $event_types = mdjm_get_addon_event_types($post_id);
            if (in_array('all', $event_types)) {
                $output[] = sprintf(__('All %s Types', 'mobile-dj-manager'), $event_label);
            } else {
                foreach ($event_types as $event_type) {
                    $term = get_term($event_type, 'event-types');
                    if (!empty($term)) {
                        $output[] = $term->name;
                    }
                }
            }
            echo implode(', ', $output);
            break;
            // Employees
        // Employees
        case 'employees':
            $employees = mdjm_get_employees_with_addon($post_id);
            $output = array();
            if (in_array('all', $employees)) {
                $output[] = __('All Employees', 'mobile-dj-manager');
            } else {
                foreach ($employees as $employee) {
                    if ('all' == $employee) {
                        continue;
                    }
                    $output[] = '<a href="' . get_edit_user_link($employee) . '">' . mdjm_get_employee_display_name($employee) . '</a>';
                }
            }
            echo implode('<br />', $output);
            break;
            // Price
        // Price
        case 'price':
            if (mdjm_addon_has_variable_prices($post_id)) {
                $range = mdjm_get_addon_price_range($post_id);
                echo mdjm_currency_filter(mdjm_format_amount($range['low']));
                echo ' &mdash; ';
                echo mdjm_currency_filter(mdjm_format_amount($range['high']));
            } else {
                echo mdjm_currency_filter(mdjm_format_amount(mdjm_get_addon_price($post_id)));
            }
            break;
            // Usage
        // Usage
        case 'usage':
            $packages = mdjm_count_packages_with_addon($post_id);
            $events = mdjm_count_events_with_addon($post_id);
            echo $packages . _n(' Package', ' Packages', $packages, 'mobile-dj-manager') . '<br />';
            echo $events . ' ' . _n(mdjm_get_label_singular(), mdjm_get_label_plural(), $events, 'mobile-dj-manager');
            break;
    }
    // switch
}
Example #18
0
 * This template is used when the current logged in client has no events.
 *
 * @version			1.0
 * @author			Mike Howard
 * @since			1.3
 * @content_tag		{client_*}
 * @shortcodes		Supported
 *
 * Do not customise this file!
 * If you wish to make changes, copy this file to your theme directory /theme/mdjm-templates/event/event-none.php
 */
?>
<div id="client-no-events">
	<p><?php 
_e('Hey', 'mobile-dj-manager');
?>
 {client_firstname}, <?php 
printf(__('welcome to the %s %s.', 'mobile-dj-manager'), '{company_name}', '{application_name}');
?>
</p>
    
    <p><?php 
printf(__('You do not currently have any active %s booked with us.', 'mobile-dj-manager'), mdjm_get_label_plural());
?>
</p>
    
    <p><?php 
printf(__('If you are ready to plan your next %s, contact us <a href="%s">here</a>.', 'mobile-dj-manager'), mdjm_get_label_singular(true), '{contact_page}');
?>
</p>        
</div>
 * This template is used to display the header section during the current users (Client) list of events.
 *
 * @version 		1.0
 * @author			Mike Howard
 * @since			1.3
 * @content_tag		{client_*}
 * @shortcodes		Supported
 *
 * Do not customise this file!
 * If you wish to make changes, copy this file to your theme directory /theme/mdjm-templates/event/event-loop-header.php
 */
?>
<div id="mdjm-event-loop-header">
	<?php 
do_action('mdjm_event_loop_before_header');
?>
    
	<p><?php 
printf(__('Hello %s and welcome to the %s %s.', 'mobile-dj-manager'), '{client_firstname}', '{company_name}', '{application_name}');
?>
    </p>
    
    <p><?php 
printf(__('The %s you have scheduled with us are listed below...', 'mobile-dj-manager'), mdjm_get_label_plural(true));
?>
</p>
    
    <?php 
do_action('mdjm_event_loop_after_header');
?>
</div>
Example #20
0
 /**
  * Retrieve events filtered by employee, client, date or status.
  *
  * @since	1.4
  * @return	void
  */
 public function list_events()
 {
     $response = array();
     if (!mdjm_employee_can('read_events', $this->user_id)) {
         $this->no_permsission();
     }
     if (!isset($this->request['employee_id']) && !mdjm_employee_can('read_events_all', $this->user_id)) {
         $this->no_permsission();
     }
     do_action('mdjm_before_api_event_list', $this);
     if (isset($this->request['employee_id'])) {
         $events = mdjm_get_employee_events($this->request['employee_id']);
     } elseif (isset($this->request['client_id'])) {
         $events = mdjm_get_client_events($this->request['client_id']);
     } elseif (isset($this->request['date'])) {
         $events = mdjm_get_events_by_date($this->request['date']);
     } elseif (isset($this->request['status'])) {
         $events = mdjm_get_events_by_status($this->request['status']);
     } else {
         $events = mdjm_get_events();
     }
     if (!$events) {
         $error = array();
         $error['error'] = sprintf(__('No %s found.', 'mobile-dj-manager'), mdjm_get_label_plural(true));
         $this->data = $error;
         $this->output();
     }
     $response['events'] = array();
     $i = 0;
     foreach ($events as $event) {
         $response['events'][$event->ID] = mdjm_get_event_data($event->ID);
         $i++;
     }
     $response['count'] = $i;
     $this->data = array_merge($this->data, $response);
     do_action('mdjm_after_api_event_list', $this);
     $this->output();
 }
Example #21
0
<?php

/**
 * This template is used when the current logged in client accesses the playlist page but has no events.
 *
 * @version			1.0
 * @author			Mike Howard
 * @since			1.3
 * @content_tag		{client_*}
 * @shortcodes		Not Supported
 *
 * Do not customise this file!
 * If you wish to make changes, copy this file to your theme directory /theme/mdjm-templates/quote/quote-noevent.php
 */
?>
<div id="client-quote-no-events">
	<p><?php 
printf(__("We haven't been able to locate your %s. Please return to our <a href='%s'>%s</a> page to see a list of your %s."), mdjm_get_label_singular(), '{application_home}', '{application_name}', mdjm_get_label_plural());
?>
</p>    
</div>
 /**
  * Constructor.
  * @since	1.4
  */
 public function __construct()
 {
     $this->event_label_single = mdjm_get_label_singular();
     $this->event_label_plural = mdjm_get_label_plural();
 }
/**
 * Add event count to At a glance widget
 *
 * @since	1.4
 * @return	void
 */
function mdjm_dashboard_at_a_glance_widget($items)
{
    $num_posts = mdjm_count_events();
    $count = 0;
    $statuses = mdjm_all_event_status();
    foreach ($statuses as $status => $label) {
        if (!empty($num_posts->{$status})) {
            $count += $num_posts->{$status};
        }
    }
    if ($num_posts && $count > 0) {
        $text = _n('%s ' . mdjm_get_label_singular(), '%s ' . mdjm_get_label_plural(), $count, 'mobile-dj-manager');
        $text = sprintf($text, number_format_i18n($count));
        if (mdjm_employee_can('read_events')) {
            $text = sprintf('<a class="event-count" href="edit.php?post_type=mdjm-event">%1$s</a>', $text);
        } else {
            $text = sprintf('<span class="event-count">%1$s</span>', $text);
        }
        $items[] = $text;
    }
    return $items;
}
/**
 * Retrieve settings tabs
 *
 * @since	1.3
 * @return	arr		$tabs
 */
function mdjm_get_settings_tabs()
{
    $settings = mdjm_get_registered_settings();
    $tabs = array();
    $tabs['general'] = __('General', 'mobile-dj-manager');
    $tabs['events'] = sprintf(__('%s', 'mobile-dj-manager'), mdjm_get_label_plural());
    $tabs['emails'] = __('Emails &amp; Templates', 'mobile-dj-manager');
    $tabs['client_zone'] = mdjm_get_option('app_name', __('Client Zone', 'mobile-dj-manager'));
    $tabs['payments'] = __('Payments', 'mobile-dj-manager');
    if (!empty($settings['extensions'])) {
        $tabs['extensions'] = __('Extensions', 'mobile-dj-manager');
    }
    if (!empty($settings['licenses'])) {
        $tabs['licenses'] = __('Licenses', 'mobile-dj-manager');
    }
    return apply_filters('mdjm_settings_tabs', $tabs);
}
Example #25
0
function mdjm_admin_toolbar($admin_bar)
{
    if (!current_user_can('mdjm_employee')) {
        return;
    }
    // Build out the toolbar menu structure
    $admin_bar->add_menu(array('id' => 'mdjm', 'title' => sprintf(__('MDJM %s', 'mobile-dj-manager'), mdjm_get_label_plural()), 'href' => mdjm_employee_can('read_events') ? admin_url('edit.php?post_type=mdjm-event') : '#', 'meta' => array('title' => __('MDJM Event Management', 'mobile-dj-manager'))));
    if (mdjm_employee_can('read_events')) {
        // Events
        $admin_bar->add_menu(array('id' => 'mdjm-events', 'parent' => 'mdjm', 'title' => mdjm_get_label_plural(), 'href' => admin_url('edit.php?post_type=mdjm-event'), 'meta' => array('title' => sprintf(__('MDJM %s', 'mobile-dj-manager'), mdjm_get_label_plural()))));
    }
    if (mdjm_employee_can('manage_all_events')) {
        $admin_bar->add_menu(array('id' => 'mdjm-add-events', 'parent' => 'mdjm-events', 'title' => sprintf(__('Create %s', 'mobile-dj-manager'), mdjm_get_label_singular()), 'href' => admin_url('post-new.php?post_type=mdjm-event'), 'meta' => array('title' => sprintf(__('Create New %s', 'mobile-dj-manager'), mdjm_get_label_singular()))));
        // Enquiries
        $event_status = array('mdjm-unattended' => __('Unattended Enquiries', 'mobile-dj-manager'), 'mdjm-enquiry' => __('View Enquiries', 'mobile-dj-manager'));
        foreach ($event_status as $current_status => $display) {
            $status_count = MDJM()->events->mdjm_count_event_status($current_status);
            if (!$status_count) {
                continue;
            }
            $admin_bar->add_menu(array('id' => 'mdjm-' . str_replace(' ', '-', strtolower($display)), 'parent' => 'mdjm-events', 'title' => $display . ' (' . $status_count . ')', 'href' => admin_url('edit.php?post_status=' . $current_status . '&post_type=mdjm-event'), 'meta' => array('title' => $display)));
        }
        // Event Types
        $admin_bar->add_menu(array('id' => 'mdjm-event-types', 'parent' => 'mdjm-events', 'title' => sprintf(__('%s Types', 'mobile-dj-manager'), mdjm_get_label_singular()), 'href' => admin_url('edit-tags.php?taxonomy=event-types&post_type=mdjm-event'), 'meta' => array('title' => sprintf(__('Manage %s Types', 'mobile-dj-manager'), mdjm_get_label_singular()))));
        // Playlist Categories
        $admin_bar->add_menu(array('id' => 'mdjm-playlist-cats', 'parent' => 'mdjm-events', 'title' => __('Playlist Categories', 'mobile-dj-manager'), 'href' => admin_url('edit-tags.php?taxonomy=playlist-category&post_type=mdjm-playlist'), 'meta' => array('title' => __('Manage Playlist Categories', 'mobile-dj-manager'))));
        // Enquiry Sources
        $admin_bar->add_menu(array('id' => 'mdjm-enquiry-sources', 'parent' => 'mdjm-events', 'title' => __('Enquiry Sources', 'mobile-dj-manager'), 'href' => admin_url('edit-tags.php?taxonomy=enquiry-source&post_type=mdjm-event'), 'meta' => array('title' => __('Manage Enquiry Sources', 'mobile-dj-manager'))));
    }
    // Dashboard
    /*$admin_bar->add_menu( array(
    		'id'		=> 'mdjm-dashboard',
    		'parent'	=> 'mdjm',
    		'title'	 => __( 'Dashboard', 'mobile-dj-manager' ),
    		'href'	  => admin_url( 'admin.php?page=mdjm-dashboard' ),
    		'meta'	  => array(
    			'title' => __( 'MDJM Dashboard', 'mobile-dj-manager' ),
    		),
    	) ); */
    // Settings
    if (mdjm_is_admin()) {
        $admin_bar->add_menu(array('id' => 'mdjm-settings', 'parent' => 'mdjm', 'title' => __('Settings', 'mobile-dj-manager'), 'href' => admin_url('admin.php?page=mdjm-settings'), 'meta' => array('title' => __('MDJM Settings', 'mobile-dj-manager'))));
        $admin_bar->add_menu(array('id' => 'mdjm-settings-general', 'parent' => 'mdjm-settings', 'title' => __('General', 'mobile-dj-manager'), 'href' => admin_url('admin.php?page=mdjm-settings&tab=general'), 'meta' => array('title' => __('MDJM General Settings', 'mobile-dj-manager'))));
        $admin_bar->add_menu(array('id' => 'mdjm-settings-events', 'parent' => 'mdjm-settings', 'title' => mdjm_get_label_plural(), 'href' => admin_url('admin.php?page=mdjm-settings&tab=events'), 'meta' => array('title' => __('MDJM Event Settings', 'mobile-dj-manager'))));
        $admin_bar->add_menu(array('id' => 'mdjm-settings-permissions', 'parent' => 'mdjm-settings', 'title' => __('Permissions', 'mobile-dj-manager'), 'href' => admin_url('admin.php?page=mdjm-settings&tab=general&section=mdjm_app_permissions'), 'meta' => array('title' => __('MDJM Permission Settings', 'mobile-dj-manager'))));
        $admin_bar->add_menu(array('id' => 'mdjm-settings-emails', 'parent' => 'mdjm-settings', 'title' => sprintf(__('Email %s Template Settings', 'mobile-dj-manager'), '&amp;'), 'href' => admin_url('admin.php?page=mdjm-settings&tab=emails'), 'meta' => array('title' => sprintf(__('MDJM Email %s Template Settings', 'mobile-dj-manager'), '&amp;'))));
        $admin_bar->add_menu(array('id' => 'mdjm-settings-client-zone', 'parent' => 'mdjm-settings', 'title' => sprintf(__('%s Settings', 'mobile-dj-manager'), mdjm_get_option('app_name', __('Client Zone', 'mobile-dj-manager'))), 'href' => admin_url('admin.php?page=mdjm-settings&tab=client_zone'), 'meta' => array('title' => sprintf(__('%s Settings', 'mobile-dj-manager'), mdjm_get_option('app_name', __('Client Zone', 'mobile-dj-manager'))))));
        $admin_bar->add_menu(array('id' => 'mdjm-settings-payments', 'parent' => 'mdjm-settings', 'title' => __('Payment Settings', 'mobile-dj-manager'), 'href' => admin_url('admin.php?page=mdjm-settings&tab=payments'), 'meta' => array('title' => __('MDJM Payment Settings', 'mobile-dj-manager'))));
    }
    do_action('mdjm_admin_bar_settings_items', $admin_bar);
    if (mdjm_is_employer() && mdjm_employee_can('manage_employees')) {
        // Employees
        $admin_bar->add_menu(array('id' => 'mdjm-employees', 'parent' => 'mdjm', 'title' => __('Employees', 'mobile-dj-manager'), 'href' => admin_url('admin.php?page=mdjm-employees'), 'meta' => array('title' => __('Employees', 'mobile-dj-manager'))));
    }
    if (mdjm_is_admin()) {
        // Employee Availability
        $admin_bar->add_menu(array('id' => 'mdjm-availability', 'parent' => mdjm_is_employer() ? 'mdjm-employees' : 'mdjm', 'title' => __('Employee Availability', 'mobile-dj-manager'), 'href' => admin_url('admin.php?page=mdjm-availability'), 'meta' => array('title' => __('Employee Availability', 'mobile-dj-manager'))));
        // Automated Tasks
        $admin_bar->add_menu(array('id' => 'mdjm-tasks', 'parent' => 'mdjm', 'title' => __('Automated Tasks', 'mobile-dj-manager'), 'href' => admin_url('admin.php?page=mdjm-tasks'), 'meta' => array('title' => __('Automated Tasks', 'mobile-dj-manager'))));
    }
    if (mdjm_employee_can('view_clients_list')) {
        // Clients
        $admin_bar->add_menu(array('id' => 'mdjm-clients', 'parent' => 'mdjm', 'title' => __('Clients', 'mobile-dj-manager'), 'href' => admin_url('admin.php?page=mdjm-clients'), 'meta' => array('title' => __('Clients', 'mobile-dj-manager'))));
    }
    if (mdjm_employee_can('list_all_clients')) {
        $admin_bar->add_menu(array('id' => 'mdjm-add-client', 'parent' => 'mdjm-clients', 'title' => __('Add Client', 'mobile-dj-manager'), 'href' => admin_url('user-new.php'), 'meta' => array('title' => __('Add New Client', 'mobile-dj-manager'))));
        $admin_bar->add_menu(array('id' => 'mdjm-custom-client-fields', 'parent' => 'mdjm-clients', 'title' => __('Custom Client Fields', 'mobile-dj-manager'), 'href' => admin_url('admin.php?page=mdjm-custom-client-fields'), 'meta' => array('title' => __('Custom Client Field', 'mobile-dj-manager'))));
    }
    // Communications
    if (mdjm_employee_can('send_comms')) {
        $admin_bar->add_menu(array('id' => 'mdjm-comms', 'parent' => 'mdjm', 'title' => __('Communications', 'mobile-dj-manager'), 'href' => admin_url('admin.php?page=mdjm-comms'), 'meta' => array('title' => __('Communications', 'mobile-dj-manager'))));
        $admin_bar->add_menu(array('id' => 'edit.php?post_type=mdjm_communication', 'parent' => 'mdjm-comms', 'title' => __('Communication History', 'mobile-dj-manager'), 'href' => admin_url('edit.php?post_type=mdjm_communication'), 'meta' => array('title' => __('Communication History', 'mobile-dj-manager'))));
    }
    // Filter for MDJM DCF Admin Bar Items
    do_action('mdjm_dcf_admin_bar_items', $admin_bar);
    if (mdjm_employee_can('manage_templates')) {
        // Contract Templates
        $admin_bar->add_menu(array('id' => 'mdjm-contracts', 'parent' => 'mdjm', 'title' => __('Contract Templates', 'mobile-dj-manager'), 'href' => admin_url('edit.php?post_type=contract'), 'meta' => array('title' => __('Contract Templates', 'mobile-dj-manager'))));
        $admin_bar->add_menu(array('id' => 'mdjm-new-contract', 'parent' => 'mdjm-contracts', 'title' => __('Add Contract Template', 'mobile-dj-manager'), 'href' => admin_url('post-new.php?post_type=contract'), 'meta' => array('title' => __('New Contract Template', 'mobile-dj-manager'))));
    }
    if (mdjm_employee_can('manage_templates')) {
        // Email Templates
        $admin_bar->add_menu(array('id' => 'mdjm-email-templates', 'parent' => 'mdjm', 'title' => __('Email Templates', 'mobile-dj-manager'), 'href' => admin_url('edit.php?post_type=email_template'), 'meta' => array('title' => __('Email Templates', 'mobile-dj-manager'))));
        $admin_bar->add_menu(array('id' => 'mdjm-new-email-template', 'parent' => 'mdjm-email-templates', 'title' => __('Add Template', 'mobile-dj-manager'), 'href' => admin_url('post-new.php?post_type=email_template'), 'meta' => array('title' => __('New Email Template', 'mobile-dj-manager'))));
    }
    // Equipment Packages & Add-ons
    if (mdjm_packages_enabled() && mdjm_employee_can('manage_packages')) {
        $admin_bar->add_menu(array('id' => 'mdjm-packages', 'parent' => 'mdjm', 'title' => __('Packages', 'mobile-dj-manager'), 'href' => admin_url('edit.php?post_type=mdjm-package'), 'meta' => array('title' => __('Packages', 'mobile-dj-manager'))));
        $admin_bar->add_menu(array('id' => 'mdjm-package-cats', 'parent' => 'mdjm-packages', 'title' => __('Package Categories', 'mobile-dj-manager'), 'href' => admin_url('edit-tags.php?taxonomy=package-category&post_type=mdjm-package'), 'meta' => array('title' => __('Package Categories', 'mobile-dj-manager'))));
        $admin_bar->add_menu(array('id' => 'mdjm-addons', 'parent' => 'mdjm-packages', 'title' => __('Add-ons', 'mobile-dj-manager'), 'href' => admin_url('edit.php?post_type=mdjm-addon'), 'meta' => array('title' => __('Add-ons', 'mobile-dj-manager'))));
        $admin_bar->add_menu(array('id' => 'mdjm-addon-cats', 'parent' => 'mdjm-packages', 'title' => __('Addon Categories', 'mobile-dj-manager'), 'href' => admin_url('edit-tags.php?taxonomy=addon-category&post_type=mdjm-addon'), 'meta' => array('title' => __('Addon Categories', 'mobile-dj-manager'))));
    }
    // Custom Event Fields
    if (mdjm_is_admin()) {
        $admin_bar->add_menu(array('id' => 'mdjm-event-fields', 'parent' => 'mdjm-events', 'title' => sprintf(__('Custom %s Fields', 'mobile-dj-manager'), mdjm_get_label_singular()), 'href' => admin_url('admin.php?page=mdjm-custom-event-fields'), 'meta' => array('title' => sprintf(__('Manage Custom %s Fields', 'mobile-dj-manager'), mdjm_get_label_singular()))));
    }
    // Event Quotes
    if (mdjm_get_option('online_enquiry', false) && mdjm_employee_can('list_own_quotes')) {
        $admin_bar->add_menu(array('id' => 'mdjm-event-quotes', 'parent' => 'mdjm-events', 'title' => sprintf(__('%s Quotes', 'mobile-dj-manager'), mdjm_get_label_singular()), 'href' => admin_url('edit.php?post_type=mdjm-quotes'), 'meta' => array('title' => sprintf(__('View %s Quotes', 'mobile-dj-manager'), mdjm_get_label_singular()))));
    }
    // Reporting
    /*if( current_user_can( 'manage_options' ) )	{
    		$admin_bar->add_menu( array(
    			'id'     => 'mdjm-reports',
    			'parent' => 'mdjm',
    			'title'  => __( 'Reports', 'mobile-dj-manager' ),
    			'href'   => admin_url( 'admin.php?page=mdjm-reports' ),
    			'meta'   => array(
    				'title' => __( 'MDJM Reports', 'mobile-dj-manager' ),
    			),
    		) );	
    	}*/
    if (mdjm_employee_can('edit_txns')) {
        // Transactions
        $admin_bar->add_menu(array('id' => 'mdjm-transactions', 'parent' => 'mdjm', 'title' => __('Transactions', 'mobile-dj-manager'), 'href' => 'edit.php?post_type=mdjm-transaction', 'meta' => array('title' => __('MDJM Transactions', 'mobile-dj-manager'))));
        $admin_bar->add_menu(array('id' => 'mdjm-add-transaction', 'parent' => 'mdjm-transactions', 'title' => __('Add Transaction', 'mobile-dj-manager'), 'href' => admin_url('post-new.php?post_type=mdjm-transaction'), 'meta' => array('title' => __('Add Transaction', 'mobile-dj-manager'))));
        // Transaction Types
        $admin_bar->add_menu(array('id' => 'mdjm-transaction-types', 'parent' => 'mdjm-transactions', 'title' => __('Transaction Types', 'mobile-dj-manager'), 'href' => admin_url('edit-tags.php?taxonomy=transaction-types&post_type=mdjm-transaction'), 'meta' => array('title' => __('View / Edit Transaction Types', 'mobile-dj-manager'))));
    }
    if (mdjm_employee_can('list_venues')) {
        // Venues
        $admin_bar->add_menu(array('id' => 'mdjm-venues', 'parent' => 'mdjm', 'title' => __('Venues', 'mobile-dj-manager'), 'href' => admin_url('edit.php?post_type=mdjm-venue'), 'meta' => array('title' => __('Venues', 'mobile-dj-manager'))));
        if (mdjm_employee_can('add_venues')) {
            $admin_bar->add_menu(array('id' => 'mdjm-add-venue', 'parent' => 'mdjm-venues', 'title' => __('Add Venue', 'mobile-dj-manager'), 'href' => admin_url('post-new.php?post_type=mdjm-venue'), 'meta' => array('title' => __('Add New Venue', 'mobile-dj-manager'))));
            $admin_bar->add_menu(array('id' => 'mdjm-venue-details', 'parent' => 'mdjm-venues', 'title' => __('Venue Details', 'mobile-dj-manager'), 'href' => admin_url('edit-tags.php?taxonomy=venue-details&post_type=mdjm-venue'), 'meta' => array('title' => __('View / Edit Venue Details', 'mobile-dj-manager'))));
        }
    }
    // MDJM Links
    $admin_bar->add_menu(array('id' => 'mdjm-user-guides', 'parent' => 'mdjm', 'title' => sprintf(__('%sDocumentation%s', 'mobile-dj-manager'), '<span style="color:#F90">', '</span>'), 'href' => 'http://mdjm.co.uk/support/', 'meta' => array('title' => __('Documentation', 'mobile-dj-manager'), 'target' => '_blank')));
    $admin_bar->add_menu(array('id' => 'mdjm-support', 'parent' => 'mdjm', 'title' => sprintf(__('%sSupport%s', 'mobile-dj-manager'), '<span style="color:#F90">', '</span>'), 'href' => 'http://www.mydjplanner.co.uk/forums/', 'meta' => array('title' => __('MDJM Support Forums', 'mobile-dj-manager'), 'target' => '_blank')));
}
Example #26
0
    /**
     * Render Getting Started Screen
     *
     * @access public
     * @since 1.9
     * @return void
     */
    public function getting_started_screen()
    {
        ?>
		<div class="wrap about-wrap mdjm-about-wrap">
			<?php 
        // load welcome message and content tabs
        $this->welcome_message();
        $this->tabs();
        ?>
			<p class="about-description"><?php 
        _e("Now that MDJM Event Management is installed, you're ready to get started. It works out of the box, but there are some customisations you can configure to match your business needs.", 'mobile-dj-manager');
        ?>
</p>

			<div class="changelog">
				<h3><?php 
        printf(__('Creating Your First %s', 'mobile-dj-manager'), mdjm_get_label_singular());
        ?>
</h3>
				<div class="feature-section">
					<div class="feature-section-media">
						<img src="<?php 
        echo MDJM_PLUGIN_URL . '/assets/images/screenshots/mdjm-first-event.png';
        ?>
" class="mdjm-welcome-screenshots"/>
					</div>
					<div class="feature-section-content">
						<h4><a href="<?php 
        echo admin_url('post-new.php?post_type=mdjm-event');
        ?>
"><?php 
        printf(__('MDJM %s &rarr; Create %s', 'mobile-dj-manager'), mdjm_get_label_plural(), mdjm_get_label_singular());
        ?>
</a></h4>
						<p><?php 
        printf(__('The MDJM %1$s menu is your access point to all aspects of your %2$s creation and setup. To create your first %2$s, simply click Add New and then fill out the %2$s details.', 'mobile-dj-manager'), mdjm_get_label_plural(), mdjm_get_label_singular(true));
        ?>
</p>

						<h4><?php 
        _e('Create a Client', 'mobile-dj-manager');
        ?>
</h4>
						<p><?php 
        printf(__('Create clients directly from the %s screen by selected <strong>Add New Client</strong> from the <em>Select Client</em> dropdown to reveal a few additional fields', 'mobile-dj-manager'), mdjm_get_label_singular());
        ?>

						<h4><?php 
        printf(__('Add %s Types', 'mobile-dj-manager'), mdjm_get_label_singular());
        ?>
</h4>
						<p><?php 
        printf(__('If the %1$s type does not exist for the %1$s you are creating, click the <em>Add New</em> link next to the %2$s Type dropdown, enter the %2$s Type name in the text box that is revealed and click <em>Add</em>.<br />To manage all %2$s Types, go to <a href="%4$s">MDJM %3$s &rarr; %2$s Types</a>.', 'mobile-dj-manager'), mdjm_get_label_singular(true), mdjm_get_label_singular(), mdjm_get_label_plural(), admin_url('edit-tags.php?taxonomy=event-types&post_type=mdjm-event'));
        ?>
</p>
					</div>
				</div>
			</div>

			<div class="changelog">
				<h3><?php 
        _e('Setup Templates for Complete Automation', 'mobile-dj-manager');
        ?>
</h3>
				<div class="feature-section">
					<div class="feature-section-media">
						<img src="<?php 
        echo MDJM_PLUGIN_URL . '/assets/images/screenshots/mdjm-edit-template.png';
        ?>
"/>
					</div>
					<div class="feature-section-content">
						<h4><?php 
        _e('Email Templates', 'mobile-dj-manager');
        ?>
</h4>
						<p><?php 
        printf(__('Email templates can be configured to be sent automatically during an %1$s status change. Supporting our vast collection of <a href="%2$s" target="_blank">content tags</a> each email can be completley customised and tailored to the %1$s and client details.', 'mobile-dj-manager'), mdjm_get_label_singular(true), 'http://mdjm.co.uk/docs/content-tags/');
        ?>
</p>
                        <p><?php 
        _e('With email tracking enabled, you can even be sure that your client received your email and know when they have read it.', 'mobile-dj-manager');
        ?>
</p>

						<h4><?php 
        _e('Contract Templates', 'mobile-dj-manager');
        ?>
</h4>
						<p><?php 
        printf(__('Create contract templates that be assigned to your %s. Clients will be able to review and <strong>Digitally Sign</strong> the contract via the %2$s.', 'mobile-dj-manager'), mdjm_get_label_singular(), mdjm_get_option('app_name', __('Client Zone', 'mobile-dj-manager')));
        ?>
</p>
					</div>
				</div>
			</div>

			<div class="changelog">
				<h3><?php 
        printf(__('Create %s Packages &amp; Add-ons', 'mobile-dj-manager'), mdjm_get_label_singular());
        ?>
</h3>
				<div class="feature-section">
					<div class="feature-section-media">
						<img src="<?php 
        echo MDJM_PLUGIN_URL . '/assets/images/screenshots/14-package-options.png';
        ?>
"/>
					</div>
					<div class="feature-section-content">
						<h4><?php 
        printf(__('%1$s Packages', 'mobile-dj-manager'), mdjm_get_label_singular());
        ?>
</h4>
						<p><?php 
        printf(__('Packages are a pre-defined collection of add-ons that you can offer to your clients for their %s. Define a price for the package and upon selection, the %1$s %2$s and %3$s will be automatically and dynamically re-calculated. Add-ons included within the package, will no longer be available for selection within the add-ons list for this %2$s.', 'mobile-dj-manager'), mdjm_get_label_singular(true), mdjm_get_balance_label(), mdjm_get_deposit_label());
        ?>
</p>

						<h4><?php 
        _e('Add-ons', 'mobile-dj-manager');
        ?>
</h4>
						<p><?php 
        printf(__('Add-ons are additional equipment items that can be selected for an %1$s. Each add-on is assigned an individual price and when selected the %1$s %2$s and %3$s are automatically and dynamically re-calculated.', 'mobile-dj-manager'), mdjm_get_label_singular(true), mdjm_get_balance_label(), mdjm_get_deposit_label());
        ?>
</p>
                        <p><?php 
        printf(__('Once you have enabled %1$s Packages &amp; Add-ons within the <a href="%3$s">MDJM %2$s Settings page</a>, manage them within <a href="%4$s">MDJM %2$s &rarr; Equipment Packages</a> and a href="%5$s">MDJM %2$s &rarr; Equipment Add-ons</a>.', 'mobile-dj-manager'), mdjm_get_label_singular(true), mdjm_get_label_plural(), admin_url('admin.php?page=mdjm-settings&tab=events'), admin_url('edit.php?post_type=mdjm-package'), admin_url('edit.php?post_type=mdjm-addon'));
        ?>
</p>
					</div>
				</div>
			</div>

			<div class="changelog">
				<h3><?php 
        _e('Even More Features', 'mobile-dj-manager');
        ?>
</h3>
				<div class="feature-section two-col">
					<div class="col">
						<h4><?php 
        _e('Integrated Client Portal', 'mobile-dj-manager');
        ?>
</h4>
						<p><?php 
        printf(__('Known as the <em>Client Zone</em> by default, a password protected portal is available to your clients where they can review their %1$s, view and accept your quote, digitally sign their contract, and manage their %1$s playlist. All %2$s pages use a template system and are fully customisable.', 'mobile-dj-manager'), mdjm_get_label_singular(true), mdjm_get_option('app_name', __('Client Zone', 'mobile-dj-manager')));
        ?>
</p>
					</div>
					<div class="col">
						<h4><?php 
        _e('Digitally Sign Contracts', 'mobile-dj-manager');
        ?>
</h4>
						<p><?php 
        printf(__('Via the %s, clients are able to review and digitally sign their %s contract. Signing requires confirmation of their name and password for verification to maintain security.', 'mobile-dj-manager'), mdjm_get_option('app_name', __('Client Zone', 'mobile-dj-manager')), mdjm_get_label_singular());
        ?>
</p>
					</div>
				</div>
                <div class="feature-section two-col">
					<div class="col">
						<h4><?php 
        _e('Transaction Logging', 'mobile-dj-manager');
        ?>
</h4>
						<p><?php 
        printf(__('Log all payments your business receives and all expenses you have with the MDJM Event Management Transactions system. Instantly know how profitable your %s are as well as how much money your company has made over differing periods of time.', 'mobile-dj-manager'), mdjm_get_label_plural());
        ?>
</p>
					</div>
					<div class="col">
						<h4><?php 
        _e('Multi Employee Aware', 'mobile-dj-manager');
        ?>
</h4>
						<p><?php 
        printf(__('MDJM Event Management supports as many employees as you need at no additional cost. Easily create new employees, set permissions for them to ensure they only have access to what they need, and then assign as many employees to an %s as you need.', 'mobile-dj-manager'), mdjm_get_label_singular(true));
        ?>
</p>
					</div>
				</div>
			</div>

			<div class="changelog">
				<h3><?php 
        _e('Need Help?', 'mobile-dj-manager');
        ?>
</h3>
				<div class="feature-section two-col">
					<div class="col">
						<h4><?php 
        _e('Excellent Support', 'mobile-dj-manager');
        ?>
</h4>
						<p><?php 
        _e('We pride ourselves on our level of support and excellent response times. If you are experiencing an issue, submit a support ticket and we will respond quickly.', 'mobile-dj-manager');
        ?>
</p>
					</div>
					<div class="col">
						<h4><?php 
        _e('Join our Facebook User Group', 'mobile-dj-manager');
        ?>
</h4>
						<p><?php 
        _e('Our <a href="https://www.facebook.com/groups/mobile-dj-manager/" target="_blank">MDJM Facebook User Group</a> is a great way to exchange knowledge with other users and gain tips for use.', 'mobile-dj-manager');
        ?>
</p>
					</div>
				</div>
			</div>

			<div class="changelog">
				<h3><?php 
        _e('Stay Up to Date', 'mobile-dj-manager');
        ?>
</h3>
				<div class="feature-section two-col">
					<div class="col">
						<h4><?php 
        _e('Get Notified of Add-on Releases', 'mobile-dj-manager');
        ?>
</h4>
						<p><?php 
        _e('New add-ons make MDJM Event Management even more powerful. Subscribe to the newsletter to stay up to date with our latest releases. <a href="http://eepurl.com/bTRkZj" target="_blank">Sign up now</a> to ensure you do not miss a release!', 'mobile-dj-manager');
        ?>
</p>
					</div>
					<div class="col">
						<h4><?php 
        _e('Get Alerted About New Tutorials', 'mobile-dj-manager');
        ?>
</h4>
						<p><?php 
        _e('<a href="http://eepurl.com/bTRkZj" target="_blank">Sign up now</a> to hear about the latest tutorial releases that explain how to take MDJM Event Management further.', 'mobile-dj-manager');
        ?>
</p>
					</div>
				</div>
			</div>

			<div class="changelog">
				<h3><?php 
        _e('Extensions', 'mobile-dj-manager');
        ?>
</h3>
				<div class="feature-section two-col">
					<div class="col">
						<h4><?php 
        _e('A Growing List of Add-ons', 'mobile-dj-manager');
        ?>
</h4>
						<p><?php 
        _e('Add-on plugins are available that greatly extend the default functionality of MDJM Event Management. There are extensions to further automate MDJM Event Management, payment processing and calendar syncronisation.', 'mobile-dj-manager');
        ?>
</p>
					</div>
					<div class="col">
						<h4><?php 
        _e('Visit the Add-ons Store', 'mobile-dj-manager');
        ?>
</h4>
						<p><?php 
        printf(__('<a href="%s" target="_blank">The Add-ons store</a> has a list of all available extensions, including convenient category filters so you can find exactly what you are looking for.', 'mobile-dj-manager'), 'http://mdjm.co.uk/add-ons');
        ?>
</p>
					</div>
				</div>
			</div>
		</div>
		<?php 
    }
Example #27
0
/**
 * Customise the messages associated with managing event posts
 *
 * @since	1.3
 * @param	arr		$messages	The current messages
 * @return	arr		$messages	Filtered messages
 *
 */
function mdjm_event_post_messages($messages)
{
    global $post;
    if ('mdjm-event' != $post->post_type) {
        return $messages;
    }
    $url1 = '<a href="' . admin_url('edit.php?post_type=mdjm-event') . '">';
    $url2 = mdjm_get_label_singular();
    $url3 = mdjm_get_label_plural();
    $url4 = '</a>';
    $messages['mdjm-event'] = array(0 => '', 1 => sprintf(__('%2$s updated. %1$s%3$s List%4$s.', 'mobile-dj-manager'), $url1, $url2, $url3, $url4), 4 => sprintf(__('%2$s updated. %1$s%3$s List%4$s.', 'mobile-dj-manager'), $url1, $url2, $url3, $url4), 6 => sprintf(__('%2$s created. %1$s%3$s List%4$s.'), $url1, $url2, $url3, $url4), 7 => sprintf(__('%2$s saved. %1$s%3$s List%4$s.', 'mobile-dj-manager'), $url1, $url2, $url3, $url4), 8 => sprintf(__('%2$s submitted. %1$s%3$s List%4$s.', 'mobile-dj-manager'), $url1, $url2, $url3, $url4));
    return apply_filters('mdjm_event_post_messages', $messages);
}
/**
 * Retrieve the next event.
 * If the current user is not an MDJM admin, only list their own event.
 *
 * @since	1.3
 * @param	int		$employee_id	User ID of employee. Leave empty to check for all employees.
 * @return	obj		Events WP_Post object.
 */
function mdjm_get_next_event($employee_id = '')
{
    if (!empty($employee_id) && !mdjm_employee_can('manage_all_events') && $employee_id != get_current_user_id()) {
        wp_die('<h1>' . __('Cheatin&#8217; uh?') . '</h1>' . '<p>' . sprintf(__('Your %s permissions do not permit you to search all %s!', 'mobile-dj-manager'), mdjm_get_label_singular(true), mdjm_get_label_plural(true)) . '</p>', 403);
    }
    if (!empty($employee_id) || !mdjm_employee_can('manage_all_events')) {
        $employee_id = !empty($employee_id) ? $employee_id : get_current_user_id();
        $event = mdjm_get_employees_next_event($employee_id);
    } else {
        $args = array('post_status' => mdjm_active_event_statuses(), 'posts_per_page' => 1, 'meta_key' => '_mdjm_event_date', 'orderby' => 'meta_value', 'order' => 'ASC');
        $event = mdjm_get_events($args);
        if (!empty($event)) {
            $event = $event[0];
        }
    }
    if (empty($event)) {
        return false;
    }
    return $event;
}
 /**
  * Set the CSV columns
  *
  * @access	public
  * @since	1.4
  * @return	arr		$cols	All the columns
  */
 public function csv_cols()
 {
     $cols = array('id' => __('ID', 'mobile-dj-manager'), 'name' => __('Name', 'mobile-dj-manager'), 'email' => __('Email', 'mobile-dj-manager'), 'events' => sprintf(__('Number of %s', 'mobile-dj-manager'), mdjm_get_label_plural()), 'amount' => __('Client Value', 'mobile-dj-manager'));
     return $cols;
 }
 /**
  * Set the CSV columns
  *
  * @access	public
  * @since	1.4
  * @return	arr		$cols	All the columns
  */
 public function csv_cols()
 {
     $cols = array('id' => __('ID', 'mobile-dj-manager'), 'name' => __('Name', 'mobile-dj-manager'), 'email' => __('Email', 'mobile-dj-manager'), 'events' => sprintf(__('Number of %s', 'mobile-dj-manager'), mdjm_get_label_plural()), 'roles' => __('Roles', 'mobile-dj-manager'), 'wages' => __('Total Wages', 'mobile-dj-manager'), 'paid' => __('Paid Wages', 'mobile-dj-manager'), 'owed' => __('Owed Wages', 'mobile-dj-manager'));
     return $cols;
 }