svn commit: r1137436 - in /ofbiz/branches/release11.04: ./ applications/order/script/org/ofbiz/order/customer/ applications/party/webapp/partymgr/WEB-INF/actions/party/ applications/product/script/org/ofbiz/product/test/ framework/common/widget/ framew...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1137436 - in /ofbiz/branches/release11.04: ./ applications/order/script/org/ofbiz/order/customer/ applications/party/webapp/partymgr/WEB-INF/actions/party/ applications/product/script/org/ofbiz/product/test/ framework/common/widget/ framew...

jleroux@apache.org
Author: jleroux
Date: Sun Jun 19 21:07:58 2011
New Revision: 1137436

URL: http://svn.apache.org/viewvc?rev=1137436&view=rev
Log:
"Applied fix from trunk for revision: 1137433"
------------------------------------------------------------------------
r1137433 | jleroux | 2011-06-19 22:59:35 +0200 (dim., 19 juin 2011) | 7 lines

A patch from Leon <<"setUserPreference" goes to main page instead last view if current form includes any lookup field>> https://issues.apache.org/jira/browse/OFBIZ-4313

When I open a form which include lookup field and then click the expand/collapse button around the upper right corner in the the header, the page will go to "main" after user preference is settled.

The cause is the requests initiated by lookup field does not remember the last view name. It simply use "main" instead.

Patch to make lookup requests remember the LAST_VIEW_NAME correctly.
------------------------------------------------------------------------


Modified:
    ofbiz/branches/release11.04/   (props changed)
    ofbiz/branches/release11.04/applications/order/script/org/ofbiz/order/customer/CheckoutMapProcs.xml   (props changed)
    ofbiz/branches/release11.04/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancialHistory.groovy   (props changed)
    ofbiz/branches/release11.04/applications/product/script/org/ofbiz/product/test/InventoryTests.xml   (props changed)
    ofbiz/branches/release11.04/framework/common/widget/HelpScreens.xml   (props changed)
    ofbiz/branches/release11.04/framework/security/data/PasswordSecurityData.xml   (props changed)
    ofbiz/branches/release11.04/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java
    ofbiz/branches/release11.04/framework/widget/templates/htmlFormMacroLibrary.ftl
    ofbiz/branches/release11.04/specialpurpose/ebaystore/lib/   (props changed)
    ofbiz/branches/release11.04/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy   (props changed)
    ofbiz/branches/release11.04/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy   (props changed)
    ofbiz/branches/release11.04/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy   (props changed)

Propchange: ofbiz/branches/release11.04/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Jun 19 21:07:58 2011
@@ -2,4 +2,4 @@
 /ofbiz/branches/dojo1.4:951708-952957
 /ofbiz/branches/jquery:952958-1044489
 /ofbiz/branches/multitenant20100310:921280-927264
-/ofbiz/trunk:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1133353,1134990,1135199,1135686,1135929,1137201
+/ofbiz/trunk:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1133353,1134990,1135199,1135686,1135929,1137201,1137433

Propchange: ofbiz/branches/release11.04/applications/order/script/org/ofbiz/order/customer/CheckoutMapProcs.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Jun 19 21:07:58 2011
@@ -2,4 +2,4 @@
 /ofbiz/branches/dojo1.4/applications/order/script/org/ofbiz/order/customer/CheckoutMapProcs.xml:951708-952957
 /ofbiz/branches/jquery/applications/order/script/org/ofbiz/order/customer/CheckoutMapProcs.xml:952958-1044489
 /ofbiz/branches/multitenant20100310/applications/order/script/org/ofbiz/order/customer/CheckoutMapProcs.xml:921280-927264
-/ofbiz/trunk/applications/order/script/org/ofbiz/order/customer/CheckoutMapProcs.xml:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929,1137201
+/ofbiz/trunk/applications/order/script/org/ofbiz/order/customer/CheckoutMapProcs.xml:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929,1137201,1137433

Propchange: ofbiz/branches/release11.04/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancialHistory.groovy
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Jun 19 21:07:58 2011
@@ -2,4 +2,4 @@
 /ofbiz/branches/dojo1.4/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancialHistory.groovy:951708-952957
 /ofbiz/branches/jquery/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancialHistory.groovy:952958-1044489
 /ofbiz/branches/multitenant20100310/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancialHistory.groovy:921280-927264
-/ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancialHistory.groovy:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929,1137201
+/ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancialHistory.groovy:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929,1137201,1137433

