Example #1
0
 /**
  * Create the events APM with the additional APM filters that TEC uses.
  *
  * @return void
  */
 public function ecp_filters()
 {
     if (!class_exists('Tribe_APM')) {
         add_action('admin_notices', array($this, 'maybe_notify_about_new_plugin'));
         return;
     }
     $filter_args = array('ecp_venue_filter_key' => array('name' => tribe_get_venue_label_singular(), 'custom_type' => 'ecp_venue_filter', 'sortable' => 'true'), 'ecp_organizer_filter_key' => array('name' => tribe_get_organizer_label_singular(), 'custom_type' => 'ecp_organizer_filter', 'sortable' => 'true'), 'ecp_start_date' => array('name' => __('Start Date', 'tribe-events-calendar-pro'), 'custom_type' => 'custom_date', 'disable' => 'columns'), 'ecp_end_date' => array('name' => __('End Date', 'tribe-events-calendar-pro'), 'custom_type' => 'custom_date', 'disable' => 'columns'), 'ecp_cost' => array('name' => __('Event Cost', 'tribe-events-calendar-pro'), 'meta' => '_EventCost', 'cast' => 'NUMERIC'), 'ecp_cat' => array('name' => __('Event Cats', 'tribe-events-calendar-pro'), 'taxonomy' => Tribe__Events__Main::TAXONOMY, 'disable' => 'columns'), 'ecp_title' => array('name' => __('Title', 'tribe-events-calendar-pro'), 'custom_type' => 'title', 'disable' => 'columns'), 'ecp_recur' => array('name' => __('Recurring', 'tribe-events-calendar-pro'), 'custom_type' => 'recur', 'disable' => 'columns'), 'ecp_content' => array('name' => __('Description', 'tribe-events-calendar-pro'), 'custom_type' => 'content', 'disable' => 'columns'));
     global $ecp_apm;
     $ecp_apm = new Tribe_APM(Tribe__Events__Main::POSTTYPE, $filter_args);
     $ecp_apm->do_metaboxes = false;
     $ecp_apm->add_taxonomies = false;
 }
Example #2
0
 /**
  * Create the events APM with the additional APM filters that TEC uses.
  *
  * @return void
  */
 public function ecp_filters()
 {
     if (!class_exists('Tribe_APM')) {
         add_action('admin_notices', array($this, 'maybe_notify_about_new_plugin'));
         return;
     }
     $filter_args = array('ecp_venue_filter_key' => array('name' => tribe_get_venue_label_singular(), 'custom_type' => 'ecp_venue_filter', 'sortable' => 'true'), 'ecp_organizer_filter_key' => array('name' => tribe_get_organizer_label_singular(), 'custom_type' => 'ecp_organizer_filter', 'sortable' => 'true'), 'ecp_start_date' => array('name' => esc_html__('Start Date', 'tribe-events-calendar-pro'), 'custom_type' => 'custom_date', 'disable' => 'columns'), 'ecp_end_date' => array('name' => esc_html__('End Date', 'tribe-events-calendar-pro'), 'custom_type' => 'custom_date', 'disable' => 'columns'), 'ecp_cost' => array('name' => esc_html__('Event Cost', 'tribe-events-calendar-pro'), 'meta' => '_EventCost', 'cast' => 'NUMERIC'), 'ecp_cat' => array('name' => esc_html__('Event Cats', 'tribe-events-calendar-pro'), 'taxonomy' => Tribe__Events__Main::TAXONOMY, 'disable' => 'columns'), 'ecp_title' => array('name' => esc_html__('Title', 'tribe-events-calendar-pro'), 'custom_type' => 'title', 'disable' => 'columns'), 'ecp_recur' => array('name' => esc_html__('Recurring', 'tribe-events-calendar-pro'), 'custom_type' => 'recur', 'disable' => 'columns'), 'ecp_content' => array('name' => esc_html__('Description', 'tribe-events-calendar-pro'), 'custom_type' => 'content', 'disable' => 'columns'));
     /**
      * Allows filtering the filters set up arguments.
      *
      * @since 4.1
      *
      * @param array $filter_args An associative array of filter set up arguments, see each filter for details.
      */
     $filter_args = apply_filters('tribe_events_pro_apm_filters_args', $filter_args);
     global $ecp_apm;
     $ecp_apm = new Tribe_APM(Tribe__Events__Main::POSTTYPE, $filter_args);
     $ecp_apm->do_metaboxes = false;
     $ecp_apm->add_taxonomies = false;
 }
