From 2fb7423fc0fcf9095b77d3951155b4c74ffc1446 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 --- .../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 b4e6e6884c..c1df0f7727 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tmpl @@ -48,7 +48,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; @@ -59,6 +59,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'; @@ -213,16 +219,18 @@ h1 select { width: 20em; } + +


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

@@ -334,13 +342,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.2