You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2010/08/18 14:03:45 UTC
svn commit: r986638 - in /ofbiz/branches/jquery: ./
applications/order/webapp/ordermgr/reports/ applications/product/config/
framework/base/config/ framework/common/widget/
framework/images/webapp/images/ framework/webapp/config/
framework/widget/templ...
Author: jleroux
Date: Wed Aug 18 12:03:45 2010
New Revision: 986638
URL: http://svn.apache.org/viewvc?rev=986638&view=rev
Log:
A patch from Sascha Rodekamp "jQuery Lookup Layer Transformation" (https://issues.apache.org/jira/browse/OFBIZ-3841) - OFBIZ-3841
Fix some issues I reported
* Theme, Locale Sites works again
* The Dialog close when clicking outside
* weird title removed
* some little other improvements
There is a small bug: the lookups are not dimensioned (very small), but I prefer to commit the work done, as it'es certainly a small thing (quickly looking I did not find the reason)
Modified:
ofbiz/branches/jquery/.project
ofbiz/branches/jquery/applications/order/webapp/ordermgr/reports/reportlist.ftl
ofbiz/branches/jquery/applications/product/config/shipment.properties
ofbiz/branches/jquery/framework/base/config/ofbiz-containers.xml
ofbiz/branches/jquery/framework/common/widget/LookupScreens.xml
ofbiz/branches/jquery/framework/images/webapp/images/fieldlookup.js
ofbiz/branches/jquery/framework/webapp/config/url.properties
ofbiz/branches/jquery/framework/widget/templates/htmlFormMacroLibrary.ftl
Modified: ofbiz/branches/jquery/.project
URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/.project?rev=986638&r1=986637&r2=986638&view=diff
==============================================================================
--- ofbiz/branches/jquery/.project (original)
+++ ofbiz/branches/jquery/.project Wed Aug 18 12:03:45 2010
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>ofbiz</name>
+ <name>ami</name>
<comment></comment>
<projects>
</projects>
Modified: ofbiz/branches/jquery/applications/order/webapp/ordermgr/reports/reportlist.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/applications/order/webapp/ordermgr/reports/reportlist.ftl?rev=986638&r1=986637&r2=986638&view=diff
==============================================================================
--- ofbiz/branches/jquery/applications/order/webapp/ordermgr/reports/reportlist.ftl (original)
+++ ofbiz/branches/jquery/applications/order/webapp/ordermgr/reports/reportlist.ftl Wed Aug 18 12:03:45 2010
@@ -35,7 +35,7 @@ these reports and helping to improve the
<tr>
<td><div>To Date:</div></td>
<td>
- <@htmlTemplate.renderDateTimeField name="tpDate" value="" className="" alert="" title="Format: yyyy-MM-dd HH:mm:ss.SSS" size="22" maxlength="25" id="t" oDate1dateType="date" shortDateInput=false timeDropdownParamName="" defaultDateTimeString="" localizedIconTitle="" timeDropdown="" timeHourName="" classString="" hour1="" hour2="" timeMinutesName="" minutes="" isTwelveHour="" ampmName="" amSelected="" pmSelected="" compositeType="" formName=""/>
+ <@htmlTemplate.renderDateTimeField name="toDate" value="" className="" alert="" title="Format: yyyy-MM-dd HH:mm:ss.SSS" size="22" maxlength="25" id="t" oDate1dateType="date" shortDateInput=false timeDropdownParamName="" defaultDateTimeString="" localizedIconTitle="" timeDropdown="" timeHourName="" classString="" hour1="" hour2="" timeMinutesName="" minutes="" isTwelveHour="" ampmName="" amSelected="" pmSelected="" compositeType="" formName=""/>
</td>
</tr>
<#--
Modified: ofbiz/branches/jquery/applications/product/config/shipment.properties
URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/applications/product/config/shipment.properties?rev=986638&r1=986637&r2=986638&view=diff
==============================================================================
--- ofbiz/branches/jquery/applications/product/config/shipment.properties (original)
+++ ofbiz/branches/jquery/applications/product/config/shipment.properties Wed Aug 18 12:03:45 2010
@@ -189,10 +189,11 @@ shipment.template.fedex.ship.location=co
shipment.template.fedex.subscription.location=component://product/templates/shipment/FedexSubscriptionRequestTemplate.xml.ftl
# Credentials
-shipment.fedex.access.accountNbr=
-shipment.fedex.access.meterNumber=
-shipment.fedex.access.userCredential.key=
-shipment.fedex.access.userCredential.password=
+# AMI test key FwWX3ONaajR1z4pz
+shipment.fedex.access.accountNbr=510087380
+shipment.fedex.access.meterNumber=118518275
+shipment.fedex.access.userCredential.key=rlhowell77
+shipment.fedex.access.userCredential.password=fedex123
# Connection details
# https://gatewaybeta.fedex.com/GatewayDC - Test URL
Modified: ofbiz/branches/jquery/framework/base/config/ofbiz-containers.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/framework/base/config/ofbiz-containers.xml?rev=986638&r1=986637&r2=986638&view=diff
==============================================================================
--- ofbiz/branches/jquery/framework/base/config/ofbiz-containers.xml (original)
+++ ofbiz/branches/jquery/framework/base/config/ofbiz-containers.xml Wed Aug 18 12:03:45 2010
@@ -38,14 +38,14 @@ under the License.
<!-- load the naming (JNDI) server -->
<container name="naming-container" class="org.ofbiz.base.container.NamingServiceContainer">
<property name="host" value="0.0.0.0"/>
- <property name="port" value="1099"/>
+ <property name="port" value="31099"/>
</container>
<!-- RMI Service Dispatcher -->
<container name="rmi-dispatcher" class="org.ofbiz.service.rmi.RmiServiceContainer">
<property name="bound-name" value="RMIDispatcher"/>
<property name="bound-host" value="127.0.0.1"/>
- <property name="bound-port" value="1099"/>
+ <property name="bound-port" value="31099"/>
<property name="delegator-name" value="default"/>
<property name="client-factory" value="org.ofbiz.service.rmi.socket.ssl.SSLClientSocketFactory"/>
<property name="server-factory" value="org.ofbiz.service.rmi.socket.ssl.SSLServerSocketFactory"/>
@@ -196,7 +196,7 @@ under the License.
<property name="maxThreads" value="100"/>
<property name="minSpareThreads" value="4"/>
<property name="noCompressionUserAgents" value=""/>
- <property name="port" value="8080"/>
+ <property name="port" value="38080"/>
<property name="restrictedUserAgents" value=""/>
<property name="server" value=""/>
<property name="socketBuffer" value="9000"/>
@@ -234,7 +234,7 @@ under the License.
<property name="maxThreads" value="100"/>
<property name="minSpareThreads" value="4"/>
<property name="noCompressionUserAgents" value=""/>
- <property name="port" value="8443"/>
+ <property name="port" value="38443"/>
<property name="restrictedUserAgents" value=""/>
<property name="server" value=""/>
<property name="socketBuffer" value="9000"/>
@@ -267,7 +267,7 @@ under the License.
<!-- load BeanShell remote telnet server -->
<container name="beanshell-container" class="org.ofbiz.base.container.BeanShellContainer">
<!-- the port below and port-1 will be opened by beanshell -->
- <property name="telnet-port" value="9990"/>
+ <property name="telnet-port" value="39990"/>
<property name="app-name" value="OFBiz"/>
</container>
</ofbiz-containers>
Modified: ofbiz/branches/jquery/framework/common/widget/LookupScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/framework/common/widget/LookupScreens.xml?rev=986638&r1=986637&r2=986638&view=diff
==============================================================================
--- ofbiz/branches/jquery/framework/common/widget/LookupScreens.xml (original)
+++ ofbiz/branches/jquery/framework/common/widget/LookupScreens.xml Wed Aug 18 12:03:45 2010
@@ -51,6 +51,7 @@ under the License.
<section>
<actions>
<set field="title" value="${uiLabelMap.CommonChooseLanguage}"/>
+ <set field="parameters.presentation" value="window"/>
</actions>
<widgets>
<decorator-screen name="LookupDecorator" location="component://common/widget/CommonScreens.xml">
@@ -71,6 +72,7 @@ under the License.
<section>
<actions>
<set field="title" value="${uiLabelMap.CommonTime}"/>
+ <set field="parameters.presentation" value="window"/>
</actions>
<widgets>
<decorator-screen name="LookupDecorator" location="component://common/widget/CommonScreens.xml">
@@ -91,6 +93,7 @@ under the License.
<section>
<actions>
<set field="title" value="${uiLabelMap.CommonVisualThemes}"/>
+ <set field="parameters.presentation" value="window"/>
<entity-one entity-name="WebSite" value-field="webSite"/>
<entity-condition entity-name="VisualTheme" list="visualThemes">
<condition-expr field-name="visualThemeSetId" from-field="webSite.visualThemeSetId"/>
Modified: ofbiz/branches/jquery/framework/images/webapp/images/fieldlookup.js
URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/framework/images/webapp/images/fieldlookup.js?rev=986638&r1=986637&r2=986638&view=diff
==============================================================================
--- ofbiz/branches/jquery/framework/images/webapp/images/fieldlookup.js (original)
+++ ofbiz/branches/jquery/framework/images/webapp/images/fieldlookup.js Wed Aug 18 12:03:45 2010
@@ -25,10 +25,7 @@ var NS6 = (document.getElementById && na
var mx, my;
var ACTIVATED_LOOKUP = null;
var LOOKUP_DIV = null;
-INITIALLY_COLLAPSED = null;
-
-// not cool but necassary until someone have anthoer idea
-var timeout = 800;
+var INITIALLY_COLLAPSED = null;
function moveobj(evt) {
if (NS4 || NS6) {
@@ -184,7 +181,6 @@ function initiallyCollapseDelayed() {
function ConstructLookup(requestUrl, inputFieldId, dialogTarget, dialogOptionalTarget, formName, width, height, position, modal, ajaxUrl, showDescription) {
// create Link Element with unique Key
var lookupId = GLOBAL_LOOKUP_REF.createNextKey();
-
var inputBox = document.getElementById(inputFieldId);
newInputBoxId = lookupId + "_" + inputFieldId;
inputBox.id = newInputBoxId;
@@ -199,7 +195,7 @@ function ConstructLookup(requestUrl, inp
var hiddenDiv = document.createElement("DIV");
hiddenDiv.id = lookupId;
hiddenDiv.css = "{display: none;}";
- hiddenDiv.title = "My Dialog " + lookupId + " --> Target: " + requestUrl;
+ hiddenDiv.title = "___________________________________________________________________________________________";
parent.appendChild(hiddenDiv);
@@ -208,7 +204,6 @@ function ConstructLookup(requestUrl, inp
//write the new input box id in the ajaxUrl Array
ajaxUrl = ajaxUrl.replace(ajaxUrl.substring(0, ajaxUrl.indexOf(",")), newInputBoxId)
new ajaxAutoCompleter(ajaxUrl, showDescription);
-
}
// Lookup Configuration
@@ -221,11 +216,14 @@ function ConstructLookup(requestUrl, inp
draggable: true,
resizeable: true,
open: function() {
- jQuery("#" + lookupId).load(requestUrl);
+ jQuery("#" + lookupId).load(requestUrl, function(data){
+ modifySubmitButton(lookupId);
+ identifyLookup(lookupId);
+ });
},
close: function() {
//when the window is closed the prev Lookup get the focus (if exists)
- var prevLookup = GLOBAL_LOOKUP_REF.getReference(ACTIVATED_LOOKUP).prevLookup;
+ var prevLookup = GLOBAL_LOOKUP_REF.getReference(lookupId).prevLookup;
if (prevLookup != null) {
identifyLookup(prevLookup);
}
@@ -245,7 +243,7 @@ function ConstructLookup(requestUrl, inp
if (dialogOptionalTarget != null) {
this.target2 = null;
}
- ((GLOBAL_LOOKUP_REF.countFields() - 1) >=0) ? this.prevLookup = (GLOBAL_LOOKUP_REF.countFields() - 1) + "_lookupId" : null;
+ ((GLOBAL_LOOKUP_REF.countFields() - 1) >= 0) ? this.prevLookup = (GLOBAL_LOOKUP_REF.countFields() - 1) + "_lookupId" : null;
this.dialogRef = dialogRef;
//write external settings in global window manager
GLOBAL_LOOKUP_REF.setReference(lookupId, this);
@@ -260,13 +258,13 @@ function ConstructLookup(requestUrl, inp
//the target2 have to be set here, because the input field is not created before
GLOBAL_LOOKUP_REF.getReference(lookupId).target2 = jQuery(dialogOptionalTarget);
}
- // thats a quite bad hack to modifay the buttons
- identifyLookup(lookupId);
- window.setTimeout("modifySubmitButton('" + lookupId +"')", timeout);
return false;
}
);
+ // close the dialog when clicking outside the dialog area
+ jQuery(".ui-widget-overlay").live("click", function() { jQuery("#" + lookupId).dialog("close"); } );
+
}
function FieldLookupCounter() {
@@ -291,25 +289,23 @@ function FieldLookupCounter() {
return this.refArr[key] != null ? this.refArr[key] : null;
};
+ this.getLastReference = function () {
+ return (this.countFields() -1) + "_lookupId";
+ }
+
this.createNextKey = function () {
- return this.countFields() + "_lookupId";
+ return this.countFields() + "_lookupId";
};
this.countFields = function () {
var count = 0;
jQuery.each(this.refArr, function (itm) {count++;});
-
return count;
};
this.removeReference = function (key) {
// deletes the Array entry (doesn't effect the array length)
delete this.refArr[key];
-
- // if all lookups closed, kill the referenze
- if (this.countFields() == 0) {
- ACTIVATED_LOOKUP = null;
- }
};
};
@@ -334,11 +330,6 @@ function identifyLookup (newAl) {
}
}
-function hideLookup() {
- obj = GLOBAL_LOOKUP_REF.getReference(ACTIVATED_LOOKUP);
- obj.closeLookup();
- }
-
//global expand/col button var
var COLLAPSE = 1999;
function getNextCollapseSeq() {
@@ -394,25 +385,6 @@ function modifySubmitButton (lookupDiv)
//set new links for lookups
var newLookups = jQuery("#" + lookupDiv + " .field-lookup");
- /* TODO Problem bei Rekursiven Kalender Aufrufen, da ID des Input feldes immer die gleiche.
- * evtl alle input felder mit DatePicker löschen und neu anlegen?!
- jQuery.each(newLookups, function(newLookup){
-
- var link = jQuery(newLookups[newLookup]).find("a:first");
- alert(link.attr("href"));
- var replaced = new RegExp('document.' + oldFormName, 'g');
- newLookup.getElementsByTagName('a')[0].href = link.replace(replaced, 'document.'+'form_' + GLOBAL_LOOKUP_REF.getReference(ACTIVATED_LOOKUP).lookupId);
- });
-
- //set new calendar links
- var newLookups = jQuery("#" + lookupDiv + " .view-calendar");
- jQuery.each(newLookups, function(newLookup){
- link = $A(newLookup.getElementsByTagName('a'));
- link.each(function(cal){
- cal.href = cal.href.replace('document.' + oldFormName, 'document.'+'form_' + GLOBAL_LOOKUP_REF.getReference(ACTIVATED_LOOKUP).lookupId);
- });
- });*/
-
var formAction = lookupForm.attr("action");
// remove the form action
lookupForm.attr("action", "");
@@ -425,7 +397,7 @@ function modifySubmitButton (lookupDiv)
id: "lookupSubmitButton",
href: "javascript:void(0);",
click: function () {
- lookupFormAjaxRequest(formAction, lookupForm.attr("id"));
+ lookupFormAjaxRequest(formAction, lookupForm.attr("id"));
return false;
},
text: txt
@@ -512,8 +484,6 @@ function modifySubmitButton (lookupDiv)
}
catch (ex) {
}
-
-
});
// modify links in result table ...
var resultTable= jQuery("#" + lookupDiv + " #search-results table:first tbody");
@@ -546,10 +516,14 @@ function modifySubmitButton (lookupDiv)
function lookupAjaxRequest(request) {
// get request arguments
var arg = request.substring(request.indexOf('?')+1,(request.length));
-
lookupId = GLOBAL_LOOKUP_REF.getReference(ACTIVATED_LOOKUP).lookupId;
- $("#" + lookupId).load(request, arg);
- window.setTimeout("modifySubmitButton('" + lookupId +"')", timeout);
+ $("#" + lookupId).load(request, arg, function(data) {
+ if (data.search(/loginform/) != -1) {
+ window.location.href = window.location.href;
+ return;
+ }
+ modifySubmitButton(lookupId);
+ });
}
/**
@@ -560,8 +534,13 @@ function lookupAjaxRequest(request) {
*/
function lookupFormAjaxRequest(formAction, form) {
lookupId = GLOBAL_LOOKUP_REF.getReference(ACTIVATED_LOOKUP).lookupId;
- $("#" + lookupId).load(formAction, $("#" + form).serialize());
- window.setTimeout("modifySubmitButton('" + lookupId +"')", timeout);
+ jQuery("#" + lookupId).load(formAction, jQuery("#" + form).serialize(), function(data) {
+ if (data.search(/loginform/) != -1) {
+ window.location.href = window.location.href;
+ return;
+ }
+ modifySubmitButton(lookupId);
+ });
}
function lookupPaginationAjaxRequest(navAction, form, type) {
@@ -574,9 +553,13 @@ function lookupPaginationAjaxRequest(nav
navAction = navAction + "&presentation=layer";
lookupId = GLOBAL_LOOKUP_REF.getReference(ACTIVATED_LOOKUP).lookupId;
- $("#" + lookupId).load(navAction);
- window.setTimeout("modifySubmitButton('" + lookupId +"')", timeout);
-
+ jQuery("#" + lookupId).load(navAction, function(data) {
+ if (data.search(/loginform/) != -1) {
+ window.location.href = window.location.href;
+ return;
+ }
+ modifySubmitButton(lookupId);
+ });
}
/*******************************************************************************************************
Modified: ofbiz/branches/jquery/framework/webapp/config/url.properties
URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/framework/webapp/config/url.properties?rev=986638&r1=986637&r2=986638&view=diff
==============================================================================
--- ofbiz/branches/jquery/framework/webapp/config/url.properties (original)
+++ ofbiz/branches/jquery/framework/webapp/config/url.properties Wed Aug 18 12:03:45 2010
@@ -22,11 +22,11 @@
# HTTPS Port (Secure port)
port.https.enabled=Y
-port.https=8443
+port.https=38443
force.https.host=
# HTTP Port (Not Secure port)
-port.http=8080
+port.http=38080
force.http.host=
# Static Content URLs to make it easy to move the serving load for static content to other machines
Modified: ofbiz/branches/jquery/framework/widget/templates/htmlFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=986638&r1=986637&r2=986638&view=diff
==============================================================================
--- ofbiz/branches/jquery/framework/widget/templates/htmlFormMacroLibrary.ftl (original)
+++ ofbiz/branches/jquery/framework/widget/templates/htmlFormMacroLibrary.ftl Wed Aug 18 12:03:45 2010
@@ -92,9 +92,9 @@ under the License.
<#if dateType!="time" >
<script type="text/javascript">
<#if shortDateInput?exists && shortDateInput>
- $("#${id}").datepicker({
+ jQuery("#${id}").datepicker({
<#else>
- $("#${id}").datetimepicker({
+ jQuery("#${id}").datetimepicker({
showSecond: true,
timeFormat: 'hh:mm:ss',
stepHour: 1,
@@ -360,9 +360,9 @@ ${item.description}</span>
<#if dateType != "time">
<script type="text/javascript">
<#if dateType == "date">
- $("#${name?html}_fld0_value").datepicker({
+ jQuery("#${name?html}_fld0_value").datepicker({
<#else>
- $("#${name?html}_fld0_value").datetimepicker({
+ jQuery("#${name?html}_fld0_value").datetimepicker({
showSecond: true,
timeFormat: 'hh:mm:ss',
stepHour: 1,
@@ -395,9 +395,9 @@ ${item.description}</span>
<#if dateType != "time">
<script type="text/javascript">
<#if dateType == "date">
- $("#${name?html}_fld1_value").datepicker({
+ jQuery("#${name?html}_fld1_value").datepicker({
<#else>
- $("#${name?html}_fld1_value").datetimepicker({
+ jQuery("#${name?html}_fld1_value").datetimepicker({
showSecond: true,
timeFormat: 'hh:mm:ss',
stepHour: 1,
@@ -476,7 +476,9 @@ ${item.description}</span>
);"></a><#rt>
<#else>
<script type="text/javascript">
- new ConstructLookup("${fieldFormName}", "${id}", document.${formName?html}.${name?html}, <#if descriptionFieldName?has_content>document.${formName?html}.${descriptionFieldName}<#else>null</#if>, "${formName?html}", "${width}", "${height}", "${position}", "${fadeBackground}", <#if ajaxEnabled?has_content && ajaxEnabled>"${ajaxUrl}", "${showDescription}"<#else>"", ""</#if>);
+ jQuery(document).ready(function(){
+ new ConstructLookup("${fieldFormName}", "${id}", document.${formName?html}.${name?html}, <#if descriptionFieldName?has_content>document.${formName?html}.${descriptionFieldName}<#else>null</#if>, "${formName?html}", "${width}", "${height}", "${position}", "${fadeBackground}", <#if ajaxEnabled?has_content && ajaxEnabled>"${ajaxUrl}", "${showDescription}"<#else>"", ""</#if>);
+ });
</script>
</#if>
<#if disabled?has_content && disabled><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>