svn commit: r949713 - in /ofbiz/branches/release10.04: ./ framework/images/webapp/images/fieldlookup.js framework/widget/templates/htmlFormMacroLibrary.ftl

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

svn commit: r949713 - in /ofbiz/branches/release10.04: ./ framework/images/webapp/images/fieldlookup.js framework/widget/templates/htmlFormMacroLibrary.ftl

jleroux@apache.org
Author: jleroux
Date: Mon May 31 10:51:24 2010
New Revision: 949713

URL: http://svn.apache.org/viewvc?rev=949713&view=rev
Log:
"Applied fix from trunk for revision: 949710"
------------------------------------------------------------------------
r949710 | jleroux | 2010-05-31 12:33:52 +0200 (lun. 31 mai 2010) | 2 lignes

* Remove useless white spaces in macro (make harder handling links in javascript)
* Implement target-parameter in case of layered lookup (was missing)
------------------------------------------------------------------------

Modified:
    ofbiz/branches/release10.04/   (props changed)
    ofbiz/branches/release10.04/framework/images/webapp/images/fieldlookup.js
    ofbiz/branches/release10.04/framework/widget/templates/htmlFormMacroLibrary.ftl

Propchange: ofbiz/branches/release10.04/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon May 31 10:51:24 2010
@@ -1,3 +1,3 @@
 /ofbiz/branches/addbirt:831210-885099,885686-886087
 /ofbiz/branches/multitenant20100310:921280-927264
-/ofbiz/trunk:939988,939990,939999,940025,940053,940234,940248,940309,940401,940410,940425,940779,940815,940849,941007,941047,941109,941177,941199,941261,941440,941600,941999,942084,942406,942414,942671,942883-942884,943168,943271-943272,944614,944621,944623,944647,944669,944797,944895,945010,945018,945026,945118,945573,945578,945580,945582,945610,945619,945848,945852,945857,946061,946066,946073,946075,946080,946309,946313,946320,946322,946596,947004-947005,947392,947424,947679,947988,948017,948694,949174
+/ofbiz/trunk:939988,939990,939999,940025,940053,940234,940248,940309,940401,940410,940425,940779,940815,940849,941007,941047,941109,941177,941199,941261,941440,941600,941999,942084,942406,942414,942671,942883-942884,943168,943271-943272,944614,944621,944623,944647,944669,944797,944895,945010,945018,945026,945118,945573,945578,945580,945582,945610,945619,945848,945852,945857,946061,946066,946073,946075,946080,946309,946313,946320,946322,946596,947004-947005,947392,947424,947679,947988,948017,948694,949174,949710

Modified: ofbiz/branches/release10.04/framework/images/webapp/images/fieldlookup.js
URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/framework/images/webapp/images/fieldlookup.js?rev=949713&r1=949712&r2=949713&view=diff
==============================================================================
--- ofbiz/branches/release10.04/framework/images/webapp/images/fieldlookup.js (original)
+++ ofbiz/branches/release10.04/framework/images/webapp/images/fieldlookup.js Mon May 31 10:51:24 2010
@@ -51,7 +51,7 @@ function call_fieldlookupLayer(target, v
         return lookup_error("Lookup can't be created, one of these variables is missing: target=" + target + " viewName=" + viewName);
     }
 
-    var fieldLookupPopup = new FieldLookupPopup(target, viewName, lookupWidth, lookupHeight, lookupPosition, fadeBackground);
+    var fieldLookupPopup = new FieldLookupPopup(target, viewName, lookupWidth, lookupHeight, lookupPosition, fadeBackground, arguments);
     fieldLookupPopup.showLookup();
     this.target = target;
 }
@@ -61,7 +61,7 @@ function call_fieldlookupLayer3(target,
         return lookup_error("Lookup can't be created, one of these variables is missing: target=" + target + " target2=" + target2 + " viewName=" + viewName);
     }
 
-    var fieldLookupPopup = new FieldLookupPopup(target, viewName, lookupWidth, lookupHeight, lookupPosition, fadeBackground);
+    var fieldLookupPopup = new FieldLookupPopup(target, viewName, lookupWidth, lookupHeight, lookupPosition, fadeBackground, arguments);
     fieldLookupPopup.showLookup();
     this.target = target;
     this.target2 = target2;
