From eaa17bf3175f2e4656fd3431919bf0ce19096738 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Fri, 16 Jul 2010 00:08:27 +0200 Subject: [PATCH] Add holidays through dialog. --- kronolith/js/kronolith.js | 28 +++++++++++++++++++++++++++- kronolith/templates/chunks/calendar.php | 25 +++++++++++++++++++++++++ kronolith/templates/index/index.inc | 1 + 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index 1656fa24c..81338a4c3 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -1138,7 +1138,9 @@ KronolithCore = { }, this); $H(Kronolith.conf.calendars.holiday).each(function(cal) { - this.insertCalendarInList('holiday', cal.key, cal.value); + if (cal.value.show) { + this.insertCalendarInList('holiday', cal.key, cal.value); + } }, this); }, @@ -2848,6 +2850,20 @@ KronolithCore = { $('kronolithCalendarremoteId').setValue(calendar); } break; + case 'holiday': + $('kronolithCalendarholidayDriver').update(); + $H(Kronolith.conf.calendars.holiday).each(function(calendar) { + calendar = calendar.value; + if (calendar.show) { + return; + } + $('kronolithCalendarholidayDriver').insert( + new Element('option', { value: calendar.name }) + .setStyle({ color: calendar.fg, backgroundColor: calendar.bg }) + .insert(calendar.name) + ); + }); + break; } $('kronolithCalendar' + type + 'Id').clear(); var color = '#', i; @@ -3363,6 +3379,16 @@ KronolithCore = { this.colorPicker.hide(); } var data = form.serialize({ hash: true }); + + if (data.type == 'holiday') { + this.insertCalendarInList('holiday', data.driver, Kronolith.conf.calendars.holiday[data.driver]); + this.toggleCalendar('holiday', data.driver); + form.down('.kronolithCalendarSave').enable(); + this.closeRedBox(); + this.go(this.lastLocation); + return; + } + if (data.name.empty()) { this.showNotifications([ { type: 'horde.warning', message: data.type == 'tasklists' ? Kronolith.text.no_tasklist_title : Kronolith.text.no_calendar_title }]); $('kronolithCalendar' + data.type + 'Name').focus(); diff --git a/kronolith/templates/chunks/calendar.php b/kronolith/templates/chunks/calendar.php index 3901cccfb..6b185b0ab 100644 --- a/kronolith/templates/chunks/calendar.php +++ b/kronolith/templates/chunks/calendar.php @@ -270,4 +270,29 @@ $file_upload = $GLOBALS['browser']->allowFileUploads(); + +
+ + + + + +
+
+ +
+ +
+ " class="kronolithCalendarSave button ok" /> + " class="kronolithCalendarDelete button ko" /> + +
+
+ +
+ + diff --git a/kronolith/templates/index/index.inc b/kronolith/templates/index/index.inc index 8e9a273f2..c874fa86d 100644 --- a/kronolith/templates/index/index.inc +++ b/kronolith/templates/index/index.inc @@ -146,6 +146,7 @@

+ ">+

-- 2.11.0