Version Description
- Bug fix: Categories can not be part of the md5 hash used to identify unique tables (breaks AJAX nav for categories)
- Bug fix: recurring scheduling for week-days only not functional when 7 days or greater
- Bug fix: Print view location filters broken
- Bug fix: Make AJAX scripting aware of which other scripts are enabled.
- Bug fix: Sort scheduled dates for event by date
- Bug fix: JetPack Grunion Contact form interfered with TinyMCE in contexts outside of post editor (https://github.com/Automattic/jetpack/issues/7598)
- Bug fix: ensure date is retained if datepicker disabled
- Bug fix: archived events filter marked as active when not *
Download this release
Release Info
Developer | joedolson |
Plugin | My Calendar |
Version | 2.5.13 |
Comparing to | |
See all releases |
Code changes from version 2.5.12 to 2.5.13
- css/mc-styles.css +8 -0
- js/jquery.public.js +0 -19
- js/mc-ajax.js +10 -4
- my-calendar-api.php +1 -1
- my-calendar-core.php +78 -5
- my-calendar-event-manager.php +76 -84
- my-calendar-events.php +1 -0
- my-calendar-group-manager.php +1 -1
- my-calendar-limits.php +7 -3
- my-calendar-output.php +4 -4
- my-calendar-print.php +1 -0
- my-calendar-settings.php +1 -2
- my-calendar-styles.php +1 -2
- my-calendar-templates.php +1 -1
- my-calendar.php +3 -3
- readme.txt +14 -2
css/mc-styles.css
CHANGED
@@ -512,6 +512,14 @@ input[name="mc_uri"] {
|
|
512 |
width: 60%;
|
513 |
}
|
514 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
515 |
.req {
|
516 |
color: red;
|
517 |
}
|
512 |
width: 60%;
|
513 |
}
|
514 |
|
515 |
+
select[name="event_recur"] {
|
516 |
+
vertical-align: top;
|
517 |
+
}
|
518 |
+
|
519 |
+
.my-calendar-admin li.events_access_notes {
|
520 |
+
padding: 0px 1px 1px 5px;
|
521 |
+
}
|
522 |
+
|
523 |
.req {
|
524 |
color: red;
|
525 |
}
|
js/jquery.public.js
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
(function ($) {
|
2 |
-
$(function () {
|
3 |
-
// Delete single instances of recurring events.
|
4 |
-
$( '.mc_response' ).hide();
|
5 |
-
$('button.delete_occurrence').on( 'click', function () {
|
6 |
-
var value = $(this).attr( 'data-value' );
|
7 |
-
var data = {
|
8 |
-
'action': mc_data.action,
|
9 |
-
'occur_id': value,
|
10 |
-
'security': mc_data.security
|
11 |
-
};
|
12 |
-
$.post( ajaxurl, data, function (response) {
|
13 |
-
if ( response.success == 1 ) {
|
14 |
-
$( "button[data-value='"+value+"']" ).parent( 'li' ).hide();
|
15 |
-
}
|
16 |
-
$('.mc_response').text( response.response ).show( 300 );
|
17 |
-
}, "json" );
|
18 |
-
});
|
19 |
-
}(jQuery));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/mc-ajax.js
CHANGED
@@ -11,12 +11,18 @@
|
|
11 |
$('#' + ref).load(link + ' #' + ref + ' > *', function () {
|
12 |
// functions to execute when new view loads.
|
13 |
// List view
|
14 |
-
|
15 |
-
|
|
|
|
|
16 |
// Grid view
|
17 |
-
|
|
|
|
|
18 |
// Mini view
|
19 |
-
|
|
|
|
|
20 |
// All views
|
21 |
$( '#' + ref ).attr('tabindex', '-1').focus();
|
22 |
// Your Custom ajax load changes if needed
|
11 |
$('#' + ref).load(link + ' #' + ref + ' > *', function () {
|
12 |
// functions to execute when new view loads.
|
13 |
// List view
|
14 |
+
if ( typeof(mclist) !== "undefined" && mclist == 'true' ) {
|
15 |
+
$('li.mc-events').children().not('.event-date').hide();
|
16 |
+
$('li.current-day').children().show();
|
17 |
+
}
|
18 |
// Grid view
|
19 |
+
if ( typeof(mcgrid) !== "undefined" && mcgrid == 'true' ) {
|
20 |
+
$('.calendar .calendar-event').children().not('.event-title').hide();
|
21 |
+
}
|
22 |
// Mini view
|
23 |
+
if ( typeof(mcmini) !== "undefined" && mcmini == 'true' ) {
|
24 |
+
$('.mini .has-events').children().not('.trigger, .mc-date, .event-date').hide();
|
25 |
+
}
|
26 |
// All views
|
27 |
$( '#' + ref ).attr('tabindex', '-1').focus();
|
28 |
// Your Custom ajax load changes if needed
|
my-calendar-api.php
CHANGED
@@ -327,7 +327,7 @@ PRODID:-//Accessible Web Design//My Calendar//http://www.joedolson.com//v' . $mc
|
|
327 |
if ( !empty( $alarm ) ) {
|
328 |
$alert = mc_generate_alert_ical( $alarm );
|
329 |
}
|
330 |
-
|
331 |
$template = str_replace( '{alert}', $alert, $template );
|
332 |
|
333 |
$output .= "\n" . jd_draw_template( $array, $template, 'ical' );
|
327 |
if ( !empty( $alarm ) ) {
|
328 |
$alert = mc_generate_alert_ical( $alarm );
|
329 |
}
|
330 |
+
$template = apply_filters( 'mc_filter_ical_template', $template );
|
331 |
$template = str_replace( '{alert}', $alert, $template );
|
332 |
|
333 |
$output .= "\n" . jd_draw_template( $array, $template, 'ical' );
|
my-calendar-core.php
CHANGED
@@ -260,6 +260,7 @@ function my_calendar_write_js() {
|
|
260 |
?>
|
261 |
<script>
|
262 |
//<![CDATA[
|
|
|
263 |
jQuery(document).ready(function ($) {
|
264 |
$( '.mc-datepicker' ).pickadate({
|
265 |
monthsFull: mc_months,
|
@@ -274,6 +275,18 @@ function my_calendar_write_js() {
|
|
274 |
format: mc_time_format,
|
275 |
editable: true
|
276 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
277 |
$('#mc-accordion').accordion( { collapsible: true, active: false, heightStyle: 'content' } );
|
278 |
<?php
|
279 |
if ( function_exists( 'jd_doTwitterAPIPost' ) && isset( $_GET['page'] ) && $_GET['page'] == 'my-calendar' ) {
|
@@ -366,21 +379,25 @@ $script = '
|
|
366 |
if ( get_option( 'mc_calendar_javascript' ) != 1 && get_option( 'mc_open_uri' ) != 'true' ) {
|
367 |
$url = apply_filters( 'mc_grid_js', plugins_url( 'js/mc-grid.js', __FILE__ ) );
|
368 |
wp_enqueue_script( 'mc.grid', $url, array( 'jquery' ) );
|
|
|
369 |
$enqueue_mcjs = true;
|
370 |
}
|
371 |
if ( get_option( 'mc_list_javascript' ) != 1 ) {
|
372 |
$url = apply_filters( 'mc_list_js', plugins_url( 'js/mc-list.js', __FILE__ ) );
|
373 |
wp_enqueue_script( 'mc.list', $url, array( 'jquery' ) );
|
|
|
374 |
$enqueue_mcjs = true;
|
375 |
}
|
376 |
if ( get_option( 'mc_mini_javascript' ) != 1 && get_option( 'mc_open_day_uri' ) != 'true' ) {
|
377 |
$url = apply_filters( 'mc_mini_js', plugins_url( 'js/mc-mini.js', __FILE__ ) );
|
378 |
wp_enqueue_script( 'mc.mini', $url, array( 'jquery' ) );
|
|
|
379 |
$enqueue_mcjs = true;
|
380 |
}
|
381 |
if ( get_option( 'mc_ajax_javascript' ) != 1 ) {
|
382 |
$url = apply_filters( 'mc_ajax_js', plugins_url( 'js/mc-ajax.js', __FILE__ ) );
|
383 |
wp_enqueue_script( 'mc.ajax', $url, array( 'jquery' ) );
|
|
|
384 |
$enqueue_mcjs = true;
|
385 |
}
|
386 |
if ( $enqueue_mcjs ) {
|
@@ -1674,7 +1691,8 @@ function mc_increment_event( $id, $post = array(), $test = false ) {
|
|
1674 |
$format = array( '%d', '%s', '%s', '%d' );
|
1675 |
$recurs = str_split( $event->event_recur, 1 );
|
1676 |
$recur = $recurs[0];
|
1677 |
-
|
|
|
1678 |
if ( $recur != "S" ) {
|
1679 |
// if this event had a rep of 0, translate that.
|
1680 |
$event_repetition = ( $event->event_repeats != 0 ) ? $event->event_repeats : _mc_increment_values( $recur );
|
@@ -1682,11 +1700,67 @@ function mc_increment_event( $id, $post = array(), $test = false ) {
|
|
1682 |
if ( $recur != 'S' ) {
|
1683 |
switch ( $recur ) {
|
1684 |
case "D":
|
1685 |
-
case "E":
|
1686 |
for ( $i = 0; $i <= $numforward; $i ++ ) {
|
1687 |
$begin = my_calendar_add_date( $orig_begin, $i * $every, 0, 0 );
|
1688 |
$end = my_calendar_add_date( $orig_end, $i * $every, 0, 0 );
|
1689 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1690 |
$data = array(
|
1691 |
'occur_event_id' => $id,
|
1692 |
'occur_begin' => date( 'Y-m-d H:i:s', $begin ),
|
@@ -1705,8 +1779,6 @@ function mc_increment_event( $id, $post = array(), $test = false ) {
|
|
1705 |
$wpdb->insert( my_calendar_event_table(), $data, $format );
|
1706 |
}
|
1707 |
}
|
1708 |
-
} else {
|
1709 |
-
$numforward ++;
|
1710 |
}
|
1711 |
}
|
1712 |
break;
|
@@ -1901,6 +1973,7 @@ function mc_register_actions() {
|
|
1901 |
|
1902 |
// Filters
|
1903 |
add_filter( 'post_updated_messages', 'mc_posttypes_messages' );
|
|
|
1904 |
|
1905 |
// Actions
|
1906 |
add_action( 'init', 'mc_taxonomies', 0 );
|
260 |
?>
|
261 |
<script>
|
262 |
//<![CDATA[
|
263 |
+
if ( typeof(mc_months) !== "undefined" ) {
|
264 |
jQuery(document).ready(function ($) {
|
265 |
$( '.mc-datepicker' ).pickadate({
|
266 |
monthsFull: mc_months,
|
275 |
format: mc_time_format,
|
276 |
editable: true
|
277 |
});
|
278 |
+
});
|
279 |
+
} else {
|
280 |
+
jQuery(document).ready(function ($) {
|
281 |
+
var datepicked = $( '.mc-datepicker' ).attr( 'data-value' );
|
282 |
+
$( '.mc-datepicker' ).val( datepicked );
|
283 |
+
});
|
284 |
+
}
|
285 |
+
//]]>
|
286 |
+
</script>
|
287 |
+
<script>
|
288 |
+
//<![CDATA[
|
289 |
+
jQuery(document).ready(function ($) {
|
290 |
$('#mc-accordion').accordion( { collapsible: true, active: false, heightStyle: 'content' } );
|
291 |
<?php
|
292 |
if ( function_exists( 'jd_doTwitterAPIPost' ) && isset( $_GET['page'] ) && $_GET['page'] == 'my-calendar' ) {
|
379 |
if ( get_option( 'mc_calendar_javascript' ) != 1 && get_option( 'mc_open_uri' ) != 'true' ) {
|
380 |
$url = apply_filters( 'mc_grid_js', plugins_url( 'js/mc-grid.js', __FILE__ ) );
|
381 |
wp_enqueue_script( 'mc.grid', $url, array( 'jquery' ) );
|
382 |
+
wp_localize_script( 'mc.grid', 'mcgrid', 'true' );
|
383 |
$enqueue_mcjs = true;
|
384 |
}
|
385 |
if ( get_option( 'mc_list_javascript' ) != 1 ) {
|
386 |
$url = apply_filters( 'mc_list_js', plugins_url( 'js/mc-list.js', __FILE__ ) );
|
387 |
wp_enqueue_script( 'mc.list', $url, array( 'jquery' ) );
|
388 |
+
wp_localize_script( 'mc.list', 'mclist', 'true' );
|
389 |
$enqueue_mcjs = true;
|
390 |
}
|
391 |
if ( get_option( 'mc_mini_javascript' ) != 1 && get_option( 'mc_open_day_uri' ) != 'true' ) {
|
392 |
$url = apply_filters( 'mc_mini_js', plugins_url( 'js/mc-mini.js', __FILE__ ) );
|
393 |
wp_enqueue_script( 'mc.mini', $url, array( 'jquery' ) );
|
394 |
+
wp_localize_script( 'mc.mini', 'mcmini', 'true' );
|
395 |
$enqueue_mcjs = true;
|
396 |
}
|
397 |
if ( get_option( 'mc_ajax_javascript' ) != 1 ) {
|
398 |
$url = apply_filters( 'mc_ajax_js', plugins_url( 'js/mc-ajax.js', __FILE__ ) );
|
399 |
wp_enqueue_script( 'mc.ajax', $url, array( 'jquery' ) );
|
400 |
+
wp_localize_script( 'mc.ajax', 'mcAjax', 'true' );
|
401 |
$enqueue_mcjs = true;
|
402 |
}
|
403 |
if ( $enqueue_mcjs ) {
|
1691 |
$format = array( '%d', '%s', '%s', '%d' );
|
1692 |
$recurs = str_split( $event->event_recur, 1 );
|
1693 |
$recur = $recurs[0];
|
1694 |
+
// can't use 2nd value directly if it's two digits
|
1695 |
+
$every = ( isset( $recurs[1] ) ) ? str_replace( $recurs[0], '', $event->event_recur ) : 1;
|
1696 |
if ( $recur != "S" ) {
|
1697 |
// if this event had a rep of 0, translate that.
|
1698 |
$event_repetition = ( $event->event_repeats != 0 ) ? $event->event_repeats : _mc_increment_values( $recur );
|
1700 |
if ( $recur != 'S' ) {
|
1701 |
switch ( $recur ) {
|
1702 |
case "D":
|
|
|
1703 |
for ( $i = 0; $i <= $numforward; $i ++ ) {
|
1704 |
$begin = my_calendar_add_date( $orig_begin, $i * $every, 0, 0 );
|
1705 |
$end = my_calendar_add_date( $orig_end, $i * $every, 0, 0 );
|
1706 |
+
|
1707 |
+
$data = array(
|
1708 |
+
'occur_event_id' => $id,
|
1709 |
+
'occur_begin' => date( 'Y-m-d H:i:s', $begin ),
|
1710 |
+
'occur_end' => date( 'Y-m-d H:i:s', $end ),
|
1711 |
+
'occur_group_id' => $group_id
|
1712 |
+
);
|
1713 |
+
if ( $test == 'test' && $i > 0 ) {
|
1714 |
+
return $data;
|
1715 |
+
}
|
1716 |
+
if ( $test == true ) {
|
1717 |
+
$return[] = $data;
|
1718 |
+
}
|
1719 |
+
if ( ! $test ) {
|
1720 |
+
$insert = apply_filters( 'mc_insert_recurring', false, $data, $format, $id, 'daily' );
|
1721 |
+
if ( ! $insert ) {
|
1722 |
+
$wpdb->insert( my_calendar_event_table(), $data, $format );
|
1723 |
+
}
|
1724 |
+
}
|
1725 |
+
}
|
1726 |
+
break;
|
1727 |
+
case "E":
|
1728 |
+
// This doesn't work for weekdays unless the period is less than one week, as it doesn't account for day repetitions.
|
1729 |
+
// probably need to set up two nested for loops two identify the number of days forward required to go through x week days.
|
1730 |
+
// $every = e.g. every 14 weekdays
|
1731 |
+
// $numforward = e.g. 7 times
|
1732 |
+
if ( $every < 7 ) {
|
1733 |
+
for ( $i = 0; $i <= $numforward; $i ++ ) {
|
1734 |
+
$begin = my_calendar_add_date( $orig_begin, $i * $every, 0, 0 );
|
1735 |
+
$end = my_calendar_add_date( $orig_end, $i * $every, 0, 0 );
|
1736 |
+
if ( ( date( 'w', $begin ) != 0 && date( 'w', $begin ) != 6 ) ) {
|
1737 |
+
$data = array(
|
1738 |
+
'occur_event_id' => $id,
|
1739 |
+
'occur_begin' => date( 'Y-m-d H:i:s', $begin ),
|
1740 |
+
'occur_end' => date( 'Y-m-d H:i:s', $end ),
|
1741 |
+
'occur_group_id' => $group_id
|
1742 |
+
);
|
1743 |
+
if ( $test == 'test' && $i > 0 ) {
|
1744 |
+
return $data;
|
1745 |
+
}
|
1746 |
+
if ( $test == true ) {
|
1747 |
+
$return[] = $data;
|
1748 |
+
}
|
1749 |
+
if ( ! $test ) {
|
1750 |
+
$insert = apply_filters( 'mc_insert_recurring', false, $data, $format, $id, 'daily' );
|
1751 |
+
if ( ! $insert ) {
|
1752 |
+
$wpdb->insert( my_calendar_event_table(), $data, $format );
|
1753 |
+
}
|
1754 |
+
}
|
1755 |
+
} else {
|
1756 |
+
$numforward ++;
|
1757 |
+
}
|
1758 |
+
}
|
1759 |
+
} else {
|
1760 |
+
// get number of weeks included in data'
|
1761 |
+
for( $i = 0; $i <= $event_repetition; $i ++ ) {
|
1762 |
+
$begin = strtotime( $orig_begin . ' ' . ( $every * $i ) . ' weekdays' );
|
1763 |
+
$end = strtotime( $orig_end . ' ' . ( $every * $i ) . ' weekdays' );
|
1764 |
$data = array(
|
1765 |
'occur_event_id' => $id,
|
1766 |
'occur_begin' => date( 'Y-m-d H:i:s', $begin ),
|
1779 |
$wpdb->insert( my_calendar_event_table(), $data, $format );
|
1780 |
}
|
1781 |
}
|
|
|
|
|
1782 |
}
|
1783 |
}
|
1784 |
break;
|
1973 |
|
1974 |
// Filters
|
1975 |
add_filter( 'post_updated_messages', 'mc_posttypes_messages' );
|
1976 |
+
add_filter( 'tmp_grunion_allow_editor_view', '__return_false' );
|
1977 |
|
1978 |
// Actions
|
1979 |
add_action( 'init', 'mc_taxonomies', 0 );
|
my-calendar-event-manager.php
CHANGED
@@ -921,7 +921,7 @@ function mc_show_block( $field, $has_data, $data, $echo = true, $default = '' )
|
|
921 |
$event_recur = ( is_object( $data ) ) ? $data->event_recur : '';
|
922 |
$recurs = str_split( $event_recur, 1 );
|
923 |
$recur = $recurs[0];
|
924 |
-
$every = ( isset( $recurs[1] ) ) ? $recurs[
|
925 |
if ( $every == 1 && $recur == 'B' ) {
|
926 |
$every = 2;
|
927 |
}
|
@@ -943,8 +943,8 @@ function mc_show_block( $field, $has_data, $data, $echo = true, $default = '' )
|
|
943 |
<fieldset>
|
944 |
<legend class="screen-reader-text">' . __( 'Recurring Events', 'my-calendar' ) . '</legend>
|
945 |
<p>
|
946 |
-
<label for="e_repeats">' . __( 'Repeats', 'my-calendar' ) . ' <input type="text" name="event_repeats" aria-labelledby="e_repeats_label" id="e_repeats" size="
|
947 |
-
<label for="e_every">' . __( 'every', 'my-calendar' ) . '</label> <input type="number" name="event_every" id="e_every" size="
|
948 |
<label for="e_recur" class="screen-reader-text">' . __( 'Units', 'my-calendar' ) . '</label>
|
949 |
<select name="event_recur" id="e_recur">
|
950 |
' . mc_recur_options( $recur ) . '
|
@@ -1146,7 +1146,7 @@ function mc_form_fields( $data, $mode, $event_id ) {
|
|
1146 |
$args = "&date=$id";
|
1147 |
}
|
1148 |
}
|
1149 |
-
$delete = " · <a href='" . admin_url( "admin.php?page=my-calendar-manage&mode=delete&event_id=$event_id$args" ) . "' class='delete'>" . __( 'Delete', 'my-calendar' ) . "</a>";
|
1150 |
} else {
|
1151 |
$text = __( 'Add Event', 'my-calendar' );
|
1152 |
$delete = '';
|
@@ -1163,7 +1163,7 @@ function mc_form_fields( $data, $mode, $event_id ) {
|
|
1163 |
<div class="inside">
|
1164 |
<p class='mc-controls'>
|
1165 |
<a href="<?php echo admin_url( 'admin.php?page=my-calendar-manage' ); ?>"><?php echo ( current_user_can( 'mc_manage_events' ) ) ? __( 'Manage events', 'my-calendar' ) : __( 'Manage your events', 'my-calendar' ); ?></a>
|
1166 |
-
<?php echo $delete;
|
1167 |
</p>
|
1168 |
<?php
|
1169 |
if ( ! empty( $_GET['date'] ) && $data->event_recur != 'S' ) {
|
@@ -1308,7 +1308,8 @@ function mc_form_fields( $data, $mode, $event_id ) {
|
|
1308 |
$date = (int) $_GET['date'];
|
1309 |
} else {
|
1310 |
$date = false;
|
1311 |
-
}
|
|
|
1312 |
<?php echo mc_instance_list( $data->event_id, $date ); ?>
|
1313 |
</ul>
|
1314 |
<p><button type='button' class='add-occurrence' aria-expanded="false"><span class='dashicons' aria-hidden='true'> </span><?php _e( 'Add another date', 'my-calendar' ); ?></button></p>
|
@@ -1507,7 +1508,7 @@ function mc_event_accessibility( $form, $data, $label ) {
|
|
1507 |
if ( isset( $events_access['notes'] ) ) {
|
1508 |
$note_value = esc_attr( $events_access['notes'] );
|
1509 |
}
|
1510 |
-
$form .= '<li><label for="events_access_notes">' . __( 'Notes', 'my-calendar' ) . '</label> <input type="text" id="events_access_notes" name="events_access[notes]" value="' . esc_attr( $note_value ) . '" /></li>';
|
1511 |
$form .= "</ul>
|
1512 |
</fieldset>";
|
1513 |
|
@@ -1655,17 +1656,37 @@ function mc_list_events() {
|
|
1655 |
|
1656 |
$found_rows = $wpdb->get_col( "SELECT FOUND_ROWS();" );
|
1657 |
$items = $found_rows[0];
|
1658 |
-
|
1659 |
-
|
1660 |
-
|
1661 |
-
|
1662 |
<li>
|
1663 |
-
<a <?php echo ( isset( $_GET['
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1664 |
href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&restrict=flagged&filter=1' ); ?>"><?php _e( 'Spam', 'my-calendar' ); ?></a>
|
1665 |
</li>
|
1666 |
-
|
1667 |
-
|
1668 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1669 |
<div class='mc-search'>
|
1670 |
<form action="<?php echo esc_url( add_query_arg( $_GET, admin_url( 'admin.php' ) ) ); ?>" method="post">
|
1671 |
<div><input type="hidden" name="_wpnonce"
|
@@ -1682,27 +1703,6 @@ function mc_list_events() {
|
|
1682 |
</form>
|
1683 |
</div>
|
1684 |
<?php
|
1685 |
-
if ( get_option( 'mc_event_approve' ) == 'true' ) {
|
1686 |
-
?>
|
1687 |
-
<ul class="links">
|
1688 |
-
<li>
|
1689 |
-
<a <?php echo ( isset( $_GET['limit'] ) && $_GET['limit'] == 'published' ) ? 'class="active-link"' : ''; ?>
|
1690 |
-
href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&limit=published' ); ?>"><?php _e( 'Published', 'my-calendar' ); ?></a>
|
1691 |
-
</li>
|
1692 |
-
<li>
|
1693 |
-
<a <?php echo ( isset( $_GET['limit'] ) && $_GET['limit'] == 'reserved' ) ? 'class="active-link"' : ''; ?>
|
1694 |
-
href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&limit=reserved' ); ?>"><?php _e( 'Reserved', 'my-calendar' ); ?></a>
|
1695 |
-
</li>
|
1696 |
-
<li>
|
1697 |
-
<a <?php echo ( isset( $_GET['limit'] ) && $_GET['limit'] == 'all' || ! isset( $_GET['limit'] ) ) ? 'class="active-link"' : ''; ?>
|
1698 |
-
href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&restrict=archived' ); ?>"><?php _e( 'Archived', 'my-calendar' ); ?></a>
|
1699 |
-
</li>
|
1700 |
-
<li>
|
1701 |
-
<a <?php echo ( isset( $_GET['limit'] ) && $_GET['limit'] == 'all' || ! isset( $_GET['limit'] ) ) ? 'class="active-link"' : ''; ?>
|
1702 |
-
href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&limit=all' ); ?>"><?php _e( 'All', 'my-calendar' ); ?></a>
|
1703 |
-
</li>
|
1704 |
-
</ul><?php
|
1705 |
-
}
|
1706 |
echo $filtered;
|
1707 |
$num_pages = ceil( $items / $items_per_page );
|
1708 |
if ( $num_pages > 1 ) {
|
@@ -1720,23 +1720,18 @@ function mc_list_events() {
|
|
1720 |
if ( ! empty( $events ) ) {
|
1721 |
?>
|
1722 |
<form action="<?php echo esc_url( add_query_arg( $_GET, admin_url( 'admin.php' ) ) ); ?>" method="post">
|
1723 |
-
|
1724 |
-
|
1725 |
-
|
1726 |
-
|
1727 |
-
|
1728 |
-
|
1729 |
-
|
1730 |
-
|
1731 |
-
|
1732 |
-
|
1733 |
-
|
1734 |
-
|
1735 |
-
<?php } else { ?>
|
1736 |
-
<input type="submit" class="button-secondary mc-archive" name="mass_undo_archive"
|
1737 |
-
value="<?php _e( 'Remove from archive', 'my-calendar' ); ?>"/>
|
1738 |
-
<?php } ?>
|
1739 |
-
</div>
|
1740 |
|
1741 |
<table class="widefat wp-list-table" id="my-calendar-admin-table">
|
1742 |
<thead>
|
@@ -1797,11 +1792,11 @@ function mc_list_events() {
|
|
1797 |
<tr class="<?php echo "$class $spam $pending $problem"; ?>">
|
1798 |
<th scope="row">
|
1799 |
<input type="checkbox" value="<?php echo $event->event_id; ?>" name="mass_edit[]" id="mc<?php echo $event->event_id; ?>" <?php echo ( $event->event_flagged == 1 ) ? 'checked="checked"' : ''; ?> />
|
1800 |
-
<label for="mc<?php echo $event->event_id; ?>"><?php
|
1801 |
</th>
|
1802 |
<td>
|
1803 |
<strong><?php if ( mc_can_edit_event( $event->event_id ) ) { ?>
|
1804 |
-
<a href="<?php echo $edit_url; ?>" class='edit'>
|
1805 |
<?php } ?>
|
1806 |
<?php echo $spam_label; echo strip_tags( stripslashes( $event->event_title ) ); ?>
|
1807 |
<?php if ( mc_can_edit_event( $event->event_id ) ) {
|
@@ -1811,7 +1806,7 @@ function mc_list_events() {
|
|
1811 |
}
|
1812 |
} ?></strong>
|
1813 |
|
1814 |
-
<div class='row-actions'
|
1815 |
<?php if ( mc_event_published( $event ) ) { ?>
|
1816 |
<a href="<?php echo $view_url; ?>" class='view'><?php _e( 'View', 'my-calendar' ); ?></a> |
|
1817 |
<?php } ?>
|
@@ -1856,12 +1851,12 @@ function mc_list_events() {
|
|
1856 |
<td>
|
1857 |
<?php if ( $event->event_label != '' ) { ?><a class='mc_filter' href='<?php $elabel = urlencode( $event->event_label ); echo admin_url( "admin.php?page=my-calendar-manage&filter=$elabel&restrict=where" ); ?>' title="<?php _e( 'Filter by location', 'my-calendar' ); ?>"><span class="screen-reader-text"><?php _e( 'Show only: ', 'my-calendar' ); ?></span><?php echo strip_tags( stripslashes( $event->event_label ) ); ?></a><?php } ?>
|
1858 |
</td>
|
1859 |
-
<?php if ( $event->event_endtime != "23:59:59" ) {
|
1860 |
-
$eventTime = date_i18n( get_option( 'mc_time_format' ), mc_strtotime( $event->event_time ) );
|
1861 |
-
} else {
|
1862 |
-
$eventTime = mc_notime_label( $event );
|
1863 |
-
} ?>
|
1864 |
<td><?php
|
|
|
|
|
|
|
|
|
|
|
1865 |
$date_format = ( get_option( 'mc_date_format' ) == '' ) ? get_option( 'date_format' ) : get_option( 'mc_date_format' );
|
1866 |
$begin = date_i18n( $date_format, mc_strtotime( $event->event_begin ) );
|
1867 |
echo "$begin, $eventTime"; ?>
|
@@ -1870,7 +1865,7 @@ function mc_list_events() {
|
|
1870 |
<?php
|
1871 |
$recurs = str_split( $event->event_recur, 1 );
|
1872 |
$recur = $recurs[0];
|
1873 |
-
$every
|
1874 |
|
1875 |
// Interpret the DB values into something human readable
|
1876 |
switch ( $recur ) {
|
@@ -1940,38 +1935,35 @@ function mc_list_events() {
|
|
1940 |
}
|
1941 |
?>
|
1942 |
</table>
|
1943 |
-
|
1944 |
-
|
1945 |
-
if ( ( function_exists( 'akismet_http_post' ) || function_exists( 'bs_checker' ) ) && $allow_filters ) {
|
1946 |
-
?>
|
1947 |
-
<ul class="links">
|
1948 |
-
<li>
|
1949 |
-
<a <?php echo ( isset( $_GET['restrict'] ) && $_GET['restrict'] == 'flagged' ) ? 'class="active-link"' : ''; ?>
|
1950 |
-
href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&restrict=flagged&filter=1' ); ?>"><?php _e( 'Spam', 'my-calendar' ); ?></a>
|
1951 |
-
</li>
|
1952 |
-
</ul><?php
|
1953 |
-
}
|
1954 |
-
if ( get_option( 'mc_event_approve' ) == 'true' ) {
|
1955 |
-
?>
|
1956 |
-
<ul class="links">
|
1957 |
<li>
|
1958 |
-
<a <?php echo ( isset( $_GET['limit'] ) && $_GET['limit'] == 'published' ) ? 'class="active-link"' : ''; ?>
|
1959 |
href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&limit=published' ); ?>"><?php _e( 'Published', 'my-calendar' ); ?></a>
|
1960 |
</li>
|
1961 |
<li>
|
1962 |
-
<a <?php echo ( isset( $_GET['limit'] ) && $_GET['limit'] == 'reserved' ) ? 'class="active-link"' : ''; ?>
|
1963 |
href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&limit=reserved' ); ?>"><?php _e( 'Reserved', 'my-calendar' ); ?></a>
|
1964 |
</li>
|
1965 |
<li>
|
1966 |
-
<a <?php echo ( isset( $_GET['
|
1967 |
href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&restrict=archived' ); ?>"><?php _e( 'Archived', 'my-calendar' ); ?></a>
|
1968 |
</li>
|
|
|
|
|
1969 |
<li>
|
1970 |
-
<a <?php echo ( isset( $_GET['
|
|
|
|
|
|
|
|
|
|
|
|
|
1971 |
href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&limit=all' ); ?>"><?php _e( 'All', 'my-calendar' ); ?></a>
|
1972 |
</li>
|
1973 |
-
|
1974 |
-
|
|
|
1975 |
echo $filtered;
|
1976 |
$num_pages = ceil( $items / $items_per_page );
|
1977 |
if ( $num_pages > 1 ) {
|
@@ -2468,9 +2460,9 @@ function mc_instance_list( $id, $occur = false, $template = '<h3>{title}</h3>{de
|
|
2468 |
$id = (int) $id;
|
2469 |
$output = '';
|
2470 |
if ( $instance == true ) {
|
2471 |
-
$sql = "SELECT * FROM " . my_calendar_event_table() . " WHERE occur_id=$id";
|
2472 |
} else {
|
2473 |
-
$sql = "SELECT * FROM " . my_calendar_event_table() . " WHERE occur_event_id=$id";
|
2474 |
}
|
2475 |
$results = $wpdb->get_results( $sql );
|
2476 |
if ( is_array( $results ) && is_admin() ) {
|
921 |
$event_recur = ( is_object( $data ) ) ? $data->event_recur : '';
|
922 |
$recurs = str_split( $event_recur, 1 );
|
923 |
$recur = $recurs[0];
|
924 |
+
$every = ( isset( $recurs[1] ) ) ? str_replace( $recurs[0], '', $event_recur ) : 1;
|
925 |
if ( $every == 1 && $recur == 'B' ) {
|
926 |
$every = 2;
|
927 |
}
|
943 |
<fieldset>
|
944 |
<legend class="screen-reader-text">' . __( 'Recurring Events', 'my-calendar' ) . '</legend>
|
945 |
<p>
|
946 |
+
<label for="e_repeats">' . __( 'Repeats', 'my-calendar' ) . ' <input type="text" name="event_repeats" aria-labelledby="e_repeats_label" id="e_repeats" size="2" value="' . esc_attr( $repeats ) . '" /> <span id="e_repeats_label">' . __( 'times', 'my-calendar' ) . '</span>, </label>
|
947 |
+
<label for="e_every">' . __( 'every', 'my-calendar' ) . '</label> <input type="number" name="event_every" id="e_every" size="2" min="1" max="99" maxlength="2" value="' . esc_attr( $every ) . '" />
|
948 |
<label for="e_recur" class="screen-reader-text">' . __( 'Units', 'my-calendar' ) . '</label>
|
949 |
<select name="event_recur" id="e_recur">
|
950 |
' . mc_recur_options( $recur ) . '
|
1146 |
$args = "&date=$id";
|
1147 |
}
|
1148 |
}
|
1149 |
+
$delete = " · <a href='" . admin_url( "admin.php?page=my-calendar-manage&mode=delete&event_id=$event_id$args" ) . "' class='delete'>" . __( 'Delete', 'my-calendar' ) . "</a>";
|
1150 |
} else {
|
1151 |
$text = __( 'Add Event', 'my-calendar' );
|
1152 |
$delete = '';
|
1163 |
<div class="inside">
|
1164 |
<p class='mc-controls'>
|
1165 |
<a href="<?php echo admin_url( 'admin.php?page=my-calendar-manage' ); ?>"><?php echo ( current_user_can( 'mc_manage_events' ) ) ? __( 'Manage events', 'my-calendar' ) : __( 'Manage your events', 'my-calendar' ); ?></a>
|
1166 |
+
<?php echo $delete; echo $text_link; ?> <input type="submit" name="save" class="button-primary" value="<?php _e( 'Save Event', 'my-calendar' ); ?>"/>
|
1167 |
</p>
|
1168 |
<?php
|
1169 |
if ( ! empty( $_GET['date'] ) && $data->event_recur != 'S' ) {
|
1308 |
$date = (int) $_GET['date'];
|
1309 |
} else {
|
1310 |
$date = false;
|
1311 |
+
}
|
1312 |
+
?>
|
1313 |
<?php echo mc_instance_list( $data->event_id, $date ); ?>
|
1314 |
</ul>
|
1315 |
<p><button type='button' class='add-occurrence' aria-expanded="false"><span class='dashicons' aria-hidden='true'> </span><?php _e( 'Add another date', 'my-calendar' ); ?></button></p>
|
1508 |
if ( isset( $events_access['notes'] ) ) {
|
1509 |
$note_value = esc_attr( $events_access['notes'] );
|
1510 |
}
|
1511 |
+
$form .= '<li class="events_access_notes"><label for="events_access_notes">' . __( 'Notes', 'my-calendar' ) . '</label> <input type="text" id="events_access_notes" name="events_access[notes]" value="' . esc_attr( $note_value ) . '" /></li>';
|
1512 |
$form .= "</ul>
|
1513 |
</fieldset>";
|
1514 |
|
1656 |
|
1657 |
$found_rows = $wpdb->get_col( "SELECT FOUND_ROWS();" );
|
1658 |
$items = $found_rows[0];
|
1659 |
+
|
1660 |
+
?>
|
1661 |
+
<ul class="links">
|
1662 |
+
<?php if ( get_option( 'mc_event_approve' ) == 'true' ) { ?>
|
1663 |
<li>
|
1664 |
+
<a <?php echo ( isset( $_GET['limit'] ) && $_GET['limit'] == 'published' ) ? 'class="active-link" aria-current="true"' : ''; ?>
|
1665 |
+
href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&limit=published' ); ?>"><?php _e( 'Published', 'my-calendar' ); ?></a>
|
1666 |
+
</li>
|
1667 |
+
<li>
|
1668 |
+
<a <?php echo ( isset( $_GET['limit'] ) && $_GET['limit'] == 'reserved' ) ? 'class="active-link" aria-current="true"' : ''; ?>
|
1669 |
+
href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&limit=reserved' ); ?>"><?php _e( 'Reserved', 'my-calendar' ); ?></a>
|
1670 |
+
</li>
|
1671 |
+
<li>
|
1672 |
+
<a <?php echo ( isset( $_GET['restrict'] ) && $_GET['restrict'] == 'archived' ) ? 'class="active-link" aria-current="true"' : ''; ?>
|
1673 |
+
href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&restrict=archived' ); ?>"><?php _e( 'Archived', 'my-calendar' ); ?></a>
|
1674 |
+
</li>
|
1675 |
+
<?php } ?>
|
1676 |
+
<?php if ( ( function_exists( 'akismet_http_post' ) || function_exists( 'bs_checker' ) ) && $allow_filters ) { ?>
|
1677 |
+
<li>
|
1678 |
+
<a <?php echo ( isset( $_GET['restrict'] ) && $_GET['restrict'] == 'flagged' ) ? 'class="active-link" aria-current="true"' : ''; ?>
|
1679 |
href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&restrict=flagged&filter=1' ); ?>"><?php _e( 'Spam', 'my-calendar' ); ?></a>
|
1680 |
</li>
|
1681 |
+
<?php } ?>
|
1682 |
+
<?php if ( get_option( 'mc_event_approve' ) == 'true' ) { ?>
|
1683 |
+
<li>
|
1684 |
+
<a <?php echo ( isset( $_GET['limit'] ) && $_GET['limit'] == 'all' || ( ! isset( $_GET['limit'] ) && ! isset( $_GET['restrict'] ) ) ) ? 'class="active-link" aria-current="true"' : ''; ?>
|
1685 |
+
href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&limit=all' ); ?>"><?php _e( 'All', 'my-calendar' ); ?></a>
|
1686 |
+
</li>
|
1687 |
+
<?php } ?>
|
1688 |
+
</ul>
|
1689 |
+
|
1690 |
<div class='mc-search'>
|
1691 |
<form action="<?php echo esc_url( add_query_arg( $_GET, admin_url( 'admin.php' ) ) ); ?>" method="post">
|
1692 |
<div><input type="hidden" name="_wpnonce"
|
1703 |
</form>
|
1704 |
</div>
|
1705 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1706 |
echo $filtered;
|
1707 |
$num_pages = ceil( $items / $items_per_page );
|
1708 |
if ( $num_pages > 1 ) {
|
1720 |
if ( ! empty( $events ) ) {
|
1721 |
?>
|
1722 |
<form action="<?php echo esc_url( add_query_arg( $_GET, admin_url( 'admin.php' ) ) ); ?>" method="post">
|
1723 |
+
<div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce( 'my-calendar-nonce' ); ?>" /></div>
|
1724 |
+
<div class='mc-actions'>
|
1725 |
+
<input type="submit" class="button-secondary delete" name="mass_delete" value="<?php _e( 'Delete events', 'my-calendar' ); ?>"/>
|
1726 |
+
<?php if ( current_user_can( 'mc_approve_events' ) ) { ?>
|
1727 |
+
<input type="submit" class="button-secondary mc-approve" name="mass_approve" value="<?php _e( 'Approve events', 'my-calendar' ); ?>"/>
|
1728 |
+
<?php } ?>
|
1729 |
+
<?php if ( ! ( isset( $_GET['restrict'] ) && $_GET['restrict'] == 'archived' ) ) { ?>
|
1730 |
+
<input type="submit" class="button-secondary mc-archive" name="mass_archive" value="<?php _e( 'Archive events', 'my-calendar' ); ?>"/>
|
1731 |
+
<?php } else { ?>
|
1732 |
+
<input type="submit" class="button-secondary mc-archive" name="mass_undo_archive" value="<?php _e( 'Remove from archive', 'my-calendar' ); ?>" />
|
1733 |
+
<?php } ?>
|
1734 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
1735 |
|
1736 |
<table class="widefat wp-list-table" id="my-calendar-admin-table">
|
1737 |
<thead>
|
1792 |
<tr class="<?php echo "$class $spam $pending $problem"; ?>">
|
1793 |
<th scope="row">
|
1794 |
<input type="checkbox" value="<?php echo $event->event_id; ?>" name="mass_edit[]" id="mc<?php echo $event->event_id; ?>" <?php echo ( $event->event_flagged == 1 ) ? 'checked="checked"' : ''; ?> />
|
1795 |
+
<label for="mc<?php echo $event->event_id; ?>"><?php printf( __( "<span class='screen-reader-text'>Select event </span>%d", 'my-calendar' ), $event->event_id ); ?></label>
|
1796 |
</th>
|
1797 |
<td>
|
1798 |
<strong><?php if ( mc_can_edit_event( $event->event_id ) ) { ?>
|
1799 |
+
<a href="<?php echo $edit_url; ?>" class='edit'><span class="dashicons dashicons-edit" aria-hidden="true"></span>
|
1800 |
<?php } ?>
|
1801 |
<?php echo $spam_label; echo strip_tags( stripslashes( $event->event_title ) ); ?>
|
1802 |
<?php if ( mc_can_edit_event( $event->event_id ) ) {
|
1806 |
}
|
1807 |
} ?></strong>
|
1808 |
|
1809 |
+
<div class='row-actions'>
|
1810 |
<?php if ( mc_event_published( $event ) ) { ?>
|
1811 |
<a href="<?php echo $view_url; ?>" class='view'><?php _e( 'View', 'my-calendar' ); ?></a> |
|
1812 |
<?php } ?>
|
1851 |
<td>
|
1852 |
<?php if ( $event->event_label != '' ) { ?><a class='mc_filter' href='<?php $elabel = urlencode( $event->event_label ); echo admin_url( "admin.php?page=my-calendar-manage&filter=$elabel&restrict=where" ); ?>' title="<?php _e( 'Filter by location', 'my-calendar' ); ?>"><span class="screen-reader-text"><?php _e( 'Show only: ', 'my-calendar' ); ?></span><?php echo strip_tags( stripslashes( $event->event_label ) ); ?></a><?php } ?>
|
1853 |
</td>
|
|
|
|
|
|
|
|
|
|
|
1854 |
<td><?php
|
1855 |
+
if ( $event->event_endtime != "23:59:59" ) {
|
1856 |
+
$eventTime = date_i18n( get_option( 'mc_time_format' ), mc_strtotime( $event->event_time ) );
|
1857 |
+
} else {
|
1858 |
+
$eventTime = mc_notime_label( $event );
|
1859 |
+
}
|
1860 |
$date_format = ( get_option( 'mc_date_format' ) == '' ) ? get_option( 'date_format' ) : get_option( 'mc_date_format' );
|
1861 |
$begin = date_i18n( $date_format, mc_strtotime( $event->event_begin ) );
|
1862 |
echo "$begin, $eventTime"; ?>
|
1865 |
<?php
|
1866 |
$recurs = str_split( $event->event_recur, 1 );
|
1867 |
$recur = $recurs[0];
|
1868 |
+
$every = ( isset( $recurs[1] ) ) ? str_replace( $recurs[0], '', $event->event_recur ) : 1;
|
1869 |
|
1870 |
// Interpret the DB values into something human readable
|
1871 |
switch ( $recur ) {
|
1935 |
}
|
1936 |
?>
|
1937 |
</table>
|
1938 |
+
<ul class="links">
|
1939 |
+
<?php if ( get_option( 'mc_event_approve' ) == 'true' ) { ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1940 |
<li>
|
1941 |
+
<a <?php echo ( isset( $_GET['limit'] ) && $_GET['limit'] == 'published' ) ? 'class="active-link" aria-current="true"' : ''; ?>
|
1942 |
href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&limit=published' ); ?>"><?php _e( 'Published', 'my-calendar' ); ?></a>
|
1943 |
</li>
|
1944 |
<li>
|
1945 |
+
<a <?php echo ( isset( $_GET['limit'] ) && $_GET['limit'] == 'reserved' ) ? 'class="active-link" aria-current="true"' : ''; ?>
|
1946 |
href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&limit=reserved' ); ?>"><?php _e( 'Reserved', 'my-calendar' ); ?></a>
|
1947 |
</li>
|
1948 |
<li>
|
1949 |
+
<a <?php echo ( isset( $_GET['restrict'] ) && $_GET['restrict'] == 'archived' ) ? 'class="active-link" aria-current="true"' : ''; ?>
|
1950 |
href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&restrict=archived' ); ?>"><?php _e( 'Archived', 'my-calendar' ); ?></a>
|
1951 |
</li>
|
1952 |
+
<?php } ?>
|
1953 |
+
<?php if ( ( function_exists( 'akismet_http_post' ) || function_exists( 'bs_checker' ) ) && $allow_filters ) { ?>
|
1954 |
<li>
|
1955 |
+
<a <?php echo ( isset( $_GET['restrict'] ) && $_GET['restrict'] == 'flagged' ) ? 'class="active-link" aria-current="true"' : ''; ?>
|
1956 |
+
href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&restrict=flagged&filter=1' ); ?>"><?php _e( 'Spam', 'my-calendar' ); ?></a>
|
1957 |
+
</li>
|
1958 |
+
<?php } ?>
|
1959 |
+
<?php if ( get_option( 'mc_event_approve' ) == 'true' ) { ?>
|
1960 |
+
<li>
|
1961 |
+
<a <?php echo ( isset( $_GET['limit'] ) && $_GET['limit'] == 'all' || ( ! isset( $_GET['limit'] ) && ! isset( $_GET['restrict'] ) ) ) ? 'class="active-link" aria-current="true"' : ''; ?>
|
1962 |
href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&limit=all' ); ?>"><?php _e( 'All', 'my-calendar' ); ?></a>
|
1963 |
</li>
|
1964 |
+
<?php } ?>
|
1965 |
+
</ul>
|
1966 |
+
<?php
|
1967 |
echo $filtered;
|
1968 |
$num_pages = ceil( $items / $items_per_page );
|
1969 |
if ( $num_pages > 1 ) {
|
2460 |
$id = (int) $id;
|
2461 |
$output = '';
|
2462 |
if ( $instance == true ) {
|
2463 |
+
$sql = "SELECT * FROM " . my_calendar_event_table() . " WHERE occur_id=$id ORDER BY occur_begin ASC";
|
2464 |
} else {
|
2465 |
+
$sql = "SELECT * FROM " . my_calendar_event_table() . " WHERE occur_event_id=$id ORDER BY occur_begin ASC";
|
2466 |
}
|
2467 |
$results = $wpdb->get_results( $sql );
|
2468 |
if ( is_array( $results ) && is_admin() ) {
|
my-calendar-events.php
CHANGED
@@ -536,6 +536,7 @@ function mc_get_event_post( $event_id ) {
|
|
536 |
return $event->event_post;
|
537 |
}
|
538 |
}
|
|
|
539 |
return false;
|
540 |
}
|
541 |
|
536 |
return $event->event_post;
|
537 |
}
|
538 |
}
|
539 |
+
|
540 |
return false;
|
541 |
}
|
542 |
|
my-calendar-group-manager.php
CHANGED
@@ -1088,7 +1088,7 @@ function mc_list_groups() {
|
|
1088 |
<?php
|
1089 |
$recurs = str_split( $event->event_recur, 1 );
|
1090 |
$recur = $recurs[0];
|
1091 |
-
$every = ( isset( $recurs[1] ) ) ? $recurs[
|
1092 |
|
1093 |
// Interpret the DB values into something human readable
|
1094 |
switch ( $recur ) {
|
1088 |
<?php
|
1089 |
$recurs = str_split( $event->event_recur, 1 );
|
1090 |
$recur = $recurs[0];
|
1091 |
+
$every = ( isset( $recurs[1] ) ) ? str_replace( $recurs[0], '', $event->event_recur ) : 1;
|
1092 |
|
1093 |
// Interpret the DB values into something human readable
|
1094 |
switch ( $recur ) {
|
my-calendar-limits.php
CHANGED
@@ -254,8 +254,12 @@ function mc_limit_string( $type = '', $ltype = '', $lvalue = '' ) {
|
|
254 |
$current_location = $lvalue;
|
255 |
}
|
256 |
} else {
|
257 |
-
$location = isset( $_GET['ltype'] ) ? urldecode( $_GET['ltype'] ) : $location;
|
258 |
-
|
|
|
|
|
|
|
|
|
259 |
}
|
260 |
switch ( $location ) {
|
261 |
case "name" :
|
@@ -314,7 +318,7 @@ function mc_limit_string( $type = '', $ltype = '', $lvalue = '' ) {
|
|
314 |
$limit_string .= mc_access_limit( $_GET['access'] );
|
315 |
}
|
316 |
|
317 |
-
return $limit_string;
|
318 |
}
|
319 |
|
320 |
function mc_access_limit( $access ) {
|
254 |
$current_location = $lvalue;
|
255 |
}
|
256 |
} else {
|
257 |
+
$location = isset( $_GET['ltype'] ) ? urldecode( $_GET['ltype'] ) : $location;
|
258 |
+
if ( isset( $_GET['loc'] ) ) {
|
259 |
+
$current_location = isset( $_GET['loc'] ) ? urldecode( $_GET['loc'] ) : $current_location;
|
260 |
+
} else if ( isset( $_GET['lvalue'] ) ) {
|
261 |
+
$current_location = isset( $_GET['lvalue'] ) ? urldecode( $_GET['lvalue'] ) : $current_location;
|
262 |
+
}
|
263 |
}
|
264 |
switch ( $location ) {
|
265 |
case "name" :
|
318 |
$limit_string .= mc_access_limit( $_GET['access'] );
|
319 |
}
|
320 |
|
321 |
+
return apply_filters( 'mc_location_limit_sql', $limit_string, $ltype, $lvalue );
|
322 |
}
|
323 |
|
324 |
function mc_access_limit( $access ) {
|
my-calendar-output.php
CHANGED
@@ -261,8 +261,8 @@ function my_calendar_draw_event( $event, $type = "calendar", $process_date, $tim
|
|
261 |
if ( strpos( $event_title, 'href' ) === false && $type != 'mini' && $type != 'list' ) {
|
262 |
if ( get_option( 'mc_open_uri' ) == 'true' ) {
|
263 |
$details_link = esc_url( mc_get_details_link( $event ) );
|
264 |
-
$wrap = "<a href='$details_link' class='url summary$has_image'>";
|
265 |
-
$balance = "</a>";
|
266 |
} else {
|
267 |
$wrap = "<a href='#$uid-$day_id-$type-details' class='url summary$has_image'>";
|
268 |
$balance = "</a>";
|
@@ -1059,10 +1059,10 @@ function my_calendar( $name, $format, $category, $time = 'month', $ltype = '', $
|
|
1059 |
'smonth' => $smonth,
|
1060 |
'sday' => $sday
|
1061 |
);
|
1062 |
-
|
|
|
1063 |
$hash_args = array(
|
1064 |
'name' => $name,
|
1065 |
-
'category' => $category,
|
1066 |
'above' => $above,
|
1067 |
'below' => $below,
|
1068 |
'ltype' => $ltype,
|
261 |
if ( strpos( $event_title, 'href' ) === false && $type != 'mini' && $type != 'list' ) {
|
262 |
if ( get_option( 'mc_open_uri' ) == 'true' ) {
|
263 |
$details_link = esc_url( mc_get_details_link( $event ) );
|
264 |
+
$wrap = ( _mc_is_url( $details_link ) ) ? "<a href='$details_link' class='url summary$has_image'>" : '<span class="no-link">';
|
265 |
+
$balance = ( _mc_is_url( $details_link ) ) ? "</a>" : '</span>';
|
266 |
} else {
|
267 |
$wrap = "<a href='#$uid-$day_id-$type-details' class='url summary$has_image'>";
|
268 |
$balance = "</a>";
|
1059 |
'smonth' => $smonth,
|
1060 |
'sday' => $sday
|
1061 |
);
|
1062 |
+
|
1063 |
+
// args used in Md5 hash cannot include 'time', 'category', or 'format', since those can be changed by navigation.
|
1064 |
$hash_args = array(
|
1065 |
'name' => $name,
|
|
|
1066 |
'above' => $above,
|
1067 |
'below' => $below,
|
1068 |
'ltype' => $ltype,
|
my-calendar-print.php
CHANGED
@@ -48,6 +48,7 @@ echo $head;
|
|
48 |
'ltype' => $ltype,
|
49 |
'lvalue' => $lvalue
|
50 |
);
|
|
|
51 |
echo my_calendar( 'print', 'calendar', $category, $time, $ltype, $lvalue, 'mc-print-view', '', '', null, null, 'none', 'none' );
|
52 |
$return_url = ( get_option( 'mc_uri' ) != '' && ! is_numeric( get_option( 'mc_uri' ) ) ) ? mc_get_uri( false, $args ) : home_url();
|
53 |
$return_url = apply_filters( 'mc_print_return_url', $return_url, $category, $time, $ltype, $lvalue );
|
48 |
'ltype' => $ltype,
|
49 |
'lvalue' => $lvalue
|
50 |
);
|
51 |
+
|
52 |
echo my_calendar( 'print', 'calendar', $category, $time, $ltype, $lvalue, 'mc-print-view', '', '', null, null, 'none', 'none' );
|
53 |
$return_url = ( get_option( 'mc_uri' ) != '' && ! is_numeric( get_option( 'mc_uri' ) ) ) ? mc_get_uri( false, $args ) : home_url();
|
54 |
$return_url = apply_filters( 'mc_print_return_url', $return_url, $category, $time, $ltype, $lvalue );
|
my-calendar-settings.php
CHANGED
@@ -570,8 +570,7 @@ function edit_my_calendar_config() {
|
|
570 |
|
571 |
<div class="inside">
|
572 |
<form method="post" action="<?php echo admin_url( "admin.php?page=my-calendar-config#mc-output" ); ?>">
|
573 |
-
<div><input type="hidden" name="_wpnonce"
|
574 |
-
value="<?php echo wp_create_nonce( 'my-calendar-nonce' ); ?>"/></div>
|
575 |
<input type="submit" name="save" class="button screen-reader-text" value="<?php _e( 'Save Output Settings', 'my-calendar' ); ?>" /></p>
|
576 |
<fieldset>
|
577 |
<legend><?php _e( 'Calendar Link Targets', 'my-calendar' ); ?></legend>
|
570 |
|
571 |
<div class="inside">
|
572 |
<form method="post" action="<?php echo admin_url( "admin.php?page=my-calendar-config#mc-output" ); ?>">
|
573 |
+
<div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce( 'my-calendar-nonce' ); ?>"/></div>
|
|
|
574 |
<input type="submit" name="save" class="button screen-reader-text" value="<?php _e( 'Save Output Settings', 'my-calendar' ); ?>" /></p>
|
575 |
<fieldset>
|
576 |
<legend><?php _e( 'Calendar Link Targets', 'my-calendar' ); ?></legend>
|
my-calendar-styles.php
CHANGED
@@ -189,8 +189,7 @@ function edit_my_calendar_styles() {
|
|
189 |
?>
|
190 |
<fieldset>
|
191 |
<p>
|
192 |
-
<label
|
193 |
-
for="mc_css_file"><?php _e( 'Select My Calendar Theme', 'my-calendar' ); ?></label>
|
194 |
<select name="mc_css_file" id="mc_css_file"><?php
|
195 |
if ( ! empty( $files ) ) {
|
196 |
echo "<optgroup label='" . __( 'Your Custom Stylesheets', 'my-calendar' ) . "'>\n";
|
189 |
?>
|
190 |
<fieldset>
|
191 |
<p>
|
192 |
+
<label for="mc_css_file"><?php _e( 'Select My Calendar Theme', 'my-calendar' ); ?></label>
|
|
|
193 |
<select name="mc_css_file" id="mc_css_file"><?php
|
194 |
if ( ! empty( $files ) ) {
|
195 |
echo "<optgroup label='" . __( 'Your Custom Stylesheets', 'my-calendar' ) . "'>\n";
|
my-calendar-templates.php
CHANGED
@@ -799,7 +799,7 @@ function mc_image_data( $e, $event ) {
|
|
799 |
function mc_event_recur_string( $event, $real_begin_date ) {
|
800 |
$recurs = str_split( $event->event_recur, 1 );
|
801 |
$recur = $recurs[0];
|
802 |
-
$every
|
803 |
$month_date = date( 'dS', strtotime( $real_begin_date ) );
|
804 |
$day_name = date_i18n( 'l', strtotime( $real_begin_date ) );
|
805 |
$week_number = mc_ordinal( week_of_month( date( 'j', strtotime( $real_begin_date ) ) ) + 1 );
|
799 |
function mc_event_recur_string( $event, $real_begin_date ) {
|
800 |
$recurs = str_split( $event->event_recur, 1 );
|
801 |
$recur = $recurs[0];
|
802 |
+
$every = ( isset( $recurs[1] ) ) ? str_replace( $recurs[0], '', $event->event_recur ) : 1;
|
803 |
$month_date = date( 'dS', strtotime( $real_begin_date ) );
|
804 |
$day_name = date_i18n( 'l', strtotime( $real_begin_date ) );
|
805 |
$week_number = mc_ordinal( week_of_month( date( 'j', strtotime( $real_begin_date ) ) ) + 1 );
|
my-calendar.php
CHANGED
@@ -7,7 +7,7 @@ Author: Joseph C Dolson
|
|
7 |
Author URI: http://www.joedolson.com
|
8 |
Text Domain: my-calendar
|
9 |
Domain Path: lang
|
10 |
-
Version: 2.5.
|
11 |
*/
|
12 |
/* Copyright 2009-2017 Joe Dolson (email : joe@joedolson.com)
|
13 |
|
@@ -30,7 +30,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
30 |
} // Exit if accessed directly
|
31 |
|
32 |
global $mc_version, $wpdb;
|
33 |
-
$mc_version = '2.5.
|
34 |
|
35 |
register_activation_hook( __FILE__, 'mc_plugin_activated' );
|
36 |
register_deactivation_hook( __FILE__, 'mc_plugin_deactivated' );
|
@@ -87,7 +87,7 @@ include( dirname( __FILE__ ) . '/my-calendar-generator.php' );
|
|
87 |
// Enable internationalisation
|
88 |
add_action( 'plugins_loaded', 'mc_load_textdomain' );
|
89 |
function mc_load_textdomain() {
|
90 |
-
// don't change this; just gradually remove shipped translations
|
91 |
load_plugin_textdomain( 'my-calendar', false, dirname( plugin_basename( __FILE__ ) ) . '/lang' );
|
92 |
}
|
93 |
|
7 |
Author URI: http://www.joedolson.com
|
8 |
Text Domain: my-calendar
|
9 |
Domain Path: lang
|
10 |
+
Version: 2.5.13
|
11 |
*/
|
12 |
/* Copyright 2009-2017 Joe Dolson (email : joe@joedolson.com)
|
13 |
|
30 |
} // Exit if accessed directly
|
31 |
|
32 |
global $mc_version, $wpdb;
|
33 |
+
$mc_version = '2.5.13';
|
34 |
|
35 |
register_activation_hook( __FILE__, 'mc_plugin_activated' );
|
36 |
register_deactivation_hook( __FILE__, 'mc_plugin_deactivated' );
|
87 |
// Enable internationalisation
|
88 |
add_action( 'plugins_loaded', 'mc_load_textdomain' );
|
89 |
function mc_load_textdomain() {
|
90 |
+
// don't change this; just gradually remove shipped translations if .org trans become complete.
|
91 |
load_plugin_textdomain( 'my-calendar', false, dirname( plugin_basename( __FILE__ ) ) . '/lang' );
|
92 |
}
|
93 |
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.joedolson.com/donate/
|
|
4 |
Tags: calendar, dates, times, event, events, scheduling, schedule, event manager, event calendar, class, concert, venue, location, box office, tickets, registration
|
5 |
Requires at least: 4.4
|
6 |
Tested up to: 4.8
|
7 |
-
Stable tag: 2.5.
|
8 |
Text domain: my-calendar
|
9 |
License: GPLv2 or later
|
10 |
|
@@ -34,7 +34,7 @@ Easy to use for anybody, My Calendar provides enormous flexibility for designers
|
|
34 |
* Edit occurrences of recurring events
|
35 |
* Rich permissions handling to restrict access to parts of My Calendar
|
36 |
* Email notification to administrator when events are scheduled or reserved
|
37 |
-
* Post to Twitter when events are created
|
38 |
* Location Manager for frequently used venues
|
39 |
* Fetch events from a remote database. (Sharing events in a network of sites.)
|
40 |
* Import events from [Kieran O'Shea's Calendar plugin](http://wordpress.org/extend/plugins/calendar/)
|
@@ -83,6 +83,18 @@ Translating my plug-ins is always appreciated. Visit <a href="https://translate.
|
|
83 |
|
84 |
== Changelog ==
|
85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
= 2.5.12 =
|
87 |
|
88 |
* Bug fix: missing space in conflict identification
|
4 |
Tags: calendar, dates, times, event, events, scheduling, schedule, event manager, event calendar, class, concert, venue, location, box office, tickets, registration
|
5 |
Requires at least: 4.4
|
6 |
Tested up to: 4.8
|
7 |
+
Stable tag: 2.5.13
|
8 |
Text domain: my-calendar
|
9 |
License: GPLv2 or later
|
10 |
|
34 |
* Edit occurrences of recurring events
|
35 |
* Rich permissions handling to restrict access to parts of My Calendar
|
36 |
* Email notification to administrator when events are scheduled or reserved
|
37 |
+
* Post to Twitter when events are created with [WP to Twitter](http://wordpress.org/extend/plugins/wp-to-twitter/)
|
38 |
* Location Manager for frequently used venues
|
39 |
* Fetch events from a remote database. (Sharing events in a network of sites.)
|
40 |
* Import events from [Kieran O'Shea's Calendar plugin](http://wordpress.org/extend/plugins/calendar/)
|
83 |
|
84 |
== Changelog ==
|
85 |
|
86 |
+
= 2.5.13 =
|
87 |
+
|
88 |
+
* Bug fix: Categories can not be part of the md5 hash used to identify unique tables (breaks AJAX nav for categories)
|
89 |
+
* Bug fix: recurring scheduling for week-days only not functional when 7 days or greater
|
90 |
+
* Bug fix: Print view location filters broken
|
91 |
+
* Bug fix: Make AJAX scripting aware of which other scripts are enabled.
|
92 |
+
* Bug fix: Sort scheduled dates for event by date
|
93 |
+
* Bug fix: JetPack Grunion Contact form interfered with TinyMCE in contexts outside of post editor (https://github.com/Automattic/jetpack/issues/7598)
|
94 |
+
* Bug fix: ensure date is retained if datepicker disabled
|
95 |
+
* Bug fix: archived events filter marked as active when not
|
96 |
+
*
|
97 |
+
|
98 |
= 2.5.12 =
|
99 |
|
100 |
* Bug fix: missing space in conflict identification
|