details: https://code.openbravo.com/erp/devel/pi/rev/176522228957 changeset: 32631:176522228957 user: Stefan Hühner <stefan.huehner <at> openbravo.com> date: Sat Sep 02 13:40:43 2017 +0200 summary: [wad-cleanup] tab1 + tab2 arrays were never read -> remove them.
details: https://code.openbravo.com/erp/devel/pi/rev/0ee6fa678770 changeset: 32632:0ee6fa678770 user: Stefan Hühner <stefan.huehner <at> openbravo.com> date: Sat Sep 02 13:51:12 2017 +0200 summary: [wad-cleanup] More unused code removal in processTab Several variables were calculated but no longer used remove them. That allows to also remove 2 xsql methods in Fields_data.xsql. Those are copied into runtime accessible AuditTrailPopup_data.xsql 'linked' via sourcecode comment to keep in sync. As the wad copy is now gone remove that comment. details: https://code.openbravo.com/erp/devel/pi/rev/13185fa9599f changeset: 32633:13185fa9599f user: Stefan Hühner <stefan.huehner <at> openbravo.com> date: Sat Sep 02 14:19:57 2017 +0200 summary: [wad-cleanup] Remove processTable as its output is never used. In prior wad cleanup all uses of the several Vector<Object> which are out-parameter of the processTable function have been already removed. Remove the call + the function itself. That allows some further cleanup of more now unused utility functions. Now unsed Fields_data.xsql select method was first in its file so is converted into a dummy function (as SqlC only uses first function to get field names) details: https://code.openbravo.com/erp/devel/pi/rev/089013c83b49 changeset: 32634:089013c83b49 user: Stefan Hühner <stefan.huehner <at> openbravo.com> date: Sat Sep 02 14:29:31 2017 +0200 summary: [wad-cleanup] remove processTable from WADControl + all sub-classes. processTable function in Wad was the only code calling those functions. As that is removed in previous code all this code here is not obsolete. details: https://code.openbravo.com/erp/devel/pi/rev/ed7cc6508f54 changeset: 32635:ed7cc6508f54 user: Stefan Hühner <stefan.huehner <at> openbravo.com> date: Sat Sep 02 14:39:10 2017 +0200 summary: [wad-cleanup] remove unused toJava from WADControl and all subclasses. details: https://code.openbravo.com/erp/devel/pi/rev/13dbc17cb892 changeset: 32636:13dbc17cb892 user: Stefan Hühner <stefan.huehner <at> openbravo.com> date: Sat Sep 02 14:41:05 2017 +0200 summary: [wad-cleanup] remove unused has2UIFields from WADControl and all subclasses. details: https://code.openbravo.com/erp/devel/pi/rev/20a3e1f6264c changeset: 32637:20a3e1f6264c user: Stefan Hühner <stefan.huehner <at> openbravo.com> date: Sat Sep 02 14:48:57 2017 +0200 summary: [wad-cleanup] remove 2 unused functions from WADControl and all subclasses. Removes: - addAdditionDefaulSQLFields - addAdditionDefaulJavaFields details: https://code.openbravo.com/erp/devel/pi/rev/9ddcc5118f86 changeset: 32638:9ddcc5118f86 user: Stefan Hühner <stefan.huehner <at> openbravo.com> date: Sat Sep 02 14:50:31 2017 +0200 summary: [wad-cleanup] remove unused getSQLCasting from WADControl and all subclasses details: https://code.openbravo.com/erp/devel/pi/rev/432b91cbf04b changeset: 32639:432b91cbf04b user: Stefan Hühner <stefan.huehner <at> openbravo.com> date: Sat Sep 02 14:56:57 2017 +0200 summary: [wad-cleanup] Remove unused processSelCol from WADControl 6 all subclasses also remove now unused utility method isSearchValueColumn details: https://code.openbravo.com/erp/devel/pi/rev/03adf707bffd changeset: 32640:03adf707bffd user: Stefan Hühner <stefan.huehner <at> openbravo.com> date: Sat Sep 02 15:07:33 2017 +0200 summary: [wad-cleanup] Remove 3 more unused methods from WADControl and all subclasses: - isLink - isText - getLinkColumn Id - this allows removal of now unused WADTable_data.xsql file also details: https://code.openbravo.com/erp/devel/pi/rev/877ee1839161 changeset: 32641:877ee1839161 user: Stefan Hühner <stefan.huehner <at> openbravo.com> date: Sat Sep 02 15:10:36 2017 +0200 summary: [wad-cleanup] Remove unused getReadOnlyLogicColumn from WADControl + subclasses details: https://code.openbravo.com/erp/devel/pi/rev/60bbc448b1f9 changeset: 32642:60bbc448b1f9 user: Stefan Hühner <stefan.huehner <at> openbravo.com> date: Sat Sep 02 15:15:09 2017 +0200 summary: [wad-cleanup] Remove unused getDisplayLogic from WADControl + all subclasses details: https://code.openbravo.com/erp/devel/pi/rev/879cd98509c5 changeset: 32643:879cd98509c5 user: Stefan Hühner <stefan.huehner <at> openbravo.com> date: Sat Sep 02 15:16:59 2017 +0200 summary: [wad-cleanup] Remove unused getDefaultValue from WADControl + all subclasses details: https://code.openbravo.com/erp/devel/pi/rev/54e7bcdec2df changeset: 32644:54e7bcdec2df user: Stefan Hühner <stefan.huehner <at> openbravo.com> date: Sat Sep 02 15:27:55 2017 +0200 summary: [wad-cleanup] Remove unused WadUtility.columnIdentifier + whole EFD xsql file. details: https://code.openbravo.com/erp/devel/pi/rev/427ed7be3581 changeset: 32645:427ed7be3581 user: Stefan Hühner <stefan.huehner <at> openbravo.com> date: Sat Sep 02 15:29:38 2017 +0200 summary: [wad-cleanup] remove unused isLink from subclass missed in earlier commit details: https://code.openbravo.com/erp/devel/pi/rev/f054d02ea284 changeset: 32646:f054d02ea284 user: Stefan Hühner <stefan.huehner <at> openbravo.com> date: Sun Sep 03 15:51:23 2017 +0200 summary: [wad-cleanup] remove unused parts of ComboReloads code generation. The following element of the ComboReloadsProcess.xml file as never used in the ComboReloadsProcess.javaxml file: - fieldTableName1 aka tablename - fieldTableName2 aka tablenametrl - fieldMethod1 aka htmltext - fieldMethod2 aka htmltexttrl - fieldSelectFields1 aka xmltext - fieldSelectFields2 aka xmltexttrl Remove them from the ComboReloadsProcess.xml structure definition. Also remove setting them in the FieldProvider[][] in Wad.processComboReloads. details: https://code.openbravo.com/erp/devel/pi/rev/2a7aff6022c8 changeset: 32647:2a7aff6022c8 user: Stefan Hühner <stefan.huehner <at> openbravo.com> date: Sun Sep 03 15:57:08 2017 +0200 summary: [wad-cleanup] Remove not needed calls to WADControl.columnIdentifier. After last commit the outParams of those calls as no longer used. Remove them. Also allows removal of two 2 unused method in WadUtility: - getWadComboReloadContext - getWadcomboReloadContextTranslate details: https://code.openbravo.com/erp/devel/pi/rev/0e0a5ad8959c changeset: 32648:0e0a5ad8959c user: Stefan Hühner <stefan.huehner <at> openbravo.com> date: Sun Sep 03 16:11:56 2017 +0200 summary: [wad-cleanup] Remove now unused columnIdentifier from WADControl & subclasses That method is unused after previous cleanup: remove it. Also remove all code which was only used by that method. That allows also to reduce visibility of WadUtility class from public to package local. details: https://code.openbravo.com/erp/devel/pi/rev/e66f890a5332 changeset: 32649:e66f890a5332 user: Stefan Hühner <stefan.huehner <at> openbravo.com> date: Sun Sep 03 16:25:45 2017 +0200 summary: [wad-cleanup] Remove some unused SqlMethod details: https://code.openbravo.com/erp/devel/pi/rev/4403b9e27088 changeset: 32650:4403b9e27088 user: Stefan Hühner <stefan.huehner <at> openbravo.com> date: Sun Sep 03 16:39:09 2017 +0200 summary: [wad-cleanup] Simplify checking if windows has no tabs with level=0 Only usage left of allTabs[] in processTab is to check if there are none at all. Simplify code accordingly: - getPrimaryTabs -> remove getSubTabs usage - as caller only checks length<>0 the initial select is enough as if it has 0 rows -> getSubTabs was never called anyway. And if it has >0 rows that is sufficient already for the caller. - remove getSubTabs functions + its related SqlMethod - getPrimaryTabs -> inline into only caller processTab - SqlMethod selectTabParent, simplify just keeping result count as relevant output details: https://code.openbravo.com/erp/devel/pi/rev/64f6f70ca5db changeset: 32651:64f6f70ca5db user: Stefan Hühner <stefan.huehner <at> openbravo.com> date: Sun Sep 03 18:32:32 2017 +0200 summary: [wad-cleanup] cleanup unused elements from javasource.xml Patched xmlEngine found a number of: a.) Unused entries in javasource.xml control file b.) a few setParameters calls for elements in javasource.xml which don't exist Clean those up. details: https://code.openbravo.com/erp/devel/pi/rev/f7c72e5a5106 changeset: 32652:f7c72e5a5106 user: Stefan Hühner <stefan.huehner <at> openbravo.com> date: Sun Sep 03 18:50:09 2017 +0200 summary: [wad-cleanup] cleanup unused entries in webConf & webParams control files details: https://code.openbravo.com/erp/devel/pi/rev/883e924e3a6c changeset: 32653:883e924e3a6c user: Stefan Hühner <stefan.huehner <at> openbravo.com> date: Sun Sep 03 19:48:51 2017 +0200 summary: [wad-cleanup] Remove more unused template entries + setParameter calls. details: https://code.openbravo.com/erp/devel/pi/rev/bca4d90be19b changeset: 32654:bca4d90be19b user: Stefan Hühner <stefan.huehner <at> openbravo.com> date: Sun Sep 03 19:49:42 2017 +0200 summary: [wad-cleanup] Remove another unused template entry details: https://code.openbravo.com/erp/devel/pi/rev/516ccad763f5 changeset: 32655:516ccad763f5 user: Asier Lostalé <asier.lostale <at> openbravo.com> date: Tue Sep 05 08:35:41 2017 +0200 summary: [wad-cleanup] reformat java details: https://code.openbravo.com/erp/devel/pi/rev/3cccd6f02684 changeset: 32656:3cccd6f02684 user: Asier Lostalé <asier.lostale <at> openbravo.com> date: Tue Sep 05 08:37:08 2017 +0200 summary: [wad-cleanup] error message in English details: https://code.openbravo.com/erp/devel/pi/rev/2db1f09ca22d changeset: 32657:2db1f09ca22d user: Asier Lostalé <asier.lostale <at> openbravo.com> date: Tue Sep 05 08:40:10 2017 +0200 summary: [wad-cleanup] use foreach to loop on array details: https://code.openbravo.com/erp/devel/pi/rev/d01aa719c57f changeset: 32658:d01aa719c57f user: Asier Lostalé <asier.lostale <at> openbravo.com> date: Tue Sep 05 08:44:29 2017 +0200 summary: [wad-cleanup] removed no-op branch details: https://code.openbravo.com/erp/devel/pi/rev/bf2ad08d2d75 changeset: 32659:bf2ad08d2d75 user: Asier Lostalé <asier.lostale <at> openbravo.com> date: Tue Sep 05 08:45:45 2017 +0200 summary: [wad-cleanup] removed useless and malformatted comment details: https://code.openbravo.com/erp/devel/pi/rev/788d0f44f3ff changeset: 32660:788d0f44f3ff user: Stefan Hühner <stefan.huehner <at> openbravo.com> date: Sat Sep 09 11:09:06 2017 +0200 summary: Fixed 36818. Merge back project doing a lot more src-wad unused code removal. This merges back the pi-wad-cleanup2 branch doing follow up cleanup for 17q2 change which removed support to compile old style 2.50 windows. diffstat: modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml | 2 + modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ExecutePayment.java | 50 +- modules/org.openbravo.client.application/src/org/openbravo/client/application/attachment/AttachImplementationManager.java | 3 + modules/org.openbravo.client.application/src/org/openbravo/client/application/personalization/PersonalizationHandler.java | 37 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js | 6 +- modules/org.openbravo.userinterface.selector/src-wad/org/openbravo/userinterface/selector/wad/WADSelector.java | 87 - modules/org.openbravo.userinterface.selector/src-wad/org/openbravo/userinterface/selector/wad/WADSelector.xml | 1 - modules/org.openbravo.userinterface.selector/src-wad/org/openbravo/userinterface/selector/wad/WADSelectorData.xsql | 22 - modules/org.openbravo.userinterface.selector/src-wad/org/openbravo/userinterface/selector/wad/WADSelectorPrimitive.java | 3 - modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js | 10 +- modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js | 35 +- src-db/database/model/functions/MA_WORKEFFORT_VALIDATE.xml | 4 +- src-db/database/model/functions/M_GET_STOCK_PARAM.xml | 4 +- src-db/database/model/functions/M_INOUT_POST.xml | 13 +- src-db/database/model/functions/M_PRODUCTION_RUN.xml | 4 +- src-wad/src/org/openbravo/wad/ActionButtonJava_Responser.xml | 6 - src-wad/src/org/openbravo/wad/ActionButton_Responser.xml | 7 - src-wad/src/org/openbravo/wad/ComboReloadsProcess.xml | 7 - src-wad/src/org/openbravo/wad/ComboReloadsProcessHelper.xml | 1 - src-wad/src/org/openbravo/wad/EditionFields_data.xsql | 48 - src-wad/src/org/openbravo/wad/Fields_data.xsql | 141 +-- src-wad/src/org/openbravo/wad/TableRelation_data.xsql | 55 - src-wad/src/org/openbravo/wad/Tabs_data.xsql | 83 +- src-wad/src/org/openbravo/wad/Template_ActionButton.xml | 1 - src-wad/src/org/openbravo/wad/Wad.java | 480 +--------- src-wad/src/org/openbravo/wad/WadActionButton.java | 3 - src-wad/src/org/openbravo/wad/WadUtility.java | 165 +--- src-wad/src/org/openbravo/wad/controls/WADButton.java | 101 -- src-wad/src/org/openbravo/wad/controls/WADControl.java | 196 ---- src-wad/src/org/openbravo/wad/controls/WADDate.java | 79 - src-wad/src/org/openbravo/wad/controls/WADDateTime.java | 66 - src-wad/src/org/openbravo/wad/controls/WADDateXML.xml | 2 - src-wad/src/org/openbravo/wad/controls/WADID.java | 50 - src-wad/src/org/openbravo/wad/controls/WADImage.java | 117 -- src-wad/src/org/openbravo/wad/controls/WADImageBLOB.java | 15 - src-wad/src/org/openbravo/wad/controls/WADInteger.java | 71 - src-wad/src/org/openbravo/wad/controls/WADLink.java | 16 - src-wad/src/org/openbravo/wad/controls/WADList.java | 131 -- src-wad/src/org/openbravo/wad/controls/WADMemo.java | 48 - src-wad/src/org/openbravo/wad/controls/WADNumber.java | 92 +- src-wad/src/org/openbravo/wad/controls/WADSearch.java | 246 ----- src-wad/src/org/openbravo/wad/controls/WADSearch_data.xsql | 10 - src-wad/src/org/openbravo/wad/controls/WADString.java | 49 - src-wad/src/org/openbravo/wad/controls/WADTable.java | 106 -- src-wad/src/org/openbravo/wad/controls/WADTableDir.java | 74 - src-wad/src/org/openbravo/wad/controls/WADTable_data.xsql | 32 - src-wad/src/org/openbravo/wad/controls/WADText.java | 26 - src-wad/src/org/openbravo/wad/controls/WADTime.java | 71 - src-wad/src/org/openbravo/wad/controls/WADYesNo.java | 11 - src-wad/src/org/openbravo/wad/javasource.xml | 25 - src-wad/src/org/openbravo/wad/webConf.xml | 2 - src-wad/src/org/openbravo/wad/webParams.xml | 1 - src/org/openbravo/authentication/AuthenticationManager.java | 124 +- src/org/openbravo/authentication/basic/DefaultAuthenticationManager.java | 25 +- src/org/openbravo/costing/CostingRuleProcess.java | 2 + src/org/openbravo/costing/LandedCostProcess.java | 3 +- src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java | 32 +- src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Invoice_data.xsql | 12 +- src/org/openbravo/erpCommon/businessUtility/AuditTrailPopup_data.xsql | 3 - src/org/openbravo/service/system/DatabaseValidator.java | 5 +- 60 files changed, 254 insertions(+), 2867 deletions(-) diffs (truncated from 4477 to 300 lines): diff -r 62f82f265b39 -r 788d0f44f3ff modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml --- a/modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml Fri Sep 01 13:23:45 2017 +0200 +++ b/modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml Sat Sep 09 11:09:06 2017 +0200 @@ -392,6 +392,7 @@ SELECT COALESCE(COUNT(*),0) INTO v_Count FROM c_orderline WHERE qtyordered <> (qtyinvoiced*v_MultiplierARC) + AND linenetamt <> 0 AND c_order_id = order_schdet.order_id; ELSE SELECT count(*) INTO v_count @@ -401,6 +402,7 @@ LEFT JOIN m_matchpo mpo ON ol.c_orderline_id = mpo.c_orderline_id AND mpo.c_invoiceline_id IS NOT NULL WHERE ol.c_order_id = order_schdet.order_id + AND ol.linenetamt <> 0 GROUP BY ol.c_orderline_id, ol.qtyordered) a WHERE a.qtyordered != (a.matchedqty*v_MultiplierARC); END IF; diff -r 62f82f265b39 -r 788d0f44f3ff modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ExecutePayment.java --- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ExecutePayment.java Fri Sep 01 13:23:45 2017 +0200 +++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ExecutePayment.java Sat Sep 09 11:09:06 2017 +0200 @@ -210,11 +210,11 @@ return processTransactionError; } } - updatePaymentAmounts(paymentRunPayment.getPayment()); + FIN_Utility.updatePaymentAmounts(psd); } } - break; } + FIN_Utility.updateBusinessPartnerCredit(paymentRunPayment.getPayment()); } finally { OBContext.restorePreviousMode(); } @@ -265,52 +265,6 @@ constantParameters.put(parameter.getSearchKey(), parameter.getDefaultTextValue()); } - private static void updatePaymentAmounts(FIN_Payment payment) { - for (FIN_PaymentDetail pDetail : payment.getFINPaymentDetailList()) { - for (FIN_PaymentScheduleDetail psd : pDetail.getFINPaymentScheduleDetailList()) { - if (psd.getInvoicePaymentSchedule() != null) { - BusinessPartner bPartner = psd.getInvoicePaymentSchedule().getInvoice() - .getBusinessPartner(); - BigDecimal creditUsed = bPartner.getCreditUsed(); - BigDecimal amountWithSign = psd.getInvoicePaymentSchedule().getInvoice() - .isSalesTransaction() ? psd.getAmount() : psd.getAmount().negate(); - creditUsed = creditUsed.subtract(amountWithSign); - bPartner.setCreditUsed(creditUsed); - OBDal.getInstance().save(bPartner); - FIN_AddPayment.updatePaymentScheduleAmounts(pDetail, psd.getInvoicePaymentSchedule(), - psd.getAmount(), psd.getWriteoffAmount()); - } - if (psd.getOrderPaymentSchedule() != null) { - FIN_AddPayment.updatePaymentScheduleAmounts(pDetail, psd.getOrderPaymentSchedule(), - psd.getAmount(), psd.getWriteoffAmount()); - } - if (pDetail.isPrepayment() && psd.getOrderPaymentSchedule() == null - && psd.getInvoicePaymentSchedule() == null) { - // This PSD is credit - BusinessPartner bPartner = psd.getPaymentDetails().getFinPayment().getBusinessPartner(); - BigDecimal creditUsed = bPartner.getCreditUsed(); - BigDecimal amountWithSign = psd.getPaymentDetails().getFinPayment().isReceipt() ? psd - .getAmount() : psd.getAmount().negate(); - creditUsed = creditUsed.subtract(amountWithSign); - bPartner.setCreditUsed(creditUsed); - OBDal.getInstance().save(bPartner); - } - } - } - // When credit is used (consumed) we compensate so_creditused as this amount is already - // included in the payment details. Credit consumed should not affect to so_creditused - if (payment.getGeneratedCredit().compareTo(BigDecimal.ZERO) == 0 - && payment.getUsedCredit().compareTo(BigDecimal.ZERO) != 0) { - BusinessPartner bp = payment.getBusinessPartner(); - if (payment.isReceipt()) { - bp.setCreditUsed(bp.getCreditUsed().add(payment.getUsedCredit())); - } else { - bp.setCreditUsed(bp.getCreditUsed().subtract(payment.getUsedCredit())); - } - OBDal.getInstance().save(bp); - } - } - /** * It calls the Transaction Process for the given transaction and action. * diff -r 62f82f265b39 -r 788d0f44f3ff modules/org.openbravo.client.application/src/org/openbravo/client/application/attachment/AttachImplementationManager.java --- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/attachment/AttachImplementationManager.java Fri Sep 01 13:23:45 2017 +0200 +++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/attachment/AttachImplementationManager.java Sat Sep 09 11:09:06 2017 +0200 @@ -148,6 +148,9 @@ } else { attachMethod = AttachmentUtils.getDefaultAttachmentMethod(); } + // The information of the existing attachment may have not changed. Force the update of the + // 'updated' field, the rest of the audit information will be updated automatically. + attachment.setUpdated(new Date()); } attachment.setOrganization(org); String strDataType = null; diff -r 62f82f265b39 -r 788d0f44f3ff modules/org.openbravo.client.application/src/org/openbravo/client/application/personalization/PersonalizationHandler.java --- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/personalization/PersonalizationHandler.java Fri Sep 01 13:23:45 2017 +0200 +++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/personalization/PersonalizationHandler.java Sat Sep 09 11:09:06 2017 +0200 @@ -11,7 +11,7 @@ * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SLU - * All portions are Copyright (C) 2011 Openbravo SLU + * All portions are Copyright (C) 2011-2017 Openbravo SLU * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************ @@ -28,7 +28,6 @@ import javax.enterprise.context.RequestScoped; -import org.apache.log4j.Logger; import org.codehaus.jettison.json.JSONArray; import org.codehaus.jettison.json.JSONException; import org.codehaus.jettison.json.JSONObject; @@ -48,6 +47,8 @@ import org.openbravo.model.ad.ui.Tab; import org.openbravo.model.ad.ui.Window; import org.openbravo.model.common.enterprise.Organization; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Handles personalization settings, stores them and retrieves them, taking into account priority @@ -55,7 +56,7 @@ */ @RequestScoped public class PersonalizationHandler { - private static final Logger log = Logger.getLogger(PersonalizationHandler.class); + private static final Logger log = LoggerFactory.getLogger(PersonalizationHandler.class); /** * Returns all the personalization settings in an object keyed by tabid. The current client, org, @@ -193,13 +194,13 @@ result.put("clients", clientObject); } - final Map<String, String> orgs = new HashMap<String, String>(); + final Map<String, String> orgs = new HashMap<>(); for (RoleOrganization currentRoleOrg : adminOrgs) { orgs.put(currentRoleOrg.getOrganization().getId(), currentRoleOrg.getOrganization() .getName()); } - final Map<String, String> roles = new HashMap<String, String>(); + final Map<String, String> roles = new HashMap<>(); for (UserRoles currentUserRole : adminRoles) { roles.put(currentUserRole.getRole().getId(), currentUserRole.getRole().getName()); } @@ -337,7 +338,6 @@ } return selectedUIPersonalization; } catch (Exception e) { - // TODO: add param values to message throw new OBException(e); } finally { OBContext.restorePreviousMode(); @@ -475,7 +475,7 @@ OBDal.getInstance().save(uiPersonalization); return uiPersonalization; } catch (Exception e) { - // TODO: add param values to message + log.error("Error when storing personalization settings for tab with ID = {}", tabId); throw new OBException(e); } finally { OBContext.restorePreviousMode(); @@ -485,7 +485,7 @@ private static List<UIPersonalization> getPersonalizations(String clientId, String orgId, String userId, String roleId, String tabId, String windowId, boolean exactMatch) { - List<Object> parameters = new ArrayList<Object>(); + List<Object> parameters = new ArrayList<>(); StringBuilder hql = new StringBuilder(); hql.append(" as p "); hql.append(" where "); @@ -565,9 +565,8 @@ // Remove from list organization that are not visible final Organization org = OBDal.getInstance().get(Organization.class, orgId); List<String> parentTree = OBContext.getOBContext() - .getOrganizationStructureProvider(org.getClient().getId()) - .getParentList(orgId, true); - List<UIPersonalization> auxPersonalizations = new ArrayList<UIPersonalization>(); + .getOrganizationStructureProvider(org.getClient().getId()).getParentList(orgId, true); + List<UIPersonalization> auxPersonalizations = new ArrayList<>(); for (UIPersonalization pers : personalizations) { if (pers.getVisibleAtOrganization() == null || parentTree.contains(pers.getVisibleAtOrganization().getId())) { @@ -599,10 +598,14 @@ private static int isHigherPriority(UIPersonalization pers1, UIPersonalization pers2, List<String> parentTree) { // Check priority by client - if ((pers2.getVisibleAtClient() == null || pers2.getVisibleAtClient().getId().equals("0")) - && pers1.getVisibleAtClient() != null && !pers1.getVisibleAtClient().getId().equals("0")) { + boolean firstIsClientVisible = visibleAtNonSystemClient(pers1); + boolean secondIsClientVisible = visibleAtNonSystemClient(pers2); + if (firstIsClientVisible && !secondIsClientVisible) { return 1; } + if (!firstIsClientVisible && secondIsClientVisible) { + return 2; + } // Check priority by organization Organization org1 = pers1.getVisibleAtOrganization(); @@ -647,4 +650,12 @@ // Actual conflict return 0; } + + private static boolean visibleAtNonSystemClient(UIPersonalization personalization) { + Client client = personalization.getVisibleAtClient(); + if (client == null) { + return false; + } + return !"0".equals(client.getId()); + } } diff -r 62f82f265b39 -r 788d0f44f3ff modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js --- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js Fri Sep 01 13:23:45 2017 +0200 +++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js Sat Sep 09 11:09:06 2017 +0200 @@ -498,7 +498,7 @@ isLabel = true; msg = error.message; params = error.params; - } else if (error.message) { + } else if (isc.isA.String(error.message)) { type = error.messageType || type; params = error.params; // error.messageType can be Error @@ -513,7 +513,7 @@ // hope that someone else will handle it return false; } - } else if (data.data) { + } else if (data && data.data) { // try it with data.data return this.setErrorMessageFromResponse(resp, data.data, req); } else { @@ -2339,8 +2339,6 @@ } selection = currentGrid.getSelection().duplicate(); - // deselect the current records - currentGrid.deselectAllRecords(); view.viewGrid.markForCalculateSummaries(); if (selection.length > 1) { diff -r 62f82f265b39 -r 788d0f44f3ff modules/org.openbravo.userinterface.selector/src-wad/org/openbravo/userinterface/selector/wad/WADSelector.java --- a/modules/org.openbravo.userinterface.selector/src-wad/org/openbravo/userinterface/selector/wad/WADSelector.java Fri Sep 01 13:23:45 2017 +0200 +++ b/modules/org.openbravo.userinterface.selector/src-wad/org/openbravo/userinterface/selector/wad/WADSelector.java Sat Sep 09 11:09:06 2017 +0200 @@ -19,12 +19,9 @@ package org.openbravo.userinterface.selector.wad; import java.util.Properties; -import java.util.Vector; import javax.servlet.ServletException; -import org.openbravo.wad.FieldsData; -import org.openbravo.wad.WadUtility; import org.openbravo.wad.controls.WADControl; import org.openbravo.xmlEngine.XmlDocument; @@ -172,88 +169,4 @@ return replaceHTML(xmlDocument.print()); } - public String toJava() { - return ""; - } - - public String getDisplayLogic(boolean display, boolean isreadonly) { - StringBuffer displayLogic = new StringBuffer(); - - displayLogic.append(super.getDisplayLogic(display, isreadonly)); - - if (!getData("IsReadOnly").equals("Y") && !isreadonly) { - displayLogic.append("displayLogicElement('"); - displayLogic.append(getData("ColumnName")); - displayLogic.append("_inp_td', ").append(display ? "true" : "false").append(");\n"); - } - return displayLogic.toString(); - } - - public boolean isLink() { - return true; - } - - public String getLinkColumnId() { - try { - return WADSelectorData.getLinkedColumnId(getConnection(), subreference); - } catch (Exception e) { - return ""; ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Openbravo-commits mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openbravo-commits
