From 341c5477fed9c1af12dd6408b0d9ff3ba2529f61 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Tue, 15 Jan 2008 21:45:48 +0000 Subject: [PATCH] Monotone-Parent: 1b7e32ba68558b623b1ae7c252ace2acac8680fd Monotone-Revision: a157cdab1102429e9d7b24c14204d15f42e774f5 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2008-01-15T21:45:48 Monotone-Branch: ca.inverse.sogo --- .../English.lproj/Localizable.strings | 37 ++ UI/Scheduler/French.lproj/Localizable.strings | 49 +- UI/Scheduler/UIxCalFilterPanel.m | 6 +- UI/Scheduler/UIxCalendarSelector.h | 4 +- UI/Scheduler/UIxCalendarSelector.m | 17 +- UI/Scheduler/UIxComponentEditor.m | 2 +- UI/Scheduler/UIxRecurrenceEditor.h | 9 +- UI/Scheduler/UIxRecurrenceEditor.m | 136 +----- UI/Scheduler/product.plist | 5 + .../SchedulerUI/UIxComponentEditor.wox | 6 +- .../SchedulerUI/UIxRecurrenceEditor.wox | 458 +++++++++--------- UI/WebServerResources/SchedulerUI.js | 2 + .../UIxAppointmentEditor.css | 2 +- UI/WebServerResources/UIxComponentEditor.js | 15 +- UI/WebServerResources/UIxRecurrenceEditor.css | 31 +- UI/WebServerResources/UIxRecurrenceEditor.js | 151 ++++-- UI/WebServerResources/skycalendar.js | 2 +- 17 files changed, 490 insertions(+), 442 deletions(-) diff --git a/UI/Scheduler/English.lproj/Localizable.strings b/UI/Scheduler/English.lproj/Localizable.strings index afd17300e..21caedce7 100644 --- a/UI/Scheduler/English.lproj/Localizable.strings +++ b/UI/Scheduler/English.lproj/Localizable.strings @@ -21,6 +21,14 @@ "Friday" = "Friday"; "Saturday" = "Saturday"; +"Sun" = "Sun"; +"Mon" = "Mon"; +"Tue" = "Tue"; +"Wed" = "Wed"; +"Thu" = "Thu"; +"Fri" = "Fri"; +"Sat" = "Sat"; + "a2_Sunday" = "Su"; "a2_Monday" = "Mo"; "a2_Tuesday" = "Tu"; @@ -291,6 +299,35 @@ "cycle_end_never" = "cycle_end_never"; "cycle_end_until" = "cycle_end_until"; +"Recurrence pattern" = "Recurrence pattern"; +"Range of recurrence" = "Range of recurrence"; + +"Repeat" = "Repeat"; +"Daily" = "Daily"; +"Weekly" = "Weekly"; +"Monthly" = "Monthly"; +"Yearly" = "Yearly"; +"Every" = "Every"; +"Days" = "Days"; +"Week(s)" = "Week(s)"; +"On" = "On"; +"Month(s)" = "Month(s)"; +"The" = "The"; +"Recur on day(s)" = "Recur on day(s)"; +"Year(s)" = "Year(s)"; +"cycle_of" = "of"; +"No end date" = "No end date"; +"Create" = "Create"; +"Appointment(s)" = "Appointment(s)"; +"Repeat until" = "Repeat until"; + +"First" = "First"; +"Second" = "Second"; +"Third" = "Third"; +"Fourth" = "Fourth"; +"Fift" = "Fift"; +"Last" = "Last"; + /* Appointment categories */ "category_NONE" = "None"; diff --git a/UI/Scheduler/French.lproj/Localizable.strings b/UI/Scheduler/French.lproj/Localizable.strings index e53cd927e..2ade48742 100644 --- a/UI/Scheduler/French.lproj/Localizable.strings +++ b/UI/Scheduler/French.lproj/Localizable.strings @@ -21,6 +21,14 @@ "Friday" = "Vendredi"; "Saturday" = "Samedi"; +"Sun" = "Dim"; +"Mon" = "Lun"; +"Tue" = "Mar"; +"Wed" = "Mer"; +"Thu" = "Jeu"; +"Fri" = "Ven"; +"Sat" = "Sam"; + "a2_Sunday" = "Di"; "a2_Monday" = "Lu"; "a2_Tuesday" = "Ma"; @@ -289,6 +297,35 @@ "cycle_end_never" = "Jamais"; "cycle_end_until" = "À la date :"; +"Recurrence pattern" = "Définir la fréquence"; +"Range of recurrence" = "Fenêtre de répétition"; + +"Repeat" = "Répétition"; +"Daily" = "quotidienne"; +"Weekly" = "hebdomadaire"; +"Monthly" = "mensuelle"; +"Yearly" = "annuelle"; +"Every" = "Chaque"; +"Days" = "Jours"; +"Week(s)" = "Semaine(s)"; +"On" = "Le"; +"Month(s)" = "Mois"; +"The" = "Le"; +"Recur on day(s)" = "Se répète le(s) jour(s)"; +"Year(s)" = "Année(s)"; +"cycle_of" = "de"; +"No end date" = "Pas de date de fin"; +"Create" = "Créer"; +"Appointment(s)" = "Rendez-vous"; +"Repeat until" = "Répéter jusqu'à"; + +"First" = "premier"; +"Second" = "deuxieme"; +"Third" = "troisieme"; +"Fourth" = "quatrieme"; +"Fift" = "cinquieme"; +"Last" = "dernier"; + /* Appointment categories */ "category_NONE" = "Aucune"; @@ -315,12 +352,12 @@ "category_VACATION" = "Absence"; "repeat_NEVER" = "Ne se répète pas"; -"repeat_DAILY" = "quotidiennement"; -"repeat_WEEKLY" = "hebdomadairement"; -"repeat_BI-WEEKLY" = "bi-hebdomadairement"; -"repeat_EVERY WEEKDAY" = "les jours ouvrables"; -"repeat_MONTHLY" = "mensuellement"; -"repeat_YEARLY" = "annuellement"; +"repeat_DAILY" = "Quotidiennement"; +"repeat_WEEKLY" = "Hebdomadairement"; +"repeat_BI-WEEKLY" = "Bi-hebdomadairement"; +"repeat_EVERY WEEKDAY" = "Chaque jour ouvrable"; +"repeat_MONTHLY" = "Mensuellement"; +"repeat_YEARLY" = "Annuellement"; "repeat_CUSTOM" = "Personnaliser..."; "reminder_NONE" = "Pas de rappel"; diff --git a/UI/Scheduler/UIxCalFilterPanel.m b/UI/Scheduler/UIxCalFilterPanel.m index 43437336a..f29c65941 100644 --- a/UI/Scheduler/UIxCalFilterPanel.m +++ b/UI/Scheduler/UIxCalFilterPanel.m @@ -104,11 +104,7 @@ static NSArray *filters = nil; - (NSString *) filterLabel { -#if 1 - return [[[self context] page] labelForKey: [self valueForKey:@"filter"]]; -#else - return [self valueForKey: @"filter"]; -#endif + return [self labelForKey: [self valueForKey:@"filter"]]; } - (NSString *) selectedFilter diff --git a/UI/Scheduler/UIxCalendarSelector.h b/UI/Scheduler/UIxCalendarSelector.h index 21feda2f8..05ffa06f6 100644 --- a/UI/Scheduler/UIxCalendarSelector.h +++ b/UI/Scheduler/UIxCalendarSelector.h @@ -1,6 +1,6 @@ /* UIxCalendarSelector.h - this file is part of SOGo * - * Copyright (C) 2007 Inverse groupe conseil + * Copyright (C) 2007, 2008 Inverse groupe conseil * * Author: Wolfgang Sourdeau * @@ -41,6 +41,8 @@ - (void) setCurrentCalendar: (NSDictionary *) newCalendar; - (NSDictionary *) currentCalendar; +- (WOResponse *) calendarsListAction; + @end #endif /* UIXCALENDARSELECTOR_H */ diff --git a/UI/Scheduler/UIxCalendarSelector.m b/UI/Scheduler/UIxCalendarSelector.m index 1e49c8e24..743375ee7 100644 --- a/UI/Scheduler/UIxCalendarSelector.m +++ b/UI/Scheduler/UIxCalendarSelector.m @@ -1,6 +1,6 @@ /* UIxCalendarSelector.m - this file is part of SOGo * - * Copyright (C) 2007 Inverse groupe conseil + * Copyright (C) 2007, 2008 Inverse groupe conseil * * Author: Wolfgang Sourdeau * @@ -24,8 +24,11 @@ #import #import +#import + #import +#import #import #import @@ -171,4 +174,16 @@ colorForNumber (unsigned int number) keysWithFormat: @"color: %{color}; background-color: %{color};"]; } +- (WOResponse *) calendarsListAction +{ + WOResponse *response; + + response = [self responseWithStatus: 200]; + [response setHeader: @"text/plain; charset=utf-8" + forKey: @"content-type"]; + [response appendContentString: [[self calendars] jsonRepresentation]]; + + return response; +} + @end /* UIxCalendarSelector */ diff --git a/UI/Scheduler/UIxComponentEditor.m b/UI/Scheduler/UIxComponentEditor.m index c4c23f380..cbf8ead5a 100644 --- a/UI/Scheduler/UIxComponentEditor.m +++ b/UI/Scheduler/UIxComponentEditor.m @@ -226,7 +226,7 @@ iCalRecurrenceRule *rule; [self setRepeat: @"CUSTOM"]; - + rule = [[component recurrenceRules] lastObject]; // If we either have an end date or a recurrence count diff --git a/UI/Scheduler/UIxRecurrenceEditor.h b/UI/Scheduler/UIxRecurrenceEditor.h index 281ee0e22..8cc3d24d1 100644 --- a/UI/Scheduler/UIxRecurrenceEditor.h +++ b/UI/Scheduler/UIxRecurrenceEditor.h @@ -28,23 +28,16 @@ @interface UIxRecurrenceEditor : UIxComponent { NSString *item, *repeat; + NSCalendarDate *aptStartDate; } -- (NSArray *) dailyRadioList; - -- (NSArray *) weeklyCheckBoxList; - -- (NSArray *) dayMonthList; - (NSArray *) monthlyRepeatList; - (NSArray *) monthlyDayList; -- (NSArray *) monthlyRadioList; - (NSArray *) yearlyMonthList; - (NSArray *) yearlyDayList; -- (NSArray *) rangeRadioList; - (NSArray *) repeatList; -- (NSArray *) yearlyRadioList; - (void) setItem: (NSString *) theItem; - (NSString *) item; diff --git a/UI/Scheduler/UIxRecurrenceEditor.m b/UI/Scheduler/UIxRecurrenceEditor.m index edb9a661f..3a733aa23 100644 --- a/UI/Scheduler/UIxRecurrenceEditor.m +++ b/UI/Scheduler/UIxRecurrenceEditor.m @@ -36,71 +36,14 @@ return self; } -// -// Items used for the "Daily" recurrences. -// -- (NSArray *) dailyRadioList -{ - static NSArray *dailyItems = nil; - - if (!dailyItems) - { - dailyItems = [NSArray arrayWithObjects: @"Every", @"Every weekday", nil]; - [dailyItems retain]; - } - - return dailyItems; -} - - -// -// Items used for the "Weekly" recurrences. -// -- (NSArray *) weeklyCheckBoxList -{ - static NSArray *dayItems = nil; - - if (!dayItems) - { - dayItems = [NSArray arrayWithObjects: @"Mon", @"Tue", @"Wed", - @"Thu", @"Fri", @"Sat", @"Sun", nil]; - [dayItems retain]; - } - - return dayItems; -} - - -// -// Items used for the "Montly" recurrences". -// -- (NSArray *) dayMonthList -{ - static NSArray *dayMonthList = nil; - - if (!dayMonthList) - { - int i; - - dayMonthList = [[NSMutableArray alloc] init]; - - for (i = 1; i <= 31; i++) - { - [(NSMutableArray *)dayMonthList addObject: [NSString stringWithFormat: @"%d", i]]; - } - } - - return dayMonthList; -} - - (NSArray *) monthlyRepeatList { static NSArray *monthlyRepeatList = nil; if (!monthlyRepeatList) { - monthlyRepeatList = [NSArray arrayWithObjects: @"FIRST", @"SECOND", @"THIRD", - @"FOURTH", @"FIFT", @"LAST", nil]; + monthlyRepeatList = [NSArray arrayWithObjects: @"First", @"Second", @"Third", + @"Fourth", @"Fift", @"Last", nil]; [monthlyRepeatList retain]; } @@ -113,54 +56,24 @@ if (!monthlyDayList) { - monthlyDayList = [NSArray arrayWithObjects: @"SUNDAY", @"MONDAY", @"TUESDAY", - @"WEDNESDAY", @"THURSDAY", @"FRIDAY", - @"SATURDAY", @"DAYOFTHEMONTH", nil]; + monthlyDayList = [NSArray arrayWithObjects: @"Sunday", @"Monday", @"Tuesday", + @"Wednesday", @"Thursday", @"Friday", + @"Saturday", @"DayOfTheMonth", nil]; [monthlyDayList retain]; } return monthlyDayList; } -- (NSArray *) monthlyRadioList -{ - static NSArray *monthlyRadioList = nil; - - if (!monthlyRadioList) - { - monthlyRadioList = [NSArray arrayWithObjects: @"The", @"Recur on day(s)", nil]; - [monthlyRadioList retain]; - } - - return monthlyRadioList; -} - - -// -// Items used for the "Yearly" recurrences". -// -- (NSArray *) yearlyRadioList -{ - static NSArray *yearlyRadioList = nil; - - if (!yearlyRadioList) - { - yearlyRadioList = [NSArray arrayWithObjects: @"Every", @"Every", nil]; - [yearlyRadioList retain]; - } - - return yearlyRadioList; -} - - (NSArray *) yearlyMonthList { static NSArray *yearlyMonthList = nil; if (!yearlyMonthList) { - yearlyMonthList = [NSArray arrayWithObjects: @"JANUARY", @"FEBRUARY", @"MARCH", - @"APRIL", @"MAY", @"JUNE", @"JULY", @"AUGUST", - @"SEPTEMBER", @"OCTOBER", @"NOVEMBER", @"DECEMBER", nil]; + yearlyMonthList = [NSArray arrayWithObjects: @"January", @"February", @"March", + @"April", @"May", @"June", @"July", @"August", + @"September", @"October", @"November", @"December", nil]; [yearlyMonthList retain]; } @@ -173,34 +86,15 @@ if (!yearlyDayList) { - yearlyDayList = [NSArray arrayWithObjects: @"SUNDAY", @"MONDAY", @"TUESDAY", - @"WEDNESDAY", @"THURSDAY", @"FRIDAY", - @"SATURDAY", nil]; + yearlyDayList = [NSArray arrayWithObjects: @"Sunday", @"Monday", @"Tuesday", + @"Wednesday", @"Thursday", @"Friday", + @"Saturday", nil]; [yearlyDayList retain]; } return yearlyDayList; } - -// -// Items used to specify the range. -// -- (NSArray *) rangeRadioList -{ - static NSArray *rangeRadioList = nil; - - if (!rangeRadioList) - { - rangeRadioList = [NSArray arrayWithObjects: @"No end date", @"Create", - @"Repeat until", nil]; - [rangeRadioList retain]; - } - - return rangeRadioList; -} - - // // Items used to specify what kind of recurrence we want // @@ -210,8 +104,8 @@ if (!repeatList) { - repeatList = [NSArray arrayWithObjects: @"DAILY", @"WEEKLY", - @"MONTHLY", @"YEARLY", nil]; + repeatList = [NSArray arrayWithObjects: @"Daily", @"Weekly", + @"Monthly", @"Yearly", nil]; [repeatList retain]; } @@ -232,11 +126,11 @@ return item; } -- (NSString *) itemText +- (NSString *) itemText { NSString *text; - text = [self labelForKey: [NSString stringWithFormat: @"repeat_%@", item]]; + text = [self labelForKey: item]; return text; } diff --git a/UI/Scheduler/product.plist b/UI/Scheduler/product.plist index 2485672cb..5b1c52486 100644 --- a/UI/Scheduler/product.plist +++ b/UI/Scheduler/product.plist @@ -44,6 +44,11 @@ protectedBy = "View"; pageName = "UIxCalDateSelector"; }; + calendarslist = { + protectedBy = "View"; + pageName = "UIxCalendarSelector"; + actionName = "calendarsList"; + }; eventslist = { protectedBy = "View"; actionClass = "UIxCalListingActions"; diff --git a/UI/Templates/SchedulerUI/UIxComponentEditor.wox b/UI/Templates/SchedulerUI/UIxComponentEditor.wox index c2fc0e844..f9f1a7bad 100644 --- a/UI/Templates/SchedulerUI/UIxComponentEditor.wox +++ b/UI/Templates/SchedulerUI/UIxComponentEditor.wox @@ -76,9 +76,11 @@ + string="itemRepeatText" var:selection="repeat" + />