Monotone-Parent: ab2613d820779df99f34c6d0ae2ec38908cae05f

Monotone-Revision: 28cde865644a3171d49fc0d08dad0efa39112fa2

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-04-19T21:30:25
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2010-04-19 21:30:25 +00:00
parent bed2246b97
commit add1d5441a
23 changed files with 124 additions and 49 deletions
+15
View File
@@ -1,3 +1,18 @@
2010-04-19 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/Appointments/SOGoWebAppointmentFolder.m (-setReloadOnLogin:)
(-reloadOnLogin): new accessors to the "AutoReloadedWebCalendars"
settings for the "Calendar" module.
* UI/Scheduler/UIxCalendarProperties.m (-setReloadOnLogin:)
(-reloadOnLogin): new accessors.
* SoObjects/Appointments/SOGoAppointmentFolders.m
(-reloadWebCalendars:): moved method from
UI/Scheduler/UIxCalMainActions.m and added a boolean parameter to
it indicating whether the "reload on login" setting should be
honoured or ignored.
2010-04-19 Francis Lachapelle <flachapelle@inverse.ca>
* UI/Scheduler/UIxComponentEditor.m (-_loadRRules): added support
@@ -30,6 +30,7 @@
@interface SOGoAppointmentFolders : SOGoParentFolder
- (NSArray *) webCalendarIds;
- (void) reloadWebCalendars: (BOOL) forceReload;
- (BOOL) hasProxyCalendarsWithWriteAccess: (BOOL) write
forUserWithLogin: (NSString *) userLogin;
@@ -284,8 +284,7 @@
rc = nil;
us = [[SOGoUser userWithLogin: [self ownerInContext: nil]]
userSettings];
us = [[SOGoUser userWithLogin: owner] userSettings];
tmp = [us objectForKey: @"Calendar"];
if (tmp)
{
@@ -300,6 +299,31 @@
return rc;
}
- (void) reloadWebCalendars: (BOOL) forceReload
{
SOGoUserSettings *settings;
NSMutableDictionary *calendarSettings, *webCalendars;
NSArray *calendarIds;
SOGoWebAppointmentFolder *folder;
NSString *name;
int count, max;
settings = [[SOGoUser userWithLogin: owner] userSettings];
calendarSettings = [settings objectForKey: @"Calendar"];
webCalendars = [calendarSettings objectForKey: @"WebCalendars"];
calendarIds = [webCalendars allKeys];
max = [calendarIds count];
for (count = 0; count < max; count++)
{
name = [calendarIds objectAtIndex: count];
folder = [self lookupName: name inContext: context acquire: NO];
if (folder
&& [folder isKindOfClass: [SOGoWebAppointmentFolder class]]
&& (forceReload || [folder reloadOnLogin]))
[folder loadWebCalendar: [webCalendars objectForKey: name]];
}
}
- (NSException *) _fetchPersonalFolders: (NSString *) sql
withChannel: (EOAdaptorChannel *) fc
{
@@ -30,6 +30,8 @@
- (int) loadWebCalendar: (NSString *) location;
- (void) deleteAllContent;
- (void) setReloadOnLogin: (BOOL) newReloadOnLogin;
- (BOOL) reloadOnLogin;
@end
@@ -73,21 +73,32 @@
return imported;
}
- (void) setReloadOnLogin: (BOOL) newReloadOnLogin
{
[self setFolderPropertyValue: [NSNumber numberWithBool: newReloadOnLogin]
inCategory: @"AutoReloadedWebCalendars"];
}
- (BOOL) reloadOnLogin
{
return [[self folderPropertyValueInCategory: @"AutoReloadedWebCalendars"]
boolValue];
}
- (NSException *) delete
{
NSException *error;
SOGoUserSettings *settings;
NSMutableDictionary *calSettings, *webCalendars;
NSMutableDictionary *webCalendars;
NSString *name;
settings = [[context activeUser] userSettings];
calSettings = [settings objectForKey: @"Calendar"];
webCalendars = [calSettings objectForKey: @"WebCalendars"];
name = [self nameInContainer];
error = [super delete];
if (!error)
{
settings = [[context activeUser] userSettings];
webCalendars = [[settings objectForKey: @"Calendar"]
objectForKey: @"WebCalendars"];
name = [self nameInContainer];
[webCalendars removeObjectForKey: name];
[settings synchronize];
}
+1 -1
View File
@@ -111,8 +111,8 @@
user = [[self alloc] initWithLogin: newLogin roles: newRoles trust: b];
if (user)
{
[user autorelease];
[cache registerUser: user withName: newLogin];
[user release];
}
}
if (newRoles)
+11 -1
View File
@@ -41,6 +41,8 @@
#import <NGExtensions/NSString+misc.h>
#import <NGExtensions/NSObject+Logs.h>
#import <Appointments/SOGoAppointmentFolders.h>
#import <SOGo/NSDictionary+Utilities.h>
#import <SOGo/NSDictionary+BSJSONAdditions.h>
#import <SOGo/SOGoCache.h>
@@ -124,7 +126,9 @@
WORequest *request;
WOCookie *authCookie;
SOGoWebAuthenticator *auth;
SOGoAppointmentFolders *calendars;
SOGoUserDefaults *ud;
SOGoUser *loggedInUser;
NSString *username, *password, *language;
NSArray *supportedLanguages;
@@ -167,12 +171,18 @@
supportedLanguages = [[SOGoSystemDefaults sharedSystemDefaults]
supportedLanguages];
loggedInUser = [SOGoUser userWithLogin: username];
[context setActiveUser: loggedInUser];
if (language && [supportedLanguages containsObject: language])
{
ud = [[SOGoUser userWithLogin: username] userDefaults];
ud = [loggedInUser userDefaults];
[ud setLanguage: language];
[ud synchronize];
}
calendars = [loggedInUser calendarsFolderInContext: context];
if ([calendars respondsToSelector: @selector (reloadWebCalendars:)])
[calendars reloadWebCalendars: NO];
}
else
{
@@ -541,3 +541,4 @@ vtodo_class2 = "(Tarefa Confidencial)";
"Subscribe to a web calendar..." = "Subscribe to a web calendar...";
"URL of the Calendar" = "URL of the Calendar";
"Web Calendar" = "Web Calendar";
"Reload on login" = "Reload on login";
@@ -541,3 +541,4 @@ vtodo_class2 = "(Důvěrný úkol)";
"Subscribe to a web calendar..." = "Přihlásit odběr vzdáleného kalendáře na webu";
"URL of the Calendar" = "Adresa vzdáleného kalendáře na webu";
"Web Calendar" = "Vzdálený kalendář na webu";
"Reload on login" = "Reload on login";
@@ -541,3 +541,4 @@ vtodo_class2 = "(Vertrouwelijke taak)";
"Subscribe to a web calendar..." = "Subscribe to a web calendar...";
"URL of the Calendar" = "URL of the Calendar";
"Web Calendar" = "Web Calendar";
"Reload on login" = "Reload on login";
@@ -541,3 +541,4 @@ vtodo_class2 = "(Confidential task)";
"Subscribe to a web calendar..." = "Subscribe to a web calendar...";
"URL of the Calendar" = "URL of the Calendar";
"Web Calendar" = "Web Calendar";
"Reload on login" = "Reload on login";
@@ -541,3 +541,4 @@ vtodo_class2 = "(Tâche confidentielle)";
"Subscribe to a web calendar..." = "S'inscrire à un agenda en ligne...";
"URL of the Calendar" = "URL de l'agenda";
"Web Calendar" = "Calendrier web";
"Reload on login" = "Rafraîchir à la connexion";
@@ -542,3 +542,4 @@ vtodo_class2 = "(Vertrauliche Aufgabe)";
"URL of the Calendar" = "URL des Kalenders";
"Web Calendar" = "Web-Kalender";
"Reload on login" = "Reload on login";
@@ -541,3 +541,4 @@ vtodo_class2 = "(Bizalmas feladat)";
"Subscribe to a web calendar..." = "Subscribe to a web calendar...";
"URL of the Calendar" = "URL of the Calendar";
"Web Calendar" = "Web Calendar";
"Reload on login" = "Reload on login";
@@ -541,3 +541,4 @@ vtodo_class2 = "(Attività confidenziale)";
"Subscribe to a web calendar..." = "Subscribe to a web calendar...";
"URL of the Calendar" = "URL of the Calendar";
"Web Calendar" = "Web Calendar";
"Reload on login" = "Reload on login";
@@ -541,3 +541,4 @@ vtodo_class2 = "(Confidential task)";
"Subscribe to a web calendar..." = "Subscribe to a web calendar...";
"URL of the Calendar" = "URL of the Calendar";
"Web Calendar" = "Web Calendar";
"Reload on login" = "Reload on login";
@@ -541,3 +541,4 @@ vtodo_class2 = "(Tarea confidencial)";
"Subscribe to a web calendar..." = "Subscribe to a web calendar...";
"URL of the Calendar" = "URL of the Calendar";
"Web Calendar" = "Web Calendar";
"Reload on login" = "Reload on login";
@@ -541,3 +541,4 @@ vtodo_class2 = "(Konfidentiell uppgift)";
"Subscribe to a web calendar..." = "Prenumrera på en webbkalender...";
"URL of the Calendar" = "URL till kalendern";
"Web Calendar" = "Webbkalender";
"Reload on login" = "Reload on login";
+1 -26
View File
@@ -124,32 +124,7 @@
- (WOResponse *) reloadWebCalendarsAction
{
SOGoUserSettings *settings;
NSMutableDictionary *calSettings, *webCalendars;
NSArray *calendarIds;
SOGoWebAppointmentFolder *folder;
NSString *name, *url;
int i, count, imported;
settings = [[context activeUser] userSettings];
calSettings = [settings objectForKey: @"Calendar"];
webCalendars = [calSettings objectForKey: @"WebCalendars"];
if (webCalendars)
{
calendarIds = [webCalendars allKeys];
count = [calendarIds count];
for (i = 0; i < count; i++)
{
name = [calendarIds objectAtIndex: i];
url = [webCalendars objectForKey: name];
folder = [[self clientObject] lookupName: name
inContext: context
acquire: NO];
if (folder)
imported = [folder loadWebCalendar: url];
}
}
[[self clientObject] reloadWebCalendars: YES];
return [self responseWith204];
}
+29 -10
View File
@@ -28,6 +28,7 @@
#import <SOGo/SOGoUser.h>
#import <SOGo/SOGoUserSettings.h>
#import <Appointments/SOGoAppointmentFolder.h>
#import <Appointments/SOGoWebAppointmentFolder.h>
#import "UIxCalendarProperties.h"
@@ -167,21 +168,37 @@
settings = [[context activeUser] userSettings];
calendarSettings = [settings objectForKey: @"Calendar"];
rc = nil;
if (calendarSettings)
{
webCalendars = [calendarSettings objectForKey: @"WebCalendars"];
if (webCalendars)
rc = [webCalendars objectForKey: [calendar nameInContainer]];
}
webCalendars = [calendarSettings objectForKey: @"WebCalendars"];
if (webCalendars)
rc = [webCalendars objectForKey: [calendar nameInContainer]];
else
rc = nil;
return rc;
}
- (BOOL) isWebCalendar
{
return ([self webCalendarURL] != nil);
return ([calendar isKindOfClass: [SOGoWebAppointmentFolder class]]);
}
- (void) setReloadOnLogin: (BOOL) newReloadOnLogin
{
if ([calendar respondsToSelector: @selector (setReloadOnLogin:)])
[(SOGoWebAppointmentFolder *) calendar
setReloadOnLogin: newReloadOnLogin];
}
- (BOOL) reloadOnLogin
{
BOOL rc;
if ([calendar respondsToSelector: @selector (reloadOnLogin)])
rc = [(SOGoWebAppointmentFolder *) calendar reloadOnLogin];
else
rc = NO;
return rc;
}
- (BOOL) shouldTakeValuesFromRequest: (WORequest *) request
@@ -196,10 +213,12 @@
- (id <WOActionResults>) savePropertiesAction
{
NSString *action = nil;
NSString *action;
if (reloadTasks)
action = @"refreshTasks()";
else
action = nil;
return [self jsCloseWithRefreshMethod: action];
}
@@ -541,3 +541,4 @@ vtodo_class2 = "(Tasg gyhoeddus)";
"Subscribe to a web calendar..." = "Subscribe to a web calendar...";
"URL of the Calendar" = "URL of the Calendar";
"Web Calendar" = "Web Calendar";
"Reload on login" = "Reload on login";
@@ -81,6 +81,12 @@
id="showCalendarTasks" var:checked="showCalendarTasks"
/><var:string label:value="Show tasks"
/></label></div>
<var:if condition="isWebCalendar"
><div><label
><input type="checkbox" const:class="checkBox"
id="reloadOnLogin" var:checked="reloadOnLogin"
/><var:string label:value="Reload on login"
/></label></div></var:if>
</fieldset>
<div id="buttons">
+3 -3
View File
@@ -2153,7 +2153,7 @@ function onCalendarModify(event) {
var url = ApplicationBaseURL + calendarID + "/properties";
var windowID = sanitizeWindowName(calendarID + " properties");
var width = 310;
var height = 266;
var height = 275;
var isWebCalendar = false;
if (UserSettings['Calendar']
&& UserSettings['Calendar']['WebCalendars']) {
@@ -2164,9 +2164,9 @@ function onCalendarModify(event) {
}
}
if (isWebCalendar)
height += 21;
height += 41;
else if (calendarID == "/personal")
height -= 25;
height -= 26;
var properties = window.open(url, windowID,
"width="+width+",height="+height+",resizable=0");