Propchange: ofbiz/branches/release11.04/applications/product/script/org/ofbiz/product/test/InventoryTests.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Jun 19 21:07:58 2011
@@ -2,4 +2,4 @@
 /ofbiz/branches/dojo1.4/applications/product/script/org/ofbiz/product/test/InventoryTests.xml:951708-952957
 /ofbiz/branches/jquery/applications/product/script/org/ofbiz/product/test/InventoryTests.xml:952958-1044489
 /ofbiz/branches/multitenant20100310/applications/product/script/org/ofbiz/product/test/InventoryTests.xml:921280-927264
-/ofbiz/trunk/applications/product/script/org/ofbiz/product/test/InventoryTests.xml:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929,1137201
+/ofbiz/trunk/applications/product/script/org/ofbiz/product/test/InventoryTests.xml:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929,1137201,1137433

Propchange: ofbiz/branches/release11.04/framework/common/widget/HelpScreens.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Jun 19 21:07:58 2011
@@ -2,4 +2,4 @@
 /ofbiz/branches/dojo1.4/framework/common/widget/HelpScreens.xml:951708-952957
 /ofbiz/branches/jquery/framework/common/widget/HelpScreens.xml:952958-1044489
 /ofbiz/branches/multitenant20100310/framework/common/widget/HelpScreens.xml:921280-927264
-/ofbiz/trunk/framework/common/widget/HelpScreens.xml:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929,1137201
+/ofbiz/trunk/framework/common/widget/HelpScreens.xml:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929,1137201,1137433

Propchange: ofbiz/branches/release11.04/framework/security/data/PasswordSecurityData.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Jun 19 21:07:58 2011
@@ -2,4 +2,4 @@
 /ofbiz/branches/dojo1.4/applications/securityext/data/PasswordSecurityData.xml:951708-952957
 /ofbiz/branches/jquery/applications/securityext/data/PasswordSecurityData.xml:952958-1044489
 /ofbiz/branches/multitenant20100310/applications/securityext/data/PasswordSecurityData.xml:921280-927264
-/ofbiz/trunk/framework/security/data/PasswordSecurityData.xml:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929,1137201
+/ofbiz/trunk/framework/security/data/PasswordSecurityData.xml:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929,1137201,1137433

Modified: ofbiz/branches/release11.04/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java?rev=1137436&r1=1137435&r2=1137436&view=diff
==============================================================================
--- ofbiz/branches/release11.04/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java (original)
+++ ofbiz/branches/release11.04/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java Sun Jun 19 21:07:58 2011
@@ -2149,6 +2149,14 @@ public class MacroFormRenderer implement
 
         boolean showDescription = "Y".equals(UtilProperties.getPropertyValue("widget", "widget.lookup.showDescription", "N"));
 
+        // lastViewName, used by lookup to remember the real last view name
+        String lastViewName = request.getParameter("_LAST_VIEW_NAME_"); // Try to get it from parameters firstly
+        if (UtilValidate.isEmpty(lastViewName)) { // get from session
+            lastViewName = (String) request.getSession().getAttribute("_LAST_VIEW_NAME_");
+        }
+        if (UtilValidate.isEmpty(lastViewName)) {
+            lastViewName = "";
+        }
         StringWriter sr = new StringWriter();
         sr.append("<@renderLookupField ");
         sr.append(" className=\"");
@@ -2208,6 +2216,8 @@ public class MacroFormRenderer implement
         sr.append(Boolean.toString(showDescription));
         sr.append("\" initiallyCollapsed=\"");
         sr.append(Boolean.toString(isInitiallyCollapsed));
+        sr.append("\" lastViewName=\"");
+        sr.append(lastViewName);
         sr.append("\" />");
         executeMacro(writer, sr.toString());
 

Modified: ofbiz/branches/release11.04/framework/widget/templates/htmlFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=1137436&r1=1137435&r2=1137436&view=diff
==============================================================================
--- ofbiz/branches/release11.04/framework/widget/templates/htmlFormMacroLibrary.ftl (original)
+++ ofbiz/branches/release11.04/framework/widget/templates/htmlFormMacroLibrary.ftl Sun Jun 19 21:07:58 2011
@@ -542,7 +542,7 @@ ${item.description}</span>
 </#if>
 </#macro>
 
