convert ftl menus, added celendar to myportal first page

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@786422 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hans Bakker
2009-06-19 09:21:44 +00:00
parent 333db18924
commit 4e42e1206e
14 changed files with 145 additions and 86 deletions
@@ -26,5 +26,14 @@
screenLocation="component://workeffort/widget/WorkEffortScreens.xml"
description="My Company Comms From My Page" securityServiceName="portalPermissionIsEmployee" securityMainAction="VIEW"/>
<PortletPortletCategory portalPortletId="mycompanycomms" portletCategoryId="EVENTSTASKS"/>
<PortalPortlet portalPortletId="Calendar"
portletName="Event Calendar"
screenName="Calendar"
screenLocation="component://workeffort/widget/CalendarScreens.xml"
description="My Calendar"/>
<PortletPortletCategory portalPortletId="Calendar" portletCategoryId="EVENTSTASKS"/>
</entity-engine-xml>
@@ -58,7 +58,9 @@ if (start == null) {
}
Timestamp prev = UtilDateTime.getDayStart(start, -1, timeZone, locale);
context.prevMillis = new Long(prev.getTime()).toString();
Timestamp next = UtilDateTime.getDayStart(start, 1, timeZone, locale);
context.nextMillis = new Long(next.getTime()).toString();
Map serviceCtx = UtilMisc.toMap("userLogin", userLogin,"start",start,"numPeriods",new Integer(24),"periodType",new Integer(Calendar.HOUR));
serviceCtx.putAll(UtilMisc.toMap("partyId", partyId, "facilityId", facilityId, "fixedAssetId", fixedAssetId, "workEffortTypeId", workEffortTypeId, "locale", locale, "timeZone", timeZone));
@@ -62,7 +62,9 @@ tempCal = UtilDateTime.toCalendar(start, timeZone, locale);
numDays = tempCal.getActualMaximum(Calendar.DAY_OF_MONTH);
prev = UtilDateTime.getMonthStart(start, -1, timeZone, locale);
context.prevMillis = new Long(prev.getTime()).toString();
next = UtilDateTime.getDayStart(start, numDays+1, timeZone, locale);
context.nextMillis = new Long(next.getTime()).toString();
end = UtilDateTime.getDayStart(start, numDays, timeZone, locale);
//Find out what date to get from
@@ -58,7 +58,9 @@ if (start == null) {
}
Timestamp prev = UtilDateTime.getDayStart(start, -7, timeZone, locale);
context.prevMillis = new Long(prev.getTime()).toString();
Timestamp next = UtilDateTime.getDayStart(start, 7, timeZone, locale);
context.nextMillis = new Long(next.getTime()).toString();
Timestamp end = UtilDateTime.getDayStart(start, 6, timeZone, locale);
Map serviceCtx = UtilMisc.toMap("userLogin", userLogin,"start",start,"numPeriods",new Integer(7),"periodType",new Integer(Calendar.DATE));
@@ -1,41 +0,0 @@
<#--
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.
-->
<#assign selected = tabButtonItem?default("void")>
<div>
<a href="<@ofbizUrl>EditWorkEffort?workEffortTypeId=EVENT&currentStatusId=CAL_TENTATIVE</@ofbizUrl>" class="buttontext">${uiLabelMap.WorkEffortNewEvent}</a>
</div>
<br/>
<style type="text/css">
.tab-bar {
margin: 0;
}
</style>
<div class="button-bar tab-bar">
<ul>
<li<#if selected = "day"> class="selected"</#if>><a href="<@ofbizUrl>day<#if eventsParam?has_content>?${eventsParam}</#if></@ofbizUrl>">${uiLabelMap.WorkEffortDayView}</a></li>
<li<#if selected = "week"> class="selected"</#if>><a href="<@ofbizUrl>week<#if eventsParam?has_content>?${eventsParam}</#if></@ofbizUrl>">${uiLabelMap.WorkEffortWeekView}</a></li>
<li<#if selected = "month"> class="selected"</#if>><a href="<@ofbizUrl>month<#if eventsParam?has_content>?${eventsParam}</#if></@ofbizUrl>">${uiLabelMap.WorkEffortMonthView}</a></li>
<li<#if selected = "upcoming"> class="selected"</#if>><a href="<@ofbizUrl>upcoming<#if eventsParam?has_content>?${eventsParam}</#if></@ofbizUrl>">${uiLabelMap.WorkEffortUpcomingEvents}</a></li>
</ul>
<br class="clear"/>
</div>
@@ -16,15 +16,6 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<div class="screenlet-title-bar">
<ul>
<li class="h3">${start?date?string("EEEE")?cap_first} ${start?date?string.long}</li>
<li><a href="<@ofbizUrl>day?start=${next.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>">${uiLabelMap.WorkEffortNextDay}</a></li>
<li><a href="<@ofbizUrl>day?start=${nowTimestamp.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>">${uiLabelMap.CommonToday}</a></li>
<li><a href="<@ofbizUrl>day?start=${prev.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>">${uiLabelMap.WorkEffortPreviousDay}</a></li>
</ul>
<br class="clear"/>
</div>
<#if periods?has_content>
<#if (maxConcurrentEntries < 2)>
<#assign entryWidth = 100>
@@ -28,15 +28,6 @@ height: auto;
}
</style>
<div class="screenlet-title-bar">
<ul>
<li class="h3">${start?date?string("MMMM yyyy")?cap_first}</li>
<li><a href='<@ofbizUrl>month?start=${next.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>'>${uiLabelMap.WorkEffortNextMonth}</a></li>
<li><a href='<@ofbizUrl>month?start=${nowTimestamp.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>'>${uiLabelMap.WorkEffortThisMonth}</a></li>
<li><a href='<@ofbizUrl>month?start=${prev.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>'>${uiLabelMap.WorkEffortPreviousMonth}</a></li>
</ul>
<br class="clear"/>
</div>
<#if periods?has_content>
<table cellspacing="0" class="basic-table calendar">
<tr class="header-row">
@@ -17,10 +17,6 @@ specific language governing permissions and limitations
under the License.
-->
<div class="screenlet">
<div class="screenlet-title-bar">
<h3>${uiLabelMap.WorkEffortCalendarUpComingEventsView}</h3>
</div>
<#if days?has_content>
<table class="basic-table hover-bar" cellspacing="0">
<tr class="header-row">
@@ -16,15 +16,6 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<div class="screenlet-title-bar">
<ul>
<li class="h3">${uiLabelMap.CommonWeek} ${start?date?string("w")}</li>
<li><a href="<@ofbizUrl>week?start=${next.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>">${uiLabelMap.WorkEffortNextWeek}</a></li>
<li><a href="<@ofbizUrl>week?start=${nowTimestamp.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>">${uiLabelMap.WorkEffortThisWeek}</a></li>
<li><a href="<@ofbizUrl>week?start=${prev.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>">${uiLabelMap.WorkEffortPreviousWeek}</a></li>
</ul>
<br class="clear"/>
</div>
<#if periods?has_content>
<#if (maxConcurrentEntries < 2)>
<#assign entryWidth = 100>
@@ -21,6 +21,51 @@ under the License.
<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
<screen name="Calendar">
<section>
<widgets>
<include-menu name="CalendarPortlet" location="component://workeffort/widget/WorkEffortMenus.xml"/>
<section>
<condition>
<if-compare field="parameters.period" operator="equals" value="day"/>
</condition>
<widgets>
<include-screen name="CalendarDay"/>
</widgets>
</section>
<section>
<condition>
<if-compare field="parameters.period" operator="equals" value="week"/>
</condition>
<widgets>
<include-screen name="CalendarWeek"/>
</widgets>
</section>
<section>
<condition>
<or>
<if-compare field="parameters.period" operator="equals" value="month"/>
<if-empty field="parameters.period"/>
</or>
</condition>
<widgets>
<include-screen name="CalendarMonth"/>
</widgets>
</section>
<section>
<condition>
<or>
<if-compare field="parameters.period" operator="equals" value="upcoming"/>
</or>
</condition>
<widgets>
<include-screen name="CalendarUpcoming"/>
</widgets>
</section>
</widgets>
</section>
</screen>
<screen name="CalendarDay">
<section>
<actions>
@@ -32,9 +77,12 @@ under the License.
<widgets>
<decorator-screen name="CommonCalendarDecorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<platform-specific>
<screenlet title="${bsh:org.ofbiz.base.util.UtilDateTime.timeStampToString(start, &quot;EEEE MMMM d, yyyy&quot;, timeZone, locale)}" navigation-menu-name="Day">
<include-menu name="Day" location="component://workeffort/widget/WorkEffortMenus.xml"/>
<platform-specific>
<html><html-template location="component://workeffort/webapp/workeffort/calendar/day.ftl"/></html>
</platform-specific>
</platform-specific>
</screenlet>
</decorator-section>
</decorator-screen>
</widgets>
@@ -52,9 +100,12 @@ under the License.
<widgets>
<decorator-screen name="CommonCalendarDecorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<platform-specific>
<html><html-template location="component://workeffort/webapp/workeffort/calendar/week.ftl"/></html>
</platform-specific>
<screenlet title="${uiLabelMap.CommonWeek} ${bsh:org.ofbiz.base.util.UtilDateTime.timeStampToString(start, &quot;w&quot;, timeZone, locale)}" navigation-menu-name="Week">
<include-menu name="Week" location="component://workeffort/widget/WorkEffortMenus.xml"/>
<platform-specific>
<html><html-template location="component://workeffort/webapp/workeffort/calendar/week.ftl"/></html>
</platform-specific>
</screenlet>
</decorator-section>
</decorator-screen>
</widgets>
@@ -72,9 +123,12 @@ under the License.
<widgets>
<decorator-screen name="CommonCalendarDecorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<platform-specific>
<screenlet title="${bsh:org.ofbiz.base.util.UtilDateTime.timeStampToString(start, &quot;MMMM yyyy&quot;, timeZone, locale)}" navigation-menu-name="Month">
<include-menu name="Month" location="component://workeffort/widget/WorkEffortMenus.xml"/>
<platform-specific>
<html><html-template location="component://workeffort/webapp/workeffort/calendar/month.ftl"/></html>
</platform-specific>
</platform-specific>
</screenlet>
</decorator-section>
</decorator-screen>
</widgets>
@@ -92,9 +146,11 @@ under the License.
<widgets>
<decorator-screen name="CommonCalendarDecorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<platform-specific>
<screenlet title="${uiLabelMap.WorkEffortCalendarUpComingEventsView}">
<platform-specific>
<html><html-template location="component://workeffort/webapp/workeffort/calendar/upcoming.ftl"/></html>
</platform-specific>
</platform-specific>
</screenlet>
</decorator-section>
</decorator-screen>
</widgets>
@@ -152,9 +152,7 @@ under the License.
<platform-specific>
<html><html-template location="component://workeffort/webapp/workeffort/calendar/eventsByForms.ftl"/></html>
</platform-specific>
<platform-specific>
<html><html-template location="component://workeffort/webapp/workeffort/calendar/CalendarTabBar.ftl"/></html>
</platform-specific>
<include-menu name="Calendar" location="component://workeffort/widget/WorkEffortMenus.xml"/>
<decorator-section-include name="body"/>
</widgets>
<fail-widgets>
@@ -144,5 +144,65 @@ under the License.
<link target="newEvent"/>
</menu-item>
</menu>
<menu name="Day">
<menu-item name="next" title="${uiLabelMap.WorkEffortNextDay}">
<link target="week?start=${nextMillis}"/>
</menu-item>
<menu-item name="toDay" title="${uiLabelMap.CommonToday}">
<link target="day"/>
</menu-item>
<menu-item name="prev" title="${uiLabelMap.WorkEffortPreviousDay}">
<link target="week?start=${prevMillis}"/>
</menu-item>
</menu>
<menu name="Week">
<menu-item name="next" title="${uiLabelMap.WorkEffortNextWeek}">
<link target="week?start=${nextMillis}"/>
</menu-item>
<menu-item name="thisWeek" title="${uiLabelMap.WorkEffortThisWeek}">
<link target="week"/>
</menu-item>
<menu-item name="prev" title="${uiLabelMap.WorkEffortPreviousWeek}">
<link target="week?start=${prevMillis}"/>
</menu-item>
</menu>
<menu name="Month">
<menu-item name="next" title="${uiLabelMap.WorkEffortNextMonth}">
<link target="week?start=${nextMillis}"/>
</menu-item>
<menu-item name="thisMonth" title="${uiLabelMap.WorkEffortThisMonth}">
<link target="month"/>
</menu-item>
<menu-item name="prev" title="${uiLabelMap.WorkEffortPreviousMonth}">
<link target="week?start=${prevMillis}"/>
</menu-item>
</menu>
<menu name="Calendar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
<menu-item name="day" title="${uiLabelMap.WorkEffortDayView}">
<link target="day"/>
</menu-item>
<menu-item name="week" title="${uiLabelMap.WorkEffortWeekView}">
<link target="week"/>
</menu-item>
<menu-item name="month" title="${uiLabelMap.WorkEffortMonthView}">
<link target="month"/>
</menu-item>
<menu-item name="upcoming" title="${uiLabelMap.WorkEffortUpcomingEvents}">
<link target="upcoming"/>
</menu-item>
</menu>
<menu name="CalendarPortlet" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
<menu-item name="day" title="${uiLabelMap.WorkEffortDayView}">
<link target="${parameters._LAST_VIEW_NAME_}?period=day"/>
</menu-item>
<menu-item name="week" title="${uiLabelMap.WorkEffortWeekView}">
<link target="${parameters._LAST_VIEW_NAME_}?period=week"/>
</menu-item>
<menu-item name="month" title="${uiLabelMap.WorkEffortMonthView}">
<link target="${parameters._LAST_VIEW_NAME_}?period=month"/>
</menu-item>
<menu-item name="upcoming" title="${uiLabelMap.WorkEffortUpcomingEvents}">
<link target="${parameters._LAST_VIEW_NAME_}?period=upcoming"/>
</menu-item>
</menu>
</menus>
@@ -88,6 +88,7 @@
<PortalPagePortlet portalPageId="MYPORTAL_EMPLOYEE" portalPortletId="SystemInfoNotes" portletSeqId="00001" columnSeqId="00001" sequenceNum="0"/>
<PortalPagePortlet portalPageId="MYPORTAL_EMPLOYEE" portalPortletId="SystemInfoStatus" portletSeqId="00001" columnSeqId="00001" sequenceNum="1"/>
<PortalPagePortlet portalPageId="MYPORTAL_EMPLOYEE" portalPortletId="Calendar" portletSeqId="00001" columnSeqId="00001" sequenceNum="2"/>
<PortalPagePortlet portalPageId="MYPORTAL_EMPLOYEE0" portalPortletId="INCOM_CUST_REQUESTS" portletSeqId="00001" columnSeqId="00001" sequenceNum="0"/>
<PortalPagePortlet portalPageId="MYPORTAL_EMPLOYEE0" portalPortletId="MyCommunications" portletSeqId="00001" columnSeqId="00001" sequenceNum="1"/>
<PortalPagePortlet portalPageId="MYPORTAL_EMPLOYEE1" portalPortletId="party" portletSeqId="00001" columnSeqId="00001" sequenceNum="0"/>
@@ -110,6 +111,7 @@
<PortalPagePortlet portalPageId="MYPORTAL_EMPL-NOEML" portalPortletId="SystemInfoNotes" portletSeqId="00001" columnSeqId="00001" sequenceNum="0"/>
<PortalPagePortlet portalPageId="MYPORTAL_EMPL-NOEML" portalPortletId="SystemInfoStatus" portletSeqId="00001" columnSeqId="00001" sequenceNum="1"/>
<PortalPagePortlet portalPageId="MYPORTAL_EMPL-NOEML" portalPortletId="Calendar" portletSeqId="00001" columnSeqId="00001" sequenceNum="2"/>
<PortalPagePortlet portalPageId="MYPORTAL_EMPL-NOEML0" portalPortletId="INCOM_CUST_REQUESTS" portletSeqId="00001" columnSeqId="00001" sequenceNum="1"/>
<PortalPagePortlet portalPageId="MYPORTAL_EMPL-NOEML0" portalPortletId="MyCommunications" portletSeqId="00001" columnSeqId="00001" sequenceNum="2"/>
<PortalPagePortlet portalPageId="MYPORTAL_EMPL-NOEML1" portalPortletId="party" portletSeqId="00001" columnSeqId="00001" sequenceNum="0"/>
@@ -173,7 +173,7 @@
<!-- Publish the staff meeting calendar event -->
<WorkEffort workEffortId="CALENDAR_PUB_DEMO" workEffortTypeId="PUBLISH_PROPS" currentStatusId="CAL_CANCELLED" scopeEnumId="WES_PUBLIC" description="Demo Project 1 Customer 1" workEffortName="iCalendar Publish Demonstration"/>
<WorkEffortAssoc workEffortIdFrom="CALENDAR_PUB_DEMO" workEffortIdTo="STAFF_MTG" workEffortAssocTypeId="WORK_EFF_DEPENDENCY" fromDate="2008-01-01 00:00:00.0"/>
<WorkEffort workEffortId="OneOffMeeting" workEffortTypeId="MEETING" currentStatusId="CAL_TENTATIVE" lastStatusUpdate="2008-01-01 00:00:00.0" scopeEnumId="WES_PUBLIC" workEffortName="One off Meeting june 14" description="Staff Meeting" estimatedStartDate="2009-06-14 09:00:00.0" estimatedMilliSeconds="3600000"/>
<WorkEffort workEffortId="OneOffMeeting" workEffortTypeId="MEETING" currentStatusId="CAL_TENTATIVE" lastStatusUpdate="2008-01-01 00:00:00.0" scopeEnumId="WES_PUBLIC" workEffortName="One off Meeting june 14" description="Staff Meeting" estimatedStartDate="2009-06-14 09:00:00.0" estimatedCompletionDate="2009-06-14 10:00:00.0"/>
<WorkEffortAssoc workEffortIdFrom="CALENDAR_PUB_DEMO" workEffortIdTo="OneOffMeeting" workEffortAssocTypeId="WORK_EFF_DEPENDENCY" fromDate="2008-01-01 00:00:00.0"/>
<WorkEffortPartyAssignment workEffortId="OneOffMeeting" partyId="DemoEmployee1" statusId="PRTYASGN_ASSIGNED" roleTypeId="CAL_OWNER" availabilityStatusId="WEPA_AV_BUSY" fromDate="2008-01-01 00:00:00.0"/>
<WorkEffortPartyAssignment workEffortId="OneOffMeeting" partyId="DemoEmployee2" statusId="PRTYASGN_ASSIGNED" roleTypeId="CAL_ATTENDEE" availabilityStatusId="WEPA_AV_BUSY" fromDate="2008-01-01 00:00:00.0"/>