From: Jan Schneider Date: Thu, 4 Nov 2010 21:00:31 +0000 (+0100) Subject: Better ask for confirmation before deleting a calendar. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=25106d01f007b1c4d3b7d3b6947a2d150e58a613;p=horde.git Better ask for confirmation before deleting a calendar. --- diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index 7784724d9..3f010788c 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -4532,10 +4532,19 @@ KronolithCore = { e.stop(); break; } else if (elt.hasClassName('kronolithCalendarDelete')) { - elt.disable(); var form = elt.up('form'), type = form.id.replace(/kronolithCalendarForm/, ''), calendar = $F('kronolithCalendar' + type + 'Id'); + + if ((type == 'tasklists' && + !window.confirm(Kronolith.text.delete_tasklist)) || + (type != 'tasklists' && + !window.confirm(Kronolith.text.delete_calendar))) { + e.stop(); + break; + } + + elt.disable(); this.doAction('deleteCalendar', { type: type, calendar: calendar }, function(r) { diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index 25c573242..c15b26509 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -307,6 +307,8 @@ class Kronolith 'no_url' => _("You must specify a URL."), 'no_calendar_title' => _("The calendar title must not be empty."), 'no_tasklist_title' => _("The task list title must not be empty."), + 'delete_calendar' => _("Are you sure you want to delete this calendar and all the events in it?"), + 'delete_tasklist' => _("Are you sure you want to delete this task list and all the tasks in it?"), 'wrong_auth' => _("The authentication information you specified wasn't accepted."), 'geocode_error' => _("Unable to locate requested address"), 'wrong_date_format' => sprintf(_("You used an unknown date format \"%s\". Please try something like \"%s\"."), '#{wrong}', '#{right}'),