示例#1
0
/**
 * Update the email content field with the selected template.
 *
 *
 * @since	1.3
 * @return	void
 */
function mdjm_user_events_dropdown_ajax()
{
    $result['event_list'] = '<option value="0">' . __('Select an Event', 'mobile-dj-manager') . '</option>';
    if (!empty($_POST['recipient'])) {
        $statuses = 'any';
        if (mdjm_is_employee($_POST['recipient'])) {
            if (mdjm_get_option('comms_show_active_events_only')) {
                $statuses = array('post_status' => mdjm_active_event_statuses());
            }
            $events = mdjm_get_employee_events($_POST['recipient'], $statuses);
        } else {
            if (mdjm_get_option('comms_show_active_events_only')) {
                $statuses = mdjm_active_event_statuses();
            }
            $events = mdjm_get_client_events($_POST['recipient'], $statuses);
        }
        if ($events) {
            foreach ($events as $event) {
                $result['event_list'] .= '<option value="' . $event->ID . '">';
                $result['event_list'] .= mdjm_get_event_date($event->ID) . ' ';
                $result['event_list'] .= __('from', 'mobile-dj-manager') . ' ';
                $result['event_list'] .= mdjm_get_event_start($event->ID) . ' ';
                $result['event_list'] .= '(' . mdjm_get_event_status($event->ID) . ')';
                $result['event_list'] .= '</option>';
            }
        }
    }
    $result['type'] = 'success';
    $result = json_encode($result);
    echo $result;
    die;
}
示例#2
0
function mdjm_dashboard()
{
    global $mdjm, $my_mdjm, $current_user;
    if (!class_exists('MDJM_Dashboard')) {
        require_once MDJM_PLUGIN_DIR . '/includes/admin/mdjm-dashboard.php';
        $mdjm_dash = new MDJM_Dashboard();
    }
    wp_enqueue_script('youtube-subscribe');
    ?>
		<?php 
    mdjm_insert_datepicker(array('class' => 'check_custom_date', 'altfield' => 'check_date', 'mindate' => 'today'));
    ?>
        <div class="wrap">
        <h1>MDJM Event Management - <?php 
    echo $current_user->display_name;
    ?>
 (<?php 
    if (!current_user_can('manage_options')) {
        echo 'DJ';
    } else {
        echo 'Admin';
    }
    ?>
)</h1>
        <hr />
        <h2>
        <?php 
    //$dj_event_count = MDJM()->events->count_events_by_status( 'dj', get_current_user_id() );
    ?>
</h2>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="widefat">
          <tr>
            <td width="60%"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="widefat">
          <tr>
            <td colspan="2" class="alternate"><strong><?php 
    printf(__('Monthly %s Overview for %s', 'mobile-dj-manager'), mdjm_get_option('artist'), date('F Y'));
    ?>
</strong></td>
            </tr>
          <tr>
            <td width="30%"><?php 
    _e('Active Bookings', 'mobile-dj-manager');
    ?>
:</td>
            <td width="70%"><?php 
    echo mdjm_count_employee_events('', array('post_status' => mdjm_active_event_statuses(), 'date' => array(date('Y-m-01'), date('Y-m-t')), 'date_compare' => 'BETWEEN'));
    ?>
</td>
          </tr>
          <?php 
    if (mdjm_employee_can('read_events')) {
        ?>
              <tr>
                <td><a href="<?php 
        echo mdjm_get_admin_page('enquiries') . '&mdjm_filter_type&mdjm_filter_date=' . date('Ym');
        ?>
">Outstanding Enquiries:</a></td>
                <td><?php 
        echo $dj_event_count['enquiry_month'] + $dj_event_count['unattended_month'] . (!empty($dj_event_count['unattended_month']) && $dj_event_count['unattended_month'] > 0 ? ' (<a href="' . mdjm_get_admin_page('unattended') . '&mdjm_filter_date=' . date('Ym') . '">' . $dj_event_count['unattended_month'] . ' Unattended)</a>' : '');
        ?>
</td>
              </tr>
              <tr>
                <td><a href="<?php 
        echo mdjm_get_admin_page('events') . '&post_status=mdjm-lost&mdjm_filter_date=' . date('Ym') . '&mdjm_filter_type';
        ?>
">Lost Enquiries:</a></td>
                <td><?php 
        echo $dj_event_count['lost_month'];
        ?>
</td>
              </tr>
				<?php 
    }
    ?>
          <tr>
            <td><a href="<?php 
    echo mdjm_get_admin_page('events') . '&post_status=mdjm-completed&mdjm_filter_date=' . date('Ym') . '&mdjm_filter_type';
    ?>
">Completed Bookings:</a></td>
            <td><?php 
    echo $dj_event_count['completed_month'];
    ?>
</td>
          </tr>
		<?php 
    if (mdjm_employee_can('manage_events')) {
        ?>
          <tr>
            <td>Potential Earnings: </td>
            <td><?php 
        echo $mdjm_dash->period_earnings('month', $current_user->ID, false);
        ?>
</td>
          </tr>
          <?php 
    }
    ?>
          <tr>
            <td>Earnings so Far:</td>
            <td><?php 
    echo $mdjm_dash->period_earnings('month', $current_user->ID, true);
    ?>
</td>
          </tr>
          <tr>
            <td colspan="2" class="alternate"><strong>Annual DJ Overview for <?php 
    echo date('Y');
    ?>
</strong></td>
            </tr>
         <?php 
    if (mdjm_employee_can('manage_events')) {
        ?>
          <tr>
            <td><a href="<?php 
        echo mdjm_get_admin_page('enquiries');
        ?>
">Outstanding Enquiries:</a></td>
                <td><?php 
        echo $dj_event_count['enquiry_year'] + $dj_event_count['unattended_year'] . (!empty($dj_event_count['unattended_year']) && $dj_event_count['unattended_year'] > 0 ? ' (<a href="' . mdjm_get_admin_page('unattended') . '&mdjm_filter_date=' . date('Ym') . '">' . $dj_event_count['unattended_year'] . ' Unattended)</a>' : '');
        ?>
</td>
          </tr>
          <tr>
            <td>Lost Enquiries:</td>
            <td><?php 
        echo $dj_event_count['lost_year'];
        ?>
</td>
          </tr>
          <?php 
    }
    ?>
          <tr>
            <td>Completed Bookings:</td>
            <td><?php 
    echo $dj_event_count['completed_year'];
    ?>
</td>
          </tr>
          <?php 
    if (mdjm_employee_can('manage_events')) {
        ?>
          <tr>
            <td>Potential Earnings:</td>
            <td><?php 
        echo $mdjm_dash->period_earnings('year', $current_user->ID, false);
        ?>
</td>
          </tr>
          <?php 
    }
    ?>
          <tr>
            <td>Earnings so Far:</td>
            <td><?php 
    echo $mdjm_dash->period_earnings('year', $current_user->ID, true);
    ?>
</td>
          </tr>
            </table>
        </td>
            <td width="40%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="widefat">
              <tr>
                <td colspan="2" class="alternate"><strong><?php 
    echo date('l jS F Y');
    ?>
</strong></td>
              </tr>
              <tr>
                <td width="35%">Your Status:</td>
                <?php 
    $next_event = MDJM()->events->next_event($current_user->ID, 'dj');
    if (!empty($next_event)) {
        $eventinfo = MDJM()->events->event_detail($next_event[0]->ID);
    }
    ?>
                <td width="65%">
				<?php 
    echo isset($eventinfo) && date('Y-m-d', $eventinfo['date']) == date('Y-m-d') ? '<a href="' . get_edit_post_link($next_event[0]->ID) . '">Booked from ' . $eventinfo['start'] . '</a>' : 'Available';
    ?>
                </td>
              </tr>
              <?php 
    if (current_user_can('administrator') && MDJM_MULTI == true) {
        $bookings_today = MDJM()->events->employee_bookings();
        ?>
				  <tr>
					<td>Employee Bookings:</td>
					<?php 
        if (empty($bookings_today)) {
            ?>
							<td>None</td>
							<?php 
        } else {
            echo '<td>';
            $i = 1;
            foreach ($bookings_today as $event) {
                $eventinfo = MDJM()->events->event_detail($event->ID);
                echo '<a href="' . get_edit_post_link($event->ID) . '">' . $eventinfo['dj']->display_name . ' from ' . $eventinfo['start'] . '</a>' . ($i < count($bookings_today) ? '<br />' : '');
                $i++;
            }
            echo '</td>';
        }
        ?>
				  </tr>
					<?php 
    }
    ?>
                <form name="availability-check" id="availability-check" method="post" action="<?php 
    echo mdjm_get_admin_page('availability');
    ?>
">
                <?php 
    if (!current_user_can('administrator')) {
        ?>
<input type="hidden" name="check_employee" id="check_employee" value="<?php 
        echo get_current_user_id();
        ?>
" /><?php 
    } else {
        ?>
<input type="hidden" name="check_employee" id="check_employee" value="all" /><?php 
    }
    ?>
                <tr>
                <td><label for="show_check_date">Availability Check:</label></th>
                <td><input type="text" name="show_check_date" id="show_check_date" class="check_custom_date" required="required" />&nbsp;&nbsp;&nbsp;
                <input type="hidden" name="check_date" id="check_date" />
                <?php 
    submit_button('Check Date', 'primary small', 'submit', false, '');
    ?>
                </td>
                </tr>
                </form>
              <tr>
                  <td colspan="2"><p><a href="http://twitter.com/mobiledjmanager" class="twitter-follow-button" data-show-count="false">Follow @mobiledjmanager</a>
<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script></p>
<p><div class="g-ytsubscribe" data-channelid="UCaD6icd6OZ8haoTBc5YjJrw" data-layout="default" data-count="hidden"></div></p></td>
              </tr>
              <tr class="alternate">
                <td colspan="2"><strong>Your 7 Day Schedule</strong></td>
              </tr>
              <tr>
              <td colspan="2"><?php 
    get_availability_activity(0, 0);
    ?>
</td>
              </tr>
            </table></td>
          </tr>
          </table>
		<?php 
    if (current_user_can('administrator') && MDJM_MULTI == true) {
        $emp_event_count = MDJM()->events->count_events_by_status();
        ?>
                <hr />
                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="widefat">
                <tr>
                <td width="60%"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="widefat">
                <tr>
                <td colspan="2" class="alternate"><strong>Monthly Employer Overview for <?php 
        echo date('F Y');
        ?>
</strong></td>
                </tr>
                <tr>
                <td width="30%">Active Bookings:</td>
                <td width="70%"><?php 
        echo $emp_event_count['active_month'];
        ?>
</td>
                </tr>
                <tr>
                <td><a href="<?php 
        echo mdjm_get_admin_page('enquiries') . '&mdjm_filter_type&mdjm_filter_date=' . date('Ym');
        ?>
">Outstanding Enquiries:</a></td>
                <td><?php 
        echo $emp_event_count['enquiry_month'] + $emp_event_count['unattended_month'] . (!empty($emp_event_count['unattended_month']) && $emp_event_count['unattended_month'] > 0 ? ' (<a href="' . mdjm_get_admin_page('unattended') . '&mdjm_filter_date=' . date('Ym') . '">' . $emp_event_count['unattended_month'] . ' Unattended)</a>' : '');
        ?>
</td>
                </tr>
                <tr>
                <td>Lost Enquiries:</td>
                <td><?php 
        echo $emp_event_count['lost_month'];
        ?>
</td>
                </tr>
                <tr>
                <td>Completed Bookings:</td>
                <td><?php 
        echo $emp_event_count['completed_month'];
        ?>
</td>
                </tr>
                <tr>
                <td>Potential Earnings:</td>
                <td><?php 
        echo $mdjm_dash->period_earnings('month', '', false);
        ?>
</td>
                </tr>
                <tr>
                <td>Earnings so Far:</td>
                <td><?php 
        echo $mdjm_dash->period_earnings('month', '', true);
        ?>
</td>
                </tr>
                <tr>
                <td colspan="2" class="alternate"><strong>Annual Employer Overview for <?php 
        echo date('Y');
        ?>
</strong></td>
                </tr>
                <tr>
                <td><a href="<?php 
        echo mdjm_get_admin_page('enquiries') . '&mdjm_filter_type&mdjm_filter_date=' . date('Ym');
        ?>
">Outstanding Enquiries:</a></td>
                <td><?php 
        echo $emp_event_count['enquiry_year'] + $emp_event_count['unattended_year'] . (!empty($emp_event_count['unattended_year']) && $emp_event_count['unattended_year'] > 0 ? ' (<a href="' . mdjm_get_admin_page('unattended') . '&mdjm_filter_date=' . date('Ym') . '">' . $emp_event_count['unattended_year'] . ' Unattended)</a>' : '');
        ?>
                </tr>
                <tr>
                <td>Lost Enquiries:</td>
                <td><?php 
        echo $emp_event_count['lost_year'];
        ?>
</td>
                </tr>
                <tr>
                <td>Completed Bookings:</td>
                <td><?php 
        echo $emp_event_count['completed_year'];
        ?>
</td>
                </tr>
                <tr>
                <td>Potential Earnings:</td>
                <td><?php 
        echo $mdjm_dash->period_earnings('year', '', false);
        ?>
</td>
                </tr>
                <tr>
                <td>Earnings so Far:</td>
                <td><?php 
        echo $mdjm_dash->period_earnings('year', '', true);
        ?>
</td>
                </tr>
                </table></td>
                <td width="40%" valign="top">
                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="widefat">
                  <tr>
                    <td width="100%" class="alternate"><strong>Latest News from <a href="<?php 
        mdjm_get_admin_page('mydjplanner');
        ?>
">My DJ Planner</a></strong></td>
                  </tr>
                  <tr>
                    <td><?php 
        wp_widget_rss_output('http://www.mydjplanner.co.uk/category/news/feed/rss2/', $args = array('show_author' => 0, 'show_date' => 1, 'show_summary' => 1, 'items' => 3));
        ?>
</td>
                  </tr>
                  <tr>
                    <td width="100%" class="alternate"><strong>Latest Support Topics</strong></td>
                  </tr>
                  <tr>
                    <td><?php 
        wp_widget_rss_output('http://www.mydjplanner.co.uk/forums/feed/?post_type=topic', $args = array('show_author' => 0, 'show_date' => 0, 'show_summary' => 0, 'items' => 3));
        ?>
</td>
                  </tr>
                </table>
                </td>
                </tr>
                </table>
                <?php 
    }
    ?>
	
        </div>
<?php 
}
/**
 * Retrieve a list of the employee's clients.
 *
 * @since	1.3
 * @param	int			$employee		The user ID of the employee.
 * @param	bool		$active_only	True to only query active clients, false for all.
 * @param	str			$return			Return resultset as WP_User OBJECTS or ARRAY of user ID's
 * @return	arr|bool	Array of client user ID's or 
 */