@@ -201,7 +201,21 @@ var GLOBAL_LOOKUP_REF = new FieldLookupC
 * position - normal (under the target field), center (layer is centered) [default: normal] -- !work still in process
 */
 var FieldLookupPopup = Class.create({
-    initialize: function (target, viewName, lookupWidth, lookupHeight, position, fadeBackground) {
+    initialize: function (target, viewName, lookupWidth, lookupHeight, position, fadeBackground, args) {
+        if (args != null) {
+            var argString = "";
+            if (args.length > 7) {
+                for (var i = 7; i < args.length; i++) {
+                    if ((viewName.indexOf("?") == -1) && (i - 6) == 1) {
+                        sep = "?";
+                    } else {
+                        sep = "&";
+                    }
+                    argString += sep + "parm" + (i - 6) + "=" + args[i];
+                }
+            viewName += argString;
+            }
+        }
 
         //fade the background if the flag is set
         if (fadeBackground != "false") {
@@ -252,6 +266,7 @@ var FieldLookupPopup = Class.create({
 
     createElement: function () {
         var parent = this.parentTarget;
+        
         var that = this;
         
         //set global reference
@@ -331,7 +346,6 @@ var FieldLookupPopup = Class.create({
         var lookupCont = new Element('DIV', {
             id: "fieldLookupContent"
         });
-
         new Ajax.Request(this.viewName, {
             parameters: { presentation : "layer" },
             onSuccess: function (transport) {
@@ -584,6 +598,7 @@ function modifySubmitButton (lookupDiv)
         
         //find the lookup form
         var forms = lookupDiv.getElementsByTagName('form');
+        
         var lookupForm = null;
         for (var i = 0; i < forms.length; i++) {
             if (! isEmpty(forms[i].getAttribute('id'))) {
@@ -594,13 +609,15 @@ function modifySubmitButton (lookupDiv)
         if (lookupForm == null) {
             return;
         }
-        
+
         //set new form name and id
         oldFormName = lookupForm.getAttribute('name');
         lookupForm.setAttribute('name', 'form_' + GLOBAL_LOOKUP_REF.getReference(ACTIVATED_LOOKUP).globalRef);
         lookupForm.setAttribute('id', 'form_' + GLOBAL_LOOKUP_REF.getReference(ACTIVATED_LOOKUP).globalRef);
         lookupForm = $('form_' + GLOBAL_LOOKUP_REF.getReference(ACTIVATED_LOOKUP).globalRef);
         
+        
+        
         //set new links for lookups
         var newLookups = $A(lookupDiv.getElementsByClassName('field-lookup'));
         newLookups.each(function(newLookup){
@@ -621,7 +638,7 @@ function modifySubmitButton (lookupDiv)
         //disable the form action
         var formAction = lookupForm.getAttribute('action');
         lookupForm.setAttribute('action', '');
-
+        
         //modify the form submit button
         for (var i = 0; i < lookupForm.length; i++) {
             var ele = lookupForm.elements[i];
@@ -745,7 +762,7 @@ function lookupAjaxRequest(request) {
     lookupContent = (GLOBAL_LOOKUP_REF.getReference(ACTIVATED_LOOKUP).contentRef);
     
     // get request arguments
-    var arg = request.substring(request.indexOf('?')+1,(request.length));
+    var arg = request.substring(request.indexOf('?')+1,(request.length));    
 
     new Ajax.Request(request, {
         method: 'post',

Modified: ofbiz/branches/release10.04/framework/widget/templates/htmlFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=949713&r1=949712&r2=949713&view=diff
==============================================================================
--- ofbiz/branches/release10.04/framework/widget/templates/htmlFormMacroLibrary.ftl (original)
+++ ofbiz/branches/release10.04/framework/widget/templates/htmlFormMacroLibrary.ftl Mon May 31 10:51:24 2010
@@ -435,17 +435,17 @@ ${item.description}</span>
 <span class="field-lookup">
 <#if size?has_content && size=="0"><input type="hidden" <#if name?has_content> name="${name}"/></#if><#else><input type="text" <@renderClass className alert /><#if name?has_content> name="${name}"</#if><#if value?has_content> value="${value}"</#if><#if size?has_content> size="${size}"</#if><#if maxlength?has_content> maxlength="${maxlength}"</#if><#if id?has_content> id="${id}"</#if><#rt/><#if disabled?has_content && disabled> disabled="disabled"</#if><#rt/><#if event?has_content && action?has_content> ${event}="${action}"</#if><#rt/><#if autocomplete?has_content> autocomplete="off"</#if>/><#rt/></#if>
 <#if presentation?has_content && descriptionFieldName?has_content && presentation == "window">
- <a href="javascript:call_fieldlookup3(document.${formName?html}.${name?html}, document.${formName?html}.${descriptionFieldName},'${fieldFormName}'<#rt/>
+ <a href="javascript:call_fieldlookup3(document.${formName?html}.${name?html},document.${formName?html}.${descriptionFieldName},'${fieldFormName}'<#rt/>
 <#elseif presentation?has_content && presentation == "window">
  <a href="javascript:call_fieldlookup2(document.${formName}.${name},'${fieldFormName}'<#rt/>
 <#elseif descriptionFieldName?has_content>
- <a href="javascript:call_fieldlookupLayer3(document.${formName?html}.${name?html}, document.${formName?html}.${descriptionFieldName},'${fieldFormName}','${width}','${height}','${position}', '${fadeBackground}'<#rt/>
+ <a href="javascript:call_fieldlookupLayer3(document.${formName?html}.${name?html},document.${formName?html}.${descriptionFieldName},'${fieldFormName}','${width}','${height}','${position}','${fadeBackground}'<#rt/>
 <#else>
- <a href="javascript:call_fieldlookupLayer(document.${formName?html}.${name?html},'${fieldFormName}','${width}','${height}','${position}', '${fadeBackground}'<#rt/>
+ <a href="javascript:call_fieldlookupLayer(document.${formName?html}.${name?html},'${fieldFormName}','${width}','${height}','${position}','${fadeBackground}'<#rt/>
 </#if>
 <#if targetParameterIter?has_content>
  <#list targetParameterIter as item>
-  ,document.${formName}.${item}.value<#rt>
+,document.${formName}.${item}.value<#rt>
  </#list>
 </#if>
 );">