From 35bee670dc44ce0d5d8ab9842cbc83dd32b562cf Mon Sep 17 00:00:00 2001 From: Magnus Enger Date: Mon, 1 Dec 2014 14:26:37 +0100 Subject: [PATCH] Bug 11211 - Followups for calendar.tt - Make sure dates are sorted correctly in the table of unique/single events (This is the same fix that was done on bug 13289.) - Make sure weekdays are sorted correctly in the table of "Events repeating weekly", including taking the CalendarFirstDayOfWeek syspref into account - Some minor changes in the "Hints" text - Replace "Unique event" with "Single event" in the colour coded legend, since that is what is used on the rest of the page - Make headers above tables and tooltips in the main calendar more in line with the language used in the colour coded legend To test: - Apply this patch on top of the other patches on this bug - Add single events that span a month boundary - Check that dates are sorted chronologically in the "Single events" table - Add several weekly events and check that sorting is by the order of days in the week, not alphabetical - Toggle CalendarFirstDayOfWeek and check that the sorting in the "Events repeating weekly" table behaves as it should - Check that the other changes described above makes sense --- .../prog/en/modules/tools/calendar.tt | 41 ++++++++++++---------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/calendar.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/calendar.tt index 1aa5178..c50daf0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/calendar.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/calendar.tt @@ -1,4 +1,5 @@ [% USE 'JavaScript' %] +[% USE 'Koha' %] [% USE 'KohaDates' %] [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › [% branchname %] Calendar @@ -147,9 +148,9 @@ if ( single_events[dateString] != null) { return [true, "event", "Single event: "+single_events[dateString].title]; } else if ( yearly_events[dayMonth] != null ) { - return [true, "repeatableyearly", "Yearly event: "+yearly_events[dayMonth].title]; + return [true, "repeatableyearly", "Event repeating yearly: "+yearly_events[dayMonth].title]; } else if ( weekly_events[weekDay] != null ){ - return [true, "repeatableweekly", "Weekly event: "+weekly_events[weekDay].title]; + return [true, "repeatableweekly", "Event repeating weekly: "+weekly_events[weekDay].title]; } else { return [true, "normalday", "Normal day"]; } @@ -182,11 +183,12 @@ $("#branch").change(function(){ changeBranch(); }); - $("#weekly-events,#single-events").dataTable($.extend(true, {}, dataTablesDefaults, { - "sDom": 't', - "bPaginate": false - })); - $("#yearly-events").dataTable($.extend(true, {}, dataTablesDefaults, { + // Replace week number with week name + $("#weekly-events>tbody>tr").each(function(){ + var first_td_span = $(this).find('td').first().find('span'); + first_td_span.html(weekdays[first_td_span.html()]); + }); + $("#yearly-events,#weekly-events,#single-events").dataTable($.extend(true, {}, dataTablesDefaults, { "sDom": 't', "aoColumns": [ { "sType": "title-string" },null,null,null @@ -459,23 +461,23 @@ li.hoursentry input {

Hints

Key

Working day - Unique event + Single event Event repeating weekly Event repeating yearly

[% IF ( weekly_events ) %] -

Weekly - Repeatable Events

+

Events repeating weekly

@@ -488,11 +490,12 @@ li.hoursentry input { [% FOREACH event IN weekly_events %] - + [%# Make sure Sundays are sorted last, if Monday should be considered the first day of the week %] + [% IF Koha.Preference( 'CalendarFirstDayOfWeek' ) == 'Monday' && event.weekday == 0 %] + + [% ELSE %] + + [% END %]
- - [% event.weekday %][% event.weekday %][% event.title %] [% event.description %] @@ -512,7 +515,7 @@ li.hoursentry input { [% END %] [% IF ( yearly_events ) %] -

Yearly - Repeatable Events

+

Events repeating yearly

@@ -549,7 +552,7 @@ li.hoursentry input { [% END %] [% IF ( single_events ) %] -

Single Events

+

Single events

-- 1.9.1