Displaying Bank Holidays in the Agenda
How to display Bank Holidays in the Agenda?
Bank Holidays (Christmas, Easter, etc.) can be defined via the Administration section>Sites>Options for Agenda and Vacations
Once defined, these days are highlighted in the vacation planning but not in the Agenda.
The following patch applies to Ovid 5-7-8. With this patch, bank holidays are displayed in the vacation planning AND in the agenda.
Modify calmonth.php
In the calmonth.php file, locate line 129.
you should find a line looking like this:
$this->daynumbername = $dday;
Before this line, insert the following code:
/* ajout TC pour détection jours fériés */
include_once $GLOBALS['babInstallPath']."utilit/nwdaysincl.php";
$this->titledate = bab_longdate($mktime,false);
$this->nonWorkingDays = array_merge(bab_getNonWorkingDays($this->year), bab_getNonWorkingDays($this->year+1));
$this->nonworking = isset($this->nonWorkingDays[$this->cdate]);
$this->nonworking_text = $this->nonworking ? $this->nonWorkingDays[$this->cdate] : '';
/* fin ajout TC */
Modify calmonth.html
In the template called calmonth.html, locate line 80:Replace the block starting with<!--#if currentmonth "== 1" --><td <!--#if currentday "== 1" --> class="BabTodayEvent" <!--#else currentday --> class="BabMonthCalendarCurentDayBackground" <!--#endif currentday --> >
<!--#else currentmonth -->that gives a class to the td tag by:<!--#if currentmonth "== 1" -->
<!--#if nonworking -->
<td class="nonworking" title="{ titledate } : { nonworking_text }">
<!--#else nonworking -->
<td <!--#if currentday "== 1" --> class="BabTodayEvent" <!--#else currentday --> class="BabMonthCalendarCurentDayBackground" <!--#endif currentday --> >
<!--#endif nonworking -->
<!--#else currentmonth -->
Don't take offense, dear contributor, but your explanation wasn't the best possible :)
But I figured it out, and modified your articles so Ovidentia users can use your contribution.
Content of the edit :
Template modification is :
on line 80, find
<!--#if currentmonth "== 1" -->
<td <!--#if currentday "== 1" --> class="BabTodayEvent" <!--#else currentday --> class="BabMonthCalendarCurentDayBackground" <!--#endif currentday --> >
<!--#else currentmonth -->
You must replace the previous code by the following :
<!--#if currentmonth "== 1" -->
<!--#if nonworking -->
<td class="nonworking" title="{ titledate } : { nonworking_text }">
<!--#else nonworking -->
<td <!--#if currentday "== 1" --> class="BabTodayEvent" <!--#else currentday --> class="BabMonthCalendarCurentDayBackground" <!--#endif currentday --> >
<!--#endif nonworking -->
<!--#else currentmonth -->
And then it works without breaking everything ;)
I tried it on a local version, and calendar view is all messed up. Could you be more precise with your template modification ?
Thanks
Frédéric Meurin