partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 4af27b8e5e7b6011e1dc6552c78a14146831b3b3
parent 33794d4f59a056eaf3b3c1b75340a60b31252eb3
Author: Felicitus <felicitus@felicitus.org>
Date:   Mon,  3 Aug 2015 16:54:41 +0200

Refactored get("id") to getId()

Diffstat:
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartsGrid.js | 8++++----
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartsManager.js | 15+++++++--------
2 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartsGrid.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartsGrid.js @@ -219,7 +219,7 @@ Ext.define('PartKeepr.PartsGrid', { onDoubleClick: function (view, record) { if (record) { - this.fireEvent("editPart", record.get("id")); + this.fireEvent("editPart", record.getId()); } }, /** @@ -493,7 +493,7 @@ Ext.define('PartKeepr.PartsGrid', { "Part", mode); call.setParameter("stock", quantity); - call.setParameter("part", e.record.get("id")); + call.setParameter("part", e.record.getId()); call.setHandler(Ext.bind(this.reloadPart, this, [e])); call.doCall(); }, @@ -502,7 +502,7 @@ Ext.define('PartKeepr.PartsGrid', { */ reloadPart: function (opts) { - this.loadPart(opts.record.get("id"), opts); + this.loadPart(opts.record.getId(), opts); }, /** * Load the part from the database. @@ -519,7 +519,7 @@ Ext.define('PartKeepr.PartsGrid', { */ onPartLoaded: function (record, opts) { - var rec = this.store.findRecord("id", record.get("id")); + var rec = this.store.findRecord("id", record.getId()); if (rec) { rec.set("stockLevel", record.get("stockLevel")); } diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartsManager.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartsManager.js @@ -240,7 +240,7 @@ Ext.define('PartKeepr.PartManager', { { var r = this.grid.getSelectionModel().getLastSelected(); - this.loadPart(r.get("id"), Ext.bind(this.createPartDuplicate, this)); + this.loadPart(r.getId(), Ext.bind(this.createPartDuplicate, this)); }, /** * Creates a full duplicate from the selected item. Loads the selected part and calls createPartDuplicate @@ -253,7 +253,7 @@ Ext.define('PartKeepr.PartManager', { { var r = this.grid.getSelectionModel().getLastSelected(); - this.loadPart(r.get("id"), Ext.bind(this.createFullPartDuplicate, this)); + this.loadPart(r.getId(), Ext.bind(this.createFullPartDuplicate, this)); }, /** * Creates a part duplicate from the given record and opens the editor window. @@ -309,7 +309,7 @@ Ext.define('PartKeepr.PartManager', { "deletePart"); call.setLoadMessage(sprintf(i18n("Deleting part %s"), r.get("name"))); - call.setParameter("part", r.get("id")); + call.setParameter("part", r.getId()); call.setHandler(Ext.bind(function () { this.store.load(); @@ -330,7 +330,7 @@ Ext.define('PartKeepr.PartManager', { var defaultPartUnit = PartKeepr.getApplication().getPartUnitStore().findRecord("default", true); - defaults.partUnit = defaultPartUnit.get("id"); + defaults.partUnit = defaultPartUnit.getId(); defaults.category = this.grid.currentCategory; record = Ext.create("PartKeepr.Part", defaults); @@ -363,7 +363,7 @@ Ext.define('PartKeepr.PartManager', { onPartSaved: function (record) { - var idx = this.grid.store.find("id", record.get("id")); + var idx = this.grid.store.find("id", record.getId()); // Only reload the grid if the edited record is contained if (idx !== -1) { @@ -389,7 +389,7 @@ Ext.define('PartKeepr.PartManager', { this.detailPanel.setActiveTab(this.detail); this.detailPanel.expand(); this.detail.setValues(r); - this.stockLevel.part = r.get("id"); + this.stockLevel.part = r.getId(); this.tree.syncButton.enable(); } else { @@ -406,9 +406,8 @@ Ext.define('PartKeepr.PartManager', { loadPart: function (id, handler) { // @todo we have this method duplicated in PartEditor - var model = Ext.ModelManager.getModel("PartKeepr.PartBundle.Entity.Part"); - model.load(id, { + PartKeepr.PartBundle.Entity.Part.load(id, { scope: this, success: handler });