Monotone-Parent: 876ba6f8e90111e66883f54764726131c606347e

Monotone-Revision: 68cc79a189835b0bd3dd288537e10828f70dc4da

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2006-10-13T23:23:44
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2006-10-13 23:23:44 +00:00
parent 9a5b43aa7c
commit ddd255114c
4 changed files with 168 additions and 0 deletions

View File

@@ -1,5 +1,8 @@
2006-10-13 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/Scheduler/UIxCalCalendarsListView.m: new component class that
wrap a selector the the "Calendars" tab.
* UI/Contacts/UIxContactsCalendarsSelection.m: buttons for the
new user calendar selector.

View File

@@ -0,0 +1,36 @@
/* UIxCalCalendarsListView.h - this file is part of SOGo
*
* Copyright (C) 2006 Inverse groupe conseil
*
* Author: Wolfgang Sourdeau <wsourdeau@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 UIXCALCALENDARSLISTVIEW_H
#define UIXCALCALENDARSLISTVIEW_H
#import <SOGoUI/UIxComponent.h>
@interface UIxCalCalendarsListView : UIxComponent
{
NSMutableArray *checkedContacts;
NSMutableArray *contacts;
}
@end
#endif /* UIXCALCALENDARSLISTVIEW_H */

View File

@@ -0,0 +1,96 @@
/* UIxCalCalendarsListView.m - this file is part of SOGo
*
* Copyright (C) 2006 Inverse groupe conseil
*
* Author: Wolfgang Sourdeau <wsourdeau@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/NSArray.h>
#import <Foundation/NSString.h>
#import <Foundation/NSUserDefaults.h>
#import <SOGo/AgenorUserManager.h>
#import <SOGo/SOGoUser.h>
#import "UIxCalCalendarsListView.h"
@implementation UIxCalCalendarsListView
- (id) init
{
if ((self = [super init]))
{
contacts = nil;
checkedContacts = nil;
}
return self;
}
- (void) _setupContacts
{
AgenorUserManager *um;
SOGoUser *user;
NSString *list, *currentId;
NSEnumerator *rawContacts;
iCalPerson *currentContact;
contacts = [NSMutableArray array];
checkedContacts = [NSMutableArray array];
um = [AgenorUserManager sharedUserManager];
user = [context activeUser];
list = [[user userDefaults] stringForKey: @"calendaruids"];
if ([list length] == 0)
list = [self shortUserNameForDisplay];
rawContacts
= [[list componentsSeparatedByString: @","] objectEnumerator];
currentId = [rawContacts nextObject];
while (currentId)
{
if ([currentId hasPrefix: @"-"])
currentContact
= [um iCalPersonWithUid: [currentId substringFromIndex: 1]];
else
{
currentContact = [um iCalPersonWithUid: currentId];
[checkedContacts addObject: currentContact];
}
[contacts addObject: currentContact];
currentId = [rawContacts nextObject];
}
}
- (NSArray *) contacts
{
if (!contacts)
[self _setupContacts];
return contacts;
}
- (NSArray *) checkedContacts
{
if (!checkedContacts)
[self _setupContacts];
return checkedContacts;
}
@end

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" standalone="yes"?>
<container
xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:rsrc="OGo:url"
xmlns:label="OGo:label">
<var:component className="UIxContactSelector"
const:selectorId="calendarsList"
const:hasCheckBoxes="YES"
const:checkBoxOnChange="return updateCalendarStatus(this);"
contacts="contacts"
checkedBoxes="checkedContacts"
/>
<!-- <ul id="calendarsList"
onselectionchange="onCalendarSelectionChange();"
multiselect="yes">
<var:foreach list="fetchUsersCalendar"
item="currentCalendar"
><li var:id="currentCalendar.uid"
var:class="currentStatusClass"
onmousedown="return false;"
onclick="return onRowClick(event);"
><input class="checkBox"
var:checked="currentCalendar.visible"
type="checkbox"
onchange="return updateCalendarStatus(this);"
/><var:string value="currentCalendar.fullName"
const:escapeHTML="NO"
/></li>
</var:foreach>
</ul> -->
</container>