|
Propchange: ofbiz/trunk/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Dec 10 20:40:08 2010 @@ -1,2 +1,4 @@ /ofbiz/branches/addbirt:831210-885099,885686-886087 +/ofbiz/branches/dojo1.4:951708-952957 +/ofbiz/branches/jquery:952958-1044489 /ofbiz/branches/multitenant20100310:921280-927264 Modified: ofbiz/trunk/LICENSE URL: http://svn.apache.org/viewvc/ofbiz/trunk/LICENSE?rev=1044503&r1=1044502&r2=1044503&view=diff ============================================================================== --- ofbiz/trunk/LICENSE (original) +++ ofbiz/trunk/LICENSE Fri Dec 10 20:40:08 2010 @@ -495,9 +495,6 @@ ofbiz/trunk/framework/base/lib/scripting ofbiz/trunk/framework/base/lib/scripting/asm-tree-3.2.jar ofbiz/trunk/framework/base/lib/scripting/asm-util-3.2.jar ofbiz/trunk/framework/base/lib/scripting/janino-2.5.15.jar -ofbiz/trunk/framework/images/webapp/images/jsgantt.css -ofbiz/trunk/framework/images/webapp/images/jsgantt.js -ofbiz/trunk/framework/images/webapp/images/dojo/* ofbiz/trunk/specialpurpose/ldap/lib/cas-server-core-3.3.jar ofbiz/trunk/specialpurpose/pos/lib/looks-2.0.2.jar @@ -1260,8 +1257,7 @@ ofbiz/trunk/framework/entity/lib/ofbiz-m ofbiz/trunk/framework/jetty/lib/jcl104-over-slf4j-1.3.1.jar ofbiz/trunk/framework/jetty/lib/slf4j-api-1.3.1.jar ofbiz/trunk/framework/jetty/lib/slf4j-log4j12-1.3.1.jar -ofbiz/trunk/framework/images/webapp/images/htmledit/whizzywig_v55i.js -ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js +ofbiz/trunk/framework/images/webapp/images/jquery/* ========================================================================= The MIT License @@ -2670,66 +2666,6 @@ after the cause of action arose. Each pa any resulting litigation. ========================================================================= -Apache Ofbiz includes prototype.js from http://www.prototypejs.org licensed under -the terms of the MIT License -ofbiz/trunk/framework/images/webapp/images/prototype/prototype.js -========================================================================= -Apache Ofbiz includes Scriptalous javascript lib from http://script.aculo.us -licensed under the terms of the MIT License -ofbiz/trunk/framework/images/webapp/images/prototype/controls.js -ofbiz/trunk/framework/images/webapp/images/prototype/dragdrop.js -ofbiz/trunk/framework/images/webapp/images/prototype/effects.js -ofbiz/trunk/framework/images/webapp/images/prototype/scriptaculous.js -ofbiz/trunk/framework/images/webapp/images/prototype/slider.js -ofbiz/trunk/framework/images/webapp/images/prototype/sound.js -ofbiz/trunk/framework/images/webapp/images/prototype/unittest.js -ofbiz/trunk/framework/images/webapp/images/prototype/builder.js -========================================================================= -Apache Ofbiz includes flotr javascript lib from http://code.google.com/p/flotr/ -licensed under the terms of the MIT License -ofbiz/trunk/framework/images/webapp/images/flotr/lib/excanvas.js -ofbiz/trunk/framework/images/webapp/images/flotr/lib/base64.js -ofbiz/trunk/framework/images/webapp/images/flotr/lib/canvas2image.js -ofbiz/trunk/framework/images/webapp/images/flotr/lib/canvastext.js -ofbiz/trunk/framework/images/webapp/images/flotr/flotr.debug-0.2.0-alpha.js -ofbiz/trunk/framework/images/webapp/images/flotr/flotr-0.2.0-alpha.js -========================================================================= -Apache Ofbiz includes LivePipe Control Suite from http://livepipe.net/projects/control_suite/ -licensed under the terms of the MIT License -ofbiz/trunk/framework/images/webapp/images/prototype/control.progress_bar.js -ofbiz/trunk/framework/images/webapp/images/prototype/progress_bar.css -========================================================================= -Apache Ofbiz includes validation.js file from -http://www.tetlaw.id.au/view/javascript/really-easy-field-validation. -ofbiz/trunk/framework/images/webapp/images/prototype/validation.js -validation.js is Licensed as follows -========================================================================= - Really easy field validation with Prototype - http://tetlaw.id.au/view/javascript/really-easy-field-validation - Andrew Tetlaw - Version 1.5.4.1 (2007-01-05) - - Copyright (c) 2007 Andrew Tetlaw - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation - files (the "Software"), to deal in the Software without - restriction, including without limitation the rights to use, copy, - modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -========================================================================= Apache Ofbiz includes docbook templates in the /applications/content/template/docbook directory with the following licence: Copyright Modified: ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl?rev=1044503&r1=1044502&r2=1044503&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl Fri Dec 10 20:40:08 2010 @@ -47,33 +47,35 @@ function getFinAccountTransRunningTotalA } } if (isAllSelected) { - $('checkAllTransactions').checked = true; + jQuery('#checkAllTransactions').attr('checked', true); } else { - $('checkAllTransactions').checked = false; + jQuery('#checkAllTransactions').attr('checked', false); } if (!isSingle) { - $('submitButton').disabled = false; - if ($('showFinAccountTransRunningTotal')) { - new Ajax.Request('getFinAccountTransRunningTotalAndBalances', { - asynchronous: false, - onSuccess: function(transport) { - var data = transport.responseText.evalJSON(true); - $('showFinAccountTransRunningTotal').update(data.finAccountTransRunningTotal); - $('finAccountTransRunningTotal').update(data.finAccountTransRunningTotal); - $('numberOfFinAccountTransaction').update(data.numberOfTransactions); - $('endingBalance').update(data.endingBalance); - }, parameters: $('listFinAccTra').serialize(), requestHeaders: {Accept: 'application/json'} + jQuery('#submitButton').attr('disabled', ''); + if (jQuery('#showFinAccountTransRunningTotal').length) { + jQuery.ajax({ + url: 'getFinAccountTransRunningTotalAndBalances', + async: false, + type: 'POST', + data: jQuery('#listFinAccTra').serialize(), + success: function(data) { + jQuery('#showFinAccountTransRunningTotal').html(data.finAccountTransRunningTotal); + jQuery('#finAccountTransRunningTotal').html(data.finAccountTransRunningTotal); + jQuery('#numberOfFinAccountTransaction').html(data.numberOfTransactions); + jQuery('#endingBalance').html(data.endingBalance); + } }); } } else { - if ($('showFinAccountTransRunningTotal')) { - $('showFinAccountTransRunningTotal').update(""); - $('finAccountTransRunningTotal').update(""); - $('numberOfFinAccountTransaction').update(""); - $('endingBalance').update($('endingBalanceInput').value); - + if (jQuery('#showFinAccountTransRunningTotal').length) { + jQuery('#showFinAccountTransRunningTotal').html(""); + jQuery('#finAccountTransRunningTotal').html(""); + jQuery('#numberOfFinAccountTransaction').html(""); + jQuery('#endingBalance').html(jQuery('#endingBalanceInput').val()); + } - $('submitButton').disabled = true; + jQuery('#submitButton').attr('disabled', ''); } } --> @@ -178,10 +180,7 @@ function getFinAccountTransRunningTotalA <td> <#if payments?has_content> <a id="togglePayment_${finAccountTrans.finAccountTransId}" href="javascript:void(0)"><img src="<@ofbizContentUrl>/images/expand.gif</@ofbizContentUrl>" alt=""/></a> ${finAccountTrans.finAccountTransId} - <div id="displayPayments_${finAccountTrans.finAccountTransId}" class="popup" style="display: none;width: 650px;"> - <div align="right"> - <input class="popup_closebox buttontext" type="button" value="X"/> - </div> + <div id="displayPayments_${finAccountTrans.finAccountTransId}" style="display: none;width: 650px;"> <table class="basic-table hover-bar" cellspacing="0" style"width :"> <tr class="header-row-2"> <th>${uiLabelMap.AccountingDepositSlipId}</th> @@ -222,7 +221,16 @@ function getFinAccountTransRunningTotalA </table> </div> <script type="text/javascript"> - new Popup('displayPayments_${finAccountTrans.finAccountTransId}','togglePayment_${finAccountTrans.finAccountTransId}', {modal: true, position: 'center', trigger: 'click'}) + jQuery(document).ready( function() { + jQuery("#displayPayments_${finAccountTrans.finAccountTransId}").dialog({autoOpen: false, modal: true, + buttons: { + '${uiLabelMap.CommonClose}': function() { + jQuery(this).dialog('close'); + } + } + }); + jQuery("#togglePayment_${finAccountTrans.finAccountTransId}").click(function(){jQuery("#displayPayments_${finAccountTrans.finAccountTransId}").dialog("open")}); + }); </script> <a href="<@ofbizUrl>DepositSlip.pdf?finAccountTransId=${finAccountTrans.finAccountTransId}</@ofbizUrl>" class="buttontext">${uiLabelMap.AccountingDepositSlip}</a> <#else> Modified: ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/GlReconciledFinAccountTrans.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/GlReconciledFinAccountTrans.ftl?rev=1044503&r1=1044502&r2=1044503&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/GlReconciledFinAccountTrans.ftl (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/GlReconciledFinAccountTrans.ftl Fri Dec 10 20:40:08 2010 @@ -197,7 +197,16 @@ under the License. <a id="toggleGlTransactions_${finAccountTrans.finAccountTransId}" href="javascript:void(0)" class="buttontext">${uiLabelMap.FormFieldTitle_glTransactions}</a> <#include "ShowGlTransactions.ftl"/> <script type="text/javascript"> - new Popup('displayGlTransactions_${finAccountTrans.finAccountTransId}','toggleGlTransactions_${finAccountTrans.finAccountTransId}', {modal: true, position: 'none', trigger: 'click', cursor_margin:0}) + jQuery(document).ready( function() { + jQuery("#displayGlTransactions_${finAccountTrans.finAccountTransId}").dialog({autoOpen: false, modal: true, + buttons: { + '${uiLabelMap.CommonClose}': function() { + jQuery(this).dialog('close'); + } + } + }); + jQuery("#toggleGlTransactions_${finAccountTrans.finAccountTransId}").click(function(){jQuery("#displayGlTransactions_${finAccountTrans.finAccountTransId}").dialog("open")}); + }); </script> </td> </#if> Modified: ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/ShowGlTransactions.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/ShowGlTransactions.ftl?rev=1044503&r1=1044502&r2=1044503&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/ShowGlTransactions.ftl (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/ShowGlTransactions.ftl Fri Dec 10 20:40:08 2010 @@ -17,10 +17,7 @@ specific language governing permissions under the License. --> -<div id="displayGlTransactions_${finAccountTrans.finAccountTransId}" class="popup" style="display: none;width: 1150px;"> - <div align="right"> - <input class="popup_closebox buttontext" type="button" value="X"/> - </div> +<div id="displayGlTransactions_${finAccountTrans.finAccountTransId}" style="display: none;width: 1150px;"> <#assign acctgTransAndEntries = dispatcher.runSync("getAssociatedAcctgTransEntriesWithFinAccountTrans", Static["org.ofbiz.base.util.UtilMisc"].toMap("finAccountTransId", finAccountTrans.finAccountTransId, "userLogin", userLogin))/> <#assign acctgTransAndEntries = acctgTransAndEntries.acctgTransAndEntries> <table class="basic-table hover-bar" cellspacing="0" style"width :"> Modified: ofbiz/trunk/applications/accounting/webapp/accounting/images/costCenters.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/images/costCenters.js?rev=1044503&r1=1044502&r2=1044503&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/images/costCenters.js (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/images/costCenters.js Fri Dec 10 20:40:08 2010 @@ -17,40 +17,41 @@ * under the License. */ -document.observe('dom:loaded', function() { - Event.observe($('costCentersSubmit'), 'click', processCostCenterData); +jQuery(document).ready( function() { + jQuery('#costCentersSubmit').click(processCostCenterData); // Find all text boxes in form and add a method to list on for on change. - var categoryShareInputs = $('costCenters').getInputs('text'); - categoryShareInputs.each(function (element) { - Event.observe(element, 'change', function(){ - var textIdSplit = element.id.split('|'); + var categoryShareInputs = jQuery('#costCenters [type=text]'); + + jQuery.each(categoryShareInputs, function (element) { + jQuery(this).change( function() { + var textIdSplit = jQuery(this).attr('id').split('|'); var tableRowId = 'row_' + textIdSplit[0]; - var tableRow = $(tableRowId); + var tableRow = jQuery("#" + tableRowId); // get all text inputs - var rowInputs = $(tableRowId).select('input[type="text"]'); + var rowInputs = jQuery("#" + tableRowId + " [type=text]"); var totalPercentage = 0; - rowInputs.each(function (inputElement) { - var inputElementIdSplit = inputElement.id.split("|"); - if (inputElement.value) { - totalPercentage = totalPercentage + parseFloat(inputElement.value) + jQuery.each( rowInputs, function (inputElement) { + var inputElementIdSplit = jQuery(this).attr('id').split("|"); + if (jquery(this).val()) { + totalPercentage = totalPercentage + parseFloat(jquery(this).val()) } }); if (totalPercentage == 100 || totalPercentage == 0 ) { - if ( $(tableRowId).hasClassName('alternate-rowWarn')){ - $(tableRowId).removeClassName('alternate-rowWarn'); + if ( jQuery("#" + tableRowId).hasClass('alternate-rowWarn')){ + jQuery("#" +tableRowId).removeClass('alternate-rowWarn'); } - if ($$('tr.alternate-rowWarn').size() == 0) { - $('costCentersSubmit').removeClassName('buttontextdisabled') - $('costCentersSubmit').disabled = false; + if (jQuery('tr.alternate-rowWarn').length == 0) { + jQuery("#" + 'costCentersSubmit').removeClass('buttontextdisabled') + jQuery("#" + 'costCentersSubmit').attr("disabled", false); } } else { - if ( !$(tableRowId).hasClassName('alternate-rowWarn')){ - $(tableRowId).addClassName('alternate-rowWarn'); + if ( !jQuery("#" + tableRowId).hasClass('alternate-rowWarn')){ + jQuery("#" + tableRowId).addClass('alternate-rowWarn'); } - if (!$('costCentersSubmit').hasClassName('buttontextdisabled')) { - $('costCentersSubmit').addClassName('buttontextdisabled') - $('costCentersSubmit').disabled = true; + if (!jQuery("#" + 'costCentersSubmit').hasClass('buttontextdisabled')) { + jQuery("#" + 'costCentersSubmit').addClass('buttontextdisabled') + jQuery("#" + 'costCentersSubmit').attr("disabled", true);; } } }); @@ -58,16 +59,19 @@ document.observe('dom:loaded', function( }); function processCostCenterData() { - new Ajax.Request($('costCenters').action, { - asynchronous: false, - onSuccess: function(transport) { - if (transport.responseText == "") { - Effect.Appear('errorMessage', {duration: 0.0}); - Effect.Fade('errorMessage', {duration: 0.0, delay: 3.0}); + jQuery.ajax({ + url: jQuery("#costCenters").attr('action'), + data: jQuery("#costCenters").serialize(), + async: false, + type: 'POST', + success: function(data){ + if (data == "") { + jQuery("#errorMessage").show(); + jQuery("#errorMessage").fadeOut('slow'); } else { - Effect.Appear('eventMessage', {duration: 0.0}); - Effect.Fade('eventMessage', {duration: 0.0, delay: 3.0}); + jQuery("#eventMessage").show(); + jQuery("#eventMessage").fadeOut('slow'); } - }, parameters: $('costCenters').serialize(), requestHeaders: {Accept: 'application/json'} + } }); -} +}; Modified: ofbiz/trunk/applications/accounting/webapp/accounting/payment/depositWithdrawPayments.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/payment/depositWithdrawPayments.ftl?rev=1044503&r1=1044502&r2=1044503&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/payment/depositWithdrawPayments.ftl (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/payment/depositWithdrawPayments.ftl Fri Dec 10 20:40:08 2010 @@ -46,22 +46,24 @@ function getPaymentRunningTotal() { } } if (isAllSelected) { - $('checkAllPayments').checked = true; + jQuery('#checkAllPayments').attr('checked', true); } else { - $('checkAllPayments').checked = false; + jQuery('#checkAllPayments').attr('checked', false); } if (!isSingle) { - $('submitButton').disabled = false; - new Ajax.Request('getPaymentRunningTotal', { - asynchronous: false, - onSuccess: function(transport) { - var data = transport.responseText.evalJSON(true); - $('showPaymentRunningTotal').update(data.paymentRunningTotal); - }, parameters: $('depositWithdrawPaymentsForm').serialize(), requestHeaders: {Accept: 'application/json'} + jQuery('#submitButton').attr('disabled', ''); + jQuery.ajax({ + url: 'getPaymentRunningTotal', + async: false, + type: 'POST', + data: jQuery('#depositWithdrawPaymentsForm').serialize(), + success: function(data) { + jQuery('#showPaymentRunningTotal').html(data.paymentRunningTotal); + } }); } else { - $('showPaymentRunningTotal').update(""); - $('submitButton').disabled = true; + jQuery('#showPaymentRunningTotal').html(""); + jQuery('#submitButton').attr('disabled', ''); } } // --> Modified: ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionRun.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionRun.ftl?rev=1044503&r1=1044502&r2=1044503&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionRun.ftl (original) +++ ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionRun.ftl Fri Dec 10 20:40:08 2010 @@ -61,14 +61,14 @@ function enableSubmitButton() { } } if (isAllSelected) { - $('checkAllInvoices').checked = true; + jQuery('#checkAllInvoices').attr('checked', true); } else { - $('checkAllInvoices').checked = false; + jQuery('#checkAllInvoices').attr('checked', false); } - if (!isSingle && $('serviceName').value != "") - $('submitButton').disabled = false; + if (!isSingle && jQuery('#serviceName').val() != "") + jQuery('#submitButton').attr('disabled', ''); else - $('submitButton').disabled = true; + jQuery('#submitButton').attr('disabled', 'disabled'); } --> Modified: ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl?rev=1044503&r1=1044502&r2=1044503&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl (original) +++ ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl Fri Dec 10 20:40:08 2010 @@ -19,73 +19,106 @@ under the License. <script language="JavaScript" type="text/javascript"> <!-- function toggleInvoiceId(master) { - var invoices = $('listPurchaseInvoices').getInputs('checkbox','invoiceIds'); - invoices.each(function(invoice){ - invoice.checked = master.checked; + var invoices = jQuery("#listPurchaseInvoices :checkbox[name='invoiceIds']"); + + jQuery.each(invoices, function() { + // this a normal html object (not a jquery object) + this.checked = master.checked; }); getInvoiceRunningTotal(); } function getInvoiceRunningTotal() { - var invoices = $('listPurchaseInvoices').getInputs('checkbox','invoiceIds'); - if(invoices.pluck('checked').all()) { - $('checkAllInvoices').checked = true; + var invoices = jQuery("#listPurchaseInvoices: checkbox[name='invoiceIds']"); + + //test if all checkboxes are checked + var allChecked = true; + jQuery.each(invoices, function() { + if (!jQuery(this).is(':checked')) { + allChecked = false; + return false; + } + }); + + if(allChecked) { + jQuery('#checkAllInvoices').attr('checked', true); } else { - $('checkAllInvoices').checked = false; + jQuery('#checkAllInvoices').attr('checked', false); } - if(invoices.pluck('checked').any()) { - new Ajax.Request('getInvoiceRunningTotal', { - asynchronous: false, - onSuccess: function(transport) { - var data = transport.responseText.evalJSON(true); - $('showInvoiceRunningTotal').update(data.invoiceRunningTotal); - }, - parameters: $('listPurchaseInvoices').serialize(), - requestHeaders: {Accept: 'application/json'} + + // check if any checkbox is checked + var anyChecked = false; + jQuery.each(invoices, function() { + if (jQuery(this).is(':checked')) { + anyChecked = true; + return false; + } + }); + + if(anyChecked) { + jQuery.ajax({ + url: 'getInvoiceRunningTotal', + type: 'POST', + data: jQuery('#listPurchaseInvoices').serialize(), + async: false, + succes: function(data) { + jQuery('#showInvoiceRunningTotal').html(data.invoiceRunningTotal); + } }); - if($F('serviceName') != "") { - $('submitButton').disabled = false; + + if(jQuery('#serviceName').val() != "") { + jQuery('#submitButton').attr('disabled', ''); } - + } else { - $('submitButton').disabled = true; - $('showInvoiceRunningTotal').update(""); + jQuery('#submitButton').attr('disabled', 'disabled'); + jQuery('#showInvoiceRunningTotal').html(""); } } function setServiceName(selection) { if ( selection.value == 'massInvoicesToApprove' || selection.value == 'massInvoicesToReceive' || selection.value == 'massInvoicesToReady' || selection.value == 'massInvoicesToPaid' || selection.value == 'massInvoicesToWriteoff' || selection.value == 'massInvoicesToCancel') { - document.listPurchaseInvoices.action = $('invoiceStatusChange').value; + document.listPurchaseInvoices.action = jQuery('#invoiceStatusChange').value; } else { document.listPurchaseInvoices.action = selection.value; } if (selection.value == 'massInvoicesToApprove') { - $('statusId').value = "INVOICE_APPROVED"; + jQuery('#statusId').val("INVOICE_APPROVED"); } else if (selection.value == 'massInvoicesToReceive') { - $('statusId').value = "INVOICE_RECEIVED"; + jQuery('#statusId').val("INVOICE_RECEIVED"); }else if (selection.value == 'massInvoicesToReady') { - $('statusId').value = "INVOICE_READY"; + jQuery('#statusId').val("INVOICE_READY"); }else if (selection.value == 'massInvoicesToPaid') { - $('statusId').value = "INVOICE_PAID"; + jQuery('#statusId').val("INVOICE_PAID"); }else if (selection.value == 'massInvoicesToWriteoff') { - $('statusId').value = "INVOICE_WRITEOFF"; + jQuery('#statusId').val("INVOICE_WRITEOFF"); }else if (selection.value == 'massInvoicesToCancel') { - $('statusId').value = "INVOICE_CANCELLED"; + jQuery('#statusId').val("INVOICE_CANCELLED"); } - if ($('processMassCheckRun').selected) { - Effect.BlindDown('issueChecks'); + if (jQuery('#processMassCheckRun').is(':selected')) { + jQuery('#issueChecks').fadeOut('slow'); } else { - Effect.BlindUp('issueChecks'); - } - if($('listPurchaseInvoices').getInputs('checkbox','invoiceIds').pluck('checked').any() && ($F('serviceName') != "")) { - $('submitButton').disabled = false; + jQuery('#issueChecks').fadeIn('slow'); } + var invoices = jQuery("#listPurchaseInvoices :checkbox[name='invoiceIds']"); + // check if any checkbox is checked + var anyChecked = false; + jQuery.each(invoices, function() { + if (jQuery(this).is(':checked')) { + anyChecked = true; + return false; + } + }); + + if(anyChecked && (jQuery('#serviceName').val() != "")) { + jQuery('#submitButton').attr('disabled', ''); + } } function runAction() { - $('listPurchaseInvoices').submit(); + jQuery('#listPurchaseInvoices').submit(); } --> Modified: ofbiz/trunk/applications/accounting/webapp/ar/invoice/ListInvoices.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/ar/invoice/ListInvoices.ftl?rev=1044503&r1=1044502&r2=1044503&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/ar/invoice/ListInvoices.ftl (original) +++ ofbiz/trunk/applications/accounting/webapp/ar/invoice/ListInvoices.ftl Fri Dec 10 20:40:08 2010 @@ -20,61 +20,91 @@ under the License. //<![CDATA[ function toggleInvoiceId(master) { - var invoices = $('listInvoices').getInputs('checkbox','invoiceIds'); - invoices.each(function(invoice){ - invoice.checked = master.checked; + var invoices = jQuery("#listInvoices :checkbox[name='invoiceIds']"); + + jQuery.each(invoices, function() { + this.checked = master.checked; }); getInvoiceRunningTotal(); } function getInvoiceRunningTotal() { - var invoices = $('listInvoices').getInputs('checkbox','invoiceIds'); - if(invoices.pluck('checked').all()) { - $('checkAllInvoices').checked = true; + var invoices = jQuery("#listInvoices :checkbox[name='invoiceIds']"); + + //test if all checkboxes are checked + var allChecked = true; + jQuery.each(invoices, function() { + if (!jQuery(this).is(':checked')) { + allChecked = false; + return false; + } + }); + + if(allChecked) { + jQuery('#checkAllInvoices').attr('checked', true); } else { - $('checkAllInvoices').checked = false; + jQuery('#checkAllInvoices').attr('checked', false); } - if(invoices.pluck('checked').any()) { - new Ajax.Request('getInvoiceRunningTotal', { - asynchronous: false, - onSuccess: function(transport) { - var data = transport.responseText.evalJSON(true); - $('showInvoiceRunningTotal').update(data.invoiceRunningTotal); - }, - parameters: $('listInvoices').serialize(), - requestHeaders: {Accept: 'application/json'} + + // check if any checkbox is checked + var anyChecked = false; + jQuery.each(invoices, function() { + if (jQuery(this).is(':checked')) { + anyChecked = true; + return false; + } + }); + if(anyChecked) { + jQuery.ajax({ + url: 'getInvoiceRunningTotal', + type: 'POST', + async: true, + data: jQuery('#listInvoices').serialize(), + success: function(data) { jQuery('#showInvoiceRunningTotal').html(data.invoiceRunningTotal) } }); - if($F('serviceName') != "") { - $('submitButton').disabled = false; + + if(jQuery('#serviceName').val() != "") { + jQuery('#submitButton').attr('disabled', ''); } - + } else { - $('submitButton').disabled = true; - $('showInvoiceRunningTotal').update(""); + jQuery('#submitButton').attr('disabled', 'disabled'); + jQuery('#showInvoiceRunningTotal').html(""); } } function setServiceName(selection) { if ( selection.value == 'massInvoicesToApprove' || selection.value == 'massInvoicesToSent' || selection.value == 'massInvoicesToReady' || selection.value == 'massInvoicesToPaid' || selection.value == 'massInvoicesToWriteoff' || selection.value == 'massInvoicesToCancel') { - $('listInvoices').action = $('invoiceStatusChange').value; + jQuery('#listInvoices').attr('action', jQuery('#invoiceStatusChange').val()); } else { - $('listInvoices').action = selection.value; + jQuery('#listInvoices').attr('action', selection.value); } if (selection.value == 'massInvoicesToApprove') { - $('statusId').value = "INVOICE_APPROVED"; + jQuery('#statusId').val("INVOICE_APPROVED"); } else if (selection.value == 'massInvoicesToSent') { - $('statusId').value = "INVOICE_SENT"; + jQuery('#statusId').val("INVOICE_SENT"); } else if (selection.value == 'massInvoicesToReady') { - $('statusId').value = "INVOICE_READY"; + jQuery('#statusId').val("INVOICE_READY"); } else if (selection.value == 'massInvoicesToPaid') { - $('statusId').value = "INVOICE_PAID"; + jQuery('#statusId').val("INVOICE_PAID"); } else if (selection.value == 'massInvoicesToWriteoff') { - $('statusId').value = "INVOICE_WRITEOFF"; + jQuery('#statusId').val("INVOICE_WRITEOFF"); } else if (selection.value == 'massInvoicesToCancel') { - $('statusId').value = "INVOICE_CANCELLED"; + jQuery('#statusId').val("INVOICE_CANCELLED"); } - if($('listInvoices').getInputs('checkbox','invoiceIds').pluck('checked').any() && ($F('serviceName') != "")) { - $('submitButton').disabled = false; + + var invoices = jQuery("#listInvoices :checkbox[name='invoiceIds']"); + // check if any checkbox is checked + var anyChecked = false; + jQuery.each(invoices, function() { + if (jQuery(this).is(':checked')) { + anyChecked = true; + return false; + } + }); + + if(anyChecked && (jQuery('#serviceName').val() != "")) { + jQuery('#submitButton').attr('disabled' , ''); } } //]]> @@ -100,7 +130,7 @@ under the License. <option value="massInvoicesToWriteoff">${uiLabelMap.AccountingInvoiceStatusToWriteoff}</option> <option value="massInvoicesToCancel">${uiLabelMap.AccountingInvoiceStatusToCancelled}</option> </select> - <input id="submitButton" type="button" onclick="javascript:$('listInvoices').submit();" value="${uiLabelMap.CommonRun}" disabled="disabled" /> + <input id="submitButton" type="button" onclick="javascript:jQuery('#listInvoices').submit();" value="${uiLabelMap.CommonRun}" disabled="disabled" /> <input type="hidden" name="organizationPartyId" value="${defaultOrganizationPartyId}"/> <input type="hidden" name="partyIdFrom" value="${parameters.partyIdFrom?if_exists}"/> <input type="hidden" name="statusId" id="statusId" value="${parameters.statusId?if_exists}"/> Modified: ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl?rev=1044503&r1=1044502&r2=1044503&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl (original) +++ ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl Fri Dec 10 20:40:08 2010 @@ -20,66 +20,97 @@ under the License. <script type="text/javascript"> //<![CDATA[ function togglePaymentId(master) { - var payments = $('paymentBatchForm').getInputs('checkbox','paymentIds'); - payments.each(function(payment){ - payment.checked = master.checked; + var payments = jQuery("#paymentBatchForm :checkbox[name='paymentIds']"); + + jQuery.each(payments, function() { + this.checked = master.checked; }); getPaymentRunningTotal(); } function getPaymentRunningTotal() { - var payments = $('paymentBatchForm').getInputs('checkbox','paymentIds'); - if(payments.pluck('checked').all()) { - $('checkAllPayments').checked = true; + var payments = jQuery("#paymentBatchForm :checkbox[name='paymentIds']"); + + //test if all checkboxes are checked + var allChecked = true; + jQuery.each(payments, function() { + if (!jQuery(this).is(':checked')) { + allChecked = false; + return false; + } + }); + + if(allChecked) { + jQuery('#checkAllPayments').attr('checked', true); } else { - $('checkAllPayments').checked = false; + jQuery('#checkAllPayments').attr('checked', false); } - if(payments.pluck('checked').any()) { - new Ajax.Request('getPaymentRunningTotal', { - asynchronous: false, - onSuccess: function(transport) { - var data = transport.responseText.evalJSON(true); - $('showPaymentRunningTotal').update(data.paymentRunningTotal); - }, - parameters: $('paymentBatchForm').serialize(), - requestHeaders: {Accept: 'application/json'} + // check if any checkbox is checked + var anyChecked = false; + jQuery.each(payments, function() { + if (jQuery(this).is(':checked')) { + anyChecked = true; + return false; + } + }); + + if(anyChecked) { + jQuery({ + url: 'getPaymentRunningTotal', + async: true, + data: jQuery('#paymentBatchForm').serialize(), + success: function(data) { + jQuery('#showPaymentRunningTotal').html(data.paymentRunningTotal); + } }); - if($F('serviceName') != "") { - $('submitButton').disabled = false; + + if(jQuery('#serviceName').val() != "") { + jQuery('#submitButton').attr('disabled', ''); } - + } else { - $('submitButton').disabled = true; - $('showPaymentRunningTotal').update(""); + jQuery('#submitButton').attr('disabled', 'disabled'); + jQuery('#showPaymentRunningTotal').html(""); } } function setServiceName(selection) { if (selection.value == 'massPaymentsToNotPaid' || selection.value == 'massPaymentsToReceived' || selection.value == 'massPaymentsToConfirmed' || selection.value == 'massPaymentsToCancelled' || selection.value == 'massPaymentsToVoid') { - $('paymentBatchForm').action = $('paymentStatusChange').value; + jQuery('#paymentBatchForm').attr('action', jQuery('#paymentStatusChange').val()); } else { - $('paymentBatchForm').action = selection.value; + jQuery('#paymentBatchForm').attr('action', selection.value); } if (selection.value == 'massPaymentsToNotPaid') { - $('statusId').value = "PMNT_NOT_PAID"; + jQuery('#statusId').val("PMNT_NOT_PAID"); } else if (selection.value == 'massPaymentsToReceived') { - $('statusId').value = "PMNT_RECEIVED"; + jQuery('#statusId').val("PMNT_RECEIVED"); }else if (selection.value == 'massPaymentsToConfirmed') { - $('statusId').value = "PMNT_CONFIRMED"; + jQuery('#statusId').val("PMNT_CONFIRMED"); }else if (selection.value == 'massPaymentsToCancelled') { - $('statusId').value = "PMNT_CANCELLED"; + jQuery('#statusId').val("PMNT_CANCELLED"); }else if (selection.value == 'massPaymentsToVoid') { - $('statusId').value = "PMNT_VOID"; + jQuery('#statusId').val("PMNT_VOID"); } - if ($('processBatchPayment').selected) { - Effect.BlindDown('createPaymentBatch'); + if (jQuery('#processBatchPayment').is(':selected')) { + jQuery('#createPaymentBatch').fadeOut('slow'); } else { - Effect.BlindUp('createPaymentBatch'); + jQuery('#createPaymentBatch').fadeIn('slow'); } - if($('paymentBatchForm').getInputs('checkbox','paymentIds').pluck('checked').any() && ($F('serviceName') != "")) { - $('submitButton').disabled = false; + + var payments = jQuery("#paymentBatchForm :checkbox[name='paymentIds']"); + // check if any checkbox is checked + var anyChecked = false; + jQuery.each(payments, function() { + if (jQuery(this).is(':checked')) { + anyChecked = true; + return false; + } + }); + + if(anyChecked && (jQuery('#serviceName').val() != "")) { + jQuery('#submitButton').attr('disabled' , ''); } else { - $('submitButton').disabled = true; + jQuery('#submitButton').attr('disabled' , 'disabled'); } } @@ -105,7 +136,7 @@ function setServiceName(selection) { <option value="massPaymentsToCancelled">${uiLabelMap.AccountingPaymentTabStatusToCancelled}</option> <option value="massPaymentsToVoid">${uiLabelMap.AccountingPaymentTabStatusToVoid}</option> </select> - <input id="submitButton" type="button" onclick="javascript:$('paymentBatchForm').submit();" value="${uiLabelMap.CommonRun}" disabled="disabled" /> + <input id="submitButton" type="button" onclick="javascript:jQuery('#paymentBatchForm').submit();" value="${uiLabelMap.CommonRun}" disabled="disabled" /> <input type="hidden" name='organizationPartyId' value="${organizationPartyId?if_exists}" /> <input type="hidden" name='paymentGroupTypeId' value="BATCH_PAYMENT" /> <input type="hidden" name="groupInOneTransaction" value="Y" /> Modified: ofbiz/trunk/applications/accounting/widget/FinAccountScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/FinAccountScreens.xml?rev=1044503&r1=1044502&r2=1044503&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/FinAccountScreens.xml (original) +++ ofbiz/trunk/applications/accounting/widget/FinAccountScreens.xml Fri Dec 10 20:40:08 2010 @@ -418,8 +418,6 @@ under the License. <actions> <set field="titleProperty" value="PageTitleFindFinAccountTrans"/> <set field="tabButtonItem" value="FinAccountTrans"/> - <set field="layoutSettings.javaScripts[]" value="/images/prototypejs/popup.js" global="true"/> - <set field="layoutSettings.styleSheets[+0]" value="/images/prototypejs/popup.css" global="true"/> <service service-name="getFinAccountTransListAndTotals" result-map="finAccountTransListAndTotals" auto-field-map="true"/> <set field="finAccountTransList" type="List" from-field="finAccountTransListAndTotals.finAccountTransList"/> <set field="searchedNumberOfRecords" type="Integer" from-field="finAccountTransListAndTotals.searchedNumberOfRecords"/> @@ -472,8 +470,6 @@ under the License. <actions> <set field="titleProperty" value="AccountingBankReconciliation"/> <set field="tabButtonItem" value="FinAccountTrans"/> - <set field="layoutSettings.javaScripts[]" value="/images/prototypejs/popup.js" global="true"/> - <set field="layoutSettings.styleSheets[+0]" value="/images/prototypejs/popup.css" global="true"/> <set field="finAccountId" from-field="parameters.finAccountId"/> <entity-one entity-name="FinAccount" value-field="finAccount"/> </actions> @@ -619,8 +615,6 @@ under the License. <section> <actions> <set field="tabButtonItem" value="FindFinAccountReconciliations"/> - <set field="layoutSettings.javaScripts[]" value="/images/prototypejs/popup.js" global="true"/> - <set field="layoutSettings.styleSheets[+0]" value="/images/prototypejs/popup.css" global="true"/> <set field="titleProperty" value="AccountingEditFinAccountReconciliations"/> <set field="finAccountId" from-field="parameters.finAccountId"/> <set field="glReconciliationId" from-field="parameters.glReconciliationId"/> Modified: ofbiz/trunk/applications/accounting/widget/ap/InvoiceScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ap/InvoiceScreens.xml?rev=1044503&r1=1044502&r2=1044503&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/ap/InvoiceScreens.xml (original) +++ ofbiz/trunk/applications/accounting/widget/ap/InvoiceScreens.xml Fri Dec 10 20:40:08 2010 @@ -167,10 +167,20 @@ under the License. <set field="tabButtonItem" value="commissionRun"/> <set field="salesRepPartyList" type="List" from-field="parameters.partyIds"/> <script location="component://accounting/webapp/ap/WEB-INF/actions/invoices/CommissionRun.groovy"/> + + <!-- asmslect parameters, must be prefixed by asm_ for setMultipleSelectJs.ftl --> + <set field="asm_multipleSelectForm" value="CommissionRun"/> + <set field="asm_multipleSelect" value="CommissionRun_partyId"/> + <set field="asm_formSize" value="700"/> + <set field="asm_listItemPercentOfForm" value="95"/> + <set field="asm_sortable" value="false"/> + <property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/> + <set field="asm_title" value="${uiLabelMap.AccountingSelectPartiesForCommissionInvoice}"/> </actions> <widgets> <decorator-screen name="CommonInvoiceDecorator" location="${parameters.mainDecoratorLocation}"> - <decorator-section name="body"> + <decorator-section name="body"> + <platform-specific><html><html-template location="component://common/webcommon/includes/setMultipleSelectJs.ftl"/></html></platform-specific> <section> <widgets> <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml"> Modified: ofbiz/trunk/applications/content/webapp/content/content/ContentNav.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/content/ContentNav.ftl?rev=1044503&r1=1044502&r2=1044503&view=diff ============================================================================== --- ofbiz/trunk/applications/content/webapp/content/content/ContentNav.ftl (original) +++ ofbiz/trunk/applications/content/webapp/content/content/ContentNav.ftl Fri Dec 10 20:40:08 2010 @@ -16,250 +16,222 @@ specific language governing permissions and limitations under the License. --> +<script language="javascript" type="text/javascript" src="<@ofbizContentUrl>/images/jquery/plugins/jsTree/jquery.jstree.js</@ofbizContentUrl>"></script> -<script type="text/javascript"> +<script type="application/javascript"> +<#-- some labels are not unescaped in the JSON object so we have to do this manuely --> +function unescapeHtmlText(text) { + return jQuery('<div />').html(text).text() +} + +jQuery(document).ready(createTree()); - dojo.require("dojo.widget.*"); - dojo.require("dojo.event.*"); - dojo.require("dojo.io.*"); - - var treeSelected = false; - var editDocumentTreeUrl = '<@ofbizUrl>/views/EditDocumentTree</@ofbizUrl>'; - var listDocument = '<@ofbizUrl>/views/ListDocument</@ofbizUrl>'; - var editDocumentUrl = '<@ofbizUrl>/views/EditDocument</@ofbizUrl>'; - var deleteDocumentUrl = '<@ofbizUrl>removeDocumentFromTree</@ofbizUrl>'; -<#-------------------------------------------------------------------------------------Load function--> - dojo.addOnLoad(function() { - dojo.event.topic.subscribe("showDocument", - function(message) { - treeSelected = true; - var ctx = new Array(); - ctx['contentId'] = message.node.widgetId; - callDocument(ctx); - } - - ); - dojo.event.topic.subscribe("NewDocumentTree/engage", - function (menuItem) { - var node = menuItem.getTreeNode(); - callCreateDocumentTree(node.widgetId); - } - - ); - dojo.event.topic.subscribe("NewDocument/engage", - function (menuItem) { - var node = menuItem.getTreeNode(); - callCreateDocument(node.widgetId); - } - - ); - dojo.event.topic.subscribe("EditDocument/engage", - function (menuItem) { - var node = menuItem.getTreeNode(); - callEditDocument(node.widgetId); - } - ); - dojo.event.topic.subscribe("RenameDocumentTree/engage", - function (menuItem) { - var node = menuItem.getTreeNode(); - callRenameDocumentTree(node.widgetId); - } - - ); - dojo.event.topic.subscribe("DeleteDocument/engage", - function (menuItem) { - var node = menuItem.getTreeNode(); - callDeleteDocument(node.widgetId, node.object); - } - ); - } - ); +<#-- creating the JSON Data --> +var rawdata = [ + <#if (contentAssoc?has_content)> + <@fillTree assocList = contentAssoc/> + </#if> + + <#macro fillTree assocList> + <#if (assocList?has_content)> + <#list assocList as assoc> + <#assign content = delegator.findByPrimaryKey("Content",Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId",assoc.contentIdTo))/> + { + "data": {"title" : unescapeHtmlText("${content.contentName!assoc.contentIdTo}"), "attr": {"href": "javascript:void(0);", "onClick" : "callDocument('${assoc.contentIdTo}');"}}, + <#assign assocChilds = delegator.findByAnd("ContentAssoc",Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId",assoc.contentIdTo,"contentAssocTypeId", "TREE_CHILD"))/> + "attr": {"id" : "${assoc.contentIdTo}", "contentId" : "${assoc.contentId}", "AssocType" : "${assoc.contentAssocTypeId}", "fromDate" : "${assoc.fromDate}"}, + <#if assocChilds?has_content> + "children": [ + <@fillTree assocList = assocChilds/> + ] + </#if> + <#if assoc_has_next> + }, + <#else> + } + </#if> + </#list> + </#if> + </#macro> + ]; + + <#-------------------------------------------------------------------------------------define Requests--> + var editDocumentTreeUrl = '<@ofbizUrl>/views/EditDocumentTree</@ofbizUrl>'; + var listDocument = '<@ofbizUrl>/views/ListDocument</@ofbizUrl>'; + var editDocumentUrl = '<@ofbizUrl>/views/EditDocument</@ofbizUrl>'; + var deleteDocumentUrl = '<@ofbizUrl>removeDocumentFromTree</@ofbizUrl>'; + + <#-------------------------------------------------------------------------------------create Tree--> + function createTree() { + jQuery(function () { + jQuery("#tree").jstree({ + "plugins" : [ "themes", "json_data", "ui", "contextmenu", "crrm"], + "json_data" : { + "data" : rawdata, + "progressive_render" : false + }, + 'contextmenu': { + 'items': { + 'ccp' : false, + 'create' : false, + 'rename' : false, + 'remove' : false, + 'create1' : { + 'label' : "New Folder", + 'action' : function(obj) { + callCreateDocumentTree(obj.attr('id')); + } + }, + 'create2' : { + 'label' : "New Content in Folder", + 'action' : function(obj) { + callCreateDocument(obj.attr('id')); + } + }, + 'rename1' : { + 'label' : "Rename Folder", + 'action' : function(obj) { + callRenameDocumentTree(obj.attr('id')); + } + }, + 'delete1' : { + 'label' : "Delete Folder", + 'action' : function(obj) { + callDeleteDocument(obj.attr('id'), obj.attr('contentId'), obj.attr('AssocType'), obj.attr('fromDate')); + } + }, + } + } + }); + }); + } -<#-------------------------------------------------------------------------------------call ofbiz function--> - function callDocument(ctx) { +<#-------------------------------------------------------------------------------------callDocument function--> + function callDocument(contentId) { var tabitem='${tabButtonItem?if_exists}'; - if(tabitem=="navigateContent") - listDocument='<@ofbizUrl>/views/ListDocument</@ofbizUrl>'; - if(tabitem=="LookupContentTree") - listDocument='<@ofbizUrl>/views/ListContentTree</@ofbizUrl>'; - if(tabitem=="LookupDetailContentTree") - listDocument='<@ofbizUrl>/views/ViewContentDetail</@ofbizUrl>'; - var bindArgs = { + if (tabitem=="navigateContent") + listDocument = '<@ofbizUrl>/views/ListDocument</@ofbizUrl>'; + if (tabitem=="LookupContentTree") + listDocument = '<@ofbizUrl>/views/ListContentTree</@ofbizUrl>'; + if (tabitem=="LookupDetailContentTree") + listDocument = '<@ofbizUrl>/views/ViewContentDetail</@ofbizUrl>'; + + //jQuerry Ajax Request + jQuery.ajax({ url: listDocument, - method: 'POST', - mimetype: 'text/html', - content: ctx, - error: function(type, data, evt) { - alert("An error occured loading content! : " + data); - }, - load: function(type, data, evt) { - var innerPage = dojo.byId('Document'); - innerPage.innerHTML = data; - } - }; - dojo.io.bind(bindArgs); - } -<#-------------------------------------------------------------------------------------callCreateFolder function--> - function callCreateDocumentTree(contentId) { - var bindArgs = { + type: 'POST', + data: {"contentId" : contentId}, + error: function(msg) { + alert("An error occured loading content! : " + msg); + }, + success: function(msg) { + jQuery('#Document').html(msg); + } + }); + } +<#-------------------------------------------------------------------------------------callCreateDocumentTree function--> + function callCreateDocumentTree(contentId) { + jQuery.ajax({ url: editDocumentTreeUrl, - method: 'POST', - mimetype: 'text/html', - content: { contentId: contentId, - contentAssocTypeId:'TREE_CHILD'}, - error: function(type, data, evt) { - alert("An error occured loading content! : " + data); - }, - load: function(type, data, evt) { - var innerPage = dojo.byId('EditDocumentTree'); - innerPage.innerHTML = data; + type: 'POST', + data: {contentId: contentId, + contentAssocTypeId: 'TREE_CHILD'}, + error: function(msg) { + alert("An error occured loading content! : " + msg); + }, + success: function(msg) { + jQuery('#Document').html(msg); } - }; - dojo.io.bind(bindArgs); + }); } <#-------------------------------------------------------------------------------------callCreateSection function--> - function callCreateDocument(ctx) { - var bindArgs = { + function callCreateDocument(contentId) { + jQuery.ajax({ url: editDocumentUrl, - method: 'POST', - mimetype: 'text/html', - content: {contentId: ctx}, - error: function(type, data, evt) { - alert("An error occured loading content! : " + data); - }, - load: function(type, data, evt) { - var innerPage = dojo.byId('Document'); - innerPage.innerHTML = data; + type: 'POST', + data: {contentId: contentId}, + error: function(msg) { + alert("An error occured loading content! : " + msg); + }, + success: function(msg) { + jQuery('#Document').html(msg); } - }; - dojo.io.bind(bindArgs); + }); } <#-------------------------------------------------------------------------------------callEditSection function--> - function callEditDocument(ctx) { - - var bindArgs = { + function callEditDocument(contentIdTo) { + jQuery.ajax({ url: editDocumentUrl, - method: 'POST', - mimetype: 'text/html', - content: {contentIdTo: ctx}, - error: function(type, data, evt) { - alert("An error occured loading content! : " + data); - }, - load: function(type, data, evt) { - var innerPage = dojo.byId('Document'); - innerPage.innerHTML = data; + type: 'POST', + data: {contentIdTo: contentIdTo}, + error: function(msg) { + alert("An error occured loading content! : " + msg); + }, + success: function(msg) { + jQuery('#Document').html(msg); } - }; - dojo.io.bind(bindArgs); + }); } <#-------------------------------------------------------------------------------------callDeleteItem function--> - function callDeleteDocument(contentIdTo,objstr) { - var ctx = new Array(); - if (objstr != null && objstr.length > 0) { - var obj = objstr.split("|"); - ctx['contentId'] = obj[0]; - ctx['contentAssocTypeId'] = obj[1]; - ctx['fromDate'] = obj[2]; - } - ctx['contentIdTo']=contentIdTo; - var bindArgs = { + function callDeleteDocument(contentId, contentIdTo, contentAssocTypeId, fromDate) { + jQuery.ajax({ url: deleteDocumentUrl, - method: 'POST', - mimetype: 'text/html', - content: ctx, - error: function(type, data, evt) { - alert("An error occured loading content! : " + data); + type: 'POST', + data: {contentId : contentId, contentIdTo : contentIdTo, contentAssocTypeId : contentAssocTypeId, fromDate : fromDate}, + error: function(msg) { + alert("An error occured loading content! : " + msg); }, - load: function(type, data, evt) { + success: function(msg) { location.reload(); } - }; - dojo.io.bind(bindArgs); + }); } <#-------------------------------------------------------------------------------------callRename function--> function callRenameDocumentTree(contentId) { - var bindArgs = { + jQuery.ajax({ url: editDocumentTreeUrl, - method: 'POST', - mimetype: 'text/html', - content: { contentId: contentId, - contentAssocTypeId:'TREE_CHILD', - rename: 'Y' + type: 'POST', + data: { contentId: contentId, + contentAssocTypeId:'TREE_CHILD', + rename: 'Y' }, - error: function(type, data, evt) { - alert("An error occured loading content! : " + data); + error: function(msg) { + alert("An error occured loading content! : " + msg); }, - load: function(type, data, evt) { - var innerPage = dojo.byId('EditDocumentTree'); - innerPage.innerHTML = data; + success: function(msg) { + jQuery('#Document').html(msg); } - }; - dojo.io.bind(bindArgs); + }); } <#------------------------------------------------------pagination function --> function nextPrevDocumentList(url){ url= '<@ofbizUrl>'+url+'</@ofbizUrl>'; - var bindArgs = { + jQuery.ajax({ url: url, - method: 'POST', - mimetype: 'text/html', - error: function(type, data, evt) { - alert("An error occured loading content! : " + data); - }, - load: function(type, data, evt) { - var innerPage = dojo.byId('Document'); - innerPage.innerHTML = data; + type: 'POST', + error: function(msg) { + alert("An error occured loading content! : " + msg); + }, + success: function(msg) { + jQuery('#Document').html(msg); } - }; - dojo.io.bind(bindArgs); + }); } + </script> -<style type="text/css"> -.dojoContextMenu { - background-color: #ccc; - font-size: 10px; -} +<style> <#if tabButtonItem?has_content> <#if tabButtonItem=="LookupContentTree"||tabButtonItem=="LookupDetailContentTree"> -body{background:none;} -.left-border{float:left;width:25%;} -.contentarea{margin: 0 0 0 0.5em;padding:0 0 0 0.5em;} -.leftonly{float:none;min-height:25em;} + body{background:none;} + .left-border{float:left;width:25%;} + .contentarea{margin: 0 0 0 0.5em;padding:0 0 0 0.5em;} + .leftonly{float:none;min-height:25em;} </#if> </#if> </style> -<#-- looping macro --> -<#macro fillTree assocList> - <#if (assocList?has_content)> - <#list assocList as assoc> - <#assign content = delegator.findByPrimaryKey("Content",Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId",assoc.contentIdTo))/> - <div dojoType="TreeNode" title="${content.contentName?default(assoc.contentIdTo)}" widgetId="${assoc.contentIdTo}" - object="${assoc.contentId}|${assoc.contentAssocTypeId}|${assoc.fromDate}"> - <#assign assocChilds = delegator.findByAnd("ContentAssoc",Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId",assoc.contentIdTo,"contentAssocTypeId", "TREE_CHILD"))/> - <#if assocChilds?has_content> - <@fillTree assocList = assocChilds/> - </#if> - </div> - </#list> - </#if> -</#macro> - -<dl dojoType="TreeContextMenu" id="contentContextMenu" style="font-size: 1em; color: #ccc;"> - <dt dojoType="TreeMenuItem" id="NewDocumentTree" caption="${uiLabelMap.ContentNewFolder}"/> - <dt dojoType="TreeMenuItem" id="NewDocument" caption="${uiLabelMap.ContentNewContentInFolder}"/> - <#--<dt dojoType="TreeMenuItem" id="EditDocument" caption="Edit Document"/> --> - <dt dojoType="TreeMenuItem" id="RenameDocumentTree" caption="${uiLabelMap.ContentRenameFolder}"/> - <dt dojoType="TreeMenuItem" id="DeleteDocument" caption="${uiLabelMap.ContentDeleteFolder}"/> -</dl> - - -<dojo:TreeSelector widgetId="contentTreeSelector" eventNames="select:showDocument"></dojo:TreeSelector> -<div dojoType="Tree" menu="contentContextMenu" widgetId="contentTree" selector="contentTreeSelector" toggler="fade" toggleDuration="500"> - <#if (contentAssoc?has_content)> - <@fillTree assocList = contentAssoc/> - </#if> -</div> +<div id="tree"></div> + Modified: ofbiz/trunk/applications/content/webapp/content/content/DisplayContentNav.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/content/DisplayContentNav.ftl?rev=1044503&r1=1044502&r2=1044503&view=diff ============================================================================== --- ofbiz/trunk/applications/content/webapp/content/content/DisplayContentNav.ftl (original) +++ ofbiz/trunk/applications/content/webapp/content/content/DisplayContentNav.ftl Fri Dec 10 20:40:08 2010 @@ -17,217 +17,223 @@ under the License. --> -<script type="text/javascript"> +<script language="javascript" type="text/javascript" src="<@ofbizContentUrl>/images/jquery/plugins/jsTree/jquery.jstree.js</@ofbizContentUrl>"></script> - dojo.require("dojo.widget.*"); - dojo.require("dojo.event.*"); - dojo.require("dojo.io.*"); +<script type="application/javascript"> +<#-- some labels are not unescaped in the JSON object so we have to do this manuely --> +function unescapeHtmlText(text) { + return jQuery('<div />').html(text).text() +} + +jQuery(document).ready(createTree()); + +/*creating the JSON Data*/ +var rawdata = [ + <#if (contentAssoc?has_content)> + <@fillTree assocList = contentAssoc/> + </#if> + + <#macro fillTree assocList> + <#if (assocList?has_content)> + <#list assocList as assoc> + <#assign content = delegator.findByPrimaryKey("Content",Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId",assoc.contentIdTo))/> + { + "data": {"title" : unescapeHtmlText("${content.contentName!assoc.contentIdTo}"), "attr": {"href": "javascript:void(0);", "onClick" : "callDocument('${assoc.contentIdTo}');"}}, + <#assign assocChilds = delegator.findByAnd("ContentAssoc",Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId",assoc.contentIdTo,"contentAssocTypeId", "TREE_CHILD"))/> + "attr": {"id" : "${assoc.contentIdTo}", "contentId" : "${assoc.contentId}", "AssocType" : "${assoc.contentAssocTypeId}", "fromDate" : "${assoc.fromDate}"}, + <#if assocChilds?has_content> + "children": [ + <@fillTree assocList = assocChilds/> + ] + </#if> + <#if assoc_has_next> + }, + <#else> + } + </#if> + </#list> + </#if> + </#macro> + ]; + <#-------------------------------------------------------------------------------------define Requests--> var treeSelected = false; var editDocumentTreeUrl = '<@ofbizUrl>/views/EditDocumentTree</@ofbizUrl>'; var listDocument = '<@ofbizUrl>/views/ShowDocument</@ofbizUrl>'; var editDocumentUrl = '<@ofbizUrl>/views/EditDocument</@ofbizUrl>'; var deleteDocumentUrl = '<@ofbizUrl>removeDocumentFromTree</@ofbizUrl>'; -<#-------------------------------------------------------------------------------------Load function--> - dojo.addOnLoad(function() { - dojo.event.topic.subscribe("showDocument", - function(message) { - treeSelected = true; - var ctx = new Array(); - ctx['contentId'] = message.node.widgetId; - callDocument(ctx); - } - - ); - dojo.event.topic.subscribe("NewDocumentTree/engage", - function (menuItem) { - var node = menuItem.getTreeNode(); - callCreateDocumentTree(node.widgetId); - } - - ); - dojo.event.topic.subscribe("NewDocument/engage", - function (menuItem) { - var node = menuItem.getTreeNode(); - callCreateDocument(node.widgetId); - } - - ); - dojo.event.topic.subscribe("EditDocument/engage", - function (menuItem) { - var node = menuItem.getTreeNode(); - callEditDocument(node.widgetId); - } - ); - dojo.event.topic.subscribe("RenameDocumentTree/engage", - function (menuItem) { - var node = menuItem.getTreeNode(); - callRenameDocumentTree(node.widgetId); - } - - ); - dojo.event.topic.subscribe("DeleteDocument/engage", - function (menuItem) { - var node = menuItem.getTreeNode(); - callDeleteDocument(node.widgetId, node.object); - } - ); - } - ); - -<#-------------------------------------------------------------------------------------call ofbiz function--> - function callDocument(ctx) { - var bindArgs = { + + <#-------------------------------------------------------------------------------------create Tree--> + function createTree() { + jQuery(function () { + jQuery("#tree").jstree({ + "plugins" : [ "themes", "json_data", "ui", "contextmenu", "crrm"], + "json_data" : { + "data" : rawdata, + "progressive_render" : false + }, + 'contextmenu': { + 'items': { + 'ccp' : false, + 'create' : false, + 'rename' : false, + 'remove' : false, + 'create1' : { + 'label' : "New Folder", + 'action' : function(obj) { + callCreateDocumentTree(obj.attr('id')); + } + }, + 'create2' : { + 'label' : "New Content in Folder", + 'action' : function(obj) { + callCreateDocument(obj.attr('id')); + } + }, + 'rename1' : { + 'label' : "Rename Folder", + 'action' : function(obj) { + callRenameDocumentTree(obj.attr('id')); + } + }, + 'delete1' : { + 'label' : "Delete Folder", + 'action' : function(obj) { + callDeleteDocument(obj.attr('id'), obj.attr('contentId'), obj.attr('AssocType'), obj.attr('fromDate')); + } + }, + } + } + }); + }); + } + +<#-------------------------------------------------------------------------------------callDocument function--> + function callDocument(contentId) { + var tabitem='${tabButtonItem?if_exists}'; + if (tabitem=="navigateContent") + listDocument = '<@ofbizUrl>/views/ListDocument</@ofbizUrl>'; + if (tabitem=="LookupContentTree") + listDocument = '<@ofbizUrl>/views/ListContentTree</@ofbizUrl>'; + if (tabitem=="LookupDetailContentTree") + listDocument = '<@ofbizUrl>/views/ViewContentDetail</@ofbizUrl>'; + + //jQuerry Ajax Request + jQuery.ajax({ url: listDocument, - method: 'POST', - mimetype: 'text/html', - content: ctx, - error: function(type, data, evt) { - alert("An error occured loading content! : " + data); - }, - load: function(type, data, evt) { - var innerPage = dojo.byId('Document'); - innerPage.innerHTML = data; - } - }; - dojo.io.bind(bindArgs); - } -<#-------------------------------------------------------------------------------------callCreateFolder function--> - function callCreateDocumentTree(contentId) { - var bindArgs = { + type: 'POST', + data: {"contentId" : contentId}, + error: function(msg) { + alert("An error occured loading content! : " + msg); + }, + success: function(msg) { + jQuery('#Document').html(msg); + } + }); + } +<#-------------------------------------------------------------------------------------callCreateDocumentTree function--> + function callCreateDocumentTree(contentId) { + jQuery.ajax({ url: editDocumentTreeUrl, - method: 'POST', - mimetype: 'text/html', - content: { contentId: contentId, - contentAssocTypeId:'TREE_CHILD'}, - error: function(type, data, evt) { - alert("An error occured loading content! : " + data); - }, - load: function(type, data, evt) { - var innerPage = dojo.byId('EditDocumentTree'); - innerPage.innerHTML = data; + type: 'POST', + data: { contentId: contentId, + contentAssocTypeId: 'TREE_CHILD'}, + error: function(msg) { + alert("An error occured loading content! : " + msg); + }, + success: function(msg) { + jQuery('#Document').html(msg); } - }; - dojo.io.bind(bindArgs); + }); } <#-------------------------------------------------------------------------------------callCreateSection function--> - function callCreateDocument(ctx) { - var bindArgs = { + function callCreateDocument(contentId) { + jQuery.ajax({ url: editDocumentUrl, - method: 'POST', - mimetype: 'text/html', - content: {contentId: ctx}, - error: function(type, data, evt) { - alert("An error occured loading content! : " + data); - }, - load: function(type, data, evt) { - var innerPage = dojo.byId('Document'); - innerPage.innerHTML = data; + type: 'POST', + data: {contentId: contentId}, + error: function(msg) { + alert("An error occured loading content! : " + msg); + }, + success: function(msg) { + jQuery('#Document').html(msg); } - }; - dojo.io.bind(bindArgs); + }); } <#-------------------------------------------------------------------------------------callEditSection function--> - function callEditDocument(ctx) { - - var bindArgs = { + function callEditDocument(contentIdTo) { + jQuery.ajax({ url: editDocumentUrl, - method: 'POST', - mimetype: 'text/html', - content: {contentIdTo: ctx}, - error: function(type, data, evt) { - alert("An error occured loading content! : " + data); - }, - load: function(type, data, evt) { - var innerPage = dojo.byId('Document'); - innerPage.innerHTML = data; + type: 'POST', + data: {contentIdTo: contentIdTo}, + error: function(msg) { + alert("An error occured loading content! : " + msg); + }, + success: function(msg) { + jQuery('#Document').html(msg); } - }; - dojo.io.bind(bindArgs); + }); } <#-------------------------------------------------------------------------------------callDeleteItem function--> - function callDeleteDocument(contentIdTo,objstr) { - var ctx = new Array(); - if (objstr != null && objstr.length > 0) { - var obj = objstr.split("|"); - ctx['contentId'] = obj[0]; - ctx['contentAssocTypeId'] = obj[1]; - ctx['fromDate'] = obj[2]; - } - ctx['contentIdTo']=contentIdTo; - var bindArgs = { + function callDeleteDocument(contentId, contentIdTo, contentAssocTypeId, fromDate) { + jQuery.ajax({ url: deleteDocumentUrl, - method: 'POST', - mimetype: 'text/html', - content: ctx, - error: function(type, data, evt) { - alert("An error occured loading content! : " + data); + type: 'POST', + data: {contentId : contentId, contentIdTo : contentIdTo, contentAssocTypeId : contentAssocTypeId, fromDate : fromDate}, + error: function(msg) { + alert("An error occured loading content! : " + msg); }, - load: function(type, data, evt) { + success: function(msg) { location.reload(); } - }; - dojo.io.bind(bindArgs); + }); } <#-------------------------------------------------------------------------------------callRename function--> function callRenameDocumentTree(contentId) { - var bindArgs = { + jQuery.ajax({ url: editDocumentTreeUrl, - method: 'POST', - mimetype: 'text/html', - content: { contentId: contentId, - contentAssocTypeId:'TREE_CHILD', - rename: 'Y' + type: 'POST', + data: { contentId: contentId, + contentAssocTypeId:'TREE_CHILD', + rename: 'Y' }, - error: function(type, data, evt) { - alert("An error occured loading content! : " + data); + error: function(msg) { + alert("An error occured loading content! : " + msg); }, - load: function(type, data, evt) { - var innerPage = dojo.byId('EditDocumentTree'); - innerPage.innerHTML = data; + success: function(msg) { + jQuery('#Document').html(msg); } - }; - dojo.io.bind(bindArgs); + }); } + <#------------------------------------------------------pagination function --> + function nextPrevDocumentList(url){ + url= '<@ofbizUrl>'+url+'</@ofbizUrl>'; + jQuery.ajax({ + url: url, + type: 'POST', + error: function(msg) { + alert("An error occured loading content! : " + msg); + }, + success: function(msg) { + jQuery('#Document').html(msg); + } + }); + } + </script> -<style type="text/css"> -.dojoContextMenu { - background-color: #ccc; - font-size: 10px; -} +<style> +<#if tabButtonItem?has_content> + <#if tabButtonItem=="LookupContentTree"||tabButtonItem=="LookupDetailContentTree"> + body{background:none;} + .left-border{float:left;width:25%;} + .contentarea{margin: 0 0 0 0.5em;padding:0 0 0 0.5em;} + .leftonly{float:none;min-height:25em;} + </#if> +</#if> </style> -<#-- looping macro --> -<#macro fillTree assocList> - <#if (assocList?has_content)> - <#list assocList as assoc> - <#assign content = delegator.findByPrimaryKey("Content",Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId",assoc.contentIdTo))/> - <div dojoType="TreeNode" title="${content.contentName?default(assoc.contentIdTo)}" widgetId="${assoc.contentIdTo}" - object="${assoc.contentId}|${assoc.contentAssocTypeId}|${assoc.fromDate}"> - <#assign assocChilds = delegator.findByAnd("ContentAssoc",Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId",assoc.contentIdTo,"contentAssocTypeId", "TREE_CHILD"))/> - <#if assocChilds?has_content> - <@fillTree assocList = assocChilds/> - </#if> - </div> - </#list> - </#if> -</#macro> - -<dl dojoType="TreeContextMenu" id="contentContextMenu" style="font-size: 1em; color: #ccc;"> - <dt dojoType="TreeMenuItem" id="NewDocumentTree" caption="${uiLabelMap.ContentNewFolder}"/> - <dt dojoType="TreeMenuItem" id="NewDocument" caption="${uiLabelMap.ContentNewContentInFolder}"/> - <#--<dt dojoType="TreeMenuItem" id="EditDocument" caption="Edit Document"/> --> - <dt dojoType="TreeMenuItem" id="RenameDocumentTree" caption="${uiLabelMap.ContentRenameFolder}"/> - <dt dojoType="TreeMenuItem" id="DeleteDocument" caption="${uiLabelMap.ContentDeleteFolder}"/> -</dl> - - -<dojo:TreeSelector widgetId="contentTreeSelector" eventNames="select:showDocument"></dojo:TreeSelector> -<div dojoType="Tree" menu="contentContextMenu" widgetId="contentTree" selector="contentTreeSelector" toggler="fade" toggleDuration="500"> - <#if (contentAssoc?has_content)> - <@fillTree assocList = contentAssoc/> - </#if> -</div> +<div id="tree"></div> + Modified: ofbiz/trunk/applications/content/webapp/content/content/nav.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/content/nav.ftl?rev=1044503&r1=1044502&r2=1044503&view=diff ============================================================================== --- ofbiz/trunk/applications/content/webapp/content/content/nav.ftl (original) +++ ofbiz/trunk/applications/content/webapp/content/content/nav.ftl Fri Dec 10 20:40:08 2010 @@ -16,80 +16,75 @@ specific language governing permissions and limitations under the License. --> +<script language="javascript" type="text/javascript" src="<@ofbizContentUrl>/images/jquery/plugins/jsTree/jquery.jstree.js</@ofbizContentUrl>"></script> -<script type="text/javascript"> - - dojo.require("dojo.widget.*"); - dojo.require("dojo.event.*"); - dojo.require("dojo.io.*"); - - var treeSelected = false; - - dojo.addOnLoad(function() { - dojo.event.topic.subscribe("showDataResources", - function(message) { - treeSelected = true; - var ctx = new Array(); - ctx['dataCategoryId'] = message.node.widgetId; - callOfbiz('<@ofbizUrl>listDataResources</@ofbizUrl>', ctx); - } - ); - var cmsdata = dojo.byId("cmsdata"); - }); - - - function callOfbiz(url, ctx) { - var bindArgs = { - url: url, - method: 'POST', - mimetype: 'text/html', - content: ctx, - error: function(type, data, evt) { - alert("An error occured loading content! : " + data); - }, - load: function(type, data, evt) { - var innerPage = dojo.byId('cmscontent'); - innerPage.innerHTML = data; - } - }; - dojo.io.bind(bindArgs); - } -</script> - -<style type="text/css"> -.dojoContextMenu { - background-color: #ccc; - font-size: 10px; +<script type="application/javascript"> +<#-- some labels are not unescaped in the JSON object so we have to do this manuely --> +function unescapeHtmlText(text) { + return jQuery('<div />').html(text).text() } -</style> -<#-- looping macro --> -<#macro fillTree assocList> - <#if (assocList?has_content)> - <#list assocList as assoc> - <div dojoType="TreeNode" title="${assoc.categoryName?default(assoc.dataCategoryId)}" widgetId="${assoc.dataCategoryId}" - object="${assoc.dataCategoryId}"> - <#assign assocs = assoc.getRelated("ChildDataCategory")?if_exists/> - <#if (assocs?has_content)> - <@fillTree assocList = assocs/> - </#if> - </div> - </#list> - </#if> -</#macro> - -<!--dl dojoType="TreeContextMenu" id="contextMenu" style="font-size: 1em; color: #ccc;"> - <dt dojoType="TreeMenuItem" id="newCat" caption="New Category"/> - <dt dojoType="TreeMenuItem" id="delCat" caption="Remove Category"/> - <dt dojoType="TreeMenuItem" id="editCat" caption="Edit Category"/> - <dt dojoType="TreeMenuItem" id="upLoad" caption="Upload file"/> -</dl--> +jQuery(document).ready(createTree()); -<dojo:TreeSelector widgetId="webCmsTreeSelector" eventNames="select:showDataResources"></dojo:TreeSelector> -<div dojoType="Tree" widgetId="webCmsTree" selector="webCmsTreeSelector" toggler="fade" toggleDuration="500"> +<#-- creating the JSON Data --> +var rawdata = [ <#if (subCategories?has_content)> <@fillTree assocList = subCategories/> </#if> -</div> + <#macro fillTree assocList> + <#if (assocList?has_content)> + <#list assocList as assoc> + { + "data": {"title" : unescapeHtmlText("${assoc.categoryName!assoc.dataCategoryId!}"), "attr": {"href": "javascript:void(0);", "onClick" : "callDocument('${assoc.dataCategoryId!}');"}}, + <#assign assocs = assoc.getRelated("ChildDataCategory")?if_exists/> + <#if assocChilds?has_content> + "children": [ + <@fillTree assocList = assocChilds/> + ] + </#if> + <#if assoc_has_next> + }, + <#else> + } + </#if> + </#list> + </#if> + </#macro> + ]; + + <#-------------------------------------------------------------------------------------define Requests--> + var listDocument = '<@ofbizUrl>listDataResources</@ofbizUrl>'; + + <#-------------------------------------------------------------------------------------create Tree--> + function createTree() { + jQuery(function () { + jQuery("#tree").jstree({ + "plugins" : [ "themes", "json_data", "ui", "crrm"], + "json_data" : { + "data" : rawdata, + "progressive_render" : false + } + }); + }); + } + +<#-------------------------------------------------------------------------------------callDocument function--> + function callDocument(dataCategoryId) { + //jQuerry Ajax Request + jQuery.ajax({ + url: listDocument, + type: 'POST', + data: {"dataCategoryId" : dataCategoryId}, + error: function(msg) { + alert("An error occured loading content! : " + msg); + }, + success: function(msg) { + jQuery('#cmscontent').html(msg); + } + }); + } + +</script> +<div id="tree"></div> \ No newline at end of file Modified: ofbiz/trunk/applications/content/webapp/content/survey/EditSurveyQuestions.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/survey/EditSurveyQuestions.ftl?rev=1044503&r1=1044502&r2=1044503&view=diff ============================================================================== --- ofbiz/trunk/applications/content/webapp/content/survey/EditSurveyQuestions.ftl (original) +++ ofbiz/trunk/applications/content/webapp/content/survey/EditSurveyQuestions.ftl Fri Dec 10 20:40:08 2010 @@ -123,7 +123,7 @@ under the License. <input type="hidden" name="surveyId" value="${surveyQuestionAndAppl.surveyId}" /> <input type="hidden" name="surveyQuestionId" value="${surveyQuestionAndAppl.surveyQuestionId}" /> <input type="hidden" name="fromDate" value="${surveyQuestionAndAppl.fromDate}" /> - <a href="javascript:$('removeSurveyQuestion_${surveyQuestionAndAppl.surveyQuestionId}').submit();"" class="buttontext">${uiLabelMap.CommonRemove}</a> + <a href="javascript:document.getElementById('removeSurveyQuestion_${surveyQuestionAndAppl.surveyQuestionId}').submit();"" class="buttontext">${uiLabelMap.CommonRemove}</a> </form> </td> </tr> |
| Free forum by Nabble | Edit this page |