-<#macro renderLookupField className alert name value size maxlength id event action readonly autocomplete descriptionFieldName formName fieldFormName targetParameterIter imgSrc ajaxUrl ajaxEnabled presentation width height position fadeBackground clearText showDescription initiallyCollapsed>
+<#macro renderLookupField className alert name value size maxlength id event action readonly autocomplete descriptionFieldName formName fieldFormName targetParameterIter imgSrc ajaxUrl ajaxEnabled presentation width height position fadeBackground clearText showDescription initiallyCollapsed lastViewName="main" >
 <#if ajaxEnabled?has_content && ajaxEnabled>
     <script type="text/javascript">
     jQuery(document).ready(function(){
@@ -573,11 +573,7 @@ ${item.description}</span>
 <#else>
     <#if ajaxEnabled?has_content && ajaxEnabled>
       <#assign defaultMinLength = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.autocompleter.defaultMinLength")>
-      <#if parameters?has_content && parameters._LAST_VIEW_NAME_?has_content>
-        <#local ajaxUrl = ajaxUrl + "&amp;_LAST_VIEW_NAME_=" + parameters._LAST_VIEW_NAME_ />
-      <#else>
-        <#local ajaxUrl = ajaxUrl + "&amp;_LAST_VIEW_NAME_=main"/>
-      </#if>      
+      <#local ajaxUrl = ajaxUrl + "&amp;_LAST_VIEW_NAME_=" + lastViewName />
       <#if !ajaxUrl?contains("searchValueFieldName=")>
           <#if descriptionFieldName?has_content && showDescription == "true">
             <#local ajaxUrl = ajaxUrl + "&amp;searchValueFieldName=" + descriptionFieldName />
@@ -609,10 +605,8 @@ ${item.description}</span>
 <#if readonly?has_content && readonly><a id="${id}_clear" style="background:none;margin-left:5px;margin-right:15px;" class="clearField" href="javascript:void();" onclick="javascript:document.${formName}.${name}.value='';<#if descriptionFieldName?has_content>document.${formName}.${descriptionFieldName}.value='';</#if>">${clearText}</a></#if>
 </span>
 <#if ajaxEnabled?has_content && ajaxEnabled>
-      <#if parameters?has_content && parameters._LAST_VIEW_NAME_?has_content && ajaxUrl?index_of("_LAST_VIEW_NAME_") < 0>
-        <#local ajaxUrl = ajaxUrl + "&amp;_LAST_VIEW_NAME_=" + parameters._LAST_VIEW_NAME_ />
-      <#elseif ajaxUrl?index_of("_LAST_VIEW_NAME_") < 0>
-        <#local ajaxUrl = ajaxUrl + "&amp;_LAST_VIEW_NAME_=main"/>
+      <#if ajaxUrl?index_of("_LAST_VIEW_NAME_") < 0>
+        <#local ajaxUrl = ajaxUrl + "&amp;_LAST_VIEW_NAME_=" + lastViewName />
       </#if>      
     <script language="JavaScript" type="text/javascript">ajaxAutoCompleter('${ajaxUrl}', ${showDescription}, ${defaultMinLength!2});</script><#t/>
 </#if>

Propchange: ofbiz/branches/release11.04/specialpurpose/ebaystore/lib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Jun 19 21:07:58 2011
@@ -2,4 +2,4 @@
 /ofbiz/branches/dojo1.4/specialpurpose/ebaystore/lib:951708-952957
 /ofbiz/branches/jquery/specialpurpose/ebaystore/lib:952958-1044489
 /ofbiz/branches/multitenant20100310/specialpurpose/ebaystore/lib:921280-927264
-/ofbiz/trunk/specialpurpose/ebaystore/lib:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929,1137201
+/ofbiz/trunk/specialpurpose/ebaystore/lib:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929,1137201,1137433

Propchange: ofbiz/branches/release11.04/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Jun 19 21:07:58 2011
@@ -2,4 +2,4 @@
 /ofbiz/branches/dojo1.4/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy:951708-952957
 /ofbiz/branches/jquery/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy:952958-1044489
 /ofbiz/branches/multitenant20100310/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy:921280-927264
-/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929,1137201
+/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929,1137201,1137433

Propchange: ofbiz/branches/release11.04/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Jun 19 21:07:58 2011
@@ -2,4 +2,4 @@
 /ofbiz/branches/dojo1.4/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy:951708-952957
 /ofbiz/branches/jquery/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy:952958-1044489
 /ofbiz/branches/multitenant20100310/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy:921280-927264
-/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929,1137201
+/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929,1137201,1137433

Propchange: ofbiz/branches/release11.04/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Jun 19 21:07:58 2011
@@ -2,4 +2,4 @@
 /ofbiz/branches/dojo1.4/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy:951708-952957
 /ofbiz/branches/jquery/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy:952958-1044489
 /ofbiz/branches/multitenant20100310/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy:921280-927264
-/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929,1137201
+/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929,1137201,1137433