Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0023597Openbravo ERPA. Platformpublic2013-04-19 18:092013-04-23 16:57
dbaz 
dbaz 
highminoralways
closedfixed 
5
 
3.0MP23 
AugustoMauch
Core
No
0023597: Add capabilities to overwritte a particular existing button of the toolbar
Add capabilities to overwritte a particular existing button of the toolbar.

The fix should not force to update any existing module, so the function 'registerButton' should behave as before with the new property 'overwriteIfExists' as null
To test the new functionality, you can just write this into the Firebug console. After it, open a tab, modify any record and press "Save" button.


NEW_SAVE_BUTTON = {
  action: function () {
    alert('Hello, this is the new save button functionality');
  },
  disabled: true,
  buttonType: 'save',
  prompt: OB.I18N.getLabel('OBUIAPP_SaveRow'),
  updateState: function () {
    var view = this.view,
        form = view.viewForm,
        hasErrors = false,
        editRow;
    if (view.isShowingForm) {
      this.setDisabled(!(form.isNew && form.allRequiredFieldsSet()) && (form.isSaving || form.readOnly || !view.hasValidState() || form.hasErrors() || !form.hasChanged || !form.allRequiredFieldsSet()));
    } else if (view.isEditingGrid) {
      form = view.viewGrid.getEditForm();
      editRow = view.viewGrid.getEditRow();
      hasErrors = view.viewGrid.rowHasErrors(editRow);
      this.setDisabled(!(form.isNew && form.allRequiredFieldsSet()) && !hasErrors && (form.isSaving || form.readOnly || !view.hasValidState() || form.hasErrors() || !form.hasChanged || !form.allRequiredFieldsSet()));
    } else {
      this.setDisabled(true);
    }
  },
  keyboardShortcutId: 'ToolBar_Save'
},

OB.ToolbarRegistry.registerButton(NEW_SAVE_BUTTON.buttonType, isc.OBToolbarIconButton, NEW_SAVE_BUTTON, 30, null, true);
No tags attached.
Issue History
2013-04-19 18:09dbazNew Issue
2013-04-19 18:09dbazAssigned To => dbaz
2013-04-19 18:09dbazModules => Core
2013-04-19 18:09dbazTriggers an Emergency Pack => No
2013-04-19 18:13dbazReview Assigned To => AugustoMauch
2013-04-19 18:13dbazIssue Monitored: AugustoMauch
2013-04-19 18:17hgbotCheckin
2013-04-19 18:17hgbotNote Added: 0058062
2013-04-19 18:17hgbotStatusnew => resolved
2013-04-19 18:17hgbotResolutionopen => fixed
2013-04-19 18:17hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/c09f69635bed61fe9ef335345ac8ae534a966d18 [^]
2013-04-19 18:19dbazNote Added: 0058064
2013-04-22 16:36hudsonbotCheckin
2013-04-22 16:36hudsonbotNote Added: 0058106
2013-04-23 16:57AugustoMauchNote Added: 0058140
2013-04-23 16:57AugustoMauchStatusresolved => closed
2013-04-23 16:57AugustoMauchFixed in Version => 3.0MP23

Notes
(0058062)
hgbot   
2013-04-19 18:17   
Repository: erp/devel/pi
Changeset: c09f69635bed61fe9ef335345ac8ae534a966d18
Author: David Baz Fayos <david.baz <at> openbravo.com>
Date: Fri Apr 19 18:16:45 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/c09f69635bed61fe9ef335345ac8ae534a966d18 [^]

Fixed issue 23597: Added 'overwriteIfExists' capabilities to 'registerButton' function

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-manage-views-toolbar.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-personalize-form-toolbar-button.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
---
(0058064)
dbaz   
2013-04-19 18:19   
Added new parameter 'overwriteIfExists' to 'OB.ToolbarRegistry.registerButton' function.
False/Null by default, so previous existing code will behave as before.
(0058106)
hudsonbot   
2013-04-22 16:36   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/f78aa78542fa [^]

Maturity status: Test
(0058140)
AugustoMauch   
2013-04-23 16:57   
Code reviewed and verified in pi@d4a9088f6a09