diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/person/person.put.json.js b/config/alfresco/templates/webscripts/org/alfresco/repository/person/person.put.json.js index 47893bd1a3..4aae158639 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/repository/person/person.put.json.js +++ b/config/alfresco/templates/webscripts/org/alfresco/repository/person/person.put.json.js @@ -34,7 +34,58 @@ function main() { person.properties["jobtitle"] = json.get("jobtitle"); } - + if (!json.isNull("location")) + { + person.properties["location"] = json.get("location"); + } + if (!json.isNull("telephone")) + { + person.properties["telephone"] = json.get("telephone"); + } + if (!json.isNull("mobile")) + { + person.properties["mobile"] = json.get("mobile"); + } + if (!json.isNull("companyaddress1")) + { + person.properties["companyaddress1"] = json.get("companyaddress1"); + } + if (!json.isNull("companyaddress2")) + { + person.properties["companyaddress2"] = json.get("companyaddress2"); + } + if (!json.isNull("companyaddress3")) + { + person.properties["companyaddress3"] = json.get("companyaddress3"); + } + if (!json.isNull("companypostcode")) + { + person.properties["companypostcode"] = json.get("companypostcode"); + } + if (!json.isNull("companytelephone")) + { + person.properties["companytelephone"] = json.get("companytelephone"); + } + if (!json.isNull("companyfax")) + { + person.properties["companyfax"] = json.get("companyfax"); + } + if (!json.isNull("companyemail")) + { + person.properties["companyemail"] = json.get("companyemail"); + } + if (!json.isNull("skype")) + { + person.properties["skype"] = json.get("skype"); + } + if (!json.isNull("instantmsg")) + { + person.properties["instantmsg"] = json.get("instantmsg"); + } + if (!json.isNull("persondescription")) + { + person.properties["persondescription"] = json.get("persondescription"); + } // Update the person node with the modified details person.save(); diff --git a/source/java/org/alfresco/repo/web/scripts/calendar/AbstractCalendarWebScript.java b/source/java/org/alfresco/repo/web/scripts/calendar/AbstractCalendarWebScript.java index 4514fdfec3..0f380f80ce 100644 --- a/source/java/org/alfresco/repo/web/scripts/calendar/AbstractCalendarWebScript.java +++ b/source/java/org/alfresco/repo/web/scripts/calendar/AbstractCalendarWebScript.java @@ -21,6 +21,7 @@ package org.alfresco.repo.web.scripts.calendar; import java.io.IOException; import java.io.Serializable; import java.io.StringWriter; +import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; @@ -66,6 +67,8 @@ import org.springframework.extensions.webscripts.json.JSONWriter; */ public abstract class AbstractCalendarWebScript extends DeclarativeWebScript { + private static final String ALL_DAY_DATETIME_PATTERN = "yyyy-MM-dd'T00:00:00.000'"; + private static final DateTimeFormatter ALL_DAY_DATETIME_FORMATTER = DateTimeFormat.forPattern("yyyy-MM-dd'T00:00:00.000'"); public static final String CALENDAR_SERVICE_ACTIVITY_APP_NAME = "calendar"; @@ -520,17 +523,31 @@ public abstract class AbstractCalendarWebScript extends DeclarativeWebScript */ protected String removeTimeZoneIfRequired(Date date, Boolean isAllDay, Boolean removeTimezone, String datePattern) { - DateTime dateTime = (removeTimezone) ? (new DateTime(date, DateTimeZone.UTC)) : (new DateTime(date)); + if (removeTimezone) + { + DateTime dateTime = new DateTime(date, DateTimeZone.UTC); - if (null == datePattern) - { - return dateTime.toString((isAllDay) ? (ALL_DAY_DATETIME_FORMATTER) : (ISODateTimeFormat.dateTime())); + if (null == datePattern) + { + return dateTime.toString((isAllDay) ? (ALL_DAY_DATETIME_FORMATTER) : (ISODateTimeFormat.dateTime())); + } + else + { + // For Legacy Dates and Times. + return dateTime.toString(DateTimeFormat.forPattern(datePattern)); + } } - else + + // This is for all other cases, including the case, when UTC time zone is configured + + if (!isAllDay && (null == datePattern)) { - // For Legacy Dates and Times. - return dateTime.toString(DateTimeFormat.forPattern(datePattern)); + return ISO8601DateFormat.format(date); } + + DateFormat simpleDateFormat = new SimpleDateFormat((null != datePattern) ? (datePattern) : (ALL_DAY_DATETIME_PATTERN)); + + return simpleDateFormat.format(date); } protected abstract Map executeImpl(SiteInfo site,