function mdjm_get_employee_clients($employee_id = '', $active_only = true, $return = 'OBJECT')
{
    $employee_id = !empty($employee_id) ? $employee_id : get_current_user_id();
    $args['post_status'] = !empty($active_only) ? 'any' : mdjm_active_event_statuses();
    // If we only want active events set an extra check for the event date.
    /*if ( ! empty( $active_only ) )	{
    		$args['date']         = date( 'Y-m-d');
    		$args['date_compare'] = '>=';
    	}*/
    $events = mdjm_get_employee_events($employee_id, $args);
    if (!$events) {
        return false;
    }
    $clients = array();
    // Loop through the events and retrieve the client.
    foreach ($events as $event) {
        $clients[] = mdjm_get_event_client_id($event->ID);
    }
    if (empty($clients)) {
        return false;
    }
    $clients = array_unique($clients);
    $clients = apply_filters('mdjm_get_employee_clients', $clients, $employee_id);
    if ($return != 'ARRAY') {
        foreach ($clients as $client) {
            $client_objects[] = get_userdata($client);
        }
        $clients = $client_objects;
    }
    return $clients;
}
示例#4
0
/**
 * MDJM Home Shortcode.
 *
 * Displays the Client Zone home page which will render event details if the client only has a single event
 * or a list of events if they have multiple events in the system.
 * 
 * @since	1.3
 *
 * @return	string
 */
