partkeepr

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

commit 4ada57abb18f8eb66bf913c948fd6464f9a89545
parent d551e66219771230860b2e5b4177c652813b9d54
Author: Timo A. Hummel <timo@netraver.de>
Date:   Mon,  6 Jun 2011 23:46:13 +0200

Allow preset part unit (Pieces)

Diffstat:
Mfrontend/js/PartDB2.js | 6+++++-
Msrc/de/RaumZeitLabor/PartDB2/Part/PartManager.php | 2+-
2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/frontend/js/PartDB2.js b/frontend/js/PartDB2.js @@ -87,7 +87,11 @@ Ext.application({ this.footprintStore.load(); this.manufacturerStore.load(); this.distributorStore.load(); - this.partUnitStore.load(); + this.partUnitStore.load({ + callback: function (records, operation, success) { + this.insert(0, { id: null, name: i18n("Pieces"), shortName: i18n("pcs")}); + } + }); Ext.defer(PartDB2.getApplication().reloadStores, 100000, this); }, createLayout: function () { diff --git a/src/de/RaumZeitLabor/PartDB2/Part/PartManager.php b/src/de/RaumZeitLabor/PartDB2/Part/PartManager.php @@ -176,7 +176,7 @@ class PartManager extends Singleton { } if (array_key_exists("partUnit", $aParameters)) { - if ($aParameters["partUnit"] === null) { + if ($aParameters["partUnit"] === null || $aParameters["partUnit"] === 0) { $part->setPartUnit(null); } else { $part->setPartUnit(PartUnitManager::getInstance()->getPartUnit($aParameters["partUnit"]));