mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-11 23:07:12 +00:00
merge of '0e8b1704a04c5c494b76cbc377b9d9075df6cb1a'
and '3665058235c9d303e295671add1811764b128816' Monotone-Parent: 0e8b1704a04c5c494b76cbc377b9d9075df6cb1a Monotone-Parent: 3665058235c9d303e295671add1811764b128816 Monotone-Revision: 4d711e074341810486c1842c6a345777cc3664bb Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2009-09-10T18:22:56 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
commit
b63b53fecd
32 files changed
+618
-39
No files matched your search
@@ -533,3 +533,6 @@ vtodo_class2 = "(Tarefa Confidencial)";
|
||||
"Open Task..." = "Open Task...";
|
||||
"Mark Completed" = "Mark Completed";
|
||||
"Delete Task" = "Delete Task";
|
||||
|
||||
"Subscribe to a web calendar..." = "Subscribe to a web calendar...";
|
||||
"URL of the Calendar" = "URL of the Calendar";
|
||||
@@ -533,3 +533,6 @@ vtodo_class2 = "(Důvěrný úkol)";
|
||||
"Open Task..." = "Open Task...";
|
||||
"Mark Completed" = "Mark Completed";
|
||||
"Delete Task" = "Delete Task";
|
||||
|
||||
"Subscribe to a web calendar..." = "Subscribe to a web calendar...";
|
||||
"URL of the Calendar" = "URL of the Calendar";
|
||||
@@ -533,3 +533,6 @@ vtodo_class2 = "(Vertrouwelijke taak)";
|
||||
"Open Task..." = "Open Task...";
|
||||
"Mark Completed" = "Mark Completed";
|
||||
"Delete Task" = "Delete Task";
|
||||
|
||||
"Subscribe to a web calendar..." = "Subscribe to a web calendar...";
|
||||
"URL of the Calendar" = "URL of the Calendar";
|
||||
@@ -533,3 +533,6 @@ vtodo_class2 = "(Confidential task)";
|
||||
"Open Task..." = "Open Task...";
|
||||
"Mark Completed" = "Mark Completed";
|
||||
"Delete Task" = "Delete Task";
|
||||
|
||||
"Subscribe to a web calendar..." = "Subscribe to a web calendar...";
|
||||
"URL of the Calendar" = "URL of the Calendar";
|
||||
@@ -533,3 +533,6 @@ vtodo_class2 = "(Tâche confidentielle)";
|
||||
"Open Task..." = "Ouvrir la tâche...";
|
||||
"Mark Completed" = "Marquer comme accomplie";
|
||||
"Delete Task" = "Supprimer la tâche";
|
||||
|
||||
"Subscribe to a web calendar..." = "S'inscrire à un agenda en ligne...";
|
||||
"URL of the Calendar" = "URL de l'agenda";
|
||||
@@ -31,6 +31,7 @@ SchedulerUI_OBJC_FILES = \
|
||||
UIxAptTableView.m \
|
||||
\
|
||||
UIxCalListingActions.m \
|
||||
UIxCalMainActions.m \
|
||||
\
|
||||
UIxAttendeesEditor.m \
|
||||
UIxComponentEditor.m \
|
||||
|
||||
@@ -533,3 +533,6 @@ vtodo_class2 = "(Vertrauliche Aufgabe)";
|
||||
"Open Task..." = "Open Task...";
|
||||
"Mark Completed" = "Mark Completed";
|
||||
"Delete Task" = "Delete Task";
|
||||
|
||||
"Subscribe to a web calendar..." = "Subscribe to a web calendar...";
|
||||
"URL of the Calendar" = "URL of the Calendar";
|
||||
@@ -533,3 +533,6 @@ vtodo_class2 = "(Bizalmas feladat)";
|
||||
"Open Task..." = "Open Task...";
|
||||
"Mark Completed" = "Mark Completed";
|
||||
"Delete Task" = "Delete Task";
|
||||
|
||||
"Subscribe to a web calendar..." = "Subscribe to a web calendar...";
|
||||
"URL of the Calendar" = "URL of the Calendar";
|
||||
@@ -533,3 +533,6 @@ vtodo_class2 = "(Attività confidenziale)";
|
||||
"Open Task..." = "Open Task...";
|
||||
"Mark Completed" = "Mark Completed";
|
||||
"Delete Task" = "Delete Task";
|
||||
|
||||
"Subscribe to a web calendar..." = "Subscribe to a web calendar...";
|
||||
"URL of the Calendar" = "URL of the Calendar";
|
||||
@@ -533,3 +533,6 @@ vtodo_class2 = "(Confidential task)";
|
||||
"Open Task..." = "Open Task...";
|
||||
"Mark Completed" = "Mark Completed";
|
||||
"Delete Task" = "Delete Task";
|
||||
|
||||
"Subscribe to a web calendar..." = "Subscribe to a web calendar...";
|
||||
"URL of the Calendar" = "URL of the Calendar";
|
||||
@@ -533,3 +533,6 @@ vtodo_class2 = "(Tarea confidencial)";
|
||||
"Open Task..." = "Open Task...";
|
||||
"Mark Completed" = "Mark Completed";
|
||||
"Delete Task" = "Delete Task";
|
||||
|
||||
"Subscribe to a web calendar..." = "Subscribe to a web calendar...";
|
||||
"URL of the Calendar" = "URL of the Calendar";
|
||||
@@ -20,7 +20,6 @@
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <SoObjects/SOGo/NSArray+Utilities.h>
|
||||
#import <SoObjects/SOGo/NSDictionary+Utilities.h>
|
||||
#import <SoObjects/SOGo/NSString+Utilities.h>
|
||||
|
||||
@@ -98,13 +97,12 @@
|
||||
{
|
||||
SOGoAppointmentFolder *folder;
|
||||
NSMutableDictionary *rc;
|
||||
NSArray *components;
|
||||
WORequest *request;
|
||||
WOResponse *response;
|
||||
NSString *fileContent;
|
||||
id data;
|
||||
iCalCalendar *additions;
|
||||
int i, count, imported;
|
||||
int imported;
|
||||
|
||||
imported = 0;
|
||||
rc = [NSMutableDictionary dictionary];
|
||||
@@ -124,29 +122,7 @@
|
||||
&& [fileContent hasPrefix: @"BEGIN:"])
|
||||
{
|
||||
additions = [iCalCalendar parseSingleFromSource: fileContent];
|
||||
if (additions)
|
||||
{
|
||||
components = [additions events];
|
||||
count = [components count];
|
||||
for (i = 0; i < count; i++)
|
||||
if ([folder importComponent: [components objectAtIndex: i]])
|
||||
imported++;
|
||||
components = [additions todos];
|
||||
count = [components count];
|
||||
for (i = 0; i < count; i++)
|
||||
if ([folder importComponent: [components objectAtIndex: i]])
|
||||
imported++;
|
||||
components = [additions journals];
|
||||
count = [components count];
|
||||
for (i = 0; i < count; i++)
|
||||
if ([folder importComponent: [components objectAtIndex: i]])
|
||||
imported++;
|
||||
components = [additions freeBusys];
|
||||
count = [components count];
|
||||
for (i = 0; i < count; i++)
|
||||
if ([folder importComponent: [components objectAtIndex: i]])
|
||||
imported++;
|
||||
}
|
||||
imported = [folder importCalendar: additions];
|
||||
}
|
||||
|
||||
[rc setObject: [NSNumber numberWithInt: imported]
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/* UIxCalMainActions.h - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2009 Inverse inc.
|
||||
*
|
||||
* Author: Cyril Robert <crobert@inverse.ca>
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This file is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef UIXCALMAINACTIONS_H
|
||||
#define UIXCALMAINACTIONS_H
|
||||
|
||||
#import <Common/WODirectAction+SOGo.h>
|
||||
|
||||
@interface UIxCalMainActions : WODirectAction
|
||||
|
||||
- (void) saveUrl: (NSURL *) calendarURL
|
||||
forCalendar: (NSString *) calendarName;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* UIXCALMAINACTIONS_H */
|
||||
@@ -0,0 +1,137 @@
|
||||
/* UIxCalMainActions.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2009 Inverse inc.
|
||||
*
|
||||
* Author: Cyril Robert <crobert@inverse.ca>
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This file is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import <NGObjWeb/WOContext.h>
|
||||
#import <NGObjWeb/WOContext+SoObjects.h>
|
||||
#import <NGObjWeb/WORequest.h>
|
||||
#import <NGObjWeb/WOResponse.h>
|
||||
|
||||
#import <SoObjects/SOGo/SOGoUser.h>
|
||||
#import <SoObjects/SOGo/NSDictionary+Utilities.h>
|
||||
#import <SoObjects/Appointments/SOGoWebAppointmentFolder.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentFolders.h>
|
||||
|
||||
#import "UIxCalMainActions.h"
|
||||
|
||||
@implementation UIxCalMainActions
|
||||
|
||||
- (WOResponse *) addWebCalendarAction
|
||||
{
|
||||
WORequest *r;
|
||||
WOResponse *response;
|
||||
SOGoWebAppointmentFolder *folder;
|
||||
NSURL *url;
|
||||
NSString *name;
|
||||
NSMutableDictionary *rc;
|
||||
int imported = 0;
|
||||
|
||||
r = [context request];
|
||||
rc = [NSMutableDictionary dictionary];
|
||||
|
||||
// Just a check
|
||||
url = [NSURL URLWithString: [r formValueForKey: @"url"]];
|
||||
if (url)
|
||||
{
|
||||
[[self clientObject] newFolderWithName: @"Web Calendar"
|
||||
nameInContainer: &name];
|
||||
[self saveUrl: url forCalendar: name];
|
||||
folder = [[self clientObject] lookupName: name
|
||||
inContext: context
|
||||
acquire: NO];
|
||||
if (folder)
|
||||
{
|
||||
imported = [folder loadWebCalendar: [r formValueForKey: @"url"]];
|
||||
|
||||
if (imported >= 0)
|
||||
{
|
||||
[rc setObject: @"Web Calendar" forKey: @"displayname"];
|
||||
[rc setObject: name forKey: @"name"];
|
||||
}
|
||||
else
|
||||
{
|
||||
[folder delete];
|
||||
}
|
||||
[rc setObject: [NSNumber numberWithInt: imported]
|
||||
forKey: @"imported"];
|
||||
}
|
||||
}
|
||||
|
||||
response = [self responseWithStatus: 200];
|
||||
[response appendContentString: [rc jsonRepresentation]];
|
||||
return response;
|
||||
}
|
||||
|
||||
- (void) saveUrl: (NSURL *) calendarURL
|
||||
forCalendar: (NSString *) calendarName
|
||||
{
|
||||
NSUserDefaults *settings;
|
||||
NSMutableDictionary *calSettings, *webCalendars;
|
||||
|
||||
settings = [[context activeUser] userSettings];
|
||||
calSettings = [settings objectForKey: @"Calendar"];
|
||||
webCalendars = [calSettings objectForKey: @"WebCalendars"];
|
||||
if (!webCalendars)
|
||||
{
|
||||
webCalendars = [NSMutableDictionary dictionary];
|
||||
[calSettings setObject: webCalendars forKey: @"WebCalendars"];
|
||||
}
|
||||
[webCalendars setObject: calendarURL forKey: calendarName];
|
||||
[settings synchronize];
|
||||
}
|
||||
|
||||
- (WOResponse *) reloadWebCalendarsAction
|
||||
{
|
||||
NSUserDefaults *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];
|
||||
}
|
||||
}
|
||||
|
||||
return [self responseWith204];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
@@ -49,6 +49,7 @@
|
||||
#import <SoObjects/Appointments/iCalEntityObject+SOGo.h>
|
||||
#import <SoObjects/Appointments/iCalPerson+SOGo.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentFolder.h>
|
||||
#import <SoObjects/Appointments/SOGoWebAppointmentFolder.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentFolders.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentObject.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentOccurence.h>
|
||||
@@ -806,12 +807,13 @@ iRANGE(2);
|
||||
|
||||
- (void) setComment: (NSString *) _value
|
||||
{
|
||||
ASSIGN (comment, _value);
|
||||
#warning should we do the same for "location" and "summary"? What about ContactsUI?
|
||||
ASSIGN (comment, [_value stringByReplacingString: @"\r\n" withString: @"\n"]);
|
||||
}
|
||||
|
||||
- (NSString *) comment
|
||||
{
|
||||
return comment;
|
||||
return [comment stringByReplacingString: @"\n" withString: @"\r\n"];
|
||||
}
|
||||
|
||||
- (BOOL) hasComment
|
||||
@@ -2044,18 +2046,23 @@ RANGE(2);
|
||||
{
|
||||
SOGoContentObject <SOGoComponentOccurence> *clientObject;
|
||||
SOGoUser *ownerUser;
|
||||
int rc = 0;
|
||||
int rc;
|
||||
|
||||
clientObject = [self clientObject];
|
||||
ownerUser = [SOGoUser userWithLogin: [clientObject ownerInContext: context]
|
||||
roles: nil];
|
||||
|
||||
if ([ownerUser isEqual: [context activeUser]])
|
||||
rc = [self ownerIsAttendee: ownerUser
|
||||
andClientObject: clientObject];
|
||||
if ([componentCalendar isKindOfClass: [SOGoWebAppointmentFolder class]])
|
||||
rc = 1;
|
||||
else
|
||||
rc = [self delegateIsAttendee: ownerUser
|
||||
andClientObject: clientObject];
|
||||
{
|
||||
if ([ownerUser isEqual: [context activeUser]])
|
||||
rc = [self ownerIsAttendee: ownerUser
|
||||
andClientObject: clientObject];
|
||||
else
|
||||
rc = [self delegateIsAttendee: ownerUser
|
||||
andClientObject: clientObject];
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -533,3 +533,6 @@ vtodo_class2 = "(Tasg gyhoeddus)";
|
||||
"Open Task..." = "Open Task...";
|
||||
"Mark Completed" = "Mark Completed";
|
||||
"Delete Task" = "Delete Task";
|
||||
|
||||
"Subscribe to a web calendar..." = "Subscribe to a web calendar...";
|
||||
"URL of the Calendar" = "URL of the Calendar";
|
||||
@@ -40,6 +40,16 @@
|
||||
protectedBy = "View";
|
||||
pageName = "UIxCalMainView";
|
||||
};
|
||||
addWebCalendar = {
|
||||
protectedBy = "View";
|
||||
actionClass = "UIxCalMainActions";
|
||||
actionName = "addWebCalendar";
|
||||
};
|
||||
reloadWebCalendars = {
|
||||
protectedBy = "View";
|
||||
actionClass = "UIxCalMainActions";
|
||||
actionName = "reloadWebCalendars";
|
||||
};
|
||||
saveDragHandleState = {
|
||||
protectedBy = "View";
|
||||
pageName = "UIxCalMainView";
|
||||
|
||||
@@ -20,6 +20,10 @@ div.colorBox.calendarFolder<var:string value="currentCalendar.folder" />
|
||||
><span class="toolbarButton"><img rsrc:src="add-calendar.png"
|
||||
label:title="New Calendar..."
|
||||
/></span></a>
|
||||
<a href="#" class="toolbarButton"
|
||||
><span class="toolbarButton"><img rsrc:src="add-web-calendar.png"
|
||||
label:title="Subscribe to a web calendar..."
|
||||
/></span></a>
|
||||
<a href="#" class="toolbarButton"
|
||||
><span class="toolbarButton"><img rsrc:src="add-user-calendar.png"
|
||||
label:title="Subscribe to a Calendar..."
|
||||
|
||||
@@ -872,11 +872,23 @@ function onMonthOverview() {
|
||||
}
|
||||
|
||||
function onCalendarReload() {
|
||||
changeCalendarDisplay(null, currentView);
|
||||
|
||||
reloadWebCalendars ();
|
||||
return false;
|
||||
}
|
||||
|
||||
function reloadWebCalendars () {
|
||||
var url = ApplicationBaseURL + "reloadWebCalendars";
|
||||
if (document.reloadWebCalAjaxRequest) {
|
||||
document.reloadWebCalAjaxRequest.aborted = true;
|
||||
document.reloadWebCalAjaxRequest.abort();
|
||||
}
|
||||
document.reloadWebCalAjaxRequest
|
||||
= triggerAjaxRequest(url, reloadWebCalendarsCallback);
|
||||
}
|
||||
function reloadWebCalendarsCallback (http) {
|
||||
changeCalendarDisplay(null, currentView);
|
||||
}
|
||||
|
||||
function scrollDayView(scrollEvent) {
|
||||
if (!preventAutoScroll) {
|
||||
if (scrollEvent) {
|
||||
@@ -1830,8 +1842,9 @@ function initCalendarSelector() {
|
||||
|
||||
var links = $("calendarSelectorButtons").childNodesWithTag("a");
|
||||
$(links[0]).observe("click", onCalendarNew);
|
||||
$(links[1]).observe("click", onCalendarAdd);
|
||||
$(links[2]).observe("click", onCalendarRemove);
|
||||
$(links[1]).observe("click", onCalendarWebAdd);
|
||||
$(links[2]).observe("click", onCalendarAdd);
|
||||
$(links[3]).observe("click", onCalendarRemove);
|
||||
}
|
||||
|
||||
function onCalendarModify(event) {
|
||||
@@ -1877,6 +1890,32 @@ function onCalendarAdd(event) {
|
||||
openUserFolderSelector(onFolderSubscribeCB, "calendar");
|
||||
preventDefault(event);
|
||||
}
|
||||
|
||||
function onCalendarWebAdd(event) {
|
||||
var calendarUrl = window.prompt(labels["URL of the Calendar"], "");
|
||||
if (calendarUrl) {
|
||||
if (document.addWebCalendarRequest) {
|
||||
document.addWebCalendarRequest.aborted = true;
|
||||
document.addWebCalendarRequest.abort ();
|
||||
}
|
||||
var url = ApplicationBaseURL + "/addWebCalendar?url=" + escape (calendarUrl);
|
||||
document.addWebCalendarRequest =
|
||||
triggerAjaxRequest (url, addWebCalendarCallback);
|
||||
}
|
||||
}
|
||||
function addWebCalendarCallback (http) {
|
||||
var data = http.responseText.evalJSON(true);
|
||||
if (data.imported > 0) {
|
||||
appendCalendar(data.displayname, "/" + data.name);
|
||||
refreshEvents();
|
||||
refreshTasks();
|
||||
changeCalendarDisplay();
|
||||
}
|
||||
else {
|
||||
alert (labels["An error occured while importing calendar."]);
|
||||
}
|
||||
}
|
||||
|
||||
function onCalendarExport(event) {
|
||||
var node = $("calendarList").getSelectedNodes().first();
|
||||
var owner = node.getAttribute("owner");
|
||||
|
||||
@@ -56,6 +56,15 @@ function initPreferences() {
|
||||
resetTableActions ();
|
||||
$("categoryAdd").observe ("click", onCategoryAdd);
|
||||
$("categoryDelete").observe ("click", onCategoryDelete);
|
||||
|
||||
// Disable placement (after) if composing in HTML
|
||||
if ($("composeMessagesType")) {
|
||||
if ($("composeMessagesType").value == 1) {
|
||||
$("replyPlacementList").selectedIndex = 0;
|
||||
$("replyPlacementList").disabled = 1;
|
||||
onReplyPlacementListChange ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function resetTableActions() {
|
||||
|
||||
Reference in new issue
Block a user