Author: adrianc
Date: Tue Oct 28 10:52:00 2008 New Revision: 708620 URL: http://svn.apache.org/viewvc?rev=708620&view=rev Log: New feature - work effort event reminders. Only works with email for now. Internationalization note: this commit contains new UI labels. Added: ofbiz/trunk/applications/workeffort/config/EventReminders.properties (with props) ofbiz/trunk/applications/workeffort/webapp/workeffort/workeffort/EventReminderEmail.ftl (with props) Modified: ofbiz/trunk/applications/workeffort/config/WorkEffortUiLabels.xml ofbiz/trunk/applications/workeffort/entitydef/entitymodel.xml ofbiz/trunk/applications/workeffort/entitydef/entitymodel_view.xml ofbiz/trunk/applications/workeffort/servicedef/services.xml ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java ofbiz/trunk/applications/workeffort/webapp/workeffort/WEB-INF/controller.xml ofbiz/trunk/applications/workeffort/widget/WorkEffortForms.xml ofbiz/trunk/applications/workeffort/widget/WorkEffortMenus.xml ofbiz/trunk/applications/workeffort/widget/WorkEffortRelatedSummaryScreens.xml ofbiz/trunk/applications/workeffort/widget/WorkEffortScreens.xml Added: ofbiz/trunk/applications/workeffort/config/EventReminders.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/config/EventReminders.properties?rev=708620&view=auto ============================================================================== --- ofbiz/trunk/applications/workeffort/config/EventReminders.properties (added) +++ ofbiz/trunk/applications/workeffort/config/EventReminders.properties Tue Oct 28 10:52:00 2008 @@ -0,0 +1,25 @@ +############################################################################### +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +############################################################################### + +# The "from" address for emailed calendar event reminders +eventReminders.emailFromAddress=[hidden email] +# The screen widget used for emailed calendar event reminders. The parameters Map +# passed to the screen widget will contain the workEffortId, the event date/time, +# the locale, and the time zone specified in the reminder. +eventReminders.emailScreenWidgetLocation=component://workeffort/widget/WorkEffortScreens.xml#WorkEffortEventReminderEmail Propchange: ofbiz/trunk/applications/workeffort/config/EventReminders.properties ------------------------------------------------------------------------------ svn:eol-style = native Modified: ofbiz/trunk/applications/workeffort/config/WorkEffortUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/config/WorkEffortUiLabels.xml?rev=708620&r1=708619&r2=708620&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/config/WorkEffortUiLabels.xml (original) +++ ofbiz/trunk/applications/workeffort/config/WorkEffortUiLabels.xml Tue Oct 28 10:52:00 2008 @@ -62,6 +62,9 @@ <value xml:lang="th">วัà¸à¸à¸µà¹à¹à¸£à¸´à¹à¸¡à¸à¸²à¸¡à¸à¸§à¸²à¸¡à¸à¸£à¸´à¸</value> <value xml:lang="zh">å®é å¼å§æ¥æ</value> </property> + <property key="FormFieldTitle_allocatedCost"> + <value xml:lang="en">Allocated Cost</value> + </property> <property key="FormFieldTitle_availabilityStatusId"> <value xml:lang="en">Availability</value> <value xml:lang="fr">Disponibilité</value> @@ -821,6 +824,9 @@ <value xml:lang="en">Add Work Effort Fixed Asset Assignment</value> <value xml:lang="fr">Ajouter l'affectation d'unetâche à une immobilisation</value> </property> + <property key="PageTitleAddWorkEffortEventReminder"> + <value xml:lang="en">Add Work Effort Event Reminder</value> + </property> <property key="PageTitleAddWorkEffortKeyword"> <value xml:lang="en">Add Work Effort Keyword</value> <value xml:lang="fr">Ajouter un mot clé à la tâche</value> @@ -1179,6 +1185,9 @@ <value xml:lang="en">Work Effort Fixed Asset Assignments</value> <value xml:lang="fr">Affectations d'une tâche à une immobilisation</value> </property> + <property key="PageTitleListWorkEffortEventReminders"> + <value xml:lang="en">Work Effort Event Reminders</value> + </property> <property key="PageTitleListWorkEffortKeyword"> <value xml:lang="en">Work Effort Keywords</value> <value xml:lang="fr">Mots-clé de la tâche</value> @@ -2549,6 +2558,12 @@ <value xml:lang="th">สà¸à¸²à¸à¸°à¹à¸«à¸à¸¸à¸à¸²à¸£à¸à¹</value> <value xml:lang="zh">äºä»¶ç¶æ</value> </property> + <property key="WorkEffortEventReminder"> + <value xml:lang="en">Event Reminder</value> + </property> + <property key="WorkEffortEventReminders"> + <value xml:lang="en">Event Reminders</value> + </property> <property key="WorkEffortExpectation"> <value xml:lang="en">Expectation</value> <value xml:lang="es">E</value> Modified: ofbiz/trunk/applications/workeffort/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/entitydef/entitymodel.xml?rev=708620&r1=708619&r2=708620&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/entitydef/entitymodel.xml (original) +++ ofbiz/trunk/applications/workeffort/entitydef/entitymodel.xml Tue Oct 28 10:52:00 2008 @@ -524,6 +524,34 @@ <key-map field-name="deliverableId"/> </relation> </entity> + <entity entity-name="WorkEffortEventReminder" + package-name="org.ofbiz.workeffort.workeffort" + title="Work Effort Event Reminder Entity"> + <field name="workEffortId" type="id-ne"></field> + <field name="contactMechId" type="id-ne"></field> + <field name="sequenceId" type="id-ne"></field> + <field name="isPopup" type="indicator"></field> + <field name="reminderDateTime" type="date-time"></field> + <field name="repeatCount" type="numeric"></field> + <field name="repeatInterval" type="numeric"> + <description>The millisecond interval between reminder repeats</description> + </field> + <field name="currentCount" type="numeric"></field> + <field name="recurrenceOffset" type="numeric"> + <description>If the work effort is recurring, the millisecond offset from + the recurring event that will be used to calculate the reminder date/time</description> + </field> + <field name="localeId" type="id"></field> + <field name="timeZoneId" type="id-long"></field> + <prim-key field="workEffortId"/> + <prim-key field="sequenceId"/> + <relation type="one" fk-name="WE_EVENT_REMIND_WE" rel-entity-name="WorkEffort"> + <key-map field-name="workEffortId"/> + </relation> + <relation type="one" fk-name="WE_EVENT_REMIND_CM" rel-entity-name="ContactMech"> + <key-map field-name="contactMechId"/> + </relation> + </entity> <entity entity-name="WorkEffortFixedAssetAssign" package-name="org.ofbiz.workeffort.workeffort" title="Work Effort Fixed Asset Assignment Entity"> Modified: ofbiz/trunk/applications/workeffort/entitydef/entitymodel_view.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/entitydef/entitymodel_view.xml?rev=708620&r1=708619&r2=708620&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/entitydef/entitymodel_view.xml (original) +++ ofbiz/trunk/applications/workeffort/entitydef/entitymodel_view.xml Tue Oct 28 10:52:00 2008 @@ -172,15 +172,20 @@ <view-entity entity-name="WorkEffortAndFixedAssetAssign" package-name="org.ofbiz.workeffort.workeffort" title="Work Effort And Fixed Asset Assignment View Entity"> - <member-entity entity-alias="WE" entity-name="WorkEffort"/> <member-entity entity-alias="WEFAA" entity-name="WorkEffortFixedAssetAssign"/> + <member-entity entity-alias="WE" entity-name="WorkEffort"/> + <member-entity entity-alias="FA" entity-name="FixedAsset"/> + <alias-all entity-alias="WEFAA"/> <alias-all entity-alias="WE"> <exclude field="fixedAssetId"/> </alias-all> - <alias-all entity-alias="WEFAA"/> - <view-link entity-alias="WE" rel-entity-alias="WEFAA"> + <alias-all entity-alias="FA"/> + <view-link entity-alias="WEFAA" rel-entity-alias="WE"> <key-map field-name="workEffortId"/> </view-link> + <view-link entity-alias="WEFAA" rel-entity-alias="FA"> + <key-map field-name="fixedAssetId"/> + </view-link> <relation type="one-nofk" rel-entity-name="FixedAsset"> <key-map field-name="fixedAssetId"/> </relation> @@ -475,7 +480,10 @@ <member-entity entity-alias="WEPA" entity-name="WorkEffortPartyAssignment"/> <member-entity entity-alias="PNV" entity-name="PartyNameView"/> <alias-all entity-alias="PNV"/> - <alias-all entity-alias="WEPA"/> + <alias-all entity-alias="WEPA"> + <exclude field="statusId"/> + </alias-all> + <alias name="assignmentStatusId" entity-alias="WEPA" field="statusId"/> <view-link entity-alias="WEPA" rel-entity-alias="PNV"> <key-map field-name="partyId"/> </view-link> @@ -504,9 +512,15 @@ <relation type="one-nofk" rel-entity-name="StatusItem"> <key-map field-name="statusId"/> </relation> + <relation type="one-nofk" rel-entity-name="StatusItem" title="Assignment"> + <key-map field-name="assignmentStatusId" rel-field-name="statusId"/> + </relation> <relation type="one-nofk" title="Expectation" rel-entity-name="Enumeration"> <key-map field-name="expectationEnumId" rel-field-name="enumId"/> </relation> + <relation type="one-nofk" title="DelegateReason" rel-entity-name="Enumeration"> + <key-map field-name="delegateReasonEnumId" rel-field-name="enumId"/> + </relation> </view-entity> <view-entity entity-name="WorkEffortCommunicationEventView" package-name="org.ofbiz.workeffort.workeffort" Modified: ofbiz/trunk/applications/workeffort/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/servicedef/services.xml?rev=708620&r1=708619&r2=708620&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/servicedef/services.xml (original) +++ ofbiz/trunk/applications/workeffort/servicedef/services.xml Tue Oct 28 10:52:00 2008 @@ -661,4 +661,28 @@ <description>Delete WorkEffortInventoryProduced</description> <auto-attributes mode="IN" include="pk" optional="false"/> </service> + + <!-- WorkEffort Event Reminder Services --> + <service name="createWorkEffortEventReminder" default-entity-name="WorkEffortEventReminder" engine="entity-auto" invoke="create" auth="true"> + <description>Create a WorkEffort Event Reminder</description> + <permission-service service-name="workEffortGenericPermission" main-action="CREATE"/> + <auto-attributes include="pk" mode="IN" optional="false"/> + <auto-attributes include="nonpk" mode="IN" optional="true"/> + <override name="sequenceId" mode="OUT"/> + </service> + <service name="updateWorkEffortEventReminder" default-entity-name="WorkEffortEventReminder" engine="entity-auto" invoke="update" auth="true"> + <description>Update a WorkEffort Event Reminder</description> + <permission-service service-name="workEffortGenericPermission" main-action="UPDATE"/> + <auto-attributes include="pk" mode="IN" optional="false"/> + <auto-attributes include="nonpk" mode="IN" optional="true"/> + </service> + <service name="deleteWorkEffortEventReminder" default-entity-name="WorkEffortEventReminder" engine="entity-auto" invoke="delete" auth="true"> + <description>Delete a WorkEffort Event Reminder</description> + <permission-service service-name="workEffortGenericPermission" main-action="DELETE"/> + <auto-attributes include="pk" mode="IN" optional="false"/> + </service> + <service name="processWorkEffortEventReminders" engine="java" + location="org.ofbiz.workeffort.workeffort.WorkEffortServices" invoke="processWorkEffortEventReminders" auth="true"> + <description>Process work effort event reminders. This service is run by the job scheduler.</description> + </service> </services> Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java?rev=708620&r1=708619&r2=708620&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java (original) +++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java Tue Oct 28 10:52:00 2008 @@ -23,7 +23,6 @@ import java.util.Calendar; import java.util.Collection; import java.util.Date; -import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; @@ -40,6 +39,7 @@ import org.ofbiz.base.util.UtilDateTime; import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.GenericDelegator; import org.ofbiz.entity.GenericEntityException; @@ -52,6 +52,7 @@ import org.ofbiz.entity.util.EntityUtil; import org.ofbiz.security.Security; import org.ofbiz.service.DispatchContext; +import org.ofbiz.service.LocalDispatcher; import org.ofbiz.service.ServiceUtil; import org.ofbiz.service.calendar.TemporalExpression; import org.ofbiz.service.calendar.TemporalExpressionWorker; @@ -731,4 +732,159 @@ return resultMap; } + /** Process work effort event reminders. This service is used by the job scheduler. + * @param ctx + * @param context + * @return + */ + public static Map<String, Object> processWorkEffortEventReminders(DispatchContext ctx, Map<String, ? extends Object> context) { + GenericDelegator delegator = ctx.getDelegator(); + Timestamp now = new Timestamp(System.currentTimeMillis()); + List<GenericValue> eventReminders = null; + try { + eventReminders = delegator.findList("WorkEffortEventReminder", EntityCondition.makeCondition(UtilMisc.<EntityCondition>toList(EntityCondition.makeCondition("reminderDateTime", EntityOperator.EQUALS, null), EntityCondition.makeCondition("reminderDateTime", EntityOperator.LESS_THAN_EQUAL_TO, now)), EntityOperator.OR), null, null, null, false); + } catch (GenericEntityException e) { + return ServiceUtil.returnError("Error while retrieving work effort event reminders: " + e); + } + for (GenericValue reminder : eventReminders) { + int repeatCount = reminder.get("repeatCount") == null ? 0 : reminder.getLong("repeatCount").intValue(); + int currentCount = reminder.get("currentCount") == null ? 0 : reminder.getLong("currentCount").intValue(); + String isPopup = reminder.getString("isPopup"); + if ("Y".equals(isPopup)) { + if (repeatCount != 0 && repeatCount == currentCount) { + try { + reminder.remove(); + } catch (GenericEntityException e) { + Debug.logWarning("Error while removing work effort event reminder: " + e, module); + } + } + continue; + } + GenericValue workEffort = null; + try { + workEffort = reminder.getRelatedOne("WorkEffort"); + } catch (GenericEntityException e) { + Debug.logWarning("Error while getting work effort: " + e, module); + } + if (workEffort == null) { + try { + reminder.remove(); + } catch (GenericEntityException e) { + Debug.logWarning("Error while removing work effort event reminder: " + e, module); + } + continue; + } + Locale locale = reminder.getString("localeId") == null ? Locale.getDefault() : new Locale(reminder.getString("localeId")); + TimeZone timeZone = reminder.getString("timeZoneId") == null ? TimeZone.getDefault() : TimeZone.getTimeZone(reminder.getString("timeZoneId")); + Map<String, Object> parameters = UtilMisc.toMap("locale", locale, "timeZone", timeZone, "workEffortId", reminder.get("workEffortId")); + Calendar cal = UtilDateTime.toCalendar(now, timeZone, locale); + Timestamp reminderStamp = reminder.getTimestamp("reminderDateTime"); + Date eventDateTime = workEffort.getTimestamp("estimatedStartDate"); + String tempExprId = workEffort.getString("tempExprId"); + if (UtilValidate.isNotEmpty(tempExprId)) { + TemporalExpression temporalExpression = null; + try { + temporalExpression = TemporalExpressionWorker.getTemporalExpression(delegator, tempExprId); + } catch (GenericEntityException e) { + Debug.logWarning("Error while getting temporal expression, id = " + tempExprId + ": " + e, module); + } + if (temporalExpression != null) { + eventDateTime = temporalExpression.first(cal).getTime(); + Date reminderDateTime = null; + long recurrenceOffset = reminder.get("recurrenceOffset") == null ? 0 : reminder.getLong("recurrenceOffset").longValue(); + if (reminderStamp == null) { + if (recurrenceOffset != 0) { + cal.setTime(eventDateTime); + TimeDuration duration = TimeDuration.fromLong(recurrenceOffset); + duration.addToCalendar(cal); + reminderDateTime = cal.getTime(); + } else { + reminderDateTime = eventDateTime; + } + } else { + reminderDateTime = new Date(reminderStamp.getTime()); + } + if (reminderDateTime.before(now) && reminderStamp != null) { + try { + parameters.put("eventDateTime", new Timestamp(eventDateTime.getTime())); + processEventReminder(ctx, reminder, parameters); + if (repeatCount != 0 && currentCount + 1 >= repeatCount) { + reminder.remove(); + } else { + cal.setTime(reminderDateTime); + Date newReminderDateTime = null; + if (recurrenceOffset != 0) { + TimeDuration duration = TimeDuration.fromLong(-recurrenceOffset); + duration.addToCalendar(cal); + cal.setTime(temporalExpression.next(cal).getTime()); + duration = TimeDuration.fromLong(recurrenceOffset); + duration.addToCalendar(cal); + newReminderDateTime = cal.getTime(); + } else { + newReminderDateTime = temporalExpression.next(cal).getTime(); + } + reminder.set("currentCount", new Long(currentCount + 1)); + reminder.set("reminderDateTime", new Timestamp(newReminderDateTime.getTime())); + reminder.store(); + } + } catch (GenericEntityException e) { + Debug.logWarning("Error while processing temporal expression reminder, id = " + tempExprId + ": " + e, module); + } + } else if (reminderStamp == null) { + try { + reminder.set("reminderDateTime", new Timestamp(reminderDateTime.getTime())); + reminder.store(); + } catch (GenericEntityException e) { + Debug.logWarning("Error while processing temporal expression reminder, id = " + tempExprId + ": " + e, module); + } + } + } + continue; + } + if (reminderStamp != null) { + Date reminderDateTime = new Date(reminderStamp.getTime()); + if (reminderDateTime.before(now)) { + try { + parameters.put("eventDateTime", eventDateTime); + processEventReminder(ctx, reminder, parameters); + long repeatInterval = reminder.get("repeatInterval") == null ? 0 : reminder.getLong("repeatInterval").longValue(); + if ((repeatCount != 0 && currentCount + 1 >= repeatCount) || repeatInterval == 0) { + reminder.remove(); + } else { + cal.setTime(now); + TimeDuration duration = TimeDuration.fromLong(repeatInterval); + duration.addToCalendar(cal); + reminderDateTime = cal.getTime(); + reminder.set("currentCount", new Long(currentCount + 1)); + reminder.set("reminderDateTime", new Timestamp(reminderDateTime.getTime())); + reminder.store(); + } + } catch (GenericEntityException e) { + Debug.logWarning("Error while processing event reminder: " + e, module); + } + } + } + } + return ServiceUtil.returnSuccess(); + } + + protected static void processEventReminder(DispatchContext ctx, GenericValue reminder, Map<String, Object> parameters) throws GenericEntityException { + LocalDispatcher dispatcher = ctx.getDispatcher(); + GenericValue contactMech = reminder.getRelatedOne("ContactMech"); + if (contactMech != null && "EMAIL_ADDRESS".equals(contactMech.get("contactMechTypeId"))) { + String screenLocation = UtilProperties.getPropertyValue("EventReminders", "eventReminders.emailScreenWidgetLocation"); + String fromAddress = UtilProperties.getPropertyValue("EventReminders", "eventReminders.emailFromAddress"); + String toAddress = contactMech.getString("infoString"); + String subject = UtilProperties.getMessage("WorkEffortUiLabels", "WorkEffortEventReminder", (Locale) parameters.get("locale")); + Map<String, Object> emailCtx = UtilMisc.toMap("sendFrom", fromAddress, "sendTo", toAddress, "subject", subject, "bodyParameters", parameters, "bodyScreenUri", screenLocation); + try { + dispatcher.runAsync("sendMailFromScreen", emailCtx); + } catch (Exception e) { + Debug.logWarning("Error while emailing event reminder - workEffortId = " + reminder.get("workEffortId") + ", contactMechId = " + reminder.get("contactMechId") + ": " + e, module); + } + return; + } + // TODO: Other contact mechanism types + Debug.logWarning("Invalid event reminder contact mech, workEffortId = " + reminder.get("workEffortId") + ", contactMechId = " + reminder.get("contactMechId"), module); + } } Modified: ofbiz/trunk/applications/workeffort/webapp/workeffort/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/webapp/workeffort/WEB-INF/controller.xml?rev=708620&r1=708619&r2=708620&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/webapp/workeffort/WEB-INF/controller.xml (original) +++ ofbiz/trunk/applications/workeffort/webapp/workeffort/WEB-INF/controller.xml Tue Oct 28 10:52:00 2008 @@ -638,6 +638,30 @@ <response name="success" type="view" value="EditAgreementWorkEffortAppls"/> <response name="error" type="view" value="EditAgreementWorkEffortAppls"/> </request-map> + + <!--WorkEffort Event Reminders --> + <request-map uri="createWorkEffortEventReminder"> + <security https="true" auth="true"/> + <event type="service" invoke="createWorkEffortEventReminder"/> + <response name="success" type="view" value="ListWorkEffortEventReminders"/> + <response name="error" type="view" value="ListWorkEffortEventReminders"/> + </request-map> + <request-map uri="updateWorkEffortEventReminder"> + <security https="true" auth="true"/> + <event type="service" invoke="updateWorkEffortEventReminder"/> + <response name="success" type="view" value="ListWorkEffortEventReminders"/> + <response name="error" type="view" value="ListWorkEffortEventReminders"/> + </request-map> + <request-map uri="deleteWorkEffortEventReminder"> + <security https="true" auth="true"/> + <event type="service" invoke="deleteWorkEffortEventReminder"/> + <response name="success" type="view" value="ListWorkEffortEventReminders"/> + <response name="error" type="view" value="ListWorkEffortEventReminders"/> + </request-map> + <request-map uri="listWorkEffortEventReminders"> + <security auth="true" https="true"/> + <response name="success" type="view" value="ListWorkEffortEventReminders"/> + </request-map> <!-- end of request mappings --> @@ -666,6 +690,7 @@ <view-map name="EditWorkEffortAssoc" type="screen" page="component://workeffort/widget/WorkEffortScreens.xml#EditWorkEffortAssoc"/> <view-map name="AddWorkEffortAssoc" type="screen" page="component://workeffort/widget/WorkEffortScreens.xml#AddWorkEffortAssoc"/> + <view-map name="ListWorkEffortEventReminders" type="screen" page="component://workeffort/widget/WorkEffortScreens.xml#ListWorkEffortEventReminders"/> <view-map name="ListWorkEffortFixedAssetAssigns" type="screen" page="component://workeffort/widget/WorkEffortScreens.xml#ListWorkEffortFixedAssetAssigns"/> <view-map name="ListWorkEffortPartyAssigns" type="screen" page="component://workeffort/widget/WorkEffortScreens.xml#ListWorkEffortPartyAssigns"/> <view-map name="EditWorkEffortAssignmentRates" type="screen" page="component://workeffort/widget/WorkEffortScreens.xml#EditWorkEffortAssignmentRates"/> Added: ofbiz/trunk/applications/workeffort/webapp/workeffort/workeffort/EventReminderEmail.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/webapp/workeffort/workeffort/EventReminderEmail.ftl?rev=708620&view=auto ============================================================================== --- ofbiz/trunk/applications/workeffort/webapp/workeffort/workeffort/EventReminderEmail.ftl (added) +++ ofbiz/trunk/applications/workeffort/webapp/workeffort/workeffort/EventReminderEmail.ftl Tue Oct 28 10:52:00 2008 @@ -0,0 +1,106 @@ +<#-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<#assign docLangAttr = locale.toString()?replace("_", "-")> +<#assign langDir = "ltr"> +<#if "ar.iw"?contains(docLangAttr?substring(0, 2))> + <#assign langDir = "rtl"> +</#if> +<html lang="${docLangAttr}" dir="${langDir}" xmlns="http://www.w3.org/1999/xhtml"> + <head/> + <body> + <style type="text/css"> + .label { + font-weight: bold; + <#if langDir == "ltr"> + padding-right: 10px; + text-align: right; + <#else> + padding-left: 10px; + text-align: left; + </#if> + } + div { + padding: 10px 0 10px 0; + } + </style> + <table cellspacing=0> + <#-- Work Effort Info --> + <tr><td class="label">${uiLabelMap.CommonDate}</td><td>${parameters.eventDateTime?default(" ")}</td></tr> + <tr><td class="label">${uiLabelMap.CommonName}</td><td>${workEffort.workEffortName?default(" ")}</td></tr> + <tr><td class="label">${uiLabelMap.CommonDescription}</td><td>${workEffort.description?default(" ")}</td></tr> + <tr><td class="label">${uiLabelMap.CommonType}</td><td>${(workEffortType.description)?default(" ")}</td></tr> + <tr><td class="label">${uiLabelMap.CommonPurpose}</td><td>${(workEffortPurposeType.description)?default(" ")}</td></tr> + <tr><td class="label">${uiLabelMap.CommonStatus}</td><td>${(currentStatusItem.description)?default(" ")}</td></tr> + <tr><td colspan="2"><hr/></td> + </table> + <#if partyAssignments?has_content> + <div><b>${uiLabelMap.PageTitleListWorkEffortPartyAssigns}</b></div> + <table cellspacing=0 cellpadding=2 border=1> + <thead><tr> + <th>${uiLabelMap.PartyParty}</th> + <th>${uiLabelMap.PartyRole}</th> + <th>${uiLabelMap.CommonFromDate}</th> + <th>${uiLabelMap.CommonThruDate}</th> + <th>${uiLabelMap.CommonStatus}</th> + <th>${uiLabelMap.WorkEffortDelegateReason}</th> + </tr></thead> + <tbody> + <#list partyAssignments as wepa> + <tr> + <td>${wepa.groupName?if_exists}${wepa.firstName?if_exists} ${wepa.lastName?if_exists}</td> + <td>${(wepa.getRelatedOne("RoleType").description)?default(" ")}</td> + <td>${wepa.fromDate?default(" ")}</td> + <td>${wepa.thruDate?default(" ")}</td> + <td>${(wepa.getRelatedOne("AssignmentStatusItem").description)?default(" ")}</td> + <td>${(wepa.getRelatedOne("DelegateReasonEnumeration").description)?default(" ")}</td> + </tr> + </#list> + </tbody> + </table> + </#if> + <#if fixedAssetAssignments?has_content> + <div><b>${uiLabelMap.PageTitleListWorkEffortFixedAssetAssigns}</b></div> + <table cellspacing=0 cellpadding=2 border=1> + <thead><tr> + <th>${uiLabelMap.AccountingFixedAsset}</th> + <th>${uiLabelMap.CommonFromDate}</th> + <th>${uiLabelMap.CommonThruDate}</th> + <th>${uiLabelMap.CommonStatus}</th> + <th>${uiLabelMap.FormFieldTitle_availabilityStatusId}</th> + <th>${uiLabelMap.FormFieldTitle_allocatedCost}</th> + <th>${uiLabelMap.CommonComments}</th> + </tr></thead> + <tbody> + <#list fixedAssetAssignments as wefa> + <tr> + <td>${wefa.fixedAssetName?default(" ")}</td> + <td>${wefa.fromDate?default(" ")}</td> + <td>${wefa.thruDate?default(" ")}</td> + <td>${(wefa.getRelatedOne("StatusItem").description)?default(" ")}</td> + <td>${(wefa.getRelatedOne("AvailabilityStatusItem").description)?default(" ")}</td> + <td>${wefa.allocatedCost?default(" ")}</td> + <td>${wefa.comments?default(" ")}</td> + </tr> + </#list> + </tbody> + </table> + </#if> + </body> +</html> Propchange: ofbiz/trunk/applications/workeffort/webapp/workeffort/workeffort/EventReminderEmail.ftl ------------------------------------------------------------------------------ svn:eol-style = native Modified: ofbiz/trunk/applications/workeffort/widget/WorkEffortForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/widget/WorkEffortForms.xml?rev=708620&r1=708619&r2=708620&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/widget/WorkEffortForms.xml (original) +++ ofbiz/trunk/applications/workeffort/widget/WorkEffortForms.xml Tue Oct 28 10:52:00 2008 @@ -492,7 +492,7 @@ <field name="roleTypeId" title="${uiLabelMap.AccountingRoleType}"><display-entity entity-name="RoleType"/></field> <field name="fromDate"><display/></field> <field name="thruDate"><display/></field> - <field name="statusId"><display-entity entity-name="StatusItem"/></field> + <field name="assignmentStatusId" title="${uiLabelMap.CommonStatus}"><display-entity entity-name="StatusItem" key-field-name="statusId"/></field> <field name="expectationEnumId" title="${uiLabelMap.WorkEffortExpectation}"><display-entity entity-name="Enumeration" key-field-name="enumId"/></field> </form> <form name="EditWorkEffortCommEvent" default-map-name="workEffortCommEvent" target="updateWorkEffortCommEvent" title="" type="single" @@ -1179,4 +1179,38 @@ <field name="comments"><text size="60" maxlength="255"/></field> <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit"><submit button-type="button"/></field> </form> + + <form name="ListWorkEffortEventReminders" type="list" target="updateWorkEffortEventReminder" + odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar"> + <actions> + <entity-condition entity-name="WorkEffortEventReminder"> + <condition-expr field-name="workEffortId" operator="equals" env-name="workEffortId"/> + <order-by field-name="-reminderDateTime"/> + </entity-condition> + </actions> + <field name="workEffortId"><hidden/></field> + <field name="sequenceId"><hidden/></field> + <field name="contactMechId"><display/></field> + <field name="reminderDateTime"><date-time/></field> + <field name="repeatCount"><text/></field> + <field name="repeatInterval"><text/></field> + <field name="recurrenceOffset"><text/></field> + <field name="submitButton" title="${uiLabelMap.CommonSave}" widget-style="smallSubmit"><submit button-type="button"/></field> + <field name="deleteLink" title=" " widget-style="buttontext"> + <hyperlink also-hidden="false" description="${uiLabelMap.CommonDelete}" target="deleteWorkEffortEventReminder?workEffortId=${workEffortId}&contactMechId=${contactMechId}&sequenceId=${sequenceId}"/> + </field> + </form> + + <form name="EditWorkEffortEventReminder" target="createWorkEffortEventReminder" type="single" + header-row-style="header-row" default-table-style="basic-table"> + <field name="workEffortId"><hidden/></field> + <field name="localeId"><hidden value="${locale}"/></field> + <field name="timeZoneId"><hidden value="${timeZone}"/></field> + <field name="contactMechId" tooltip="${uiLabelMap.CommonRequired}" widget-style="required"><lookup target-form-name="LookupContactMech"/></field> + <field name="reminderDateTime"><date-time/></field> + <field name="repeatCount"><text/></field> + <field name="repeatInterval"><text/></field> + <field name="recurrenceOffset"><text/></field> + <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit"><submit button-type="button"/></field> + </form> </forms> Modified: ofbiz/trunk/applications/workeffort/widget/WorkEffortMenus.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/widget/WorkEffortMenus.xml?rev=708620&r1=708619&r2=708620&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/widget/WorkEffortMenus.xml (original) +++ ofbiz/trunk/applications/workeffort/widget/WorkEffortMenus.xml Tue Oct 28 10:52:00 2008 @@ -101,5 +101,8 @@ <menu-item name="WorkEffortFixedAssetAssigns" title="${uiLabelMap.AccountingFixedAssets}"> <link target="ListWorkEffortFixedAssetAssigns?workEffortId=${workEffortId}"/> </menu-item> + <menu-item name="WorkEffortEventReminders" title="${uiLabelMap.WorkEffortEventReminders}"> + <link target="listWorkEffortEventReminders?workEffortId=${workEffortId}"/> + </menu-item> </menu> </menus> Modified: ofbiz/trunk/applications/workeffort/widget/WorkEffortRelatedSummaryScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/widget/WorkEffortRelatedSummaryScreens.xml?rev=708620&r1=708619&r2=708620&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/widget/WorkEffortRelatedSummaryScreens.xml (original) +++ ofbiz/trunk/applications/workeffort/widget/WorkEffortRelatedSummaryScreens.xml Tue Oct 28 10:52:00 2008 @@ -73,28 +73,10 @@ <widgets> <horizontal-separator/> <container style="h2"> - <label text="${uiLabelMap.PartyPartyAssignmentsDetail}"/> + <label text="${uiLabelMap.PageTitleListWorkEffortPartyAssigns}"/> </container> <container style="screenlet-body"> <include-form location="component://workeffort/widget/WorkEffortForms.xml" name="DisplayWorkEffortPartyAssigns"/> -<!-- <iterate-section list-name="partyAssignments" entry-name="partyAssign"> - <section> - <actions> - <get-related-one value-name="partyAssign" relation-name="RoleType" to-value-name="partyAssignRoleType" use-cache="true"/> - <get-related-one value-name="partyAssign" relation-name="StatusItem" to-value-name="partyAssignStatusItem" use-cache="true"/> - <get-related-one value-name="partyAssign" relation-name="ExpectationEnumeration" to-value-name="partyAssignExpectationEnumeration" use-cache="true"/> - </actions> - <widgets> - <container> - <link target="/partymgr/control/viewprofile?partyId=${partyAssign.partyId}" url-mode="inter-app" text="${partyAssign.partyId}" style="buttontext"/> - <label text="${partyAssign.firstName} ${partyAssign.lastName} ${partyAssign.groupName}"/> - <label text="${uiLabelMap.PartyRoleId} " style="label"/><label text="${partyAssignRoleType.description}"/> - <label text="${uiLabelMap.CommonStatus} " style="label"/><label text="${partyAssignStatusItem.description}"/> - <label text="${uiLabelMap.CommonExpectation} " style="label"/><label text="${partyAssignExpectationEnumeration.description}"/> - </container> - </widgets> - </section> - </iterate-section> --> </container> </widgets> </section> @@ -202,4 +184,4 @@ </widgets> </section> </screen> -</screens> \ No newline at end of file +</screens> Modified: ofbiz/trunk/applications/workeffort/widget/WorkEffortScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/widget/WorkEffortScreens.xml?rev=708620&r1=708619&r2=708620&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/widget/WorkEffortScreens.xml (original) +++ ofbiz/trunk/applications/workeffort/widget/WorkEffortScreens.xml Tue Oct 28 10:52:00 2008 @@ -865,4 +865,52 @@ </widgets> </section> </screen> -</screens> \ No newline at end of file + + <screen name="ListWorkEffortEventReminders"> + <section> + <actions> + <set field="titleProperty" value="PageTitleListWorkEffortEventReminders"/> + <set field="labelTitleProperty" from-field="titleProperty"/> + <set field="tabButtonItem" value="WorkEffortEventReminders"/> + <set field="workEffortId" from-field="parameters.workEffortId"/> + </actions> + <widgets> + <decorator-screen name="CommonWorkEffortDecorator" location="${parameters.mainDecoratorLocation}"> + <decorator-section name="body"> + <screenlet id="AddWorkEffortEventReminder" title="${uiLabelMap.PageTitleAddWorkEffortEventReminder}" collapsible="true"> + <include-form name="EditWorkEffortEventReminder" location="component://workeffort/widget/WorkEffortForms.xml"/> + </screenlet> + <include-form name="ListWorkEffortEventReminders" location="component://workeffort/widget/WorkEffortForms.xml"/> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + + <screen name="WorkEffortEventReminderEmail"> + <section> + <actions> + <property-map resource="WorkEffortUiLabels" map-name="uiLabelMap" global="true"/> + <property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/> + <property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/> + <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/> + <set field="workEffortId" from-field="parameters.workEffortId"/> + <entity-one entity-name="WorkEffort" value-name="workEffort"/> + <get-related-one value-name="workEffort" relation-name="WorkEffortType" to-value-name="workEffortType"/> + <get-related-one value-name="workEffort" relation-name="CurrentStatusItem" to-value-name="currentStatusItem"/> + <get-related-one value-name="workEffort" relation-name="WorkEffortPurposeType" to-value-name="workEffortPurposeType"/> + <get-related-one value-name="workEffort" relation-name="ScopeEnumeration" to-value-name="scopeEnumeration"/> + <entity-and entity-name="WorkEffortPartyAssignView" list-name="partyAssignments"> + <field-map field-name="workEffortId"/> + </entity-and> + <entity-and entity-name="WorkEffortAndFixedAssetAssign" list-name="fixedAssetAssignments" filter-by-date="true"> + <field-map field-name="workEffortId"/> + </entity-and> + </actions> + <widgets> + <platform-specific><html><html-template location="component://workeffort/webapp/workeffort/workeffort/EventReminderEmail.ftl"/></html></platform-specific> + </widgets> + </section> + </screen> + +</screens> |
Free forum by Nabble | Edit this page |