You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by nm...@apache.org on 2015/06/20 15:50:13 UTC
svn commit: r1686621 - in /ofbiz/trunk:
framework/webtools/webapp/webtools/WEB-INF/actions/entity/
framework/webtools/widget/ themes/flatgrey/webapp/flatgrey/
themes/tomahawk/webapp/tomahawk/css/
Author: nmalin
Date: Sat Jun 20 13:50:13 2015
New Revision: 1686621
URL: http://svn.apache.org/r1686621
Log:
Replace FTL at webtools/control/entitymaint with widgets. Remove multi column and convert links as include-menu. By default the entityName is link on Find and receive the anchor. This patch is related to OFBIZ-6402, thanks Christian Carlow for this issue.
Modified:
ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntityMaint.groovy
ofbiz/trunk/framework/webtools/widget/EntityForms.xml
ofbiz/trunk/framework/webtools/widget/EntityScreens.xml
ofbiz/trunk/framework/webtools/widget/Menus.xml
ofbiz/trunk/themes/flatgrey/webapp/flatgrey/maincss.css
ofbiz/trunk/themes/tomahawk/webapp/tomahawk/css/style.css
Modified: ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntityMaint.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntityMaint.groovy?rev=1686621&r1=1686620&r2=1686621&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntityMaint.groovy (original)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntityMaint.groovy Sat Jun 20 13:50:13 2015
@@ -27,6 +27,7 @@ import org.ofbiz.entity.model.ModelReade
import org.ofbiz.entity.model.ModelEntity;
import org.ofbiz.entity.model.ModelViewEntity
import org.ofbiz.entity.util.EntityUtil;
+import org.ofbiz.base.util.UtilProperties;
if (delegator.getDelegatorTenantId() == null) {
mgr = delegator.getModelGroupReader();
@@ -36,6 +37,12 @@ if (delegator.getDelegatorTenantId() ==
entityGroups = EntityUtil.getFieldListFromEntityList(baseDelegator.findList("TenantDataSource", EntityCondition.makeCondition("tenantId", EntityComparisonOperator.EQUALS, delegator.getDelegatorTenantId()), ['entityGroupName'] as Set, ['entityGroupName'], null, false), 'entityGroupName', false);
}
+context.entityGroups = [];
+context.entityGroups.add(["name" : UtilProperties.getMessage("WebtoolsUiLabels", "WebtoolsAll", locale), "value" : ""]);
+for (String entityGroup : entityGroups) {
+ context.entityGroups.add(["name" : entityGroup, "value" : entityGroup]);
+}
+
filterByGroupName = parameters.filterByGroupName;
context.filterByGroupName = filterByGroupName;
@@ -45,9 +52,9 @@ context.filterByEntityName = filterByEnt
reader = delegator.getModelReader();
entities = new TreeSet(reader.getEntityNames());
-int colSize = entities.size()/3 + 1;
-int kIdx = 0;
entitiesList = [];
+firstChars = [];
+firstChar = "";
entities.each { entityName ->
entity = reader.getModelEntity(entityName);
entityGroupName = delegator.getEntityGroupName(entity.getEntityName());
@@ -76,21 +83,18 @@ entities.each { entityName ->
entityPermissionCreate = "Y";
}
- changeColumn = "N";
- kIdx++;
- if (kIdx >= colSize) {
- colSize += colSize;
- changeColumn = "Y";
- }
-
entityMap = [:];
entityMap.entityName = entity.getEntityName();
entityMap.entityPermissionView = entityPermissionView;
entityMap.entityPermissionCreate = entityPermissionCreate;
entityMap.viewEntity = viewEntity;
- entityMap.changeColumn = changeColumn;
+
+ if (firstChar != entityName.substring(0, 1)) {
+ firstChar = entityName.substring(0, 1);
+ firstChars.add(firstChar);
+ }
entitiesList.add(entityMap);
}
-context.entityGroups = entityGroups;
-context.entitiesList = entitiesList;
+context.firstChars = firstChars;
+context.entitiesList = entitiesList;
\ No newline at end of file
Modified: ofbiz/trunk/framework/webtools/widget/EntityForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/widget/EntityForms.xml?rev=1686621&r1=1686620&r2=1686621&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/widget/EntityForms.xml (original)
+++ ofbiz/trunk/framework/webtools/widget/EntityForms.xml Sat Jun 20 13:50:13 2015
@@ -42,4 +42,29 @@ under the License.
<field name="secsPerCall" title="${uiLabelMap.WebtoolsPerformanceSecondsCall}"><display/></field>
<field name="callsPerSecond" title="${uiLabelMap.WebtoolsPerformanceCallsSecond}"><display/></field>
</form>
+
+ <form name="FilterEntities" default-table-style="condensed-table">
+ <field name="filterByGroupName">
+ <drop-down>
+ <list-options key-name="value" list-name="entityGroups" description="${name}"/>
+ </drop-down>
+ </field>
+ <field name="filterByEntityName" position="2"><text/></field>
+ <field name="submitButton" position="3" title="${uiLabelMap.CommonApply}"><submit/></field>
+ </form>
+
+ <grid name="ListEntities" list-name="entitiesList" paginate="false"
+ odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
+ <row-actions>
+ <set field="firstChar" value="${groovy: entityName.substring(0, 1)}"/>
+ </row-actions>
+ <field name="entityName">
+ <hyperlink id="${firstChar}" description="${entityName}" target="FindGeneric">
+ <parameter param-name="entityName"/>
+ </hyperlink>
+ </field>
+ <field name="actions" title=" ">
+ <include-menu name="ListEntitiesAction" location="component://webtools/widget/Menus.xml"/>
+ </field>
+ </grid>
</forms>
Modified: ofbiz/trunk/framework/webtools/widget/EntityScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/widget/EntityScreens.xml?rev=1686621&r1=1686620&r2=1686621&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/widget/EntityScreens.xml (original)
+++ ofbiz/trunk/framework/webtools/widget/EntityScreens.xml Sat Jun 20 13:50:13 2015
@@ -166,9 +166,21 @@ under the License.
<widgets>
<decorator-screen name="CommonEntityDecorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
- <platform-specific>
- <html><html-template location="component://webtools/webapp/webtools/entity/EntityMaint.ftl"/></html>
- </platform-specific>
+ <screenlet title="${uiLabelMap.WebtoolsFindRecord}">
+ <include-form name="FilterEntities" location="component://webtools/widget/EntityForms.xml"/>
+ </screenlet>
+ <screenlet title="${uiLabelMap.WebtoolsFindRecord}">
+ <iterate-section entry="firstChar" list="firstChars" view-size="100">
+ <section>
+ <widgets>
+ <link text="${firstChar}" style="buttontext button-bar" target="#${firstChar}" full-path="true" url-mode="plain"></link>
+ </widgets>
+ </section>
+ </iterate-section>
+ </screenlet>
+ <screenlet title="${uiLabelMap.WebtoolsEntitiesAlpha}">
+ <include-grid name="ListEntities" location="component://webtools/widget/EntityForms.xml"/>
+ </screenlet>
</decorator-section>
</decorator-screen>
</widgets>
Modified: ofbiz/trunk/framework/webtools/widget/Menus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/widget/Menus.xml?rev=1686621&r1=1686620&r2=1686621&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/widget/Menus.xml (original)
+++ ofbiz/trunk/framework/webtools/widget/Menus.xml Sat Jun 20 13:50:13 2015
@@ -215,6 +215,31 @@ under the License.
<link target="EntityPerformanceTest"/>
</menu-item>
</menu>
+ <menu name="ListEntitiesAction" extends="CommonInlineBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
+ <menu-item name="createLink" title="${uiLabelMap.WebtoolsCreate}">
+ <condition>
+ <and>
+ <if-compare field="entityPermissionView" operator="equals" value="Y"/>
+ <if-compare field="viewEntity" operator="not-equals" value="Y"/>
+ </and>
+ </condition>
+ <link target="ViewGeneric">
+ <parameter param-name="entityName"/>
+ <parameter param-name="enableEdit" value="true"/>
+ </link>
+ </menu-item>
+ <menu-item name="relation" title="${uiLabelMap.WebtoolsReln}">
+ <link target="ViewRelations">
+ <parameter param-name="entityName"/>
+ </link>
+ </menu-item>
+ <menu-item name="all" title="${uiLabelMap.WebtoolsAll}">
+ <link target="FindGeneric">
+ <parameter param-name="entityName"/>
+ <parameter param-name="find" value="true"/>
+ </link>
+ </menu-item>
+ </menu>
<menu name="StatsTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml"
selected-menuitem-context-field-name="tabButtonItem">
Modified: ofbiz/trunk/themes/flatgrey/webapp/flatgrey/maincss.css
URL: http://svn.apache.org/viewvc/ofbiz/trunk/themes/flatgrey/webapp/flatgrey/maincss.css?rev=1686621&r1=1686620&r2=1686621&view=diff
==============================================================================
--- ofbiz/trunk/themes/flatgrey/webapp/flatgrey/maincss.css (original)
+++ ofbiz/trunk/themes/flatgrey/webapp/flatgrey/maincss.css Sat Jun 20 13:50:13 2015
@@ -1167,6 +1167,10 @@ width: auto;
margin-bottom: 1em;
}
+.basic-form table.condensed-table{
+ width: 0%;
+}
+
/* ------------------------------- */
/* List Navigation Style */
/* ------------------------------- */
Modified: ofbiz/trunk/themes/tomahawk/webapp/tomahawk/css/style.css
URL: http://svn.apache.org/viewvc/ofbiz/trunk/themes/tomahawk/webapp/tomahawk/css/style.css?rev=1686621&r1=1686620&r2=1686621&view=diff
==============================================================================
--- ofbiz/trunk/themes/tomahawk/webapp/tomahawk/css/style.css (original)
+++ ofbiz/trunk/themes/tomahawk/webapp/tomahawk/css/style.css Sat Jun 20 13:50:13 2015
@@ -2029,6 +2029,10 @@ color: #333366;
text-decoration: none;
}
+.basic-form table.condensed-table{
+ width: 0%;
+}
+
/* ===== Form decorator - Form Widget ===== */
.form-widget table tr .label,.form-widget-table tr .label {
/* Added for backward compatibility */
@@ -3056,4 +3060,4 @@ height: auto;
*+html .jstree-default a {
white-space:normal;
height: auto;
-}
+}
\ No newline at end of file