Example #3
0
 /**
  * Get the organizer label
  *
  * @param bool $singular TRUE to return the singular label, FALSE to return plural
  *
  * @return string
  */
 function tribe_get_organizer_label($singular = true)
 {
     if ($singular) {
         return tribe_get_organizer_label_singular();
     } else {
         return tribe_get_organizer_label_plural();
     }
 }
Example #4
0
?>

<script type="text/javascript">
	jQuery('[name=organizer\\[Organizer\\]]').blur(function () {
		jQuery.post('<?php 
echo admin_url('admin-ajax.php');
?>
',
			{
				action: 'tribe_event_validation',
				nonce : '<?php 
echo wp_create_nonce('tribe-validation-nonce');
?>
',
				type  : 'organizer',
				name  : jQuery('[name=organizer\\[Organizer\\]]').get(0).value
			},
			function (result) {
				if (result == 1) {
					jQuery('.tribe-organizer-error').remove();
				} else {
					jQuery('.tribe-organizer-error').remove();
					jQuery( '[name=organizer\\[Organizer\\]]' ).after('<div class="tribe-organizer-error error form-invalid"><?php 
printf(__('%s Name Already Exists', 'tribe-events-calendar'), tribe_get_organizer_label_singular());
?>
</div>');
				}
			}
		);
	});
</script>
Example #5
0
		</tr>
		<?php 
do_action('tribe_venue_table_top', $event->ID);
?>
		<?php 
include $tribe->pluginPath . 'src/admin-views/venue-meta-box.php';
?>
	</table>
	<?php 
do_action('tribe_after_location_details', $event->ID);
?>
	<table id="event_organizer" class="eventtable">
		<tr>
			<td colspan="2" class="tribe_sectionheader">
				<h4><?php 
echo tribe_get_organizer_label_singular();
?>
</h4></td>
		</tr>
		<?php 
do_action('tribe_organizer_table_top', $event->ID);
?>
		<?php 
include $tribe->pluginPath . 'src/admin-views/organizer-meta-box.php';
?>
	</table>

	<table id="event_url" class="eventtable">
		<tr>
			<td colspan="2" class="tribe_sectionheader">
				<h4><?php 
Example #6
0
</span>
															<a href="#" style="color:#006caa !important; display:block; margin:0; font-family: 'Helvetica Neue', Helvetica, sans-serif; font-size:13px; text-decoration:underline;"><?php 
    echo $venue_email;
    ?>
</a><br />
															<a href="#" style="color:#006caa !important; display:block; margin:0; font-family: 'Helvetica Neue', Helvetica, sans-serif; font-size:13px; text-decoration:underline;"><?php 
    echo $venue_web;
    ?>
</a>
														</td>
													</tr>
												</table>
											</td>
											<td class="ticket-organizer" valign="top" align="left" width="140" style="padding: 0 !important; width:140px; margin:0 !important;">
												<h6 style="color:#909090 !important; margin:0 0 4px 0; font-family: 'Helvetica Neue', Helvetica, sans-serif; text-transform:uppercase; font-size:13px; font-weight:700 !important;"><?php 
    _e(tribe_get_organizer_label_singular(), "tribe-events-calendar");
    ?>
</h6>
												<span style="color:#0a0a0e !important; font-family: 'Helvetica Neue', Helvetica, sans-serif; font-size:15px;"><?php 
    echo tribe_get_organizer($event->ID);
    ?>
</span>
											</td>
										</tr>
									</table>
									<table border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
										<tr>
											<td class="ticket-footer" valign="top" align="left" width="100%" style="padding: 0 !important; width:100%; margin:0 !important;">
												<a href="<?php 
    echo esc_url(home_url());
    ?>
    /**
     * Renders the "Add Another Organizer" button
     *
     */
    protected function render_add_organizer_button()
    {
        ?>
		<tfoot>
			<tr>
				<td colspan="2"><a class="tribe-add-organizer" href="#"><?php 
        echo esc_html(sprintf(__('Add another %s', 'the-events-calendar'), strtolower(tribe_get_organizer_label_singular())));
        ?>
</a></td>
			</tr>
		</tfoot>
		<?php 
    }
Example #8
0
<?php

/**
 * Single Event Meta (Organizer) Template
 *
 */
$phone = tribe_get_organizer_phone();
$email = tribe_get_organizer_email();
$website = tribe_get_organizer_website_link();
?>

<div class="grve-tribe-events-meta-group grve-tribe-events-meta-group-organizer">
	<h5 class="grve-title"> <?php 
_e(tribe_get_organizer_label_singular(), GRVE_THEME_TRANSLATE);
?>
 </h5>
	<ul>
		<?php 
do_action('tribe_events_single_meta_organizer_section_start');
?>

		<li class="fn org"> <?php 
echo tribe_get_organizer();
?>
 </li>

		<?php 
if (!empty($phone)) {
    ?>
			<li>
				<span> <?php 
Example #9
0
 /**
  * Creates a new organizer
  *
  * @param array  $data        The organizer data.
  * @param string $post_status the intended post status.
  *
  * @return mixed
  */
 public static function createOrganizer($data, $post_status = 'publish')
 {
     if (isset($data['Organizer']) && $data['Organizer'] || self::someOrganizerDataSet($data)) {
         $organizer_label = tribe_get_organizer_label_singular();
         $title = $data['Organizer'] ? $data['Organizer'] : sprintf(__('Unnamed %s', 'the-events-calendar'), ucfirst($organizer_label));
         $slug = sanitize_title($title);
         $postdata = array('post_title' => $title, 'post_name' => $slug, 'post_type' => Tribe__Events__Main::ORGANIZER_POST_TYPE, 'post_status' => $post_status);
         $organizerId = wp_insert_post($postdata, true);
         if (!is_wp_error($organizerId)) {
             self::saveOrganizerMeta($organizerId, $data);
             do_action('tribe_events_organizer_created', $organizerId, $data);
             return $organizerId;
         }
     } else {
         // if the venue is blank, let's save the value as 0 instead
         return 0;
     }
 }
 /**
  * Creates a new organizer
  *
  * @param array  $data        The organizer data.
  * @param string $post_status the intended post status.
  *
  * @return mixed
  */
 public function create($data, $post_status = 'publish')
 {
     if (isset($data['Organizer']) && $data['Organizer'] || $this->has_organizer_data($data)) {
         $organizer_label = tribe_get_organizer_label_singular();
         $title = isset($data['Organizer']) ? $data['Organizer'] : sprintf(__('Unnamed %s', 'the-events-calendar'), ucfirst($organizer_label));
         $content = isset($data['Description']) ? $data['Description'] : '';
         $slug = sanitize_title($title);
         $postdata = array('post_title' => $title, 'post_content' => $content, 'post_name' => $slug, 'post_type' => self::POSTTYPE, 'post_status' => $post_status);
         $organizer_id = wp_insert_post($postdata, true);
         if (!is_wp_error($organizer_id)) {
             $this->save_meta($organizer_id, $data);
             do_action('tribe_events_organizer_created', $organizer_id, $data);
             return $organizer_id;
         }
     }
     // if the venue is blank, let's save the value as 0 instead
     return 0;
 }