From a5080e4b5c1d2181f398ffecd65be2f44a47f6cc Mon Sep 17 00:00:00 2001 From: Garry Collum Date: Sat, 30 May 2009 12:29:11 -0400 Subject: [PATCH] Bug 3274: Patch to fix Holiday Exceptions radio button. Holiday exceptions only make since for repeatable holidays. Javascript showHoliday function was looking for a 'showTitle' id that no longer existed in the showHolidau form. Added a hidden input field because of the possibility of re-adding the title text input field at a later time. Added code to determine whether a holiday as an exception or not, so that the "Delete this program" radio button changes to "Delete this exception" because that is the program's true functionality if the holiday is an exception. Signed-off-by: Galen Charlton Signed-off-by: Henri-Damien LAURENT --- .../prog/en/modules/tools/holidays.tmpl | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tmpl index 4e85967f7b..242a3e1f20 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tmpl @@ -45,7 +45,7 @@ } // This function shows the "Show Holiday" panel // - function showHoliday (exceptionPosibility, dayName, day, month, year, weekDay, title, description) { + function showHoliday (exceptionPosibility, dayName, day, month, year, weekDay, title, description, isException) { $("#newHoliday").slideUp("fast"); $("#showHoliday").slideDown("fast"); document.getElementById('showDayname').value = dayName; @@ -56,6 +56,12 @@ document.getElementById('showDescription').value = description; document.getElementsByName('showWeekday')[0].value = weekDay; document.getElementById('showTitle').value = title; + + if (isException == 1) { + document.getElementById('showOperationDelLabel').innerHTML = 'Delete this exception.'; + } else { + document.getElementById('showOperationDelLabel').innerHTML = 'Delete this program.'; + } if (exceptionPosibility == 1) { document.getElementById('exceptionPosibility').style.display = 'inline'; @@ -210,16 +216,18 @@ h1 select { width: 20em; } + +


- . - /../img/more.gif" border="0" alt="More information" /> + + /../img/more.gif" border="0" alt="More information" />

@@ -331,13 +339,13 @@ h1 select { width: 20em; } var dateString = year + '/' + month + '/' + day; if (calendar.dateClicked) { if (holidays[dateString] != null) { - showHoliday(0, dayName, day, month, year, weekDay, holidays[dateString].title, holidays[dateString].description); + showHoliday(0, dayName, day, month, year, weekDay, holidays[dateString].title, holidays[dateString].description, 0); } else if (exception_holidays[dateString] != null) { - showHoliday(0, dayName, day, month, year, weekDay, exception_holidays[dateString].title, exception_holidays[dateString].description); + showHoliday(0, dayName, day, month, year, weekDay, exception_holidays[dateString].title, exception_holidays[dateString].description, 1); } else if (week_days[weekDay] != null) { - showHoliday(1, dayName, day, month, year, weekDay, week_days[weekDay].title, week_days[weekDay].description); + showHoliday(1, dayName, day, month, year, weekDay, week_days[weekDay].title, week_days[weekDay].description, 0); } else if (day_month_holidays[dayMonth] != null) { - showHoliday(1, dayName, day, month, year, weekDay, day_month_holidays[dayMonth].title, day_month_holidays[dayMonth].description); + showHoliday(1, dayName, day, month, year, weekDay, day_month_holidays[dayMonth].title, day_month_holidays[dayMonth].description, 0); } else { newHoliday(dayName, day, month, year, weekDay); } -- 2.39.5