From dc48e05dd37ae05a5d2c16c8b0da8da76e07582e Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Wed, 13 May 2015 13:12:15 -0400 Subject: [PATCH] (feat) print event/task description in list view (#2881) --- NEWS | 1 + SoObjects/Appointments/SOGoAppointmentFolder.m | 2 +- SoObjects/Appointments/iCalEvent+SOGo.m | 6 ++++++ SoObjects/Appointments/iCalToDo+SOGo.m | 6 ++++++ UI/Scheduler/UIxCalListingActions.m | 4 ++-- UI/WebServerResources/UIxCalViewPrint.js | 13 +++++++++++-- 6 files changed, 27 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index 23e65b00e..0287f5a22 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,7 @@ Enhancements - synchronize events, contacts and tasks in reverse chronological order (Zentyal) - during login, we now extract the domain from the user to accelerate authentication requests on sources - make sure sure email invitations can always be read by EAS clients + - now able to print event/task's description (new components only) in the list view (#2881) Bug fixes - now keep the BodyPreference for future EAS use and default to MIME if none set (#3146) diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 9b670d83b..915fd4aa5 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -2814,7 +2814,7 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir @"c_category", @"c_classification", @"c_isallday", @"c_isopaque", @"c_participants", @"c_partmails", @"c_partstates", @"c_sequence", @"c_priority", - @"c_cycleinfo", @"c_iscycle", @"c_nextalarm", nil]; + @"c_cycleinfo", @"c_iscycle", @"c_nextalarm", @"c_description", nil]; return [self fetchFields: infos from: _startDate to: _endDate title: title component: _component diff --git a/SoObjects/Appointments/iCalEvent+SOGo.m b/SoObjects/Appointments/iCalEvent+SOGo.m index 485d2822e..a19dcf3cd 100644 --- a/SoObjects/Appointments/iCalEvent+SOGo.m +++ b/SoObjects/Appointments/iCalEvent+SOGo.m @@ -248,6 +248,12 @@ else [row setObject: [NSNull null] forKey: @"c_category"]; + /* handle description */ + if ([self comment]) + [row setObject: [self comment] forKey: @"c_description"]; + else + [row setObject: [NSNull null] forKey: @"c_description"]; + return row; } diff --git a/SoObjects/Appointments/iCalToDo+SOGo.m b/SoObjects/Appointments/iCalToDo+SOGo.m index cb42c6a03..79ed39265 100644 --- a/SoObjects/Appointments/iCalToDo+SOGo.m +++ b/SoObjects/Appointments/iCalToDo+SOGo.m @@ -177,6 +177,12 @@ [row setObject: [categories componentsJoinedByString: @","] forKey: @"c_category"]; + /* handle description */ + if ([self comment]) + [row setObject: [self comment] forKey: @"c_description"]; + else + [row setObject: [NSNull null] forKey: @"c_description"]; + return row; } diff --git a/UI/Scheduler/UIxCalListingActions.m b/UI/Scheduler/UIxCalListingActions.m index 32d2a6a7f..59e124326 100644 --- a/UI/Scheduler/UIxCalListingActions.m +++ b/UI/Scheduler/UIxCalListingActions.m @@ -89,7 +89,7 @@ static NSArray *tasksFields = nil; @"c_partmails", @"c_partstates", @"c_owner", @"c_iscycle", @"c_nextalarm", @"c_recurrence_id", @"isException", @"editable", - @"erasable", @"ownerIsOrganizer", nil]; + @"erasable", @"ownerIsOrganizer", @"c_description", nil]; [eventsFields retain]; } if (!tasksFields) @@ -99,7 +99,7 @@ static NSArray *tasksFields = nil; @"c_status", @"c_title", @"c_enddate", @"c_classification", @"c_location", @"c_category", @"editable", @"erasable", - @"c_priority", @"c_owner", @"c_recurrence_id", @"isException", nil]; + @"c_priority", @"c_owner", @"c_recurrence_id", @"isException", @"c_description", nil]; [tasksFields retain]; } } diff --git a/UI/WebServerResources/UIxCalViewPrint.js b/UI/WebServerResources/UIxCalViewPrint.js index 0fe3a6385..f0b35bf86 100644 --- a/UI/WebServerResources/UIxCalViewPrint.js +++ b/UI/WebServerResources/UIxCalViewPrint.js @@ -538,7 +538,7 @@ function _parseEvent(event) { var end = _("End:"); var location = _("Location:"); var calendar = _("Calendar:"); - + var description = _("Description:"); var newEvent = document.createElement("div"); var table = document.createElement("table"); Element.addClassName(newEvent, "divEventsPreview"); @@ -562,7 +562,11 @@ function _parseEvent(event) { var calendarCell = row.insertCell(0); Element.addClassName(calendarCell, "cellFormat"); var calendarCellValue = row.insertCell(1); - + row = table.insertRow(5); + var descriptionCell = row.insertCell(0); + Element.addClassName(descriptionCell, "cellFormat"); + var descriptionCellValue = row.insertCell(1); + title.innerHTML = event[4]; startCell.innerHTML = start; var startDate = new Date(event[5] *1000); @@ -575,6 +579,11 @@ function _parseEvent(event) { calendarCell.innerHTML = calendar; calendarCellValue.innerHTML = event[2]; + if (event[21] && event[21].length) { + descriptionCell.innerHTML = description; + descriptionCellValue.innerHTML = event[21]; + } + if (printColors.checked) { var allColors = window.parentvar("UserSettings")['Calendar']['FolderColors']; var owner = event[13];