From 3e357eb6e9c62ee4b343e4b7181736a15441b2ef Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Thu, 30 Jul 2009 01:07:17 +0000 Subject: [PATCH] When viewing read-only event, organizer is shown only if event has attendees Monotone-Parent: 1857b430e01dba18873b059ee5977d9ca10bea8e Monotone-Revision: 09a0f45d386d7951e7a9222e26d26b67281bf847 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2009-07-30T01:07:17 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ UI/Scheduler/UIxComponentEditor.h | 2 ++ UI/Scheduler/UIxComponentEditor.m | 7 ++++++- UI/Templates/SchedulerUI/UIxComponentEditor.wox | 6 ++++-- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 96d4ecfee..42e45b227 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-07-29 Francis Lachapelle + * UI/Scheduler/UIxComponentEditor.m ([UIxComponentEditor + -hasAttendees]): new method used to show organizer only if the event + has attenddes (read-only view). + * UI/Scheduler/UIxTaskEditor.m ([UIxTaskEditor -taskStartDateTimeText]): new method to return a localized description of the start date and time. diff --git a/UI/Scheduler/UIxComponentEditor.h b/UI/Scheduler/UIxComponentEditor.h index 2fdb1b28d..4886ee918 100644 --- a/UI/Scheduler/UIxComponentEditor.h +++ b/UI/Scheduler/UIxComponentEditor.h @@ -140,6 +140,8 @@ - (void) setAttach: (NSString *) _attachUrl; - (NSString *) attach; +- (BOOL) hasAttendees; + - (void) setAttendeesNames: (NSString *) newAttendeesNames; - (NSString *) attendeesNames; diff --git a/UI/Scheduler/UIxComponentEditor.m b/UI/Scheduler/UIxComponentEditor.m index 7985adf25..3e6fa16b5 100644 --- a/UI/Scheduler/UIxComponentEditor.m +++ b/UI/Scheduler/UIxComponentEditor.m @@ -744,6 +744,11 @@ iRANGE(2); // return [item keysWithFormat: @"%{fullName} <%{email}>"]; //} +- (BOOL) hasAttendees +{ + return ([[component attendees] count] > 0); +} + - (void) setAttendeesNames: (NSString *) newAttendeesNames { ASSIGN (attendeesNames, newAttendeesNames); @@ -1536,7 +1541,7 @@ RANGE(2); owner = [componentCalendar ownerInContext: context]; login = [[context activeUser] login]; isOwner = [owner isEqualToString: login]; - hasAttendees = ([[component attendees] count] > 0); + hasAttendees = [self hasAttendees]; organizerEmail = [[component organizer] email]; hasOrganizer = ([organizerEmail length] > 0); diff --git a/UI/Templates/SchedulerUI/UIxComponentEditor.wox b/UI/Templates/SchedulerUI/UIxComponentEditor.wox index c683960f1..6b085ed51 100644 --- a/UI/Templates/SchedulerUI/UIxComponentEditor.wox +++ b/UI/Templates/SchedulerUI/UIxComponentEditor.wox @@ -203,9 +203,11 @@ - +