Author: deepak
Date: Sat Sep 3 12:24:49 2016 New Revision: 1759085 URL: http://svn.apache.org/viewvc?rev=1759085&view=rev Log: (OFBIZ-7997) Applied patch from jira issue ===================================== Add UI labels for success / error messages in scrum component ===================================== Thanks Tanmay for your contribution. Modified: ofbiz/trunk/specialpurpose/scrum/config/scrumUiLabels.xml ofbiz/trunk/specialpurpose/scrum/src/main/java/org/apache/ofbiz/scrum/ScrumServices.java Modified: ofbiz/trunk/specialpurpose/scrum/config/scrumUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/scrum/config/scrumUiLabels.xml?rev=1759085&r1=1759084&r2=1759085&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/scrum/config/scrumUiLabels.xml (original) +++ ofbiz/trunk/specialpurpose/scrum/config/scrumUiLabels.xml Sat Sep 3 12:24:49 2016 @@ -755,6 +755,9 @@ under the License. <value xml:lang="zh">æ交è </value> <value xml:lang="zh-TW">æ交è </value> </property> + <property key="ScrumCommunicationEventIdRequired"> + <value xml:lang="en">A communication event id is required.</value> + </property> <property key="ScrumCommunications"> <value xml:lang="en">Communications</value> <value xml:lang="ja">ã³ãã¥ãã±ã¼ã·ã§ã³</value> @@ -969,6 +972,9 @@ under the License. <value xml:lang="zh">é¢è®¡å°æ¶æ°</value> <value xml:lang="zh-TW">é è¨å°ææ¸</value> </property> + <property key="ScrumErrorCallingUpdatingCommeventStatus"> + <value xml:lang="en">Error calling updating commevent status:</value> + </property> <property key="ScrumErrorTasksList"> <value xml:lang="en">Error Tasks List</value> <value xml:lang="ja">ã¨ã©ã¼ã¿ã¹ã¯ä¸è¦§</value> @@ -1001,6 +1007,9 @@ under the License. <value xml:lang="zh">ä»»å¡ï¼${parameters.workEffortId}没æè¿å±ï¼æ²¡ææ·»å 请æ±</value> <value xml:lang="zh-TW">ä»»å:${parameters.workEffortId}æ²æé²å±,æ²æå¢å è«æ±</value> </property> + <property key="ScrumFindByPrimaryKeyError"> + <value xml:lang="en">Find by primary key error:</value> + </property> <property key="ScrumFindProduct"> <value xml:lang="en">Find Product</value> <value xml:lang="ja">製åãæ¤ç´¢</value> Modified: ofbiz/trunk/specialpurpose/scrum/src/main/java/org/apache/ofbiz/scrum/ScrumServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/scrum/src/main/java/org/apache/ofbiz/scrum/ScrumServices.java?rev=1759085&r1=1759084&r2=1759085&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/scrum/src/main/java/org/apache/ofbiz/scrum/ScrumServices.java (original) +++ ofbiz/trunk/specialpurpose/scrum/src/main/java/org/apache/ofbiz/scrum/ScrumServices.java Sat Sep 3 12:24:49 2016 @@ -25,11 +25,13 @@ import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Set; import org.apache.ofbiz.base.util.Debug; import org.apache.ofbiz.base.util.UtilMisc; +import org.apache.ofbiz.base.util.UtilProperties; import org.apache.ofbiz.base.util.UtilValidate; import org.apache.ofbiz.entity.Delegator; import org.apache.ofbiz.entity.GenericEntityException; @@ -47,9 +49,10 @@ import org.apache.ofbiz.service.ServiceU public class ScrumServices { public static final String module = ScrumServices.class.getName(); - + public static final String resource = "scrumUiLabels"; public static Map<String, Object> linkToProduct(DispatchContext ctx, Map<String, ? extends Object> context) { Delegator delegator = ctx.getDelegator(); + Locale locale = (Locale)context.get("locale"); LocalDispatcher dispatcher = ctx.getDispatcher(); String communicationEventId = (String) context.get("communicationEventId"); // Debug.logInfo("==== Processing Commevent: " + communicationEventId, module); @@ -85,7 +88,7 @@ public class ScrumServices { } } catch (GenericServiceException e1) { Debug.logError(e1, "Error calling updating commevent status", module); - return ServiceUtil.returnError("Error calling updating commevent status:" + e1.toString()); + return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ScrumErrorCallingUpdatingCommeventStatus", locale) + e1.toString()); } } else { Debug.logInfo("Product id " + productId + " found in subject but not in database", module); @@ -95,13 +98,13 @@ public class ScrumServices { } } catch (GenericEntityException e) { - return ServiceUtil.returnError("find by primary key error:" + e.toString()); + return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ScrumFindByPrimaryKeyError", locale) + e.toString()); } Map<String, Object> result = ServiceUtil.returnSuccess(); return result; } else { - Map<String, Object> result = ServiceUtil.returnError("A communication event id is required"); + Map<String, Object> result = ServiceUtil.returnError(UtilProperties.getMessage(resource, "ScrumCommunicationEventIdRequired", locale)); return result; } } |
Free forum by Nabble | Edit this page |