function mdjm_shortcode_home($atts)
{
    if (is_user_logged_in()) {
        global $mdjm_event;
        $mdjm_event = '';
        ob_start();
        $output = '';
        $client_id = get_current_user_id();
        mdjm_add_content_tag('event_action_buttons', sprintf(__('%s action buttons within %s', 'mobile-dj-manager'), mdjm_get_label_singular(), mdjm_get_option('app_name')), 'mdjm_do_action_buttons');
        if (isset($_GET['event_id'])) {
            $mdjm_event = mdjm_get_event($_GET['event_id']);
            if (!empty($mdjm_event->ID)) {
                ob_start();
                mdjm_get_template_part('event', 'single');
                $output .= mdjm_do_content_tags(ob_get_contents(), $mdjm_event->ID, $client_id);
                ob_get_clean();
            } else {
                ob_start();
                mdjm_get_template_part('event', 'none');
                $output .= mdjm_do_content_tags(ob_get_contents(), '', $client_id);
                ob_get_clean();
            }
        } else {
            $client_events = mdjm_get_client_events($client_id, mdjm_active_event_statuses());
            if ($client_events) {
                $slug = 'single';
                if (count($client_events) > 1) {
                    $slug = 'loop';
                    ob_start();
                    mdjm_get_template_part('event', 'loop-header');
                    $output .= mdjm_do_content_tags(ob_get_contents(), '', $client_id);
                    do_action('mdjm_pre_event_loop');
                    ?>
<div id="mdjm-event-loop"><?php 
                    ob_get_clean();
                }
                foreach ($client_events as $event) {
                    $mdjm_event = new MDJM_Event($event->ID);
                    ob_start();
                    mdjm_get_template_part('event', $slug);
                    $output .= mdjm_do_content_tags(ob_get_contents(), $mdjm_event->ID, $client_id);
                    ob_get_clean();
                }
                if ($slug == 'loop') {
                    ob_start();
                    mdjm_get_template_part('event', 'loop-footer');
                    $output .= mdjm_do_content_tags(ob_get_contents(), '', $client_id);
                    ?>
</div><?php 
                    do_action('mdjm_post_event_loop', $client_events);
                    ob_get_clean();
                }
            } else {
                mdjm_get_template_part('event', 'none');
                $output .= mdjm_do_content_tags(ob_get_contents(), '', $client_id);
                ob_get_clean();
            }
        }
        $mdjm_event = '';
        return $output;
    } else {
        echo mdjm_login_form(mdjm_get_current_page_url());
    }
}
/**
 * Retrieve today's events.
 *
 * @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_todays_events($employee_id = '')
{
    $employee_id = !empty($employee_id) ? $employee_id : get_current_user_id();
    $args = array('post_status' => mdjm_active_event_statuses(), 'posts_per_page' => 1, 'meta_key' => '_mdjm_event_date', 'orderby' => 'meta_value', 'order' => 'DESC');
    $event = mdjm_get_employee_events($employee_id, $args);
    if (empty($event)) {
        return false;
    }
    return $event[0];
}
示例#6
0
/**
 * Hide inactive events from the 'all' events list.
 *
 * @since	1.0
 * @param	obj		$query	The WP_Query.
 * @return	void
 */
