Author: mor
Date: Sat Oct 3 13:19:14 2009 New Revision: 821313 URL: http://svn.apache.org/viewvc?rev=821313&view=rev Log: Improvement to the facility contactmech screen. Moved permission check and various links from the template to the screen. Modified: ofbiz/trunk/applications/product/webapp/facility/facility/EditFacility.ftl ofbiz/trunk/applications/product/webapp/facility/facility/ViewContactMechs.ftl ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml Modified: ofbiz/trunk/applications/product/webapp/facility/facility/EditFacility.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/facility/EditFacility.ftl?rev=821313&r1=821312&r2=821313&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/facility/EditFacility.ftl (original) +++ ofbiz/trunk/applications/product/webapp/facility/facility/EditFacility.ftl Sat Oct 3 13:19:14 2009 @@ -17,17 +17,6 @@ under the License. --> -<#if security.hasEntityPermission("FACILITY", "_VIEW", session)> -<#if facilityId?has_content> - <h1>${uiLabelMap.ProductEditFacility} ${facility.facilityName?if_exists} [${facilityId?if_exists}]</h1> - <div class="button-bar"> - <a href="<@ofbizUrl>EditFacility</@ofbizUrl>" name="EditFacilityForm" class="buttontext">${uiLabelMap.ProductNewFacility}</a> - <a href="/workeffort/control/calendar?facilityId=${facilityId}&externalLoginKey=${requestAttributes.externalLoginKey?if_exists}" class="buttontext">${uiLabelMap.CommonViewCalendar}</a> - </div> -<#else> - <h1>${uiLabelMap.ProductNewFacility}</h1> -</#if> - <#if facility?exists && facilityId?has_content> <form action="<@ofbizUrl>UpdateFacility</@ofbizUrl>" name="EditFacilityForm" method="post"> <input type="hidden" name="facilityId" value="${facilityId?if_exists}"> @@ -133,9 +122,3 @@ </tr> </table> </form> - -<#else> - <h3>${uiLabelMap.ProductFacilityViewPermissionError}</h3> -</#if> - - Modified: ofbiz/trunk/applications/product/webapp/facility/facility/ViewContactMechs.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/facility/ViewContactMechs.ftl?rev=821313&r1=821312&r2=821313&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/facility/ViewContactMechs.ftl (original) +++ ofbiz/trunk/applications/product/webapp/facility/facility/ViewContactMechs.ftl Sat Oct 3 13:19:14 2009 @@ -17,17 +17,7 @@ under the License. --> -<h1>${title}</h1> -<div class="button-bar"> - <a href="<@ofbizUrl>EditFacility</@ofbizUrl>" class="buttontext">${uiLabelMap.ProductNewFacility}</a> - <#if facilityId?has_content> - <a href="/workeffort/control/calendar?period=month&facilityId=${facilityId}&externalLoginKey=${externalLoginKey?if_exists}" class="buttontext">${uiLabelMap.CommonViewCalendar}</a> - <a href="<@ofbizUrl>EditContactMech?facilityId=${facilityId}</@ofbizUrl>" class="buttontext">${uiLabelMap.ProductNewContactMech}</a> - </#if> -</div> - -<div class="screenlet"> - <div class="screenlet-title-bar"><h3>${uiLabelMap.ProductContactTypeInformation}</h3></div> +<div> <#if contactMeches?has_content> <table class="basic-table" cellspacing="0"> <#list contactMeches as contactMechMap> Modified: ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml?rev=821313&r1=821312&r2=821313&view=diff ============================================================================== --- ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml (original) +++ ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml Sat Oct 3 13:19:14 2009 @@ -50,9 +50,26 @@ </condition> <widgets> <include-menu name="FacilityTabBar" location="component://product/widget/facility/Menus.xml"/> - <platform-specific> - <html><html-template location="component://product/webapp/facility/facility/EditFacility.ftl"/></html> - </platform-specific> + <section> + <condition> + <not><if-empty field="facilityId"/></not> + </condition> + <widgets> + <container style="button-bar"> + <link target="EditFacility" text="${uiLabelMap.ProductNewFacility}" style="buttontext"/> + <link target="/workeffort/control/calendar" text="${uiLabelMap.CommonViewCalendar}" style="buttontext" url-mode="inter-app"> + <parameter param-name="facilityId"/> + <parameter param-name="externalLoginKey" from-field="parameters.externalLoginKey"/> + </link> + </container> + <label style="h1">${uiLabelMap.ProductEditFacility} ${facility.facilityName} [${facilityId}]</label> + <platform-specific><html><html-template location="component://product/webapp/facility/facility/EditFacility.ftl"/></html></platform-specific> + </widgets> + <fail-widgets> + <label style="h1">${uiLabelMap.ProductNewFacility}"</label> + <platform-specific><html><html-template location="component://product/webapp/facility/facility/EditFacility.ftl"/></html></platform-specific> + </fail-widgets> + </section> </widgets> <fail-widgets> <label style="h3">${uiLabelMap.ProductFacilityViewPermissionError}</label> @@ -147,18 +164,50 @@ <widgets> <decorator-screen name="CommonFacilityDecorator" location="${parameters.commonFacilityDecoratorLocation}"> <decorator-section name="body"> - <platform-specific> - <html><html-template location="component://product/webapp/facility/facility/EditFacility.ftl"/></html> - </platform-specific> + <section> + <condition> + <if-service-permission service-name="facilityGenericPermission" main-action="VIEW"/> + </condition> + <widgets> + <section> + <condition> + <not><if-empty field="facilityId"/></not> + </condition> + <widgets> + <container style="button-bar"> + <link target="EditFacility" text="${uiLabelMap.ProductNewFacility}" style="buttontext"/> + <link target="/workeffort/control/calendar" text="${uiLabelMap.CommonViewCalendar}" style="buttontext" url-mode="inter-app"> + <parameter param-name="facilityId"/> + <parameter param-name="externalLoginKey" from-field="parameters.externalLoginKey"/> + </link> + </container> + <label style="h1">${uiLabelMap.ProductEditFacility} ${facility.facilityName} [${facilityId}]</label> + <platform-specific><html><html-template location="component://product/webapp/facility/facility/EditFacility.ftl"/></html></platform-specific> + </widgets> + </section> + </widgets> + <fail-widgets> + <label style="h3">${uiLabelMap.ProductFacilityViewPermissionError}</label> + </fail-widgets> + </section> </decorator-section> </decorator-screen> </widgets> <fail-widgets> <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> <decorator-section name="body"> - <platform-specific> - <html><html-template location="component://product/webapp/facility/facility/EditFacility.ftl"/></html> - </platform-specific> + <section> + <condition> + <if-service-permission service-name="facilityGenericPermission" main-action="VIEW"/> + </condition> + <widgets> + <label style="h1">${uiLabelMap.ProductNewFacility}</label> + <platform-specific><html><html-template location="component://product/webapp/facility/facility/EditFacility.ftl"/></html></platform-specific> + </widgets> + <fail-widgets> + <label style="h3">${uiLabelMap.ProductFacilityViewPermissionError}</label> + </fail-widgets> + </section> </decorator-section> </decorator-screen> </fail-widgets> @@ -831,9 +880,28 @@ <widgets> <decorator-screen name="CommonFacilityDecorator" location="${parameters.commonFacilityDecoratorLocation}"> <decorator-section name="body"> - <platform-specific> - <html><html-template location="component://product/webapp/facility/facility/ViewContactMechs.ftl"/></html> - </platform-specific> + <label style="h1">${title}</label> + <container> + <link target="EditFacility" text="${uiLabelMap.ProductNewFacility}" style="buttontext"/> + <section> + <condition> + <not><if-empty field="facilityId"/></not> + </condition> + <widgets> + <link target="/workeffort/control/calendar" text="${uiLabelMap.CommonViewCalendar}" style="buttontext" url-mode="inter-app"> + <parameter param-name="period" value="month"/> + <parameter param-name="facilityId"/> + <parameter param-name="externalLoginKey"/> + </link> + <link target="EditContactMech" text="${uiLabelMap.ProductNewContactMech}" style="buttontext"> + <parameter param-name="facilityId"/> + </link> + </widgets> + </section> + </container> + <screenlet title="${uiLabelMap.PartyContactInformation}"> + <platform-specific><html><html-template location="component://product/webapp/facility/facility/ViewContactMechs.ftl"/></html></platform-specific> + </screenlet> </decorator-section> </decorator-screen> </widgets> |
Free forum by Nabble | Edit this page |