diff --git a/ChangeLog b/ChangeLog index cce164c33..27e880935 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +2012-07-09 Jean Raby + + * UI/WebServerResources/SchedulerUI.js (onMenuRawEvent, onMenuRawTask): + New callback to show the event/task content from the menu + + * UI/Scheduler/UIxComponentEditor.m (rawAction): + New method that returns the object's raw content in a WOResponse. + + * UI/Templates/SchedulerUI/UIxCal{Day,Month,Main,Week}View.wox: + New contextual menu item: Show Raw Source + + * UI/WebServerResources/ContactsUI.js (onMenuRawContact): + Rework to use calendar/ics/raw + + * UI/Contacts/UIxContactFolderActions.m (rawAction): + Removed / moved to UI/Contacts/UIxContactActions.m + + * UI/Contacts/UIxContactActions.m (rawAction): + New method that returns the object's raw content in a WOResponse. + + * UI/Templates/ContactsUI/UIxContactFoldersView.wox: + Show vCard content -> Show Raw Source + + 2012-07-05 Jean Raby * UI/WebServerResources/generic.js (openGenericWindow): diff --git a/NEWS b/NEWS index c0d3fbf2e..3e7e020d3 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,7 @@ 1.3.17 (2012-MM-DD) ------------------- New Features - - + - New contextual menu to view the raw content of events, tasks and contacts Enhancements - updated Czech translation diff --git a/UI/Contacts/English.lproj/Localizable.strings b/UI/Contacts/English.lproj/Localizable.strings index 539f2b41d..5c2239220 100644 --- a/UI/Contacts/English.lproj/Localizable.strings +++ b/UI/Contacts/English.lproj/Localizable.strings @@ -195,7 +195,7 @@ "Lists can't be moved or copied." = "Lists can't be moved or copied."; "Export" = "Export"; "Export Address Book..." = "Export Address Book..."; -"Show vCard content" = "Show vCard content"; +"View Raw Source" = "View Raw Source"; "Import Cards" = "Import Cards"; "Select a vCard or LDIF file." = "Select a vCard or LDIF file."; "Upload" = "Upload"; diff --git a/UI/Contacts/French.lproj/Localizable.strings b/UI/Contacts/French.lproj/Localizable.strings index 5efce3d8e..255ee0c08 100644 --- a/UI/Contacts/French.lproj/Localizable.strings +++ b/UI/Contacts/French.lproj/Localizable.strings @@ -195,7 +195,6 @@ "Lists can't be moved or copied." = "Les listes ne peuvent pas être déplacées ou copiées."; "Export" = "Exporter"; "Export Address Book..." = "Exporter le carnet d'adresses..."; -"Show vCard content" = "Afficher le contenu vCard"; "Import Cards" = "Importer des contacts"; "Select a vCard or LDIF file." = "Sélectionner un fichier. LDIF ou vCard."; "Upload" = "Ajouter"; diff --git a/UI/Contacts/UIxContactActions.m b/UI/Contacts/UIxContactActions.m index aa4cc7138..4ed09e295 100644 --- a/UI/Contacts/UIxContactActions.m +++ b/UI/Contacts/UIxContactActions.m @@ -130,4 +130,21 @@ return [self _setOrUnsetCategoryAction: NO]; } +// returns the raw content of the object +- (WOResponse *) rawAction +{ + NSMutableString *content; + WOResponse *response; + + content = [NSMutableString string]; + response = [context response]; + + [content appendFormat: [[self clientObject] contentAsString]]; + [response setHeader: @"text/plain; charset=utf-8" + forKey: @"content-type"]; + [response appendContentString: content]; + + return response; +} + @end diff --git a/UI/Contacts/UIxContactFolderActions.m b/UI/Contacts/UIxContactFolderActions.m index 4d2f6cccb..a8831a12c 100644 --- a/UI/Contacts/UIxContactFolderActions.m +++ b/UI/Contacts/UIxContactFolderActions.m @@ -287,51 +287,4 @@ return rc; } -- (id ) rawAction -{ - WORequest *request; - WOResponse *response; - NSArray *contactsId; - NSEnumerator *uids; - NSString *uid; - id currentChild; - SOGoContactGCSFolder *sourceFolder; - NSMutableString *content; - - content = [NSMutableString string]; - request = [context request]; - response = [context response]; - sourceFolder = [self clientObject]; - contactsId = [request formValuesForKey: @"uid"]; - - if ((uids = [contactsId objectEnumerator])) - { - while ((uid = [uids nextObject])) - { - currentChild = [sourceFolder lookupName: uid - inContext: [self context] - acquire: NO]; - if([currentChild isKindOfClass: [NSException class]]) - continue; - [content appendFormat: [currentChild contentAsString]]; - [content appendString: @"\n"]; - } - } - - if (![content length]) - { - response = [self responseWithStatus: 404 - andString: @"Contact does not exist"]; - } - else - { - [response setHeader: @"text/plain; charset=utf-8" - forKey: @"content-type"]; - [response appendContentString: content]; - } - - return response; -} - - @end /* UIxContactsListView */ diff --git a/UI/Contacts/product.plist b/UI/Contacts/product.plist index 6ee56d387..dbec6108a 100644 --- a/UI/Contacts/product.plist +++ b/UI/Contacts/product.plist @@ -99,11 +99,6 @@ actionClass = "UIxContactFolderActions"; actionName = "export"; }; - raw = { - protectedBy = "View"; - actionClass = "UIxContactFolderActions"; - actionName = "raw"; - }; exportFolder = { protectedBy = "View"; actionClass = "UIxContactFolderActions"; @@ -206,6 +201,11 @@ actionClass = "UIxContactActions"; actionName = "unsetCategory"; }; + raw = { + protectedBy = "View"; + actionClass = "UIxContactActions"; + actionName = "raw"; + }; }; }; @@ -238,6 +238,11 @@ pageName = "UIxListEditor"; actionName = "save"; }; + raw = { + protectedBy = "View"; + actionClass = "UIxContactActions"; + actionName = "raw"; + }; }; }; diff --git a/UI/Scheduler/English.lproj/Localizable.strings b/UI/Scheduler/English.lproj/Localizable.strings index 8aa9e8642..66f4982a0 100644 --- a/UI/Scheduler/English.lproj/Localizable.strings +++ b/UI/Scheduler/English.lproj/Localizable.strings @@ -565,6 +565,7 @@ vtodo_class2 = "(Confidential task)"; "Delete Task" = "Delete Task"; "Delete Event" = "Delete Event"; "Copy event to my calendar" = "Copy event to my calendar"; +"View Raw Source" = "View Raw Source"; "Subscribe to a web calendar..." = "Subscribe to a web calendar..."; "URL of the Calendar" = "URL of the Calendar"; diff --git a/UI/Scheduler/UIxComponentEditor.m b/UI/Scheduler/UIxComponentEditor.m index 3813f9646..d79993de1 100644 --- a/UI/Scheduler/UIxComponentEditor.m +++ b/UI/Scheduler/UIxComponentEditor.m @@ -2526,4 +2526,21 @@ RANGE(2); return [[self clientObject] ownerInContext: context]; } +// returns the raw content of the object +- (WOResponse *) rawAction +{ + NSMutableString *content; + WOResponse *response; + + content = [NSMutableString string]; + response = [context response]; + + [content appendFormat: [[self clientObject] contentAsString]]; + [response setHeader: @"text/plain; charset=utf-8" + forKey: @"content-type"]; + [response appendContentString: content]; + + return response; +} + @end diff --git a/UI/Scheduler/product.plist b/UI/Scheduler/product.plist index fa3f719e1..d23ccf387 100644 --- a/UI/Scheduler/product.plist +++ b/UI/Scheduler/product.plist @@ -235,6 +235,11 @@ actionClass = "UIxAppointmentActions"; actionName = "copy"; }; + raw = { + protectedBy = "ViewAllComponent"; + actionClass = "UIxComponentEditor"; + actionName = "raw"; + }; accept = { protectedBy = "RespondToComponent"; pageName = "UIxAppointmentEditor"; @@ -304,6 +309,11 @@ pageName = "UIxTaskEditor"; actionName = "changeStatus"; }; + raw = { + protectedBy = "ViewAllComponent"; + pageName = "UIxComponentEditor"; + actionName = "raw"; + }; }; }; diff --git a/UI/Templates/ContactsUI/UIxContactFoldersView.wox b/UI/Templates/ContactsUI/UIxContactFoldersView.wox index 716fa06e9..5cbecd695 100644 --- a/UI/Templates/ContactsUI/UIxContactFoldersView.wox +++ b/UI/Templates/ContactsUI/UIxContactFoldersView.wox @@ -84,7 +84,7 @@
  • -
  • +
  • diff --git a/UI/Templates/SchedulerUI/UIxCalDayView.wox b/UI/Templates/SchedulerUI/UIxCalDayView.wox index 34f291a9d..f41be3a5d 100644 --- a/UI/Templates/SchedulerUI/UIxCalDayView.wox +++ b/UI/Templates/SchedulerUI/UIxCalDayView.wox @@ -17,6 +17,7 @@
  • +
  • +
  • +
  • diff --git a/UI/Templates/SchedulerUI/UIxCalMonthView.wox b/UI/Templates/SchedulerUI/UIxCalMonthView.wox index f49827c5d..f01954dcd 100644 --- a/UI/Templates/SchedulerUI/UIxCalMonthView.wox +++ b/UI/Templates/SchedulerUI/UIxCalMonthView.wox @@ -17,6 +17,7 @@
  • +
  • +