function mdjm_hide_inactive_events($query)
{
    if (!is_admin() || !$query->is_main_query() || 'mdjm-event' != $query->get('post_type')) {
        return;
    }
    $active_statuses = mdjm_active_event_statuses();
    if (isset($_GET['post_status']) && in_array($_GET['post_status'], $active_statuses)) {
        return;
    }
    if (!mdjm_get_option('show_active_only', false)) {
        return;
    }
    $active_ids = mdjm_get_events(array('post_status' => $active_statuses, 'fields' => 'ids'));
    if ($active_ids) {
        $query->set('post__in', $active_ids);
    }
}
/**
 * Retrieve the array of plugin settings
 *
 * @since	1.3
 * @return	array
*/
function mdjm_get_registered_settings()
{
    /**
     * 'Whitelisted' MDJM settings, filters are provided for each settings
     * section to allow extensions and other plugins to add their own settings
     */
    $mdjm_settings = array('general' => apply_filters('mdjm_settings_general', array('main' => array('general_settings' => array('id' => 'general_settings', 'name' => '<h3>' . __('General Settings', 'mobile-dj-manager') . '</h3>', 'desc' => '', 'type' => 'header'), 'company_name' => array('id' => 'company_name', 'name' => __('Company Name', 'mobile-dj-manager'), 'desc' => __('Your company name.', 'mobile-dj-manager'), 'type' => 'text', 'std' => get_bloginfo('name')), 'time_format' => array('id' => 'time_format', 'name' => __('Time Format', 'mobile-dj-manager'), 'desc' => sprintf(__('Select the format in which you want your %s times displayed. Applies to both admin and client pages', 'mobile-dj-manager'), mdjm_get_label_singular(true)), 'type' => 'select', 'options' => array('g:i A' => date('g:i A', current_time('timestamp')), 'H:i' => date('H:i', current_time('timestamp'))), 'std' => 'H:i'), 'short_date_format' => array('id' => 'short_date_format', 'name' => __('Short Date Format', 'mobile-dj-manager'), 'desc' => __('Select the format in which you want short dates displayed. Applies to both admin and client pages', 'mobile-dj-manager'), 'type' => 'select', 'options' => array('d/m/Y' => date('d/m/Y') . ' - d/m/Y', 'm/d/Y' => date('m/d/Y') . ' - m/d/Y', 'Y/m/d' => date('Y/m/d') . ' - Y/m/d', 'd-m-Y' => date('d-m-Y') . ' - d-m-Y', 'm-d-Y' => date('m-d-Y') . ' - m-d-Y', 'Y-m-d' => date('Y-m-d') . ' - Y-m-d'), 'std' => 'd/m/Y'), 'show_credits' => array('id' => 'show_credits', 'name' => __('Display Credits?', 'mobile-dj-manager'), 'desc' => sprintf(__('Whether or not to display the %sPowered by ' . '%s, version %s%s text at the footer of the %s application pages.', 'mobile-dj-manager'), '<span class="mdjm-admin-footer">', MDJM_NAME, MDJM_VERSION_NUM, '</span>', mdjm_get_option('app_name', __('Client Zone', 'mobile-dj-manager'))), 'type' => 'checkbox')), 'debugging' => array('debugging_settings' => array('id' => 'debugging_settings', 'name' => '<h3>' . __('Debugging MDJM', 'mobile-dj-manager') . '</h3>', 'desc' => '', 'type' => 'header'), 'enable_debugging' => array('id' => 'enable_debugging', 'name' => __('Enable Debugging', 'mobile-dj-manager'), 'desc' => __('Only enable if MDJM Support have asked you to do so. Performance may be impacted', 'mobile-dj-manager'), 'type' => 'checkbox'), 'debug_log_size' => array('id' => 'debug_log_size', 'name' => __('Maximum Log File Size', 'mobile-dj-manager'), 'hint' => sprintf(__('MB %sDefault is 2 (MB)%s', 'mobile-dj-manager'), '<code>', '</code>'), 'desc' => __('The max size in Megabytes to allow your log files to grow to before you receive a warning (if configured below)', 'mobile-dj-manager'), 'type' => 'text', 'size' => 'small', 'std' => '2'), 'debug_warn' => array('id' => 'debug_warn', 'name' => __('Display Warning if Over Size', 'mobile-dj-manager'), 'desc' => __('Will display notice and allow removal and recreation of log files', 'mobile-dj-manager'), 'type' => 'checkbox', 'std' => '1'), 'debug_auto_purge' => array('id' => 'debug_auto_purge', 'name' => __('Auto Purge Log Files', 'mobile-dj-manager'), 'desc' => __('If selected, log files will be auto-purged when they reach the value of <code>Maximum Log File Size</code>', 'mobile-dj-manager'), 'type' => 'checkbox')), 'uninstall' => array('uninst_settings' => array('id' => 'uninst_settings', 'name' => '<h3>' . __('Uninstallation Settings', 'mobile-dj-manager') . '</h3>', 'desc' => '', 'type' => 'header'), 'uninst_remove_db' => array('id' => 'uninst_remove_db', 'name' => __('Remove Database Tables', 'mobile-dj-manager'), 'desc' => __('Should the database tables and data be removed when uninstalling the plugin? ' . 'Cannot be recovered unless you or your host have a backup solution in place and a recent backup.', 'mobile-dj-manager'), 'type' => 'checkbox'), 'uninst_remove_mdjm_posts' => array('id' => 'uninst_remove_mdjm_posts', 'name' => __('Remove Data?', 'mobile-dj-manager'), 'desc' => __('Do you want to remove all MDJM pages', 'mobile-dj-manager'), 'type' => 'checkbox'), 'uninst_remove_mdjm_pages' => array('id' => 'uninst_remove_mdjm_pages', 'name' => __('Remove Pages?', 'mobile-dj-manager'), 'desc' => __('Do you want to remove all MDJM pages?', 'mobile-dj-manager'), 'type' => 'checkbox'), 'uninst_remove_users' => array('id' => 'uninst_remove_users', 'name' => __('Remove Employees and Clients?', 'mobile-dj-manager'), 'desc' => __('If selected, all users who are defined as clients or employees will be removed.', 'mobile-dj-manager'), 'type' => 'checkbox')))), 'events' => apply_filters('mdjm_settings_events', array('main' => array('event_settings' => array('id' => 'event_settings', 'name' => '<h3>' . sprintf(__('%s Settings', 'mobile-dj-manager'), mdjm_get_label_singular()) . '</h3>', 'desc' => '', 'type' => 'header'), 'event_prefix' => array('id' => 'event_prefix', 'name' => sprintf(__('%s Prefix', 'mobile-dj-manager'), mdjm_get_label_singular()), 'desc' => sprintf(__('The prefix you enter here will be added to each unique %s, contract and invoice ID', 'mobile-dj-manager'), mdjm_get_label_singular(true)), 'type' => 'text', 'size' => 'small'), 'show_active_only' => array('id' => 'show_active_only', 'name' => sprintf(__('Hide Inactive %s?', 'mobile-dj-manager'), mdjm_get_label_plural()), 'desc' => sprintf(__('Select to include only active %1$s within the <code>All</code> view on the %1$s screen.', 'mobile-dj-manager'), mdjm_get_label_plural(true)), 'type' => 'checkbox'), 'employer' => array('id' => 'employer', 'name' => __('I am an Employer', 'mobile-dj-manager'), 'desc' => __('Check if you employ staff other than yourself.', 'mobile-dj-manager'), 'type' => 'checkbox'), 'artist' => array('id' => 'artist', 'name' => __('Refer to Performers as', 'mobile-dj-manager'), 'hint' => '<code>' . __('Default is DJ', 'mobile-dj-manager') . '</code>', 'desc' => __('Change the name of your performers here as necessary.', 'mobile-dj-manager'), 'type' => 'text', 'size' => 'regular', 'std' => __('DJ', 'mobile-dj-manager')), 'default_contract' => array('id' => 'default_contract', 'name' => __('Default Contract', 'mobile-dj-manager'), 'desc' => sprintf(__('Select the default contract for your %s. Can be changed per %s', 'mobile-dj-manager'), mdjm_get_label_plural(true), mdjm_get_label_singular(true)), 'type' => 'select', 'options' => mdjm_list_templates('contract')), 'warn_unattended' => array('id' => 'warn_unattended', 'name' => __('New Enquiry Notification', 'mobile-dj-manager'), 'desc' => __('Displays a notification message at the top of the Admin pages to Administrators if there are outstanding Unattended Enquiries.', 'mobile-dj-manager'), 'type' => 'checkbox', 'std' => '1'), 'events_order_by' => array('id' => 'events_order_by', 'name' => __('Default Order By', 'mobile-dj-manager'), 'desc' => sprintf(__('Select how you want to see %s ordered within the %s admin list', 'mobile-dj-manager'), mdjm_get_label_plural(true), mdjm_get_label_singular(true)), 'type' => 'select', 'options' => array('ID' => __('Contract ID', 'mobile-dj-manager'), 'post_date' => __('Creation Date', 'mobile-dj-manager'), 'event_date' => sprintf(__('%s Date', 'mobile-dj-manager'), mdjm_get_label_singular()), 'value' => __('Total Cost', 'mobile-dj-manager')), 'std' => 'event_date'), 'events_order' => array('id' => 'events_order', 'name' => __('Default Order', 'mobile-dj-manager'), 'desc' => '', 'type' => 'select', 'options' => array('ASC' => __('Ascending', 'mobile-dj-manager'), 'DESC' => __('Descending', 'mobile-dj-manager')), 'std' => 'DESC'), 'set_client_inactive' => array('id' => 'set_client_inactive', 'name' => __('Set Client Inactive?', 'mobile-dj-manager'), 'desc' => sprintf(__('Set a client to inactive when their %s is cancelled, rejected or marked as a failed enquiry and they have no other upcoming %s.', 'mobile-dj-manager'), mdjm_get_label_singular(true), mdjm_get_label_plural(true)), 'type' => 'checkbox', 'std' => '1'), 'journaling' => array('id' => 'journaling', 'name' => __('Enable Journaling?', 'mobile-dj-manager'), 'desc' => sprintf(__('Log and track all client &amp; %s actions (recommended).', 'mobile-dj-manager'), mdjm_get_label_singular()), 'type' => 'checkbox', 'std' => '1')), 'playlist' => array('playlist_settings' => array('id' => 'playlist_settings', 'name' => '<h3>' . __('Playlist Settings', 'mobile-dj-manager') . '</h3>', 'desc' => '', 'type' => 'header'), 'enable_playlists' => array('id' => 'enable_playlists', 'name' => sprintf(__('Enable %s Playlists by Default?', 'mobile-dj-manager'), mdjm_get_label_singular()), 'desc' => sprintf(__('Check to enable Client Playlist features by default. Can be overridden per %s.', 'mobile-dj-manager'), mdjm_get_label_singular(true)), 'type' => 'checkbox', 'std' => '1'), 'close' => array('id' => 'close', 'name' => __('Close the Playlist', 'mobile-dj-manager'), 'hint' => sprintf(__('Enter %s0%s to never close.', 'mobile-dj-manager'), '<code>', '</code>'), 'desc' => sprintf(__('Number of days before %s that the playlist should close to new entries.', 'mobile-dj-manager'), mdjm_get_label_singular(true)), 'type' => 'text', 'size' => 'small', 'std' => '5'), 'upload_playlists' => array('id' => 'upload_playlists', 'name' => __('Upload Playlists?', 'mobile-dj-manager'), 'desc' => sprintf(__('With this option checked, your playlist information will occasionally be transmitted back to the MDJM servers ' . 'to help build an information library. The consolidated list of playlist songs will be freely shared. ' . 'Only song, artist and the %s type information is transmitted.', 'mobile-dj-manager'), mdjm_get_label_singular(true)), 'type' => 'checkbox')), 'packages' => array('package_settings' => array('id' => 'package_settings', 'name' => '<h3>' . __('Package &amp; Addon Settings', 'mobile-dj-manager') . '</h3>', 'desc' => '', 'type' => 'header'), 'enable_packages' => array('id' => 'enable_packages', 'name' => __('Enable Packages', 'mobile-dj-manager'), 'desc' => __('Check this to enable Equipment Packages & Add-ons.', 'mobile-dj-manager'), 'type' => 'checkbox'), 'package_excerpt_length' => array('id' => 'package_excerpt_length', 'name' => __('Description Length', 'mobile-dj-manager'), 'desc' => __('The maximum number of characters for the package/addon description.', 'mobile-dj-manager'), 'hint' => __('Entering <code>0</code> will render the full exceprt if it exists, otherwise the description', 'mobile-dj-manager'), 'type' => 'number', 'size' => 'small', 'step' => '5', 'std' => '55'), 'package_contact_btn' => array('id' => 'package_contact_btn', 'name' => __('Add Contact Button?', 'mobile-dj-manager'), 'hint' => sprintf(__('Select to auto add a contact button to the end of package/addons post content. The link will redirect to the <code>Contact Page</code>page as defined in <a href="%s">Pages</a>', 'mobile-dj-manager'), admin_url('admin.php?page=mdjm-settings&tab=client_zone&section=pages')), 'desc' => sprintf(__('If you use the <a href="%s" target="_blank">Dynamic Contact Forms</a> add-on, the package/addon will be auto selected on page load', 'mobile-dj-manager'), 'http://mdjm.co.uk/products/dynamic-contact-forms/'), 'type' => 'checkbox'), 'package_contact_btn_text' => array('id' => 'package_contact_btn_text', 'name' => __('Text for Contact Button', 'mobile-dj-manager'), 'desc' => '', 'type' => 'text', 'std' => __('Enquire Now', 'mobile-dj-manager'))), 'travel' => array('travel_settings' => array('id' => 'travel_settings', 'name' => '<h3>' . __('Travel Settings', 'mobile-dj-manager') . '</h3>', 'desc' => '', 'type' => 'header'), 'travel_add_cost' => array('id' => 'travel_add_cost', 'name' => __('Add Travel Cost to Price?', 'mobile-dj-manager'), 'desc' => sprintf(__('If selected, the travel cost will be added to the overall %s cost', 'mobile-dj-manager'), mdjm_get_label_singular(true)), 'type' => 'checkbox'), 'travel_primary' => array('id' => 'travel_primary', 'name' => __('Primary Post/Zip Code', 'mobile-dj-manager'), mdjm_get_label_singular(), 'desc' => __('When the primary employee has no address in their profile, this post code will be used to calculate the distance to the venue.', 'mobile-dj-manager'), 'type' => 'text', 'std' => mdjm_get_employee_post_code(1)), 'travel_status' => array('id' => 'travel_status', 'name' => sprintf(__('%s Status', 'mobile-dj-manager'), mdjm_get_label_singular()), 'desc' => sprintf(__("CTRL (cmd on MAC) + Click to select which %s status' can have travel costs updated.", 'mobile-dj-manager'), mdjm_get_label_singular(true)), 'type' => 'multiple_select', 'options' => mdjm_all_event_status(), 'std' => array('mdjm-unattended', 'mdjm-enquiry', 'mdjm-contract')), 'travel_units' => array('id' => 'travel_units', 'name' => __('Calculate in?', 'mobile-dj-manager'), 'desc' => '', 'type' => 'select', 'options' => array('imperial' => __('Miles', 'mobile-dj-manager'), 'metric' => __('Kilometers', 'mobile-dj-manager')), 'std' => 'imperial'), 'cost_per_unit' => array('id' => 'cost_per_unit', 'name' => sprintf(__('Cost per %s', 'mobile-dj-manager'), mdjm_travel_unit_label()), 'desc' => __('Enter the cost per mile that should be calculated. i.e. 0.45', 'mobile-dj-manager'), 'type' => 'text', 'size' => 'small', 'std' => '0.45'), 'travel_cost_round' => array('id' => 'travel_cost_round', 'name' => __('Round Cost', 'mobile-dj-manager'), 'desc' => __('Do you want to round costs up or down?', 'mobile-dj-manager'), 'type' => 'select', 'options' => array(false => __('No', 'mobile-dj-manager'), 'up' => __('Up', 'mobile-dj-manager'), 'down' => __('Down', 'mobile-dj-manager')), 'std' => 'up'), 'travel_round_to' => array('id' => 'travel_round_to', 'name' => __('Round to Nearest', 'mobile-dj-manager'), 'hint' => mdjm_get_currency() . ' i.e. 5', 'type' => 'number', 'size' => 'small', 'std' => '5'), 'travel_min_distance' => array('id' => 'travel_min_distance', 'name' => __("Don't add if below", 'mobile-dj-manager'), 'hint' => mdjm_travel_unit_label(false, true), 'type' => 'number', 'size' => 'small', 'std' => '30')))), 'emails' => apply_filters('mdjm_settings_emails', array('main' => array('email_settings' => array('id' => 'email_settings', 'name' => '<h3>' . __('Email Settings', 'mobile-dj-manager') . '</h3>', 'desc' => '', 'type' => 'header'), 'system_email' => array('id' => 'system_email', 'name' => __('Default From Address', 'mobile-dj-manager'), 'desc' => __('The email address you want generic emails from MDJM to come from.', 'mobile-dj-manager'), 'type' => 'text', 'size' => 'regular', 'std' => get_bloginfo('admin_email')), 'comms_show_active_events_only' => array('id' => 'comms_show_active_events_only', 'name' => __('Communicate Active Events Only', 'mobile-dj-manager'), 'desc' => __("Check to only retrieve a client's/employee's active events on the communication page.", 'mobile-dj-manager'), 'type' => 'checkbox'), 'track_client_emails' => array('id' => 'track_client_emails', 'name' => __('Track Client Emails?', 'mobile-dj-manager'), 'desc' => __('Some email clients may not support this feature.', 'mobile-dj-manager'), 'type' => 'checkbox', 'std' => '1'), 'bcc_dj_to_client' => array('id' => 'bcc_dj_to_client', 'name' => sprintf(__('Copy %s in Client Emails?', 'mobile-dj-manager'), mdjm_get_option('artist', __('DJ', 'mobile-dj-manager'))), 'desc' => sprintf(__('Send a copy of client emails to the %s primary %s', 'mobile-dj-manager'), mdjm_get_label_plural(true), mdjm_get_option('artist', __('DJ', 'mobile-dj-manager'))), 'type' => 'checkbox'), 'bcc_admin_to_client' => array('id' => 'bcc_admin_to_client', 'name' => __('Copy Admin in Client Emails?', 'mobile-dj-manager'), 'desc' => sprintf(__('Send a copy of client emails to %sDefault From Address%s', 'mobile-dj-manager'), '<code>', '</code>'), 'type' => 'checkbox', 'std' => '1')), 'templates' => array('quote_templates' => array('id' => 'quote_templates', 'name' => '<h3>' . __('Quote Template Settings', 'mobile-dj-manager') . '</h3>', 'desc' => '', 'type' => 'header'), 'enquiry' => array('id' => 'enquiry', 'name' => __('Quote Template', 'mobile-dj-manager'), 'desc' => __('This is the default template used when sending quotes via email to clients', 'mobile-dj-manager'), 'type' => 'select', 'options' => mdjm_list_templates('email_template')), 'online_enquiry' => array('id' => 'online_enquiry', 'name' => __('Online Quote Template', 'mobile-dj-manager'), 'desc' => sprintf(__('This is the default template used for clients viewing quotes online via the %s.', 'mobile-dj-manager'), mdjm_get_option('app_name', __('Client Zone', 'mobile-dj-manager'))), 'type' => 'select', 'options' => mdjm_list_templates('email_template', true)), 'unavailable' => array('id' => 'unavailable', 'name' => __('Unavailability Template', 'mobile-dj-manager'), 'desc' => sprintf(__('This is the default template used when responding to enquiries that you are unavailable for the %s', 'mobile-dj-manager'), mdjm_get_label_singular(true)), 'type' => 'select', 'options' => mdjm_list_templates('email_template')), 'enquiry_from' => array('id' => 'enquiry_from', 'name' => __('Emails From?', 'mobile-dj-manager'), 'desc' => __('Who should enquiries and unavailability emails to be sent by?', 'mobile-dj-manager'), 'type' => 'select', 'options' => array('admin' => __('Admin', 'mobile-dj-manager'), 'dj' => mdjm_get_option('artist', __('Primary Employee', 'mobile-dj-manager'))), 'std' => 'admin'), 'contract_templates' => array('id' => 'contract_templates', 'name' => '<h3>' . __('Awaiting Contract Template Settings', 'mobile-dj-manager') . '</h3>', 'desc' => '', 'type' => 'header'), 'contract_to_client' => array('id' => 'contract_to_client', 'name' => __('Contract Notification Email?', 'mobile-dj-manager'), 'desc' => sprintf(__('Do you want to auto send an email to the client when their %s changes to the <em>Awaiting Contract<em> status?', 'mobile-dj-manager'), mdjm_get_label_singular(true)), 'type' => 'checkbox', 'std' => '1'), 'contract' => array('id' => 'contract', 'name' => __('Contract Template', 'mobile-dj-manager'), 'desc' => sprintf(__('Only applies if %sContract Notification Email%s is enabled', 'mobile-dj-manager'), '<em>', '</em>'), 'type' => 'select', 'options' => mdjm_list_templates('email_template')), 'contract_from' => array('id' => 'contract_from', 'name' => __('Emails From?', 'mobile-dj-manager'), 'desc' => __('Who should contract notification emails to be sent by?', 'mobile-dj-manager'), 'type' => 'select', 'options' => array('admin' => __('Admin', 'mobile-dj-manager'), 'dj' => mdjm_get_option('artist', __('Primary Employee', 'mobile-dj-manager'))), 'std' => 'admin'), 'booking_conf_templates' => array('id' => 'booking_conf_templates', 'name' => '<h3>' . __('Booking Confirmation Template Settings', 'mobile-dj-manager') . '</h3>', 'desc' => '', 'type' => 'header'), 'booking_conf_to_client' => array('id' => 'booking_conf_to_client', 'name' => __('Booking Confirmation to Client', 'mobile-dj-manager'), 'desc' => __('Email client with selected template when booking is confirmed i.e. contract accepted, or status changed to Approved', 'mobile-dj-manager'), 'type' => 'checkbox', 'std' => '1'), 'booking_conf_client' => array('id' => 'booking_conf_client', 'name' => __('Client Booking Confirmation Template', 'mobile-dj-manager'), 'desc' => __('Select an email template to be used when sending the Booking Confirmation to Clients', 'mobile-dj-manager'), 'type' => 'select', 'options' => mdjm_list_templates('email_template')), 'booking_conf_from' => array('id' => 'booking_conf_from', 'name' => __('Emails From?', 'mobile-dj-manager'), 'desc' => __('Who should booking confirmation emails to be sent by?', 'mobile-dj-manager'), 'type' => 'select', 'options' => array('admin' => __('Admin', 'mobile-dj-manager'), 'dj' => mdjm_get_option('artist', __('Primary Employee', 'mobile-dj-manager'))), 'std' => 'admin'), 'booking_conf_to_dj' => array('id' => 'booking_conf_to_dj', 'name' => __('Booking Confirmation to Employee?', 'mobile-dj-manager'), 'desc' => sprintf(__('Email %s primary %s with selected template when booking is confirmed i.e. contract accepted, or status changed to Approved', 'mobile-dj-manager'), mdjm_get_label_plural(true), mdjm_get_option('artist', __('DJ', 'mobile-dj-manager'))), 'type' => 'checkbox'), 'email_dj_confirm' => array('id' => 'email_dj_confirm', 'name' => sprintf(__('%s Booking Confirmation Template', 'mobile-dj-manager'), mdjm_get_option('artist', __('DJ', 'mobile-dj-manager'))), 'desc' => sprintf(__('Select an email template to be used when sending the Booking Confirmation to %s primary %s', 'mobile-dj-manager'), mdjm_get_label_plural(true), mdjm_get_option('artist', __('DJ', 'mobile-dj-manager'))), 'type' => 'select', 'options' => mdjm_list_templates('email_template'))))), 'client_zone' => apply_filters('mdjm_settings_client_zone', array('main' => array('client_zone_settings' => array('id' => 'client_zone_settings', 'name' => '<h3>' . sprintf(__('%s Settings', 'mobile-dj-manager'), mdjm_get_option('app_name', __('Client Zone', 'mobile-dj-manager'))) . '</h3>', 'desc' => '', 'type' => 'header'), 'app_name' => array('id' => 'app_name', 'name' => __('Application Name', 'mobile-dj-manager'), 'hint' => sprintf(__('Default is %sClient Zone%s.', 'mobile-dj-manager'), '<code>', '</code>'), 'desc' => __('Choose your own name for the application.', 'mobile-dj-manager'), 'type' => 'text', 'size' => 'regular', 'std' => __('Client Zone', 'mobile-dj-manager')), 'client_settings' => array('id' => 'client_settings', 'name' => '<h3>' . __('Client Settings', 'mobile-dj-manager') . '</h3>', 'desc' => '', 'type' => 'header'), 'pass_length' => array('id' => 'pass_length', 'name' => __('Default Password Length', 'mobile-dj-manager'), 'desc' => sprintf(__('If opting to generate or reset a user password during %s creation, how many characters should the password be?', 'mobile-dj-manager'), mdjm_get_label_singular(true)), 'type' => 'select', 'options' => array('5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10', '11' => '11', '12' => '12'), 'std' => '8'), 'complex_passwords' => array('id' => 'complex_passwords', 'name' => __('Use Complex Passwords?', 'mobile-dj-manager'), 'desc' => __('Generated passwords will contain <em>special</em> characters such as <code>!@#$%^&*()</code> as well as letters and numbers', 'mobile-dj-manager'), 'type' => 'checkbox', 'std' => '1'), 'notify_profile' => array('id' => 'notify_profile', 'name' => __('Incomplete Profile Warning?', 'mobile-dj-manager'), 'desc' => __('Display notice to Clients when they login if their Profile is incomplete? (i.e. Required field is empty)', 'mobile-dj-manager'), 'type' => 'checkbox'), 'client_zone_event_settings' => array('id' => 'client_zone_event_settings', 'name' => '<h3>' . sprintf(__('%s Settings', 'mobile-dj-manager'), mdjm_get_label_singular()) . '</h3>', 'desc' => '', 'type' => 'header'), 'package_prices' => array('id' => 'package_prices', 'name' => __('Display Package Price?', 'mobile-dj-manager'), 'desc' => sprintf(__('Select to display %s package &amp; Add-on prices within hover text within the %s', 'mobile-dj-manager'), mdjm_get_label_singular(true), mdjm_get_option('app_name', __('Client Zone', 'mobile-dj-manager'))), 'type' => 'checkbox')), 'styles' => array('client_zone_styles' => array('id' => 'client_zone_styles', 'name' => '<h3>' . __('Styling', 'mobile-dj-manager') . '</h3>', 'desc' => '', 'type' => 'header'), 'action_button_colour' => array('id' => 'action_button_colour', 'name' => __('Action Button Colour', 'mobile-dj-manager'), 'desc' => sprintf(__('Select your preferred colour for the %s action buttons', 'mobile-dj-manager'), mdjm_get_label_singular(true)), 'type' => 'select', 'options' => array('blue' => __('Blue', 'mobile-dj-manager'), 'green' => __('Green', 'mobile-dj-manager'), 'red' => __('Red', 'mobile-dj-manager'), 'turquoise' => __('Turquoise', 'mobile-dj-manager')), 'std' => 'blue')), 'pages' => array('page_settings' => array('id' => 'page_settings', 'name' => '<h3>' . __('Page Settings', 'mobile-dj-manager') . '</h3>', 'desc' => '', 'type' => 'header'), 'app_home_page' => array('id' => 'app_home_page', 'name' => mdjm_get_option('app_name', __('Client Zone', 'mobile-dj-manager')) . ' ' . __('Home Page', 'mobile-dj-manager'), 'desc' => sprintf(__("Select the home page for the %s application. Needs to contain the shortcode %s[mdjm-home]%s", 'mobile-dj-manager'), mdjm_get_option('app_name', __('Client Zone', 'mobile-dj-manager')), '<code>', '</code>'), 'type' => 'select', 'options' => mdjm_list_pages()), 'quotes_page' => array('id' => 'quotes_page', 'name' => __('Online Quotes Page', 'mobile-dj-manager'), 'desc' => sprintf(__("Select the page to use for online %s quotes. Needs to contain the shortcode <code>[mdjm-quote]</code>", 'mobile-dj-manager'), mdjm_get_label_singular(true)), 'type' => 'select', 'options' => mdjm_list_pages()), 'contact_page' => array('id' => 'contact_page', 'name' => __('Contact Page', 'mobile-dj-manager'), 'desc' => __("Select your website's contact page so we can correctly direct visitors.", 'mobile-dj-manager'), 'type' => 'select', 'options' => mdjm_list_pages()), 'contracts_page' => array('id' => 'contracts_page', 'name' => __('Contracts Page', 'mobile-dj-manager'), 'desc' => sprintf(__("Select your website's contracts page. Needs to contain the shortcode %s[mdjm-contract]%s", 'mobile-dj-manager'), '<code>', '</code>'), 'type' => 'select', 'options' => mdjm_list_pages()), 'payments_page' => array('id' => 'payments_page', 'name' => __('Payments Page', 'mobile-dj-manager'), 'desc' => sprintf(__("Select your website's payments page. Needs to contain the shortcode %s[mdjm-payments]%s", 'mobile-dj-manager'), '<code>', '</code>'), 'type' => 'select', 'options' => mdjm_list_pages()), 'playlist_page' => array('id' => 'playlist_page', 'name' => __('Playlist Page', 'mobile-dj-manager'), 'desc' => sprintf(__("Select your website's playlist page. Needs to contain the shortcode %s[mdjm-playlist]%s", 'mobile-dj-manager'), '<code>', '</code>'), 'type' => 'select', 'options' => mdjm_list_pages()), 'profile_page' => array('id' => 'profile_page', 'name' => __('Profile Page', 'mobile-dj-manager'), 'desc' => sprintf(__("Select your website's profile page. Needs to contain the shortcode %s[mdjm-profile]%s", 'mobile-dj-manager'), '<code>', '</code>'), 'type' => 'select', 'options' => mdjm_list_pages())), 'availability' => array('availability_settings' => array('id' => 'availability_settings', 'name' => '<h3>' . __('Availability Settings', 'mobile-dj-manager') . '</h3>', 'desc' => '', 'type' => 'header'), 'availability_status' => array('id' => 'availability_status', 'name' => __('Unavailable Statuses', 'mobile-dj-manager'), 'desc' => sprintf(__("CTRL (cmd on MAC) + Click to select %s status' that you want availability checker to report as unavailable", 'mobile-dj-manager'), mdjm_get_label_singular(true)), 'type' => 'multiple_select', 'options' => mdjm_all_event_status(), 'std' => mdjm_active_event_statuses()), 'availability_roles' => array('id' => 'availability_roles', 'name' => __('Employee Roles', 'mobile-dj-manager'), 'desc' => __('CTRL (cmd on MAC) + Click to select employee roles that need to be available', 'mobile-dj-manager'), 'type' => 'multiple_select', 'options' => mdjm_get_roles(), 'std' => array('dj')), 'avail_ajax' => array('id' => 'avail_ajax', 'name' => __('Use Ajax?', 'mobile-dj-manager'), 'desc' => __('Perform checks without page refresh', 'mobile-dj-manager'), 'type' => 'checkbox', 'std' => '1'), 'availability_check_pass_page' => array('id' => 'availability_check_pass_page', 'name' => __('Available Redirect Page', 'mobile-dj-manager'), 'desc' => __('Select a page to which users should be directed when an availability check is successful', 'mobile-dj-manager'), 'type' => 'select', 'options' => mdjm_list_pages(array('text' => __('NO REDIRECT - USE TEXT', 'mobile-dj-manager'))), 'std' => 'text'), 'availability_check_pass_text' => array('id' => 'availability_check_pass_text', 'name' => __('Available Text', 'mobile-dj-manager'), 'desc' => __('Text to be displayed when you are available - Only displayed if <code>NO REDIRECT - USE TEXT</code> is selected above, unless you are redirecting to an MDJM Contact Form. Valid shortcodes <code>{event_date}</code> &amp; <code>{event_date_short}</code>', 'mobile-dj-manager'), 'type' => 'rich_editor', 'std' => __('Good news, we are available on the date you entered. Please contact us now', 'mobile-dj-manager')), 'availability_check_fail_page' => array('id' => 'availability_check_fail_page', 'name' => __('Unavailable Redirect Page', 'mobile-dj-manager'), 'desc' => __('Select a page to which users should be directed when an availability check is not successful', 'mobile-dj-manager'), 'type' => 'select', 'options' => mdjm_list_pages(array('text' => __('NO REDIRECT - USE TEXT', 'mobile-dj-manager'))), 'std' => 'text'), 'availability_check_fail_text' => array('id' => 'availability_check_fail_text', 'name' => __('Unavailable Text', 'mobile-dj-manager'), 'desc' => __('Text to be displayed when you are not available - Only displayed if <code>NO REDIRECT - USE TEXT</code> is selected above. Valid shortcodes <code>{event_date}</code> &amp; <code>{event_date_short}</code>', 'mobile-dj-manager'), 'type' => 'rich_editor', 'std' => __('Unfortunately we do not appear to be available on the date you selected. Why not try another date below...', 'mobile-dj-manager'))))), 'payments' => apply_filters('mdjm_settings_payments', array('main' => array('gateway_settings' => array('id' => 'gateway_settings', 'name' => '<h3>' . __('Gateway Settings', 'mobile-dj-manager') . '</h3>', 'desc' => '', 'type' => 'header'), 'gateways' => array('id' => 'gateways', 'name' => __('Payment Gateways', 'mobile-dj-manager'), 'desc' => __('Choose the payment gateways you want to enable.', 'mobile-dj-manager'), 'type' => 'gateways', 'options' => mdjm_get_payment_gateways()), 'payment_gateway' => array('id' => 'payment_gateway', 'name' => __('Default Gateway', 'mobile-dj-manager'), 'desc' => __('This gateway will be loaded automatically with the payments page.', 'mobile-dj-manager'), 'type' => 'gateway_select', 'options' => mdjm_get_payment_gateways()), 'currency_settings' => array('id' => 'currency_settings', 'name' => '<h3>' . __('Currency Settings', 'mobile-dj-manager') . '</h3>', 'desc' => '', 'type' => 'header'), 'currency' => array('id' => 'currency', 'name' => __('Currency', 'mobile-dj-manager'), 'desc' => '', 'type' => 'select', 'options' => mdjm_get_currencies()), 'currency_format' => array('id' => 'currency_format', 'name' => __('Currency Position', 'mobile-dj-manager'), 'desc' => __('Where to display the currency symbol.', 'mobile-dj-manager'), 'type' => 'select', 'options' => array('before' => __('before price', 'mobile-dj-manager'), 'after' => __('after price', 'mobile-dj-manager'), 'before with space' => __('before price with space', 'mobile-dj-manager'), 'after with space' => __('after price with space', 'mobile-dj-manager'))), 'decimal' => array('id' => 'decimal', 'name' => __('Decimal Separator', 'mobile-dj-manager'), 'desc' => __('The symbol to separate decimal points. (Usually . or ,)', 'mobile-dj-manager'), 'type' => 'text', 'size' => 'small', 'std' => '.'), 'thousands_seperator' => array('id' => 'thousands_seperator', 'name' => __('Thousands Separator', 'mobile-dj-manager'), 'desc' => '', 'type' => 'text', 'size' => 'small', 'std' => ','), 'deposit_settings' => array('id' => 'deposit_settings', 'name' => '<h3>' . sprintf(__('%s Settings', 'mobile-dj-manager'), mdjm_get_deposit_label()) . '</h3>', 'desc' => '', 'type' => 'header'), 'deposit_type' => array('id' => 'deposit_type', 'name' => mdjm_get_deposit_label() . "'s " . __('are', 'mobile-dj-manager'), 'desc' => sprintf(__('If you require ' . mdjm_get_deposit_label() . ' payments for your %s, how should they be calculated?', 'mobile-dj-manager'), mdjm_get_label_plural(true)), 'type' => 'select', 'options' => array('0' => 'Not required', 'percentage' => '% ' . sprintf(__('of %s value', 'mobile-dj-manager'), mdjm_get_label_singular(true)), 'fixed' => __('Fixed price', 'mobile-dj-manager'))), 'deposit_amount' => array('id' => 'deposit_amount', 'name' => mdjm_get_deposit_label() . ' ' . __('Amount', 'mobile-dj-manager'), 'desc' => sprintf(__("If your %s's are a percentage enter the value (i.e 20). For fixed prices, enter the amount in the format %s", 'mobile-dj-manager'), mdjm_get_deposit_label(), mdjm_format_amount('0')), 'type' => 'text', 'size' => 'small'), 'payment_form_settings' => array('id' => 'payment_form_settings', 'name' => '<h3>' . __('Payment Form Settings', 'mobile-dj-manager') . '</h3>', 'desc' => '', 'type' => 'header'), 'payment_label' => array('id' => 'payment_label', 'name' => __('Payment Label', 'mobile-dj-manager'), 'desc' => __('Display name of the label shown to clients to select the payment they wish to make.', 'mobile-dj-manager'), 'type' => 'text', 'size' => 'regular', 'std' => __('Make a Payment Towards', 'mobile-dj-manager')), 'other_amount_label' => array('id' => 'other_amount_label', 'name' => __('Label for Other Amount', 'mobile-dj-manager'), 'desc' => __('Enter your desired label for the other amount radio button.', 'mobile-dj-manager'), 'type' => 'text', 'size' => 'regular', 'std' => __('Other Amount', 'mobile-dj-manager')), 'payment_button' => array('id' => 'payment_button', 'name' => __('Payment Button Text', 'mobile-dj-manager'), 'desc' => __('The text you want to appear on the Payment Form submit button.', 'mobile-dj-manager'), 'type' => 'text', 'size' => 'regular', 'std' => __('Pay Now', 'mobile-dj-manager')), 'other_amount_default' => array('id' => 'other_amount_default', 'name' => __('Default', 'mobile-dj-manager') . ' ' . mdjm_get_option('other_amount_label', __('Other Amount', 'mobile-dj-manager')), 'desc' => sprintf(__('Enter the default amount to be used in the %s field.', 'mobile-dj-manager'), mdjm_get_option('other_amount_label', __('Other Amount', 'mobile-dj-manager'))), 'type' => 'text', 'size' => 'small', 'std' => '50.00'), 'tax_settings' => array('id' => 'tax_settings', 'name' => '<h3>' . __('Tax Settings', 'mobile-dj-manager') . '</h3>', 'desc' => '', 'type' => 'header'), 'enable_tax' => array('id' => 'enable_tax', 'name' => __('Enable Taxes?', 'mobile-dj-manager'), 'desc' => __('Enable if you need to add taxes to online payments', 'mobile-dj-manager'), 'type' => 'checkbox'), 'tax_type' => array('id' => 'tax_type', 'name' => __('Apply Tax As', 'mobile-dj-manager'), 'desc' => __('How do you apply tax?', 'mobile-dj-manager'), 'type' => 'select', 'options' => array('percentage' => __('% of total', 'mobile-dj-manager'), 'fixed' => __('Fixed rate', 'mobile-dj-manager')), 'std' => 'percentage'), 'tax_rate' => array('id' => 'tax_rate', 'name' => __('Tax Rate', 'mobile-dj-manager'), 'desc' => __('If you apply tax based on a fixed percentage (i.e. VAT) enter the value (i.e 20). For fixed rates, enter the amount in the format 0.00. Taxes will only be applied during checkout.', 'mobile-dj-manager'), 'type' => 'text', 'size' => 'small', 'std' => '20'), 'payment_types' => array('id' => 'payment_types', 'name' => '<h3>' . __('Payment Types', 'mobile-dj-manager') . '</h3>', 'desc' => '', 'type' => 'header'), 'payment_sources' => array('id' => 'payment_sources', 'name' => __('Payment Types', 'mobile-dj-manager'), 'desc' => __('Enter methods of payment.', 'mobile-dj-manager'), 'type' => 'textarea', 'std' => __('BACS', 'mobile-dj-manager') . "\r\n" . __('Cash', 'mobile-dj-manager') . "\r\n" . __('Cheque', 'mobile-dj-manager') . "\r\n" . __('PayPal', 'mobile-dj-manager') . "\r\n" . __('PayFast', 'mobile-dj-manager') . "\r\n" . __('Stripe', 'mobile-dj-manager') . "\r\n" . __('Other', 'mobile-dj-manager')), 'default_type' => array('id' => 'default_type', 'name' => __('Default Payment Type', 'mobile-dj-manager'), 'desc' => sprintf(__('What is the default method of payment? i.e. if you select an %s %s as paid how should we log it?', 'mobile-dj-manager'), mdjm_get_label_singular(true), mdjm_get_balance_label()), 'type' => 'select', 'options' => mdjm_list_txn_sources())), 'employee_payments' => array('employee_payment_settings' => array('id' => 'employee_payment_settings', 'name' => '<h3>' . __('Employee Payment Settings', 'mobile-dj-manager') . '</h3>', 'desc' => '', 'type' => 'header'), 'enable_employee_payments' => array('id' => 'enable_employee_payments', 'name' => __('Enable Employee Payments', 'mobile-dj-manager'), 'desc' => sprintf(__('Enable this option to be able to record employee wage payments for %s.', 'mobile-dj-manager'), mdjm_get_label_plural()), 'type' => 'checkbox'), 'employee_pay_status' => array('id' => 'employee_pay_status', 'name' => __('Payment Statuses', 'mobile-dj-manager'), 'desc' => sprintf(__("CTRL (cmd on MAC) + Click to select %s status' that an event must be at before employee payments can be made.", 'mobile-dj-manager'), mdjm_get_label_singular(true)), 'type' => 'multiple_select', 'options' => mdjm_all_event_status(), 'std' => array('mdjm-completed')), 'employee_auto_pay_complete' => array('id' => 'employee_auto_pay_complete', 'name' => sprintf(__('Pay when %s Completes', 'mobile-dj-manager'), mdjm_get_label_singular()), 'desc' => sprintf(__('Enable this option to automatically pay employees once an %s completes.', 'mobile-dj-manager'), mdjm_get_label_singular()), 'type' => 'checkbox')), 'receipts' => array('payment_conf_templates' => array('id' => 'payment_conf_templates', 'name' => '<h3>' . __('Payment Receipts', 'mobile-dj-manager') . '</h3>', 'desc' => '', 'type' => 'header'), 'payment_cfm_template' => array('id' => 'payment_cfm_template', 'name' => __('Gateway Payment Receipt', 'mobile-dj-manager'), 'desc' => __('Select an email template to be sent as a receipt to clients when a gateway payment is received.', 'mobile-dj-manager'), 'type' => 'select', 'options' => mdjm_list_templates('email_template', true)), 'manual_payment_cfm_template' => array('id' => 'manual_payment_cfm_template', 'name' => __('Manual Payment Receipt', 'mobile-dj-manager'), 'desc' => __('Select an email template to be sent as a receipt to clients when you manually log a payment.', 'mobile-dj-manager'), 'type' => 'select', 'options' => mdjm_list_templates('email_template', true))))), 'extensions' => apply_filters('mdjm_settings_extensions', array()), 'licenses' => apply_filters('mdjm_settings_licenses', array()));
    return apply_filters('mdjm_registered_settings', $mdjm_settings);
}
 /**
  * Build all the reports data
  *
  * @access	public
  * @since	1.4
  * @return	arr		$reports_data	All the data for customer reports
  */
 public function reports_data()
 {
     $stats = new MDJM_Stats();
     $dates = mdjm_get_report_dates();
     $stats->setup_dates($dates['range']);
     $cached_reports = false;
     if (false !== $cached_reports) {
         $reports_data = $cached_reports;
     } else {
         $reports_data = array();
         $term_args = array('parent' => 0, 'hierarchical' => 0);
         $categories = get_terms('enquiry-source', $term_args);
         foreach ($categories as $category_id => $category) {
             $conversions = 0;
             $ratio = 0;
             $event_count = 0;
             $category_slugs = array($category->slug);
             $all_event_args = array('post_status' => 'any', 'fields' => 'ids', 'tax_query' => array(array('taxonomy' => 'enquiry-source', 'field' => 'slug', 'terms' => $category_slugs)), 'date_query' => array(array('after' => date('Y-m-d', $stats->start_date), 'before' => date('Y-m-d', $stats->end_date), 'inclusive' => true)));
             $value = 0.0;
             $events = mdjm_get_events($all_event_args);
             $statuses = mdjm_active_event_statuses();
             $statuses[] = 'mdjm-completed';
             $statuses[] = 'mdjm-cancelled';
             if ($events) {
                 foreach ($events as $event) {
                     $event_count++;
                     $mdjm_event = new MDJM_Event($event);
                     if (in_array($mdjm_event->post_status, $statuses)) {
                         $current_value = $mdjm_event->get_total_profit();
                         $value += $current_value;
                     }
                 }
             } else {
                 continue;
             }
             $conversions += $stats->get_conversions($events, 'enquiry-source', $category_slugs, $stats->start_date, $stats->end_date);
             $ratio = round((double) ($conversions / $event_count) * 100);
             $reports_data[] = array('ID' => $category->term_id, 'source' => $category->name, 'total_events' => $event_count, 'total_conversions' => $conversions, 'conversion_ratio' => $ratio . '%', 'total_value' => mdjm_currency_filter(mdjm_format_amount($value)), 'total_value_raw' => $value, 'is_child' => false);
             $this->total_enquiries += $event_count;
             $this->total_value += $value;
             $this->total_conversions += $conversions;
         }
     }
     return $reports_data;
 }