Added calendar default reminder support.
parent
f167475c91
commit
df3e9033f3
3
NEWS
3
NEWS
|
@ -2,7 +2,8 @@
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
New features
|
New features
|
||||||
-
|
- it's now possible to set a default reminder for calendar components
|
||||||
|
using SOGoCalendarDefaultReminder
|
||||||
|
|
||||||
Enhancements
|
Enhancements
|
||||||
- we now automatically convert <img src=data...> into file attachments
|
- we now automatically convert <img src=data...> into file attachments
|
||||||
|
|
|
@ -69,12 +69,10 @@
|
||||||
SOGoCalendarShouldDisplayWeekend = YES;
|
SOGoCalendarShouldDisplayWeekend = YES;
|
||||||
SOGoCalendarEventsDefaultClassification = "PUBLIC";
|
SOGoCalendarEventsDefaultClassification = "PUBLIC";
|
||||||
SOGoCalendarTasksDefaultClassification = "PUBLIC";
|
SOGoCalendarTasksDefaultClassification = "PUBLIC";
|
||||||
|
SOGoCalendarDefaultReminder = "NONE";
|
||||||
|
|
||||||
SOGoFreeBusyDefaultInterval = ( 7, 7 );
|
SOGoFreeBusyDefaultInterval = ( 7, 7 );
|
||||||
|
|
||||||
SOGoReminderEnabled = YES;
|
|
||||||
SOGoRemindWithASound = YES;
|
|
||||||
|
|
||||||
SOGoSearchMinimumWordLength = 2;
|
SOGoSearchMinimumWordLength = 2;
|
||||||
|
|
||||||
SOGoMailLabelsColors = {
|
SOGoMailLabelsColors = {
|
||||||
|
|
|
@ -183,14 +183,8 @@ extern NSString *SOGoWeekStartFirstFullWeek;
|
||||||
- (void) setCalendarTasksDefaultClassification: (NSString *) newValue;
|
- (void) setCalendarTasksDefaultClassification: (NSString *) newValue;
|
||||||
- (NSString *) calendarTasksDefaultClassification;
|
- (NSString *) calendarTasksDefaultClassification;
|
||||||
|
|
||||||
- (void) setReminderEnabled: (BOOL) newValue;
|
- (void) setCalendarDefaultReminder: (NSString *) newValue;
|
||||||
- (BOOL) reminderEnabled;
|
- (NSString *) calendarDefaultReminder;
|
||||||
|
|
||||||
- (void) setReminderTime: (NSString *) newValue;
|
|
||||||
- (NSString *) reminderTime;
|
|
||||||
|
|
||||||
- (void) setRemindWithASound: (BOOL) newValue;
|
|
||||||
- (BOOL) remindWithASound;
|
|
||||||
|
|
||||||
/* contacts */
|
/* contacts */
|
||||||
- (void) setContactsCategories: (NSArray *) newValues;
|
- (void) setContactsCategories: (NSArray *) newValues;
|
||||||
|
|
|
@ -59,29 +59,6 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek";
|
||||||
up = [SOGoUserProfileKlass userProfileWithType: SOGoUserProfileTypeDefaults
|
up = [SOGoUserProfileKlass userProfileWithType: SOGoUserProfileTypeDefaults
|
||||||
forUID: userId];
|
forUID: userId];
|
||||||
[up fetchProfile];
|
[up fetchProfile];
|
||||||
// if ([_defaults values])
|
|
||||||
// {
|
|
||||||
// BOOL b;
|
|
||||||
// b = NO;
|
|
||||||
|
|
||||||
// if (![[_defaults stringForKey: @"MessageCheck"] length])
|
|
||||||
// {
|
|
||||||
// [_defaults setObject: defaultMessageCheck forKey: @"MessageCheck"];
|
|
||||||
// b = YES;
|
|
||||||
// }
|
|
||||||
// if (![[_defaults stringForKey: @"TimeZone"] length])
|
|
||||||
// {
|
|
||||||
// [_defaults setObject: [serverTimeZone name] forKey: @"TimeZone"];
|
|
||||||
// b = YES;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (b)
|
|
||||||
// [_defaults synchronize];
|
|
||||||
|
|
||||||
|
|
||||||
// See explanation in -language
|
|
||||||
// [self invalidateLanguage];
|
|
||||||
// }
|
|
||||||
|
|
||||||
parent = [SOGoDomainDefaults defaultsForDomain: domainId];
|
parent = [SOGoDomainDefaults defaultsForDomain: domainId];
|
||||||
if (!parent)
|
if (!parent)
|
||||||
|
@ -706,34 +683,14 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek";
|
||||||
return [self stringForKey: @"SOGoCalendarTasksDefaultClassification"];
|
return [self stringForKey: @"SOGoCalendarTasksDefaultClassification"];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setReminderEnabled: (BOOL) newValue
|
- (void) setCalendarDefaultReminder: (NSString *) newValue
|
||||||
{
|
{
|
||||||
[self setBool: newValue forKey: @"SOGoReminderEnabled"];
|
[self setObject: newValue forKey: @"SOGoCalendarDefaultReminder"];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) reminderEnabled
|
- (NSString *) calendarDefaultReminder
|
||||||
{
|
{
|
||||||
return [self boolForKey: @"SOGoReminderEnabled"];
|
return [self stringForKey: @"SOGoCalendarDefaultReminder"];
|
||||||
}
|
|
||||||
|
|
||||||
- (void) setReminderTime: (NSString *) newValue
|
|
||||||
{
|
|
||||||
[self setObject: newValue forKey: @"SOGoReminderTime"];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSString *) reminderTime
|
|
||||||
{
|
|
||||||
return [self stringForKey: @"SOGoReminderTime"];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void) setRemindWithASound: (BOOL) newValue
|
|
||||||
{
|
|
||||||
[self setBool: newValue forKey: @"SOGoRemindWithASound"];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (BOOL) remindWithASound
|
|
||||||
{
|
|
||||||
return [self boolForKey: @"SOGoRemindWithASound"];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -111,18 +111,19 @@
|
||||||
"personalCalendar" = "Personal calendar";
|
"personalCalendar" = "Personal calendar";
|
||||||
"firstCalendar" = "First enabled calendar";
|
"firstCalendar" = "First enabled calendar";
|
||||||
|
|
||||||
"reminderTime_0000" = "0 minutes";
|
"reminder_NONE" = "No reminder";
|
||||||
"reminderTime_0005" = "5 minutes";
|
"reminder_5_MINUTES_BEFORE" = "5 minutes before";
|
||||||
"reminderTime_0010" = "10 minutes";
|
"reminder_10_MINUTES_BEFORE" = "10 minutes before";
|
||||||
"reminderTime_0015" = "15 minutes";
|
"reminder_15_MINUTES_BEFORE" = "15 minutes before";
|
||||||
"reminderTime_0030" = "30 minutes";
|
"reminder_30_MINUTES_BEFORE" = "30 minutes before";
|
||||||
"reminderTime_0100" = "1 hour";
|
"reminder_45_MINUTES_BEFORE" = "45 minutes before";
|
||||||
"reminderTime_0200" = "2 hours";
|
"reminder_1_HOUR_BEFORE" = "1 hour before";
|
||||||
"reminderTime_0400" = "4 hours";
|
"reminder_2_HOURS_BEFORE" = "2 hours before";
|
||||||
"reminderTime_0800" = "8 hours";
|
"reminder_5_HOURS_BEFORE" = "5 hours before";
|
||||||
"reminderTime_1200" = "1/2 day";
|
"reminder_15_HOURS_BEFORE" = "15 hours before";
|
||||||
"reminderTime_2400" = "1 day";
|
"reminder_1_DAY_BEFORE" = "1 day before";
|
||||||
"reminderTime_4800" = "2 days";
|
"reminder_2_DAYS_BEFORE" = "2 days before";
|
||||||
|
"reminder_1_WEEK_BEFORE" = "1 week before";
|
||||||
|
|
||||||
/* Mailer */
|
/* Mailer */
|
||||||
"Show subscribed mailboxes only" = "Show subscribed mailboxes only";
|
"Show subscribed mailboxes only" = "Show subscribed mailboxes only";
|
||||||
|
|
|
@ -58,11 +58,55 @@
|
||||||
workweek = from -> to
|
workweek = from -> to
|
||||||
identities */
|
identities */
|
||||||
|
|
||||||
|
static NSArray *reminderItems = nil;
|
||||||
|
static NSArray *reminderValues = nil;
|
||||||
|
|
||||||
@implementation UIxPreferences
|
@implementation UIxPreferences
|
||||||
|
|
||||||
|
+ (void) initialize
|
||||||
|
{
|
||||||
|
if (!reminderItems && !reminderValues)
|
||||||
|
{
|
||||||
|
reminderItems = [NSArray arrayWithObjects:
|
||||||
|
@"5_MINUTES_BEFORE",
|
||||||
|
@"10_MINUTES_BEFORE",
|
||||||
|
@"15_MINUTES_BEFORE",
|
||||||
|
@"30_MINUTES_BEFORE",
|
||||||
|
@"45_MINUTES_BEFORE",
|
||||||
|
@"-",
|
||||||
|
@"1_HOUR_BEFORE",
|
||||||
|
@"2_HOURS_BEFORE",
|
||||||
|
@"5_HOURS_BEFORE",
|
||||||
|
@"15_HOURS_BEFORE",
|
||||||
|
@"-",
|
||||||
|
@"1_DAY_BEFORE",
|
||||||
|
@"2_DAYS_BEFORE",
|
||||||
|
@"1_WEEK_BEFORE",
|
||||||
|
nil];
|
||||||
|
reminderValues = [NSArray arrayWithObjects:
|
||||||
|
@"-PT5M",
|
||||||
|
@"-PT10M",
|
||||||
|
@"-PT15M",
|
||||||
|
@"-PT30M",
|
||||||
|
@"-PT45M",
|
||||||
|
@"",
|
||||||
|
@"-PT1H",
|
||||||
|
@"-PT2H",
|
||||||
|
@"-PT5H",
|
||||||
|
@"-PT15H",
|
||||||
|
@"",
|
||||||
|
@"-P1D",
|
||||||
|
@"-P2D",
|
||||||
|
@"-P1W",
|
||||||
|
nil];
|
||||||
|
|
||||||
|
[reminderItems retain];
|
||||||
|
[reminderValues retain];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (id) init
|
- (id) init
|
||||||
{
|
{
|
||||||
//NSDictionary *locale;
|
|
||||||
SOGoDomainDefaults *dd;
|
SOGoDomainDefaults *dd;
|
||||||
|
|
||||||
if ((self = [super init]))
|
if ((self = [super init]))
|
||||||
|
@ -485,6 +529,54 @@
|
||||||
return [userDefaults calendarTasksDefaultClassification];
|
return [userDefaults calendarTasksDefaultClassification];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSArray *) reminderList
|
||||||
|
{
|
||||||
|
return reminderItems;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *) itemReminderText
|
||||||
|
{
|
||||||
|
NSString *text;
|
||||||
|
|
||||||
|
if ([item isEqualToString: @"-"])
|
||||||
|
text = item;
|
||||||
|
else
|
||||||
|
text = [self labelForKey: [NSString stringWithFormat: @"reminder_%@", item]];
|
||||||
|
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setReminder: (NSString *) theReminder
|
||||||
|
{
|
||||||
|
NSString *value;
|
||||||
|
int index;
|
||||||
|
|
||||||
|
index = NSNotFound;
|
||||||
|
value = @"NONE";
|
||||||
|
|
||||||
|
if (theReminder && [theReminder caseInsensitiveCompare: @"-"] != NSOrderedSame)
|
||||||
|
index = [reminderItems indexOfObject: theReminder];
|
||||||
|
|
||||||
|
if (index != NSNotFound)
|
||||||
|
value = [reminderValues objectAtIndex: index];
|
||||||
|
|
||||||
|
[userDefaults setCalendarDefaultReminder: value];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *) reminder
|
||||||
|
{
|
||||||
|
NSString *value;
|
||||||
|
int index;
|
||||||
|
|
||||||
|
value = [userDefaults calendarDefaultReminder];
|
||||||
|
index = [reminderValues indexOfObject: value];
|
||||||
|
|
||||||
|
if (index != NSNotFound)
|
||||||
|
return [reminderItems objectAtIndex: index];
|
||||||
|
|
||||||
|
return @"NONE";
|
||||||
|
}
|
||||||
|
|
||||||
- (NSArray *) hoursList
|
- (NSArray *) hoursList
|
||||||
{
|
{
|
||||||
static NSMutableArray *hours = nil;
|
static NSMutableArray *hours = nil;
|
||||||
|
@ -558,58 +650,6 @@
|
||||||
[userDefaults setFirstWeekOfYear: newFirstWeek];
|
[userDefaults setFirstWeekOfYear: newFirstWeek];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) reminderEnabled
|
|
||||||
{
|
|
||||||
return [userDefaults reminderEnabled];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void) setReminderEnabled: (BOOL) newValue
|
|
||||||
{
|
|
||||||
[userDefaults setReminderEnabled: newValue];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (BOOL) remindWithASound
|
|
||||||
{
|
|
||||||
return [userDefaults remindWithASound];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void) setRemindWithASound: (BOOL) newValue
|
|
||||||
{
|
|
||||||
[userDefaults setRemindWithASound: newValue];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSArray *) reminderTimesList
|
|
||||||
{
|
|
||||||
static NSArray *reminderTimesList = nil;
|
|
||||||
|
|
||||||
if (!reminderTimesList)
|
|
||||||
{
|
|
||||||
reminderTimesList = [NSArray arrayWithObjects: @"0000", @"0005",
|
|
||||||
@"0010", @"0015", @"0030", @"0100",
|
|
||||||
@"0200", @"0400", @"0800", @"1200",
|
|
||||||
@"2400", @"4800", nil];
|
|
||||||
[reminderTimesList retain];
|
|
||||||
}
|
|
||||||
|
|
||||||
return reminderTimesList;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSString *) itemReminderTimeText
|
|
||||||
{
|
|
||||||
return [self labelForKey:
|
|
||||||
[NSString stringWithFormat: @"reminderTime_%@", item]];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSString *) userReminderTime
|
|
||||||
{
|
|
||||||
return [userDefaults reminderTime];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void) setReminderTime: (NSString *) newTime
|
|
||||||
{
|
|
||||||
[userDefaults setReminderTime: newTime];
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Mailer */
|
/* Mailer */
|
||||||
- (void) setShowSubscribedFoldersOnly: (BOOL) showSubscribedFoldersOnly
|
- (void) setShowSubscribedFoldersOnly: (BOOL) showSubscribedFoldersOnly
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
/* UIxComponentEditor.h - this file is part of SOGo
|
/* UIxComponentEditor.h - this file is part of SOGo
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2012 Inverse inc.
|
* Copyright (C) 2006-2013 Inverse inc.
|
||||||
*
|
|
||||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
|
||||||
*
|
*
|
||||||
* This file is free software; you can redistribute it and/or modify
|
* This file is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -42,8 +40,6 @@
|
||||||
|
|
||||||
NSString *saveURL;
|
NSString *saveURL;
|
||||||
NSMutableArray *calendarList;
|
NSMutableArray *calendarList;
|
||||||
//NSMutableArray *organizerList;
|
|
||||||
//NSDictionary *organizerIdentity;
|
|
||||||
NSDictionary *organizerProfile;
|
NSDictionary *organizerProfile;
|
||||||
|
|
||||||
/* individual values */
|
/* individual values */
|
||||||
|
|
|
@ -1152,25 +1152,39 @@ iRANGE(2);
|
||||||
return reminderItems;
|
return reminderItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setReminder: (NSString *) theReminder
|
- (void) setReminder: (NSString *) theReminder
|
||||||
{
|
{
|
||||||
ASSIGN(reminder, theReminder);
|
ASSIGN(reminder, theReminder);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *) reminder
|
- (NSString *) reminder
|
||||||
{
|
{
|
||||||
return reminder;
|
if ([[self clientObject] isNew])
|
||||||
}
|
{
|
||||||
|
NSString *value;
|
||||||
|
int index;
|
||||||
|
|
||||||
|
value = [userDefaults calendarDefaultReminder];
|
||||||
|
index = [reminderValues indexOfObject: value];
|
||||||
|
|
||||||
|
if (index != NSNotFound)
|
||||||
|
return [reminderItems objectAtIndex: index];
|
||||||
|
|
||||||
|
return @"NONE";
|
||||||
|
}
|
||||||
|
|
||||||
- (void) setReminderQuantity: (NSString *) theReminderQuantity
|
return reminder;
|
||||||
{
|
}
|
||||||
ASSIGN(reminderQuantity, theReminderQuantity);
|
|
||||||
}
|
- (void) setReminderQuantity: (NSString *) theReminderQuantity
|
||||||
|
{
|
||||||
|
ASSIGN(reminderQuantity, theReminderQuantity);
|
||||||
|
}
|
||||||
|
|
||||||
- (NSString *) reminderQuantity
|
- (NSString *) reminderQuantity
|
||||||
{
|
{
|
||||||
return reminderQuantity;
|
return reminderQuantity;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *) itemReminderText
|
- (NSString *) itemReminderText
|
||||||
{
|
{
|
||||||
|
|
|
@ -204,6 +204,13 @@
|
||||||
const:id="tasksClassification"
|
const:id="tasksClassification"
|
||||||
const:name="tasksClassification"
|
const:name="tasksClassification"
|
||||||
string="itemClassificationText" selection="tasksDefaultClassification"/></dd>
|
string="itemClassificationText" selection="tasksDefaultClassification"/></dd>
|
||||||
|
<dt><var:string label:value="Default reminder :"/></dt>
|
||||||
|
<dd><var:popup list="reminderList" item="item"
|
||||||
|
const:disabledValue="-"
|
||||||
|
label:noSelectionString="reminder_NONE"
|
||||||
|
const:name="reminderList"
|
||||||
|
const:id="reminderList"
|
||||||
|
string="itemReminderText" var:selection="reminder"/></dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<label><var:string label:value="Categories"/></label>
|
<label><var:string label:value="Categories"/></label>
|
||||||
|
|
|
@ -250,17 +250,6 @@
|
||||||
<input type="checkbox" name="delegateReceiveUpdates" /> <var:string label:value="Keep sending me updates" /> -->
|
<input type="checkbox" name="delegateReceiveUpdates" /> <var:string label:value="Keep sending me updates" /> -->
|
||||||
</span>
|
</span>
|
||||||
</label>
|
</label>
|
||||||
<!--TODO: I'm not sure how to send this
|
|
||||||
<label><var:string label:value="Reminder:" />
|
|
||||||
<span class="content"><var:popup list="reminderList" item="item"
|
|
||||||
const:disabledValue="-"
|
|
||||||
label:noSelectionString="reminder_NONE"
|
|
||||||
const:name="reminderList"
|
|
||||||
const:id="reminderList"
|
|
||||||
string="itemReminderText"
|
|
||||||
var:selection="reminder"
|
|
||||||
const:onchange="?" /></span>
|
|
||||||
</label>-->
|
|
||||||
</var:if>
|
</var:if>
|
||||||
</div>
|
</div>
|
||||||
<var:if condition="hasAttendees">
|
<var:if condition="hasAttendees">
|
||||||
|
|
Loading…
Reference in New Issue