From 1a676c69c653197a51bab6d3c53447b5d26c7b4b Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Thu, 27 Oct 2016 14:31:29 -0400 Subject: [PATCH] Fix for the agenda view dates shown. Looping through each recurrence and finding the correct one to output the date. --- index.php | 6 ++-- models/front/events/list.php | 1 - views/front/events/agenda.html | 63 ++++++++++++++++++---------------- 3 files changed, 37 insertions(+), 33 deletions(-) diff --git a/index.php b/index.php index 6c067fe..413dff4 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ * Plugin Name: GLM Members Database Events * Plugin URI: http://www.gaslightmedia.com/ * Description: Gaslight Media Members Database. - * Version: 1.5.1 + * Version: 1.5.2 * Author: Chuck Scott * Author URI: http://www.gaslightmedia.com/ * License: GPL2 @@ -20,7 +20,7 @@ * @package glmMembersDatabaseEventsAddOn * @author Chuck Scott * @license http://www.gaslightmedia.com Gaslightmedia - * @version 1.5.1 + * @version 1.5.2 */ /* @@ -38,7 +38,7 @@ * so that we're sure the other add-ons see an up to date * version from this plugin. */ -define('GLM_MEMBERS_EVENTS_PLUGIN_VERSION', '1.5.1'); +define('GLM_MEMBERS_EVENTS_PLUGIN_VERSION', '1.5.2'); define('GLM_MEMBERS_EVENTS_PLUGIN_DB_VERSION', '0.0.22'); // This is the minimum version of the GLM Members DB plugin require for this plugin. diff --git a/models/front/events/list.php b/models/front/events/list.php index 96fb993..00d3c39 100644 --- a/models/front/events/list.php +++ b/models/front/events/list.php @@ -644,7 +644,6 @@ class GlmMembersFront_events_list extends GlmMembersFront_events_baseAction } else { $calendar_view = $calendar_view[0]['calendar_view']; } - // Compile template data $templateData = array( 'assetsUrl' => GLM_MEMBERS_EVENTS_PLUGIN_URL . 'assets/', diff --git a/views/front/events/agenda.html b/views/front/events/agenda.html index 24835d9..444f671 100644 --- a/views/front/events/agenda.html +++ b/views/front/events/agenda.html @@ -21,30 +21,35 @@

{$event.name}

-
- ( Occurring {$event.recurrences.0.from_date.date} - {if $event.recurrences.0.from_date.date != $event.recurrences.0.to_date.date} - - {$event.recurrences.0.to_date.date} - {else if $event.recurrences.0.specific_dates} - - {$event.recurrences.0.specific_dates|@end|date_format:"%m/%d/%Y"} - {/if} - - - {if $event.recurrences.0.day_of_week.names|@count < 7 && $event.recurrences.0.day_of_week.names|@count > 0 } - - on - {foreach $event.recurrences.0.day_of_week.names as $day} - {if $day == "Thursday"} - {$day|substr:0:4} - {else} - {$day|substr:0:3} - {/if} - {/foreach} - - - {/if} - ) -
+ {foreach $event.recurrences as $rec} + {if ($rec.from_date.timestamp == $rec.to_date.timestamp && $rec.from_date.timestamp == $date) + or ($date <= $rec.to_date.timestamp && $date >= $rec.from_date.timestamp )} +
+ ( Occurring {$rec.from_date.date} + {if $rec.from_date.date != $rec.to_date.date} + - {$rec.to_date.date} + {else if $rec.specific_dates} + - {$rec.specific_dates|@end|date_format:"%m/%d/%Y"} + {/if} + + + {if $rec.day_of_week.names|@count < 7 && $rec.day_of_week.names|@count > 0 } + + on + {foreach $rec.day_of_week.names as $day} + {if $day == "Thursday"} + {$day|substr:0:4} + {else} + {$day|substr:0:3} + {/if} + {/foreach} + + + {/if} + ) +
+ {/if} + {/foreach}
{if !$event.all_day} {if $event.starting_date|date_format:"%l:%M %P" == $event.ending_date|date_format:"%l:%M %P"} @@ -117,11 +122,11 @@ type: 'POST', url: '{$ajaxUrl}', data: dat, - beforeSend: function(){ + beforeSend: function(){ $(".event-overlay").show(); $(".loading").show(); }, - complete: function(){ + complete: function(){ $(".event-overlay").hide(); $(".loading").hide(); }, @@ -207,7 +212,7 @@ calendar.fullCalendar('render'); } else if ( $("#glm-event-view-select option:selected").val() === "agenda"){ - agenda.css("display", "block"); + agenda.css("display", "block"); calendar.fadeOut('slow', function(){}); } }); @@ -216,13 +221,13 @@ $(document).on("click", "button.fc-button", function () { eventsCalMonthAJAX(month_obj); }); - + var dates = $(".agenda-event-recur-dates"); dates.each( function (){ if( $(this).text().indexOf('-') < 0 ){ $(this).remove(); } }); - + }); -- 2.17.1