From 7ee1d69013442d06d275af00630120b4f61ad3f6 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 7 Jun 2007 20:49:06 +0000 Subject: [PATCH] Monotone-Parent: 7ccd1ab7beef95f5bf3ce66708988dbf11332387 Monotone-Revision: 9775cc0ae35a853e8915b4d80257272df826dfeb Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-06-07T20:49:06 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 + UI/Scheduler/GNUmakefile | 4 +- UI/Scheduler/UIxCalAptListView.h | 43 -- UI/Scheduler/UIxCalAptListView.m | 183 -------- ...TasksListView.h => UIxCalListingActions.h} | 31 +- UI/Scheduler/UIxCalListingActions.m | 328 ++++++++++++++ UI/Scheduler/UIxCalTasksListView.m | 177 -------- UI/Scheduler/product.plist | 420 +++++++++--------- 8 files changed, 562 insertions(+), 628 deletions(-) delete mode 100644 UI/Scheduler/UIxCalAptListView.h delete mode 100644 UI/Scheduler/UIxCalAptListView.m rename UI/Scheduler/{UIxCalTasksListView.h => UIxCalListingActions.h} (67%) create mode 100644 UI/Scheduler/UIxCalListingActions.m delete mode 100644 UI/Scheduler/UIxCalTasksListView.m diff --git a/ChangeLog b/ChangeLog index c7be8c25a..c1de9d920 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2007-06-07 Wolfgang Sourdeau + * UI/Scheduler/UIxCalListingActions.[hm]: new subclass of + WODirectAction that returns WOResponse objects with the events or + todos satisfying the parameters passed in the url. + * UI/Scheduler/UIxAppointmentEditor.m ([UIxAppointmentEditor -takeValuesFromRequest:_rqinContext:_ctx]): take the new ivar "isAllDay" into account and compute the amount of days to pass to diff --git a/UI/Scheduler/GNUmakefile b/UI/Scheduler/GNUmakefile index 66c045d8e..830b6972f 100644 --- a/UI/Scheduler/GNUmakefile +++ b/UI/Scheduler/GNUmakefile @@ -20,8 +20,6 @@ SchedulerUI_OBJC_FILES = \ \ UIxComponent+Scheduler.m \ UIxCalView.m \ - UIxCalAptListView.m \ - UIxCalTasksListView.m \ UIxCalDayView.m \ UIxCalMulticolumnDayView.m \ UIxCalWeekView.m \ @@ -29,6 +27,8 @@ SchedulerUI_OBJC_FILES = \ UIxCalMonthViewOld.m \ UIxAptTableView.m \ \ + UIxCalListingActions.m \ + \ UIxAttendeesEditor.m \ UIxComponentEditor.m \ UIxCalendarSelector.m \ diff --git a/UI/Scheduler/UIxCalAptListView.h b/UI/Scheduler/UIxCalAptListView.h deleted file mode 100644 index b2205239f..000000000 --- a/UI/Scheduler/UIxCalAptListView.h +++ /dev/null @@ -1,43 +0,0 @@ -/* UIxCalAptListView.h - this file is part of SOGo - * - * Copyright (C) 2006 Inverse groupe conseil - * - * Author: Wolfgang Sourdeau - * - * 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 UIXCALAPTLISTVIEW_H -#define UIXCALAPTLISTVIEW_H - -#import "UIxCalView.h" - -@class NSDictionary; - -@interface UIxCalAptListView : UIxCalView -{ - NSCalendarDate *startDate; - NSCalendarDate *endDate; - - NSDictionary *currentAppointment; -} - -- (void) setCurrentAppointment: (NSDictionary *) apt; -- (NSDictionary *) currentAppointment; - -@end - -#endif /* UIXCALAPTLIST_H */ diff --git a/UI/Scheduler/UIxCalAptListView.m b/UI/Scheduler/UIxCalAptListView.m deleted file mode 100644 index 92d227d8f..000000000 --- a/UI/Scheduler/UIxCalAptListView.m +++ /dev/null @@ -1,183 +0,0 @@ -/* UIxCalAptListView.m - this file is part of SOGo - * - * Copyright (C) 2006 Inverse groupe conseil - * - * Author: Wolfgang Sourdeau - * - * 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 -#import -#import - -#import -#import - -#import - -#import "UIxCalAptListView.h" - -@implementation UIxCalAptListView - -- (id) init -{ - if ((self = [super init])) - { - startDate = nil; - endDate = nil; - } - - return self; -} - -- (void) setCurrentAppointment: (NSDictionary *) apt -{ - currentAppointment = apt; -} - -- (NSDictionary *) currentAppointment -{ - return currentAppointment; -} - -- (NSCalendarDate *) startDate -{ - NSCalendarDate *today; - NSString *filterPopup; - - if (!startDate) - { - filterPopup = [self queryParameterForKey: @"filterpopup"]; - today = [[NSCalendarDate date] beginOfDay]; - if (!filterPopup || ![filterPopup length]) - startDate = today; - else if ([filterPopup isEqualToString: @"view_selectedday"]) - startDate = [[self selectedDate] beginOfDay]; - else if ([filterPopup isEqualToString: @"view_thismonth"]) - startDate = [today firstDayOfMonth]; - else if ([filterPopup isEqualToString: @"view_all"]) - startDate = [NSCalendarDate dateWithTimeIntervalSince1970: 0]; - else - startDate = today; - } - - return startDate; -} - -- (NSCalendarDate *) endDate -{ - NSCalendarDate *today; - NSString *filterPopup; - - if (!endDate) - { - filterPopup = [self queryParameterForKey: @"filterpopup"]; - - today = [[NSCalendarDate date] endOfDay]; - if (!filterPopup || ![filterPopup length] - || [filterPopup isEqualToString: @"view_today"]) - endDate = today; - else if ([filterPopup isEqualToString: @"view_all"] - || [filterPopup isEqualToString: @"view_future"]) - endDate = [NSCalendarDate dateWithTimeIntervalSince1970: 0x7fffffff]; - else if ([filterPopup isEqualToString: @"view_thismonth"]) - endDate = [today lastDayOfMonth]; - else if ([filterPopup isEqualToString: @"view_selectedday"]) - endDate = [[self selectedDate] endOfDay]; - else if ([filterPopup isEqualToString: @"view_next7"]) - endDate = [today dateByAddingYears: 0 months: 0 days: 7]; - else if ([filterPopup isEqualToString: @"view_next14"]) - endDate = [today dateByAddingYears: 0 months: 0 days: 14]; - else if ([filterPopup isEqualToString: @"view_next31"]) - endDate = [today dateByAddingYears: 0 months: 1 days: 0]; - else - endDate = today; - } - - return endDate; -} - -- (SOGoDateFormatter *) itemDateFormatter -{ - SOGoDateFormatter *fmt; - - fmt = [[SOGoDateFormatter alloc] initWithLocale: [self locale]]; - [fmt autorelease]; - [fmt setFullWeekdayNameAndDetails]; - - return fmt; -} - -- (NSString *) currentStartTime -{ - NSCalendarDate *date; - - date = [NSCalendarDate dateWithTimeIntervalSince1970: - [[currentAppointment objectForKey: @"startdate"] - intValue]]; - [date setTimeZone: timeZone]; - - return [[self itemDateFormatter] stringForObjectValue: date]; -} - -- (NSString *) currentEndTime -{ - NSCalendarDate *date; - - date = [NSCalendarDate dateWithTimeIntervalSince1970: - [[currentAppointment objectForKey: @"enddate"] - intValue]]; - [date setTimeZone: timeZone]; - - return [[self itemDateFormatter] stringForObjectValue: date]; -} - -- (NSString *) currentLocation -{ - return [currentAppointment objectForKey: @"location"]; -} - -- (NSString *) currentSerialDay -{ - NSCalendarDate *date; - int intDate; - - intDate = [[currentAppointment objectForKey: @"startdate"] intValue]; - date = [NSCalendarDate dateWithTimeIntervalSince1970: intDate]; - [date setTimeZone: timeZone]; - - return [NSString stringWithFormat: @"%d%.2d%.2d", - [date yearOfCommonEra], - [date monthOfYear], - [date dayOfMonth]]; -} - -- (NSString *) currentSerialHour -{ - NSCalendarDate *date; - int intDate; - - intDate = [[currentAppointment objectForKey: @"startdate"] intValue]; - date = [NSCalendarDate dateWithTimeIntervalSince1970: intDate]; - [date setTimeZone: timeZone]; - - return [NSString stringWithFormat: @"%.2d%.2d", - [date hourOfDay], - [date minuteOfHour]]; -} - -@end diff --git a/UI/Scheduler/UIxCalTasksListView.h b/UI/Scheduler/UIxCalListingActions.h similarity index 67% rename from UI/Scheduler/UIxCalTasksListView.h rename to UI/Scheduler/UIxCalListingActions.h index 59b94dd77..c222ec0c1 100644 --- a/UI/Scheduler/UIxCalTasksListView.h +++ b/UI/Scheduler/UIxCalListingActions.h @@ -1,4 +1,4 @@ -/* UIxCalTasksListView.h - this file is part of SOGo +/* UIxCalListingActions.h - this file is part of SOGo * * Copyright (C) 2006 Inverse groupe conseil * @@ -20,29 +20,32 @@ * Boston, MA 02111-1307, USA. */ -#ifndef UIXCALTASKSLISTVIEW_H -#define UIXCALTASKSLISTVIEW_H +#ifndef UIXCALLISTINGACTIONVIEW_H +#define UIXCALLISTINGACTIONVIEW_H -#import "UIxCalView.h" -@class NSDictionary; +#import + +@class NSCalendarDate; @class NSMutableDictionary; +@class NSString; +@class NSTimeZone; -@interface UIxCalTasksListView : UIxCalView +@class WOResponse; +@class WORequest; + +@interface UIxCalListingActions : WODirectAction { + NSMutableDictionary *componentsData; NSCalendarDate *startDate; NSCalendarDate *endDate; - - BOOL knowsToShow; - BOOL showCompleted; - - NSDictionary *currentTask; + NSString *userLogin; + WORequest *request; } -- (void) setCurrentTask: (NSDictionary *) task; -- (NSDictionary *) currentTask; +- (WOResponse *) eventsListAction; - (WOResponse *) tasksListAction; @end -#endif /* UIXCALTASKSLIST_H */ +#endif /* UIXCALLISTINGACTION_H */ diff --git a/UI/Scheduler/UIxCalListingActions.m b/UI/Scheduler/UIxCalListingActions.m new file mode 100644 index 000000000..64cfdf364 --- /dev/null +++ b/UI/Scheduler/UIxCalListingActions.m @@ -0,0 +1,328 @@ +/* UIxCalListingActions.m - this file is part of SOGo + * + * Copyright (C) 2006 Inverse groupe conseil + * + * Author: Wolfgang Sourdeau + * + * 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 +#import +#import +#import +#import + +#import +#import +#import +#import +#import + +#import +#import +#import +#import +#import + +#import "UIxCalListingActions.h" + +@implementation UIxCalListingActions + +- (id) init +{ + if ((self = [super init])) + { + componentsData = [NSMutableDictionary new]; + startDate = nil; + endDate = nil; + request = nil; +// knowsToShow = NO; +// showCompleted = NO; + } + + return self; +} + +- (void) dealloc +{ + [componentsData release]; + [startDate release]; + [endDate release]; + [super dealloc]; +} + +- (void) _setupContext +{ + SOGoUser *user; + NSTimeZone *userTZ; + NSString *param; + + user = [context activeUser]; + userLogin = [user login]; + userTZ = [user timeZone]; + + request = [context request]; + param = [request formValueForKey: @"sd"]; + if ([param length] > 0) + startDate = [[NSCalendarDate dateFromShortDateString: param + andShortTimeString: nil + inTimeZone: userTZ] beginOfDay]; + else + startDate = nil; + + param = [request formValueForKey: @"sd"]; + if ([param length] > 0) + endDate = [[NSCalendarDate dateFromShortDateString: param + andShortTimeString: nil + inTimeZone: userTZ] endOfDay]; + else + endDate = nil; +} + +- (void) _updatePrivacyInComponent: (NSMutableDictionary *) component + fromFolder: (SOGoAppointmentFolder *) folder +{ + int privacyFlag; + NSString *roleString; + + privacyFlag = [[component objectForKey: @"classification"] intValue]; + roleString = [folder roleForComponentsWithAccessClass: privacyFlag + forUser: userLogin]; + if ([roleString isEqualToString: @"ComponentDAndTViewer"]) + { + [component setObject: @"" forKey: @"title"]; + [component setObject: @"" forKey: @"location"]; + } +} + +- (SOGoAppointmentFolder *) _aptFolder: (NSString *) folder + withClientObject: (SOGoAppointmentFolder *) clientObject +{ + SOGoAppointmentFolder *aptFolder; + NSArray *folderParts; + + if ([folder isEqualToString: @"/"]) + aptFolder = clientObject; + else + { + folderParts = [folder componentsSeparatedByString: @":"]; + aptFolder + = [clientObject lookupCalendarFolderForUID: + [folderParts objectAtIndex: 0]]; + } + + return aptFolder; +} + +- (NSArray *) _activeCalendarFolders +{ + NSMutableArray *activeFolders; + NSEnumerator *folders; + NSDictionary *currentFolderDict; + SOGoAppointmentFolder *currentFolder, *clientObject; + + activeFolders = [NSMutableArray new]; + [activeFolders autorelease]; + + clientObject = [self clientObject]; + + folders = [[clientObject calendarFolders] objectEnumerator]; + currentFolderDict = [folders nextObject]; + while (currentFolderDict) + { + if ([[currentFolderDict objectForKey: @"active"] boolValue]) + { + currentFolder + = [self _aptFolder: [currentFolderDict objectForKey: @"folder"] + withClientObject: clientObject]; + [activeFolders addObject: currentFolder]; + } + + currentFolderDict = [folders nextObject]; + } + + return activeFolders; +} + +- (NSArray *) _fetchFields: (NSArray *) fields + forComponentOfType: (NSString *) component +{ + NSEnumerator *folders, *currentInfos; + SOGoAppointmentFolder *currentFolder; + NSMutableDictionary *infos, *currentInfo, *newInfo; + NSString *owner, *uid; + NSNull *marker; + + marker = [NSNull null]; + + infos = [NSMutableDictionary dictionary]; + folders = [[self _activeCalendarFolders] objectEnumerator]; + currentFolder = [folders nextObject]; + while (currentFolder) + { + owner = [currentFolder ownerInContext: context]; + currentInfos = [[currentFolder fetchCoreInfosFrom: startDate + to: endDate + component: component] objectEnumerator]; + newInfo = [currentInfos nextObject]; + while (newInfo) + { + uid = [newInfo objectForKey: @"uid"]; + currentInfo = [infos objectForKey: uid]; + if (!currentInfo + || [owner isEqualToString: userLogin]) + { + [self _updatePrivacyInComponent: newInfo + fromFolder: currentFolder]; + [newInfo setObject: owner forKey: @"owner"]; + [infos setObject: [newInfo objectsForKeys: fields + notFoundMarker: marker] + forKey: uid]; + } + newInfo = [currentInfos nextObject]; + } + currentFolder = [folders nextObject]; + } + + return [infos allValues]; +} + +- (WOResponse *) _responseWithData: (NSArray *) data +{ + WOResponse *response; + + response = [context response]; + [response setHeader: @"text/plain; charset=utf-8" + forKey: @"content-type"]; + [response setStatus: 200]; + [response appendContentString: [data jsonRepresentation]]; + + return response; +} + +- (WOResponse *) eventsListAction +{ + NSArray *fields; + NSArray *events; + + [self _setupContext]; + + fields = [NSArray arrayWithObjects: @"c_name", @"owner", @"status", + @"startdate", @"enddate", @"location", nil]; + events = [self _fetchFields: fields forComponentOfType: @"vevent"]; + + return [self _responseWithData: events]; +} + +- (NSString *) _getStatusClassForStatusCode: (int) statusCode + andEndDateStamp: (unsigned int) endDateStamp +{ + NSCalendarDate *taskDate, *now; + NSString *statusClass; + + if (statusCode == 1) + statusClass = @"completed"; + else + { + if (endDateStamp) + { + now = [NSCalendarDate calendarDate]; + taskDate + = [NSCalendarDate dateWithTimeIntervalSince1970: endDateStamp]; + if ([taskDate earlierDate: now] == taskDate) + statusClass = @"overdue"; + else + { + if ([taskDate isToday]) + statusClass = @"duetoday"; + else + statusClass = @"duelater"; + } + } + else + statusClass = @"duelater"; + } + + return statusClass; +} + +- (WOResponse *) tasksListAction +{ + NSEnumerator *tasks; + NSMutableArray *filteredTasks, *filteredTask; + BOOL showCompleted; + NSArray *fields, *task; + int statusCode; + unsigned int endDateStamp; + NSString *statusFlag; + + filteredTasks = [NSMutableArray array]; + + [self _setupContext]; + + fields = [NSArray arrayWithObjects: @"c_name", @"owner", @"status", + @"title", @"enddate", nil]; + + tasks = [[self _fetchFields: fields + forComponentOfType: @"vtodo"] objectEnumerator]; + showCompleted = [[request formValueForKey: @"show-completed"] intValue]; + + task = [tasks nextObject]; + while (task) + { + statusCode = [[task objectAtIndex: 2] intValue]; + if (statusCode != 1 || showCompleted) + { + filteredTask = [NSMutableArray arrayWithArray: task]; + endDateStamp = [[task objectAtIndex: 4] intValue]; + statusFlag = [self _getStatusClassForStatusCode: statusCode + andEndDateStamp: endDateStamp]; + [filteredTask addObject: statusFlag]; + [filteredTasks addObject: filteredTask]; + } + task = [tasks nextObject]; + } + + return [self _responseWithData: filteredTasks]; +} + +// - (BOOL) shouldDisplayCurrentTask +// { +// if (!knowsToShow) +// { +// showCompleted +// = [[self queryParameterForKey: @"show-completed"] intValue]; +// knowsToShow = YES; +// } + +// return ([[currentTask objectForKey: @"status"] intValue] != 1 +// || showCompleted); +// } + +// - (BOOL) shouldShowCompletedTasks +// { +// if (!knowsToShow) +// { +// showCompleted +// = [[self queryParameterForKey: @"show-completed"] intValue]; +// knowsToShow = YES; +// } + +// return showCompleted; +// } + +@end diff --git a/UI/Scheduler/UIxCalTasksListView.m b/UI/Scheduler/UIxCalTasksListView.m deleted file mode 100644 index 7c10d8c89..000000000 --- a/UI/Scheduler/UIxCalTasksListView.m +++ /dev/null @@ -1,177 +0,0 @@ -/* UIxCalTasksListView.m - this file is part of SOGo - * - * Copyright (C) 2006 Inverse groupe conseil - * - * Author: Wolfgang Sourdeau - * - * 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 -#import -#import -#import - -#import -#import -#import - -#import "UIxCalTasksListView.h" - -@implementation UIxCalTasksListView - -- (id) init -{ - if ((self = [super init])) - { - startDate = nil; - endDate = nil; - knowsToShow = NO; - showCompleted = NO; - } - - return self; -} - -- (void) setCurrentTask: (NSDictionary *) task -{ - currentTask = task; -} - -- (NSDictionary *) currentTask -{ - return currentTask; -} - -- (NSCalendarDate *) startDate -{ - return nil; -} - -- (NSCalendarDate *) endDate -{ - return nil; -} - -- (NSString *) getStatusClassForTask: (NSDictionary *) task -{ - NSCalendarDate *taskDate, *now; - NSString *statusClass, *allClasses; - NSNumber *taskDueStamp; - - if ([[task objectForKey: @"status"] intValue] == 1) - statusClass = @"completed"; - else - { - taskDueStamp = [task objectForKey: @"enddate"]; - if ([taskDueStamp intValue]) - { - now = [NSCalendarDate calendarDate]; - taskDate = [NSCalendarDate dateWithTimeIntervalSince1970: - [taskDueStamp intValue]]; - if ([taskDate earlierDate: now] == taskDate) - statusClass = @"overdue"; - else - { - if ([taskDate isToday]) - statusClass = @"duetoday"; - else - statusClass = @"duelater"; - } - } - else - statusClass = @"duelater"; - } - - allClasses = [NSString stringWithFormat: @"%@ ownerIs%@", - statusClass, - [task objectForKey: @"owner"]]; - - return allClasses; -} - -- (WOResponse *) tasksListAction -{ - WOResponse *response; - NSDictionary *tasks; - NSMutableArray *filteredTasks; - BOOL showCompleted; - unsigned i, count; - - response = [context response]; - filteredTasks = [NSMutableArray new]; - [filteredTasks autorelease]; - tasks = [self _fetchCoreInfosForComponent: @"vtodo"]; - showCompleted = [[self queryParameterForKey: @"show-completed"] intValue]; - - count = [tasks count]; - for (i = 0; i < count; i++) { - NSDictionary *task; - NSArray *filteredTask; - - task = [tasks objectAtIndex: i]; - - if ([[task objectForKey: @"status"] intValue] != 1 - || showCompleted) - { - filteredTask = [NSArray arrayWithObjects: - [task objectForKey: @"c_name"], - [task objectForKey: @"owner"], - [task objectForKey: @"status"], - [task objectForKey: @"title"], - [self getStatusClassForTask: task], - nil]; - [filteredTasks addObject: filteredTask]; - } - } - - [response setStatus: 200]; - [response appendContentString: [filteredTasks jsonRepresentation]]; - - return response; -} - -- (BOOL) shouldDisplayCurrentTask -{ - if (!knowsToShow) - { - showCompleted - = [[self queryParameterForKey: @"show-completed"] intValue]; - knowsToShow = YES; - } - - return ([[currentTask objectForKey: @"status"] intValue] != 1 - || showCompleted); -} - -- (BOOL) shouldShowCompletedTasks -{ - if (!knowsToShow) - { - showCompleted - = [[self queryParameterForKey: @"show-completed"] intValue]; - knowsToShow = YES; - } - - return showCompleted; -} - -- (BOOL) isCurrentTaskCompleted -{ - return ([[currentTask objectForKey: @"status"] intValue] == 1); -} - -@end diff --git a/UI/Scheduler/product.plist b/UI/Scheduler/product.plist index 1a4a61d34..63d85f5ef 100644 --- a/UI/Scheduler/product.plist +++ b/UI/Scheduler/product.plist @@ -1,224 +1,226 @@ -{ +{ /* -*-javascript-*- */ requires = ( MAIN, MainUI, CommonUI, Appointments, Contacts, ContactsUI ); publicResources = ( - previous_week.gif, - next_week.gif, - icon_view_overview.gif, - icon_view_overview_inactive.gif, - icon_view_chart.gif, - icon_view_chart_inactive.gif, - icon_view_list.gif, - icon_view_list_inactive.gif, - icon_view_columns.gif, - icon_view_columns_inactive.gif, - icon_popupcalendar.gif, - first.gif, - previous.gif, - next.gif, - last.gif, - skycalendar.html, - skycalendar.js, - green_corner.gif, - invisible_space_2.gif, - cycles.plist, + previous_week.gif, + next_week.gif, + icon_view_overview.gif, + icon_view_overview_inactive.gif, + icon_view_chart.gif, + icon_view_chart_inactive.gif, + icon_view_list.gif, + icon_view_list_inactive.gif, + icon_view_columns.gif, + icon_view_columns_inactive.gif, + icon_popupcalendar.gif, + first.gif, + previous.gif, + next.gif, + last.gif, + skycalendar.html, + skycalendar.js, + green_corner.gif, + invisible_space_2.gif, + cycles.plist, ); factories = { }; categories = { - SOGoAppointmentFolder = { - slots = { - toolbar = { - protectedBy = "View"; - value = "SOGoAppointmentFolder.toolbar"; - }; - }; - methods = { - view = { - protectedBy = "View"; - pageName = "UIxCalMainView"; - }; - dateselector = { - protectedBy = "View"; - pageName = "UIxCalDateSelector"; - }; - aptlist = { - protectedBy = "View"; - pageName = "UIxCalAptListView"; - }; - taskslist = { - protectedBy = "View"; - pageName = "UIxCalTasksListView"; - }; - dayview = { - protectedBy = "View"; - pageName = "UIxCalDayView"; - }; - multicolumndayview = { - protectedBy = "View"; - pageName = "UIxCalMulticolumnDayView"; - }; - weekview = { - protectedBy = "View"; - pageName = "UIxCalWeekView"; - }; - monthview = { - protectedBy = "View"; - pageName = "UIxCalMonthView"; - }; - newevent = { - protectedBy = "Add Documents, Images, and Files"; - pageName = "UIxAppointmentEditor"; - actionName = "new"; - }; - newtask = { - protectedBy = "Add Documents, Images, and Files"; - pageName = "UIxTaskEditor"; - actionName = "new"; - }; - show = { - protectedBy = "View"; - pageName = "UIxCalView"; - actionName = "redirectForUIDs"; - }; - proposal = { - protectedBy = "View"; - pageName = "UIxAppointmentProposal"; - }; - proposalSearch = { - protectedBy = "View"; - pageName = "UIxAppointmentProposal"; - actionName = "proposalSearch"; - }; - batchDelete = { - protectedBy = "Delete Objects"; - pageName = "UIxCalMainView"; - actionName = "batchDelete"; - }; - updateCalendars = { - protectedBy = "View"; - pageName = "UIxCalMainView"; - actionName = "updateCalendars"; - }; - editAttendees = { - protectedBy = "View"; - pageName = "UIxAttendeesEditor"; + SOGoAppointmentFolder = { + slots = { + toolbar = { + protectedBy = "View"; + value = "SOGoAppointmentFolder.toolbar"; + }; }; - userRights = { - protectedBy = "ReadAcls"; - pageName = "UIxCalUserRightsEditor"; - }; - saveUserRights = { - protectedBy = "SaveAcls"; - pageName = "UIxCalUserRightsEditor"; - actionName = "saveUserRights"; + methods = { + view = { + protectedBy = "View"; + pageName = "UIxCalMainView"; + }; + dateselector = { + protectedBy = "View"; + pageName = "UIxCalDateSelector"; + }; + eventslist = { + protectedBy = "View"; + actionClass = "UIxCalListingActions"; + actionName = "eventsList"; + }; + taskslist = { + protectedBy = "View"; + actionClass = "UIxCalListingActions"; + actionName = "tasksList"; + }; + dayview = { + protectedBy = "View"; + pageName = "UIxCalDayView"; + }; + multicolumndayview = { + protectedBy = "View"; + pageName = "UIxCalMulticolumnDayView"; + }; + weekview = { + protectedBy = "View"; + pageName = "UIxCalWeekView"; + }; + monthview = { + protectedBy = "View"; + pageName = "UIxCalMonthView"; + }; + newevent = { + protectedBy = "Add Documents, Images, and Files"; + pageName = "UIxAppointmentEditor"; + actionName = "new"; + }; + newtask = { + protectedBy = "Add Documents, Images, and Files"; + pageName = "UIxTaskEditor"; + actionName = "new"; + }; + show = { + protectedBy = "View"; + pageName = "UIxCalView"; + actionName = "redirectForUIDs"; + }; + proposal = { + protectedBy = "View"; + pageName = "UIxAppointmentProposal"; + }; + proposalSearch = { + protectedBy = "View"; + pageName = "UIxAppointmentProposal"; + actionName = "proposalSearch"; + }; + batchDelete = { + protectedBy = "Delete Objects"; + pageName = "UIxCalMainView"; + actionName = "batchDelete"; + }; + updateCalendars = { + protectedBy = "View"; + pageName = "UIxCalMainView"; + actionName = "updateCalendars"; + }; + editAttendees = { + protectedBy = "View"; + pageName = "UIxAttendeesEditor"; + }; + userRights = { + protectedBy = "ReadAcls"; + pageName = "UIxCalUserRightsEditor"; + }; + saveUserRights = { + protectedBy = "SaveAcls"; + pageName = "UIxCalUserRightsEditor"; + actionName = "saveUserRights"; + }; }; - }; - }; - SOGoCalendarComponent = { - }; + }; + SOGoCalendarComponent = { + }; - SOGoAppointmentObject = { - slots = { - toolbar = { - protectedBy = "View"; - value = "SOGoAppointmentObject.toolbar"; - }; - }; - methods = { - view = { - protectedBy = "ViewAllComponent"; - pageName = "UIxAppointmentView"; - }; - delete = { - protectedBy = "Delete Objects"; - pageName = "UIxAppointmentView"; - actionName = "delete"; - }; - edit = { - protectedBy = "ViewAllComponent"; - pageName = "UIxAppointmentEditor"; - }; - editAsAppointment = { - protectedBy = "ViewAllComponent"; - pageName = "UIxAppointmentEditor"; - }; - save = { - protectedBy = "ModifyComponent"; - pageName = "UIxAppointmentEditor"; - actionName = "save"; - }; - saveAsAppointment = { - protectedBy = "ModifyComponent"; - pageName = "UIxAppointmentEditor"; - actionName = "save"; - }; - accept = { - protectedBy = "RespondToComponent"; - pageName = "UIxAppointmentEditor"; - actionName = "accept"; - }; - decline = { - protectedBy = "RespondToComponent"; - pageName = "UIxAppointmentEditor"; - actionName = "decline"; - }; - }; - }; + SOGoAppointmentObject = { + slots = { + toolbar = { + protectedBy = "View"; + value = "SOGoAppointmentObject.toolbar"; + }; + }; + methods = { + view = { + protectedBy = "ViewAllComponent"; + pageName = "UIxAppointmentView"; + }; + delete = { + protectedBy = "Delete Objects"; + pageName = "UIxAppointmentView"; + actionName = "delete"; + }; + edit = { + protectedBy = "ViewAllComponent"; + pageName = "UIxAppointmentEditor"; + }; + editAsAppointment = { + protectedBy = "ViewAllComponent"; + pageName = "UIxAppointmentEditor"; + }; + save = { + protectedBy = "ModifyComponent"; + pageName = "UIxAppointmentEditor"; + actionName = "save"; + }; + saveAsAppointment = { + protectedBy = "ModifyComponent"; + pageName = "UIxAppointmentEditor"; + actionName = "save"; + }; + accept = { + protectedBy = "RespondToComponent"; + pageName = "UIxAppointmentEditor"; + actionName = "accept"; + }; + decline = { + protectedBy = "RespondToComponent"; + pageName = "UIxAppointmentEditor"; + actionName = "decline"; + }; + }; + }; - SOGoTaskObject = { - slots = { - toolbar = { - protectedBy = "View"; - value = "SOGoAppointmentObject.toolbar"; - }; - }; - methods = { - view = { - protectedBy = "ViewAllComponent"; - pageName = "UIxTaskView"; - }; - delete = { - protectedBy = "Delete Objects"; - pageName = "UIxTaskView"; - actionName = "delete"; - }; - edit = { - protectedBy = "ViewAllComponent"; - pageName = "UIxTaskEditor"; - }; - editAsTask = { - protectedBy = "ViewAllComponent"; - pageName = "UIxTaskEditor"; - }; - save = { - protectedBy = "ModifyComponent"; - pageName = "UIxTaskEditor"; - actionName = "save"; - }; - saveAsTask = { - protectedBy = "ModifyComponent"; - pageName = "UIxTaskEditor"; - actionName = "save"; - }; - changeStatus = { - protectedBy = "ModifyComponent"; - pageName = "UIxTaskEditor"; - actionName = "changeStatus"; - }; - accept = { - protectedBy = "RespondToComponent"; - pageName = "UIxTaskEditor"; - actionName = "accept"; - }; - decline = { - protectedBy = "RespondToComponent"; - pageName = "UIxTaskEditor"; - actionName = "decline"; - }; - }; - }; + SOGoTaskObject = { + slots = { + toolbar = { + protectedBy = "View"; + value = "SOGoAppointmentObject.toolbar"; + }; + }; + methods = { + view = { + protectedBy = "ViewAllComponent"; + pageName = "UIxTaskView"; + }; + delete = { + protectedBy = "Delete Objects"; + pageName = "UIxTaskView"; + actionName = "delete"; + }; + edit = { + protectedBy = "ViewAllComponent"; + pageName = "UIxTaskEditor"; + }; + editAsTask = { + protectedBy = "ViewAllComponent"; + pageName = "UIxTaskEditor"; + }; + save = { + protectedBy = "ModifyComponent"; + pageName = "UIxTaskEditor"; + actionName = "save"; + }; + saveAsTask = { + protectedBy = "ModifyComponent"; + pageName = "UIxTaskEditor"; + actionName = "save"; + }; + changeStatus = { + protectedBy = "ModifyComponent"; + pageName = "UIxTaskEditor"; + actionName = "changeStatus"; + }; + accept = { + protectedBy = "RespondToComponent"; + pageName = "UIxTaskEditor"; + actionName = "accept"; + }; + decline = { + protectedBy = "RespondToComponent"; + pageName = "UIxTaskEditor"; + actionName = "decline"; + }; + }; + }; }; }