Author: adrianc
Date: Thu Jul 2 03:10:35 2009
New Revision: 790455
URL: http://svn.apache.org/viewvc?rev=790455&view=rev
Log:
iCalendar Help screen and permission bug fix.
Last To Do: Make some meaningful demo data.
Added:
ofbiz/trunk/applications/workeffort/webapp/workeffort/workeffort/ICalendarHelp.ftl
(with props)
ofbiz/trunk/framework/images/webapp/images/wiki-content.css (with props)
Modified:
ofbiz/trunk/applications/workeffort/config/WorkEffortUiLabels.xml
ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/permission/WorkEffortPermissionServices.xml
ofbiz/trunk/applications/workeffort/servicedef/services.xml
ofbiz/trunk/applications/workeffort/webapp/workeffort/WEB-INF/controller.xml
ofbiz/trunk/applications/workeffort/widget/WorkEffortMenus.xml
ofbiz/trunk/applications/workeffort/widget/WorkEffortScreens.xml
Modified: ofbiz/trunk/applications/workeffort/config/WorkEffortUiLabels.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/config/WorkEffortUiLabels.xml?rev=790455&r1=790454&r2=790455&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/config/WorkEffortUiLabels.xml (original)
+++ ofbiz/trunk/applications/workeffort/config/WorkEffortUiLabels.xml Thu Jul
2 03:10:35 2009
@@ -1939,6 +1939,12 @@
<property key="WorkEffortICalendarFind">
<value xml:lang="en">Find iCalendars</value>
</property>
+ <property key="WorkEffortICalendarHelp">
+ <value xml:lang="en">iCalendar Help</value>
+ </property>
+ <property key="WorkEffortICalendarHelpUrl">
+ <value xml:lang="en">http://docs.ofbiz.org/x/piE</value>
+ </property>
<property key="WorkEffortICalendarName">
<value xml:lang="en">Calendar Name</value>
</property>
Modified:
ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/permission/WorkEffortPermissionServices.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/permission/WorkEffortPermissionServices.xml?rev=790455&r1=790454&r2=790455&view=diff
==============================================================================
---
ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/permission/WorkEffortPermissionServices.xml
(original)
+++
ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/permission/WorkEffortPermissionServices.xml
Thu Jul 2 03:10:35 2009
@@ -309,72 +309,80 @@
<log level="verbose" message="workEffortICalendarPermission invoked
for workEffortId ${parameters.workEffortId},
user login partyId = ${userLogin.partyId}"/>
<call-simple-method method-name="workEffortManagerPermission"/>
- <if-compare field="hasPermission" value="true" operator="equals">
- <set field="hasPermission" value="false" type="Boolean"/>
- <set field="workEffortId" from-field="parameters.workEffortId"/>
- <entity-one value-field="workEffort" entity-name="WorkEffort"/>
- <if-not-empty field="workEffort">
- <entity-condition list="partyAssignments"
entity-name="WorkEffortPartyAssignment" filter-by-date="true">
- <condition-list combine="and">
- <condition-expr field-name="workEffortId"
from-field="workEffortId"/>
- <condition-expr field-name="partyId"
from-field="userLogin.partyId"/>
- <condition-expr field-name="statusId"
value="PRTYASGN_ASSIGNED"/>
- <condition-list combine="or">
- <condition-expr field-name="roleTypeId"
value="CAL_OWNER"/>
- <condition-expr field-name="roleTypeId"
value="CAL_ORGANIZER"/>
- <condition-expr field-name="roleTypeId"
value="CAL_DELEGATE"/>
+ <if>
+ <condition>
+ <and>
+ <if-compare field="hasPermission" value="true"
operator="equals"/>
+ <not><if-empty field="parameters.workEffortId"/></not>
+ </and>
+ </condition>
+ <then>
+ <set field="hasPermission" value="false" type="Boolean"/>
+ <set field="workEffortId"
from-field="parameters.workEffortId"/>
+ <entity-one value-field="workEffort" entity-name="WorkEffort"/>
+ <if-not-empty field="workEffort">
+ <entity-condition list="partyAssignments"
entity-name="WorkEffortPartyAssignment" filter-by-date="true">
+ <condition-list combine="and">
+ <condition-expr field-name="workEffortId"
from-field="workEffortId"/>
+ <condition-expr field-name="partyId"
from-field="userLogin.partyId"/>
+ <condition-expr field-name="statusId"
value="PRTYASGN_ASSIGNED"/>
+ <condition-list combine="or">
+ <condition-expr field-name="roleTypeId"
value="CAL_OWNER"/>
+ <condition-expr field-name="roleTypeId"
value="CAL_ORGANIZER"/>
+ <condition-expr field-name="roleTypeId"
value="CAL_DELEGATE"/>
+ </condition-list>
</condition-list>
- </condition-list>
- </entity-condition>
- <set field="isDelegate" value="false"/>
- <set field="isOwner" value="false"/>
- <set field="isOrganizer" value="false"/>
- <iterate list="partyAssignments" entry="partyAssignment">
- <if-compare field="partyAssignment.roleTypeId"
operator="equals" value="CAL_OWNER">
- <set field="isDelegate" value="true"/>
- <set field="isOwner" value="true"/>
- <set field="isOrganizer" value="true"/>
- <else>
- <if-compare field="partyAssignment.roleTypeId"
operator="equals" value="CAL_ORGANIZER">
+ </entity-condition>
+ <set field="isDelegate" value="false"/>
+ <set field="isOwner" value="false"/>
+ <set field="isOrganizer" value="false"/>
+ <iterate list="partyAssignments" entry="partyAssignment">
+ <if-compare field="partyAssignment.roleTypeId"
operator="equals" value="CAL_OWNER">
+ <set field="isDelegate" value="true"/>
+ <set field="isOwner" value="true"/>
<set field="isOrganizer" value="true"/>
- <else>
- <if-compare field="partyAssignment.roleTypeId"
operator="equals" value="CAL_DELEGATE">
- <set field="isDelegate" value="true"/>
- </if-compare>
- </else>
+ <else>
+ <if-compare field="partyAssignment.roleTypeId"
operator="equals" value="CAL_ORGANIZER">
+ <set field="isOrganizer" value="true"/>
+ <else>
+ <if-compare
field="partyAssignment.roleTypeId" operator="equals" value="CAL_DELEGATE">
+ <set field="isDelegate" value="true"/>
+ </if-compare>
+ </else>
+ </if-compare>
+ </else>
+ </if-compare>
+ </iterate>
+ <if-compare value="PUBLISH_PROPS"
field="workEffort.workEffortTypeId" operator="equals">
+ <log level="verbose" message="Checking publish
properties permission, isOwner = ${isOwner}, isDelegate = ${isDelegate}"/>
+ <if>
+ <condition>
+ <or>
+ <!-- The user is the calendar owner -->
+ <if-compare field="isOwner"
operator="equals" value="true"/>
+ <and>
+ <!-- The calendar is confidential and
the user is a delegate of the calendar -->
+ <if-compare
field="workEffort.scopeEnumId" operator="equals" value="WES_CONFIDENTIAL"/>
+ <if-compare field="isDelegate"
operator="equals" value="true"/>
+ </and>
+ </or>
+ </condition>
+ <then>
+ <set field="hasPermission" value="true"
type="Boolean"/>
+ </then>
+ </if>
+ <else>
+ <!-- RFC 2445 3.5 Only an ORGANIZER can update a
VEVENT or VTODO. -->
+ <log level="verbose" message="Checking work effort
update permission, isOrganizer = ${isOrganizer}"/>
+ <if-compare field="isOrganizer" operator="equals"
value="true">
+ <set field="hasPermission" value="true"
type="Boolean"/>
</if-compare>
</else>
</if-compare>
- </iterate>
- <if-compare value="PUBLISH_PROPS"
field="workEffort.workEffortTypeId" operator="equals">
- <log level="verbose" message="Checking publish properties
permission, isOwner = ${isOwner}, isDelegate = ${isDelegate}"/>
- <if>
- <condition>
- <or>
- <!-- The user is the calendar owner -->
- <if-compare field="isOwner" operator="equals"
value="true"/>
- <and>
- <!-- The calendar is confidential and the
user is a delegate of the calendar -->
- <if-compare field="workEffort.scopeEnumId"
operator="equals" value="WES_CONFIDENTIAL"/>
- <if-compare field="isDelegate"
operator="equals" value="true"/>
- </and>
- </or>
- </condition>
- <then>
- <set field="hasPermission" value="true"
type="Boolean"/>
- </then>
- </if>
- <else>
- <!-- RFC 2445 3.5 Only an ORGANIZER can update a VEVENT or
VTODO. -->
- <log level="verbose" message="Checking work effort update
permission, isOrganizer = ${isOrganizer}"/>
- <if-compare field="isOrganizer" operator="equals"
value="true">
- <set field="hasPermission" value="true"
type="Boolean"/>
- </if-compare>
- </else>
- </if-compare>
- </if-not-empty>
- <field-to-result field="hasPermission"/>
- </if-compare>
+ </if-not-empty>
+ <field-to-result field="hasPermission"/>
+ </then>
+ </if>
</simple-method>
</simple-methods>
Modified: ofbiz/trunk/applications/workeffort/servicedef/services.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/servicedef/services.xml?rev=790455&r1=790454&r2=790455&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/workeffort/servicedef/services.xml Thu Jul 2
03:10:35 2009
@@ -684,7 +684,7 @@
location="component://workeffort/script/org/ofbiz/workeffort/permission/WorkEffortPermissionServices.xml"
invoke="workEffortICalendarPermission">
<description>iCalendar Permission Check</description>
<implements service="permissionInterface"/>
- <attribute type="String" mode="IN" name="workEffortId"
optional="false"/>
+ <attribute type="String" mode="IN" name="workEffortId"
optional="true"/>
</service>
<service name="getICalWorkEfforts" engine="simple" auth="false"
location="component://workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml"
invoke="getICalWorkEfforts">
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=790455&r1=790454&r2=790455&view=diff
==============================================================================
---
ofbiz/trunk/applications/workeffort/webapp/workeffort/WEB-INF/controller.xml
(original)
+++
ofbiz/trunk/applications/workeffort/webapp/workeffort/WEB-INF/controller.xml
Thu Jul 2 03:10:35 2009
@@ -147,6 +147,10 @@
<security https="true" auth="true"/>
<response name="success" type="view" value="FindICalendars"/>
</request-map>
+ <request-map uri="ICalendarHelp">
+ <security https="true" auth="true"/>
+ <response name="success" type="view" value="ICalendarHelp"/>
+ </request-map>
<request-map uri="createICalendar">
<security https="true" auth="true"/>
<event type="service" invoke="createWorkEffort"/>
@@ -752,6 +756,7 @@
<view-map name="ICalendarParties" type="screen"
page="component://workeffort/widget/WorkEffortScreens.xml#ICalendarParties"/>
<view-map name="ICalendarFixedAssets" type="screen"
page="component://workeffort/widget/WorkEffortScreens.xml#ICalendarFixedAssets"/>
<view-map name="FindICalendars" type="screen"
page="component://workeffort/widget/WorkEffortScreens.xml#FindICalendars"/>
+ <view-map name="ICalendarHelp" type="screen"
page="component://workeffort/widget/WorkEffortScreens.xml#ICalendarHelp"/>
<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"/>
Added:
ofbiz/trunk/applications/workeffort/webapp/workeffort/workeffort/ICalendarHelp.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/webapp/workeffort/workeffort/ICalendarHelp.ftl?rev=790455&view=auto
==============================================================================
---
ofbiz/trunk/applications/workeffort/webapp/workeffort/workeffort/ICalendarHelp.ftl
(added)
+++
ofbiz/trunk/applications/workeffort/webapp/workeffort/workeffort/ICalendarHelp.ftl
Thu Jul 2 03:10:35 2009
@@ -0,0 +1,19 @@
+<#--
+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.
+-->
+${StringUtil.wrapString(wikiContent)}
Propchange:
ofbiz/trunk/applications/workeffort/webapp/workeffort/workeffort/ICalendarHelp.ftl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
ofbiz/trunk/applications/workeffort/webapp/workeffort/workeffort/ICalendarHelp.ftl
------------------------------------------------------------------------------
svn:keywords = "Date Rev Author URL Id"
Propchange:
ofbiz/trunk/applications/workeffort/webapp/workeffort/workeffort/ICalendarHelp.ftl
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: ofbiz/trunk/applications/workeffort/widget/WorkEffortMenus.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/widget/WorkEffortMenus.xml?rev=790455&r1=790454&r2=790455&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/widget/WorkEffortMenus.xml (original)
+++ ofbiz/trunk/applications/workeffort/widget/WorkEffortMenus.xml Thu Jul 2
03:10:35 2009
@@ -236,6 +236,11 @@
<parameter param-name="workEffortId"/>
</link>
</menu-item>
+ <menu-item name="ICalendarHelp" title="${uiLabelMap.CommonHelp}">
+ <link target="ICalendarHelp">
+ <parameter param-name="workEffortId"/>
+ </link>
+ </menu-item>
</menu>
</menus>
Modified: ofbiz/trunk/applications/workeffort/widget/WorkEffortScreens.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/widget/WorkEffortScreens.xml?rev=790455&r1=790454&r2=790455&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/widget/WorkEffortScreens.xml (original)
+++ ofbiz/trunk/applications/workeffort/widget/WorkEffortScreens.xml Thu Jul 2
03:10:35 2009
@@ -886,6 +886,7 @@
</container>
<container style="button-bar">
<link text="${uiLabelMap.CommonCreate}"
target="EditICalendar" style="buttontext"/>
+ <link text="${uiLabelMap.CommonHelp}"
target="ICalendarHelp" style="buttontext"/>
</container>
<include-form name="ListIcalendars"
location="component://workeffort/widget/WorkEffortForms.xml"/>
</widgets>
@@ -909,6 +910,15 @@
<set field="title"
value="${uiLabelMap.WorkEffortICalendarEdit} - ${workEffort.workEffortName}"/>
</actions>
<widgets>
+ <section>
+ <condition>
+ <if-empty field="workEffort"/>
+ </condition>
+ <actions>
+ <set field="title"
value="${uiLabelMap.WorkEffortICalendarAdd}"/>
+ </actions>
+ <widgets/>
+ </section>
<decorator-screen name="iCalendarDecorator"
location="${parameters.iCalendarDecoratorLocation}">
<decorator-section name="body">
<section>
@@ -919,7 +929,6 @@
</condition>
<actions>
<set field="quickAssignPartyId"
from-field="userLogin.partyId"/>
- <set field="title"
value="${uiLabelMap.WorkEffortICalendarAdd}"/>
</actions>
<widgets>
<include-form name="EditICalendar"
location="component://workeffort/widget/WorkEffortForms.xml"/>
@@ -1011,4 +1020,33 @@
</section>
</screen>
+ <screen name="ICalendarHelp">
+ <section>
+ <actions>
+ <set field="layoutSettings.styleSheets[+0]"
value="/images/wiki-content.css" global="true"/>
+ <property-map resource="WorkEffortUiLabels"
map-name="uiLabelMap"/>
+ <set field="tabButtonItem" value="ICalendarHelp"/>
+ <set field="workEffortId"
from-field="parameters.workEffortId"/>
+ <entity-one entity-name="WorkEffort" value-field="workEffort"/>
+ <set field="title"
value="${uiLabelMap.WorkEffortICalendarHelp}"/>
+ <set field="document"
from-field="dom:readHtmlDocument(uiLabelMap.WorkEffortICalendarHelpUrl)"/>
+ <set field="wikiDivList"
from-field="document["//d...@class='wiki-content']"]"/>
+ <set field="wikiContent"
from-field="dom:toHtmlString(wikiDivList[0], 'UTF-8', true, 2)"/>
+ </actions>
+ <widgets>
+ <decorator-screen name="iCalendarDecorator"
location="${parameters.iCalendarDecoratorLocation}">
+ <decorator-section name="body">
+ <section>
+ <widgets>
+ <platform-specific>
+ <html><html-template
location="component://workeffort/webapp/workeffort/workeffort/ICalendarHelp.ftl"/></html>
+ </platform-specific>
+ </widgets>
+ </section>
+ </decorator-section>
+ </decorator-screen>
+ </widgets>
+ </section>
+ </screen>
+
</screens>
Added: ofbiz/trunk/framework/images/webapp/images/wiki-content.css
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/wiki-content.css?rev=790455&view=auto
==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/wiki-content.css (added)
+++ ofbiz/trunk/framework/images/webapp/images/wiki-content.css Thu Jul 2
03:10:35 2009
@@ -0,0 +1,99 @@
+/*
+ * 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.
+*/
+.wiki-content p {
+ margin: 16px 0px 16px 0px;
+ padding: 0px;
+}
+.wiki-content-preview {
+ padding: 5px;
+ border-left: 1px solid #3c78b5;
+ border-right: 1px solid #3c78b5;
+}
+.wiki-content ul, .wiki-content ol {
+ list-style-position: inside;
+ margin-top: 2px;
+ margin-bottom: 2px;
+ padding-top: 0px;
+ padding-bottom: 0px;
+}
+.wiki-content ol {
+list-style-type: decimal;
+}
+.wiki-content ul {
+list-style-type: circle;
+}
+.wiki-content .warningPanel { background: #FFFFCE; border:#F0C000 1px solid;
padding: 8px; margin: 10px; }
+.wiki-content .alertPanel { background: #FFCCCC; border:#C00 1px solid;
padding: 8px; margin: 10px; }
+.wiki-content .infoPanel { background: #D8E4F1; border:#3c78b5 1px solid;
padding: 8px; margin: 10px; }
+.wiki-content .noteMacro { border-style: solid; border-width: 1px;
border-color: #F0C000; background-color: #FFFFCE; text-align:left; margin-top:
5px; margin-bottom: 5px}
+.wiki-content .warningMacro { border-style: solid; border-width: 1px;
border-color: #c00; background-color: #fcc; text-align:left; margin-top: 5px;
margin-bottom: 5px}
+.wiki-content .infoMacro { border-style: solid; border-width: 1px;
border-color: #3c78b5; background-color: #D8E4F1; text-align:left; margin-top:
5px; margin-bottom: 5px}
+.wiki-content .tipMacro { border-style: solid; border-width: 1px;
border-color: #090; background-color: #dfd; text-align:left; margin-top: 5px;
margin-bottom: 5px}
+.wiki-content .informationMacroPadding { padding: 5px 0 0 5px; }
+.wiki-content h1 {
+ font-size: 24px;
+ line-height: normal;
+ font-weight: bold;
+ background-color: #f0f0f0;
+ color: #003366;
+ border-bottom: 1px solid #3c78b5;
+ padding: 2px;
+ margin: 36px 0px 4px 0px;
+}
+.wiki-content h2 {
+ font-size: 18px;
+ line-height: normal;
+ font-weight: bold;
+ background-color: #f0f0f0;
+ border-bottom: 1px solid #3c78b5;
+ padding: 2px;
+ margin: 27px 0px 4px 0px;
+}
+.wiki-content h3 {
+ font-size: 14px;
+ line-height: normal;
+ font-weight: bold;
+ background-color: #f0f0f0;
+ padding: 2px;
+ margin: 21px 0px 4px 0px;
+}
+.wiki-content h4 {
+ font-size: 12px;
+ line-height: normal;
+ font-weight: bold;
+ background-color: #f0f0f0;
+ padding: 2px;
+ margin: 18px 0px 4px 0px;
+}
+.wiki-content h5 {
+ font-size: 10px;
+ line-height: normal;
+ font-weight: bold;
+ background-color: #f0f0f0;
+ padding: 2px;
+ margin: 14px 0px 4px 0px;
+}
+.wiki-content h6 {
+ font-size: 8px;
+ line-height: normal;
+ font-weight: bold;
+ background-color: #f0f0f0;
+ padding: 2px;
+ margin: 14px 0px 4px 0px;
+}
Propchange: ofbiz/trunk/framework/images/webapp/images/wiki-content.css
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ofbiz/trunk/framework/images/webapp/images/wiki-content.css
------------------------------------------------------------------------------
svn:keywords = "Date Rev Author URL Id"
Propchange: ofbiz/trunk/framework/images/webapp/images/wiki-content.css
------------------------------------------------------------------------------
svn:mime-type = text/plain