Mantis 139: dialog boxes of webcalendar

Monotone-Parent: fe1684747671de5019121d2155b79f89a2f376eb
Monotone-Revision: 525ded69698841a7e49b579ace037c3eca060d31

Monotone-Author: crobert@inverse.ca
Monotone-Date: 2009-09-21T14:10:16
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
C Robert 2009-09-21 14:10:16 +00:00
parent 78cf07608f
commit facfdaadd3
17 changed files with 74 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2009-09-21 Cyril Robert <crobert@inverse.ca>
* UI/Scheduler/UIxCalMainActions.m (displayNameForUrl:): The calendar's
display name is extracted from the URL for web calendars.
* UI/Scheduler/UIxCalendarProperties.m (webCalendarURL, isWebCalendar):
Added new methods to display a web calendar's url in the properties dialog.
2009-09-21 Ludovic Marcotte <lmarcotte@inverse.ca>
* Updated the contact import text to be more

View File

@ -536,3 +536,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";

View File

@ -536,3 +536,4 @@ vtodo_class2 = "(Důvěrný úkol)";
"Subscribe to a web calendar..." = "Subscribe to a web calendar...";
"URL of the Calendar" = "URL of the Calendar";
"Web Calendar" = "Web Calendar";

View File

@ -536,3 +536,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";

View File

@ -536,3 +536,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";

View File

@ -536,3 +536,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";

View File

@ -536,3 +536,4 @@ vtodo_class2 = "(Vertrauliche Aufgabe)";
"Subscribe to a web calendar..." = "Subscribe to a web calendar...";
"URL of the Calendar" = "URL of the Calendar";
"Web Calendar" = "Web Calendar";

View File

@ -536,3 +536,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";

View File

@ -536,3 +536,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";

View File

@ -536,3 +536,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";

View File

@ -536,3 +536,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";

View File

@ -42,7 +42,7 @@
WOResponse *response;
SOGoWebAppointmentFolder *folder;
NSURL *url;
NSString *name;
NSString *name, *displayName;
NSMutableDictionary *rc;
int imported = 0;
@ -53,7 +53,8 @@
url = [NSURL URLWithString: [r formValueForKey: @"url"]];
if (url)
{
[[self clientObject] newFolderWithName: @"Web Calendar"
displayName = [self displayNameForUrl: [r formValueForKey: @"url"]];
[[self clientObject] newFolderWithName: displayName
nameInContainer: &name];
[self saveUrl: url forCalendar: name];
folder = [[self clientObject] lookupName: name
@ -65,7 +66,7 @@
if (imported >= 0)
{
[rc setObject: @"Web Calendar" forKey: @"displayname"];
[rc setObject: displayName forKey: @"displayname"];
[rc setObject: name forKey: @"name"];
}
else
@ -82,6 +83,20 @@
return response;
}
- (NSString *) displayNameForUrl: (NSString *) calendarURL
{
NSString *rc, *tmp;
tmp = [calendarURL lastPathComponent];
if (tmp)
rc = [tmp stringByDeletingSuffix: @".ics"];
else
rc = [self labelForKey: @"Web Calendar"];
return rc;
}
- (void) saveUrl: (NSURL *) calendarURL
forCalendar: (NSString *) calendarName
{

View File

@ -172,6 +172,31 @@
[calendar setShowCalendarTasks: new];
}
- (NSString *) webCalendarURL
{
NSUserDefaults *settings;
NSMutableDictionary *calendarSettings;
NSMutableDictionary *webCalendars;
NSString *rc;
settings = [[context activeUser] userSettings];
calendarSettings = [settings objectForKey: @"Calendar"];
if (calendarSettings)
{
webCalendars = [calendarSettings objectForKey: @"WebCalendars"];
if (webCalendars)
rc = [webCalendars objectForKey: [calendar nameInContainer]];
}
return rc;
}
- (BOOL) isWebCalendar
{
return ([self webCalendarURL] != nil);
}
- (BOOL) shouldTakeValuesFromRequest: (WORequest *) request
inContext: (WOContext*) context
{

View File

@ -536,3 +536,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";

View File

@ -23,6 +23,12 @@
class="textField"
var:value="calendarName"
/></span></div>
<var:if condition="isWebCalendar"
><div const:id="webCalendarUrl"><span class="label"
><var:string label:value="URL:"/></span
><span class="content" var:title="webCalendarURL"
><var:string var:value="webCalendarURL"/>
</span></div></var:if>
<div><span class="label"><var:string
label:value="Color:"
/></span><span class="content"

View File

@ -41,3 +41,7 @@ DIV#buttons
INPUT#calendarSyncTag
{ width: 7em; }
#webCalendarUrl span.content
{ white-space:nowrap;
overflow: hidden; }

View File

@ -1,6 +1,9 @@
/* -*- Mode: java; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
function onLoadCalendarProperties() {
if ($("webCalendarUrl"))
window.resizeTo(500,360);
var colorButton = $("colorButton");
var calendarColor = $("calendarColor");
colorButton.setStyle({ "backgroundColor": calendarColor.value, display: "inline" });