2006-08-19 00:55:46 +02:00
|
|
|
/* UIxCalMainView.m - this file is part of SOGo
|
|
|
|
*
|
2017-12-15 22:17:51 +01:00
|
|
|
* Copyright (C) 2006-2017 Inverse inc.
|
2006-08-19 00:55:46 +02:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2006-08-22 21:24:48 +02:00
|
|
|
#import <Foundation/NSCalendarDate.h>
|
2009-04-01 15:49:24 +02:00
|
|
|
#import <Foundation/NSDictionary.h>
|
2014-08-28 15:37:49 +02:00
|
|
|
#import <Foundation/NSKeyValueCoding.h>
|
2006-08-22 21:24:48 +02:00
|
|
|
#import <Foundation/NSValue.h>
|
|
|
|
|
2008-02-04 23:22:14 +01:00
|
|
|
#import <NGObjWeb/WORequest.h>
|
2006-10-14 01:31:45 +02:00
|
|
|
|
2015-08-05 22:44:25 +02:00
|
|
|
#import <NGCards/iCalPerson.h>
|
|
|
|
|
2010-04-20 23:30:17 +02:00
|
|
|
#import <SOGo/NSArray+Utilities.h>
|
2015-08-07 20:13:27 +02:00
|
|
|
#import <SOGo/NSString+Utilities.h>
|
2006-10-14 01:31:45 +02:00
|
|
|
#import <SOGo/SOGoUser.h>
|
2009-11-29 05:19:32 +01:00
|
|
|
#import <SOGo/SOGoUserDefaults.h>
|
2010-04-20 23:30:17 +02:00
|
|
|
#import <SOGo/SOGoUserSettings.h>
|
2006-10-14 01:31:45 +02:00
|
|
|
|
2010-04-20 23:30:17 +02:00
|
|
|
#import <Appointments/SOGoAppointmentFolders.h>
|
2008-02-04 23:22:14 +01:00
|
|
|
|
2006-08-19 00:55:46 +02:00
|
|
|
#import "UIxCalMainView.h"
|
|
|
|
|
|
|
|
@implementation UIxCalMainView
|
2006-08-22 21:24:48 +02:00
|
|
|
|
2015-09-21 14:41:31 +02:00
|
|
|
- (NSString *) modulePath
|
|
|
|
{
|
|
|
|
return @"Calendar";
|
|
|
|
}
|
|
|
|
|
2009-08-19 19:19:32 +02:00
|
|
|
- (void) checkDefaultModulePreference
|
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
SOGoUserDefaults *ud;
|
2009-08-19 19:19:32 +02:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
ud = [[context activeUser] userDefaults];
|
|
|
|
if ([ud rememberLastModule])
|
2010-01-06 20:43:23 +01:00
|
|
|
{
|
|
|
|
[ud setLoginModule: @"Calendar"];
|
|
|
|
[ud synchronize];
|
|
|
|
}
|
2009-08-19 19:19:32 +02:00
|
|
|
}
|
|
|
|
|
2008-02-04 23:22:14 +01:00
|
|
|
- (void) _setupContext
|
|
|
|
{
|
|
|
|
SOGoUser *activeUser;
|
|
|
|
NSString *module;
|
|
|
|
SOGoAppointmentFolders *clientObject;
|
|
|
|
|
2010-01-06 20:43:23 +01:00
|
|
|
contextIsSetup = YES;
|
2009-08-19 19:19:32 +02:00
|
|
|
[self checkDefaultModulePreference];
|
|
|
|
|
2008-02-04 23:22:14 +01:00
|
|
|
activeUser = [context activeUser];
|
|
|
|
clientObject = [self clientObject];
|
|
|
|
|
|
|
|
module = [clientObject nameInContainer];
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
us = [activeUser userSettings];
|
|
|
|
moduleSettings = [us objectForKey: module];
|
2008-02-04 23:22:14 +01:00
|
|
|
if (!moduleSettings)
|
|
|
|
{
|
2009-03-24 18:33:15 +01:00
|
|
|
moduleSettings = [NSMutableDictionary dictionary];
|
2009-11-29 05:19:32 +01:00
|
|
|
[us setObject: moduleSettings forKey: module];
|
2008-02-04 23:22:14 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-04 22:25:52 +01:00
|
|
|
- (NSString *) localeCode
|
|
|
|
{
|
|
|
|
// WARNING : NSLocaleCode is not defined in <Foundation/NSUserDefaults.h>
|
2015-03-19 13:32:37 +01:00
|
|
|
// Region subtag must be separated by a dash
|
2015-03-26 18:54:17 +01:00
|
|
|
NSMutableString *s = [NSMutableString stringWithString: [locale objectForKey: @"NSLocaleCode"]];
|
|
|
|
|
|
|
|
[s replaceOccurrencesOfString: @"_"
|
|
|
|
withString: @"-"
|
|
|
|
options: 0
|
|
|
|
range: NSMakeRange(0, [s length])];
|
|
|
|
|
|
|
|
return s;
|
2014-02-04 22:25:52 +01:00
|
|
|
}
|
|
|
|
|
2006-08-22 21:24:48 +02:00
|
|
|
- (NSArray *) monthMenuItems
|
|
|
|
{
|
2009-03-24 18:33:15 +01:00
|
|
|
static NSMutableArray *monthMenuItems = nil;
|
2006-08-22 21:24:48 +02:00
|
|
|
unsigned int count;
|
2009-11-29 05:19:32 +01:00
|
|
|
|
2006-08-22 21:24:48 +02:00
|
|
|
if (!monthMenuItems)
|
|
|
|
{
|
2009-03-24 18:33:15 +01:00
|
|
|
monthMenuItems = [[NSMutableArray alloc] initWithCapacity: 12];
|
2006-08-22 21:24:48 +02:00
|
|
|
for (count = 1; count < 13; count++)
|
|
|
|
[monthMenuItems addObject:
|
|
|
|
[NSString stringWithFormat: @"%.2d", count]];
|
|
|
|
}
|
|
|
|
|
|
|
|
return monthMenuItems;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setMonthMenuItem: (NSString *) aMonthMenuItem
|
|
|
|
{
|
|
|
|
monthMenuItem = aMonthMenuItem;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString *) monthMenuItem
|
|
|
|
{
|
|
|
|
return monthMenuItem;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString *) monthMenuItemLabel
|
|
|
|
{
|
|
|
|
return [self localizedNameForMonthOfYear: [monthMenuItem intValue]];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSArray *) yearMenuItems
|
|
|
|
{
|
2009-03-24 18:33:15 +01:00
|
|
|
static NSMutableArray *yearMenuItems = nil;
|
2006-08-22 21:24:48 +02:00
|
|
|
int count, year;
|
|
|
|
|
|
|
|
if (!yearMenuItems)
|
|
|
|
{
|
|
|
|
year = [[NSCalendarDate date] yearOfCommonEra];
|
2009-03-24 18:33:15 +01:00
|
|
|
yearMenuItems = [[NSMutableArray alloc] initWithCapacity: 11];
|
2006-08-22 21:24:48 +02:00
|
|
|
for (count = -5; count < 6; count++)
|
|
|
|
[yearMenuItems addObject: [NSNumber numberWithInt: year + count]];
|
|
|
|
}
|
|
|
|
|
|
|
|
return yearMenuItems;
|
|
|
|
}
|
|
|
|
|
2014-05-08 23:17:05 +02:00
|
|
|
- (NSArray *) tasksFilters
|
|
|
|
{
|
|
|
|
return [NSArray arrayWithObjects: @"view_all", @"view_today", @"view_next7",
|
|
|
|
@"view_next14", @"view_next31", @"view_thismonth",
|
|
|
|
@"view_not_started", @"view_overdue", @"view_incomplete", nil];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString *) tasksFilterLabel
|
|
|
|
{
|
2014-08-28 15:37:49 +02:00
|
|
|
return [self labelForKey: [self valueForKey: @"taskFilter"]];
|
2014-05-08 23:17:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString *) selectedTasksFilter
|
|
|
|
{
|
|
|
|
NSString *selectedFilter;
|
|
|
|
|
|
|
|
selectedFilter = [self queryParameterForKey: @"tasksFilterpopup"];
|
|
|
|
|
|
|
|
if (![selectedFilter length])
|
|
|
|
selectedFilter = @"view_today";
|
|
|
|
|
|
|
|
return selectedFilter;
|
|
|
|
}
|
|
|
|
|
2006-08-22 21:24:48 +02:00
|
|
|
- (void) setYearMenuItem: (NSNumber *) aYearMenuItem
|
|
|
|
{
|
|
|
|
yearMenuItem = aYearMenuItem;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSNumber *) yearMenuItem
|
|
|
|
{
|
|
|
|
return yearMenuItem;
|
|
|
|
}
|
|
|
|
|
2008-03-25 20:59:13 +01:00
|
|
|
- (NSString *) verticalDragHandleStyle
|
2008-02-04 23:22:14 +01:00
|
|
|
{
|
2008-08-30 01:58:16 +02:00
|
|
|
NSString *vertical;
|
|
|
|
|
2010-01-06 20:43:23 +01:00
|
|
|
if (!contextIsSetup)
|
|
|
|
[self _setupContext];
|
2008-08-30 01:58:16 +02:00
|
|
|
vertical = [moduleSettings objectForKey: @"DragHandleVertical"];
|
2008-02-04 23:22:14 +01:00
|
|
|
|
2009-04-01 15:49:24 +02:00
|
|
|
return ((vertical && [vertical intValue] > 0) ? (id)[vertical stringByAppendingFormat: @"px"] : nil);
|
2008-03-25 20:59:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString *) horizontalDragHandleStyle
|
|
|
|
{
|
2008-08-30 01:58:16 +02:00
|
|
|
NSString *horizontal;
|
|
|
|
|
2010-01-06 20:43:23 +01:00
|
|
|
if (!contextIsSetup)
|
|
|
|
[self _setupContext];
|
2008-08-30 01:58:16 +02:00
|
|
|
horizontal = [moduleSettings objectForKey: @"DragHandleHorizontal"];
|
2008-03-25 20:59:13 +01:00
|
|
|
|
2009-04-01 15:49:24 +02:00
|
|
|
return ((horizontal && [horizontal intValue] > 0) ? (id)[horizontal stringByAppendingFormat: @"px"] : nil);
|
2008-03-25 20:59:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString *) eventsListViewStyle
|
|
|
|
{
|
2008-07-11 19:32:59 +02:00
|
|
|
NSString *height;
|
2008-02-04 23:22:14 +01:00
|
|
|
|
2010-01-06 20:43:23 +01:00
|
|
|
if (!contextIsSetup)
|
|
|
|
[self _setupContext];
|
2008-07-11 19:32:59 +02:00
|
|
|
height = [moduleSettings objectForKey: @"DragHandleVertical"];
|
2008-02-04 23:22:14 +01:00
|
|
|
|
2012-09-07 21:46:49 +02:00
|
|
|
return ((height && [height intValue] > 0) ? [NSString stringWithFormat: @"%ipx", [height intValue]] : nil);
|
2008-02-04 23:22:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
- (WOResponse *) saveDragHandleStateAction
|
|
|
|
{
|
|
|
|
WORequest *request;
|
|
|
|
NSString *dragHandle;
|
|
|
|
|
2010-01-06 20:43:23 +01:00
|
|
|
if (!contextIsSetup)
|
|
|
|
[self _setupContext];
|
2008-02-04 23:22:14 +01:00
|
|
|
request = [context request];
|
|
|
|
|
|
|
|
if ((dragHandle = [request formValueForKey: @"vertical"]) != nil)
|
|
|
|
[moduleSettings setObject: dragHandle
|
|
|
|
forKey: @"DragHandleVertical"];
|
|
|
|
else if ((dragHandle = [request formValueForKey: @"horizontal"]) != nil)
|
|
|
|
[moduleSettings setObject: dragHandle
|
|
|
|
forKey: @"DragHandleHorizontal"];
|
|
|
|
else
|
|
|
|
return [self responseWithStatus: 400];
|
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
[us synchronize];
|
2008-02-04 23:22:14 +01:00
|
|
|
|
|
|
|
return [self responseWithStatus: 204];
|
|
|
|
}
|
|
|
|
|
2012-09-07 21:46:49 +02:00
|
|
|
- (NSString *) eventsTabClass
|
|
|
|
{
|
|
|
|
NSString *list;
|
|
|
|
|
|
|
|
[self _setupContext];
|
|
|
|
list = [moduleSettings objectForKey: @"SelectedList"];
|
|
|
|
|
|
|
|
return (list && [list compare: @"eventsListView"] == NSOrderedSame)? @"active" : @"";
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString *) tasksTabClass
|
|
|
|
{
|
|
|
|
NSString *list;
|
|
|
|
|
|
|
|
[self _setupContext];
|
|
|
|
list = [moduleSettings objectForKey: @"SelectedList"];
|
|
|
|
|
|
|
|
return (list && [list compare: @"tasksListView"] == NSOrderedSame)? @"active" : @"";
|
|
|
|
}
|
|
|
|
|
2013-01-25 00:50:20 +01:00
|
|
|
- (BOOL) showCompletedTasks
|
|
|
|
{
|
|
|
|
[self _setupContext];
|
|
|
|
|
|
|
|
return [[us objectForKey: @"ShowCompletedTasks"] boolValue];
|
|
|
|
}
|
|
|
|
|
2012-09-07 21:46:49 +02:00
|
|
|
- (WOResponse *) saveSelectedListAction
|
|
|
|
{
|
|
|
|
WORequest *request;
|
2015-08-07 20:13:27 +02:00
|
|
|
NSDictionary *params;
|
2012-09-07 21:46:49 +02:00
|
|
|
NSString *selectedList;
|
|
|
|
|
|
|
|
[self _setupContext];
|
|
|
|
request = [context request];
|
2015-08-07 20:13:27 +02:00
|
|
|
params = [[request contentAsString] objectFromJSONString];
|
2012-09-07 21:46:49 +02:00
|
|
|
|
2015-08-07 20:13:27 +02:00
|
|
|
selectedList = [params objectForKey: @"list"];
|
2012-09-07 21:46:49 +02:00
|
|
|
[moduleSettings setObject: selectedList
|
|
|
|
forKey: @"SelectedList"];
|
|
|
|
[us synchronize];
|
|
|
|
|
|
|
|
return [self responseWithStatus: 204];
|
|
|
|
}
|
|
|
|
|
2013-07-11 19:46:38 +02:00
|
|
|
- (WOResponse *) saveListStateAction
|
|
|
|
{
|
|
|
|
WORequest *request;
|
2016-11-21 22:23:49 +01:00
|
|
|
NSDictionary *params;
|
2013-07-11 19:46:38 +02:00
|
|
|
NSString *state;
|
|
|
|
|
|
|
|
[self _setupContext];
|
|
|
|
request = [context request];
|
2016-11-21 22:23:49 +01:00
|
|
|
params = [[request contentAsString] objectFromJSONString];
|
2013-07-11 19:46:38 +02:00
|
|
|
|
2016-11-21 22:23:49 +01:00
|
|
|
state = [params objectForKey: @"state"];
|
2013-07-11 19:46:38 +02:00
|
|
|
[moduleSettings setObject: state
|
|
|
|
forKey: @"ListState"];
|
|
|
|
[us synchronize];
|
|
|
|
|
|
|
|
return [self responseWithStatus: 204];
|
|
|
|
}
|
|
|
|
|
2016-11-21 22:23:49 +01:00
|
|
|
- (BOOL) listIsCollapsed
|
2013-07-11 19:46:38 +02:00
|
|
|
{
|
|
|
|
NSString *state;
|
|
|
|
|
|
|
|
[self _setupContext];
|
|
|
|
state = [moduleSettings objectForKey: @"ListState"];
|
|
|
|
|
2016-11-21 22:23:49 +01:00
|
|
|
return (state && [state compare: @"collapse"] == NSOrderedSame);
|
2013-07-11 19:46:38 +02:00
|
|
|
}
|
|
|
|
|
2016-04-27 21:25:01 +02:00
|
|
|
- (WOResponse *) saveFoldersOrderAction
|
|
|
|
{
|
|
|
|
WORequest *request;
|
|
|
|
NSDictionary *params;
|
|
|
|
NSArray *list;
|
|
|
|
|
|
|
|
[self _setupContext];
|
|
|
|
request = [context request];
|
|
|
|
params = [[request contentAsString] objectFromJSONString];
|
|
|
|
|
|
|
|
list = [params objectForKey: @"folders"];
|
|
|
|
if (list)
|
|
|
|
[moduleSettings setObject: list
|
|
|
|
forKey: @"FoldersOrder"];
|
|
|
|
else
|
|
|
|
[moduleSettings removeObjectForKey: @"FoldersOrder"];
|
|
|
|
[us synchronize];
|
|
|
|
|
|
|
|
return [self responseWithStatus: 204];
|
|
|
|
}
|
|
|
|
|
2008-07-18 21:25:26 +02:00
|
|
|
- (unsigned int) firstDayOfWeek
|
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
SOGoUserDefaults *ud;
|
|
|
|
|
|
|
|
ud = [[context activeUser] userDefaults];
|
|
|
|
|
|
|
|
return [ud firstDayOfWeek];
|
2008-07-18 21:25:26 +02:00
|
|
|
}
|
|
|
|
|
2008-07-25 20:44:31 +02:00
|
|
|
- (unsigned int) dayStartHour
|
|
|
|
{
|
2009-11-29 05:19:32 +01:00
|
|
|
SOGoUserDefaults *ud;
|
|
|
|
|
|
|
|
ud = [[context activeUser] userDefaults];
|
|
|
|
|
|
|
|
return [ud dayStartHour];
|
2008-07-25 20:44:31 +02:00
|
|
|
}
|
|
|
|
|
2009-06-09 23:25:41 +02:00
|
|
|
- (NSString *) currentView
|
|
|
|
{
|
|
|
|
NSString *view;
|
|
|
|
|
2010-01-06 20:43:23 +01:00
|
|
|
if (!contextIsSetup)
|
|
|
|
[self _setupContext];
|
2009-06-09 23:25:41 +02:00
|
|
|
view = [moduleSettings objectForKey: @"View"];
|
|
|
|
|
|
|
|
return (view ? view : @"weekview");
|
|
|
|
}
|
|
|
|
|
2006-08-19 00:55:46 +02:00
|
|
|
@end
|
2015-04-24 22:48:41 +02:00
|
|
|
|
2015-08-05 22:44:25 +02:00
|
|
|
/* Component Viewer, parent class of Appointment Viewer and Task Viewer */
|
|
|
|
|
|
|
|
@interface UIxComponentViewTemplate : UIxComponent
|
|
|
|
{
|
|
|
|
id item;
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation UIxComponentViewTemplate
|
|
|
|
|
|
|
|
- (id) init
|
|
|
|
{
|
|
|
|
if ((self = [super init]))
|
|
|
|
{
|
|
|
|
item = nil;
|
|
|
|
}
|
|
|
|
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) dealloc
|
|
|
|
{
|
|
|
|
[item release];
|
|
|
|
[super dealloc];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setItem: (id) _item
|
|
|
|
{
|
|
|
|
ASSIGN (item, _item);
|
|
|
|
}
|
|
|
|
|
|
|
|
- (id) item
|
|
|
|
{
|
|
|
|
return item;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSArray *) replyList
|
|
|
|
{
|
|
|
|
return [NSArray arrayWithObjects:
|
|
|
|
[NSNumber numberWithInt: iCalPersonPartStatAccepted],
|
|
|
|
[NSNumber numberWithInt: iCalPersonPartStatDeclined],
|
|
|
|
[NSNumber numberWithInt: iCalPersonPartStatNeedsAction],
|
|
|
|
[NSNumber numberWithInt: iCalPersonPartStatTentative],
|
|
|
|
[NSNumber numberWithInt: iCalPersonPartStatDelegated],
|
|
|
|
nil];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString *) itemReplyText
|
|
|
|
{
|
|
|
|
NSString *word;
|
|
|
|
|
|
|
|
word = [iCalPerson descriptionForParticipationStatus: [item intValue]];
|
|
|
|
|
|
|
|
return [self labelForKey: [NSString stringWithFormat: @"partStat_%@", word]];
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
2015-07-21 14:26:50 +02:00
|
|
|
/* Appointment Viewer */
|
|
|
|
|
2015-08-05 22:44:25 +02:00
|
|
|
@interface UIxAppointmentViewTemplate : UIxComponentViewTemplate
|
2015-07-21 14:26:50 +02:00
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation UIxAppointmentViewTemplate
|
|
|
|
@end
|
|
|
|
|
|
|
|
/* Task Viewer */
|
|
|
|
|
2015-08-05 22:44:25 +02:00
|
|
|
@interface UIxTaskViewTemplate : UIxComponentViewTemplate
|
2015-07-21 14:26:50 +02:00
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation UIxTaskViewTemplate
|
|
|
|
@end
|
|
|
|
|
|
|
|
/* Component Editor, parent class of Appointment Editor and Task Editor */
|
|
|
|
|
2015-06-30 03:03:52 +02:00
|
|
|
@interface UIxComponentEditorTemplate : UIxComponent
|
2015-04-24 22:48:41 +02:00
|
|
|
{
|
|
|
|
id item;
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
2015-06-30 03:03:52 +02:00
|
|
|
@implementation UIxComponentEditorTemplate
|
|
|
|
|
|
|
|
- (id) init
|
|
|
|
{
|
|
|
|
if ((self = [super init]))
|
|
|
|
{
|
|
|
|
item = nil;
|
|
|
|
}
|
|
|
|
|
|
|
|
return self;
|
|
|
|
}
|
2015-04-24 22:48:41 +02:00
|
|
|
|
|
|
|
- (void) dealloc
|
|
|
|
{
|
|
|
|
[item release];
|
|
|
|
[super dealloc];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setItem: (id) _item
|
|
|
|
{
|
|
|
|
ASSIGN (item, _item);
|
|
|
|
}
|
|
|
|
|
|
|
|
- (id) item
|
|
|
|
{
|
|
|
|
return item;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSArray *) repeatList
|
|
|
|
{
|
|
|
|
static NSArray *repeatItems = nil;
|
|
|
|
|
|
|
|
if (!repeatItems)
|
|
|
|
{
|
2015-05-20 17:11:01 +02:00
|
|
|
repeatItems = [NSArray arrayWithObjects: @"never",
|
|
|
|
@"daily",
|
2015-04-24 22:48:41 +02:00
|
|
|
@"weekly",
|
|
|
|
@"monthly",
|
|
|
|
@"yearly",
|
2017-12-15 22:17:51 +01:00
|
|
|
@"custom",
|
2015-04-24 22:48:41 +02:00
|
|
|
nil];
|
|
|
|
[repeatItems retain];
|
|
|
|
}
|
|
|
|
|
|
|
|
return repeatItems;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString *) itemRepeatText
|
|
|
|
{
|
|
|
|
return [self labelForKey: [NSString stringWithFormat: @"repeat_%@", [item uppercaseString]]];
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
2015-06-30 03:03:52 +02:00
|
|
|
|
2015-07-21 14:26:50 +02:00
|
|
|
/* Appointment Editor */
|
|
|
|
|
2015-06-30 03:03:52 +02:00
|
|
|
@interface UIxAppointmentEditorTemplate : UIxComponentEditorTemplate
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation UIxAppointmentEditorTemplate
|
|
|
|
@end
|
|
|
|
|
2015-07-21 14:26:50 +02:00
|
|
|
/* Task Editor */
|
|
|
|
|
2015-06-30 03:03:52 +02:00
|
|
|
@interface UIxTaskEditorTemplate : UIxComponentEditorTemplate
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation UIxTaskEditorTemplate
|
|
|
|
|
|
|
|
- (NSArray *) statusList
|
|
|
|
{
|
|
|
|
static NSArray *statusItems = nil;
|
|
|
|
|
|
|
|
if (!statusItems)
|
|
|
|
{
|
|
|
|
statusItems = [NSArray arrayWithObjects: @"not-specified",
|
|
|
|
@"needs-action",
|
|
|
|
@"in-process",
|
|
|
|
@"completed",
|
|
|
|
@"cancelled",
|
|
|
|
nil];
|
|
|
|
[statusItems retain];
|
|
|
|
}
|
|
|
|
|
|
|
|
return statusItems;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString *) itemStatusText
|
|
|
|
{
|
|
|
|
return [self labelForKey: [NSString stringWithFormat: @"status_%@", [item uppercaseString]]];
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|