Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0026761
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorhave not tried2014-06-02 13:372014-06-10 22:23
ReporterguillermogilView Statuspublic 
Assigned Toguillermogil 
PrioritynormalResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revisionbc3a8a312111
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned ToAugustoMauch
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0026761: Clean code on parameter windows

DescriptionClean code on parameter windows
Steps To ReproduceN/A
Proposed Solution function actionClick() {
      var hasErrors = false,
          grid, fields, selection, len, allRows, lineNumbers, i, j, record, undef;
      view.messageBar.hide();
      if (view.grid && view.grid.viewGrid) {
        grid = view.grid.viewGrid;
        fields = grid.getFields();
        selection = grid.getSelectedRecords() || [];
        len = selection.length;
        allRows = grid.data.allRows || grid.data.localData || grid.data;
        for (i = 0; i < len; i++) {
          record = grid.getEditedRecord(grid.getRecordIndex(selection[i]));
          for (j = 0; j < fields.length; j++) {
            if (fields[j].required) {
              if (record[fields[j].name] === null || record[fields[j].name] === '' || record[fields[j] === undef]) {
                hasErrors = true;
                if (lineNumbers === undef) {
                  lineNumbers = grid.getRecordIndex(selection[i]).toString();
                } else {
                  lineNumbers = lineNumbers + "," + grid.getRecordIndex(selection[i]).toString();
                }
              }
            }
          }
        }
      }
      if (!hasErrors) {
        if (view.validate()) {
          view.doProcess(this._buttonValue);
        } else {
          // If the messageBar is visible, it means that it has been set due to a custom validation inside view.validate()
          // so we don't want to overwrite it with the generic OBUIAPP_ErrorInFields message
          if (!view.messageBar.isVisible()) {
            view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('OBUIAPP_ErrorInFields'));
          }
        }
      } else {
        view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('OBUIAPP_FillMandatoryFields') + " " + lineNumbers);
      }
    }

if (view.grid && view.grid.viewGrid) { condition is always false
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0067673)
hgbot (developer)
2014-06-02 15:38

Repository: erp/devel/pi
Changeset: bc3a8a312111b41aa2ea892d037662651bae1c9c
Author: Guillermo Gil <guillermo.gil <at> openbravo.com>
Date: Mon Jun 02 15:37:09 2014 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/bc3a8a312111b41aa2ea892d037662651bae1c9c [^]

Fixed issue 26761: Clean code on parameter windows

Removed for loop that look for errors since that functionality is implemented on validators structure

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-parameter-window-view.js
---
(0067718)
AugustoMauch (manager)
2014-06-03 17:24

Code reviewed and verified in pi@9e9cdee21888
(0067866)
hudsonbot (developer)
2014-06-10 22:23

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/763f16c2ad2e [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2014-06-02 13:37 guillermogil New Issue
2014-06-02 13:37 guillermogil Assigned To => guillermogil
2014-06-02 13:37 guillermogil Modules => Core
2014-06-02 13:37 guillermogil Triggers an Emergency Pack => No
2014-06-02 15:29 guillermogil Issue Monitored: AugustoMauch
2014-06-02 15:30 guillermogil Review Assigned To => AugustoMauch
2014-06-02 15:38 hgbot Checkin
2014-06-02 15:38 hgbot Note Added: 0067673
2014-06-02 15:38 hgbot Status new => resolved
2014-06-02 15:38 hgbot Resolution open => fixed
2014-06-02 15:38 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/bc3a8a312111b41aa2ea892d037662651bae1c9c [^]
2014-06-03 17:24 AugustoMauch Note Added: 0067718
2014-06-03 17:24 AugustoMauch Status resolved => closed
2014-06-10 22:23 hudsonbot Checkin
2014-06-10 22:23 hudsonbot Note Added: 0067866


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker