commit e9c8dff944314a56185a11fee7a04dc97d1c5973
parent 38e09982db6a3bb9447ec44008cc987f14655fdc
Author: Felicitus <felicitus@felicitus.org>
Date: Fri, 30 Jan 2015 12:16:15 +0100
Merge branch 'master' of github.com:partkeepr/PartKeepr
Diffstat:
3 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/documentation/developer/INSTALL-UBUNTU b/documentation/developer/INSTALL-UBUNTU
@@ -1,6 +1,8 @@
Step-by-Step Guide for Ubuntu
=============================
+IF YOU SIMPLY WANT TO USE PARTKEEPR AND NOT DEVELOPING, DOWNLOAD A RELEASE FROM http://www.partkeepr.org/download/ INSTEAD!
+
This guide explains how to setup your workstation so that you can develop using PartKeepr.
Tested with:
@@ -53,6 +55,20 @@ pear install --alldeps phpmd/PHP_PMD-alpha
# You'll also need jsl, the JavaScript lint
# Unfortunately, you need to compile this manually.
+
+#jslint installation process
+
+sudo apt-get install nodejs
+sudo apt-get install npm
+npm config set registry http://registry.npmjs.org/
+Install node-jslint. either globally:
+
+sudo npm install -g jslint
+or locally, and include it in $PATH:
+
+npm install jslint
+
+
------------------
# PARTKEEPR CONFIG
------------------
diff --git a/src/backend/PartKeepr/Part/Part.php b/src/backend/PartKeepr/Part/Part.php
@@ -437,7 +437,10 @@ class Part extends BaseEntity implements Serializable, Deserializable {
$query = PartKeepr::getEM()->createQuery("SELECT SUM(s.stockLevel) FROM PartKeepr\Stock\StockEntry s WHERE s.part = :part");
$query->setParameter("part", $this);
- return $query->getSingleScalarResult();
+ $count = $query->getSingleScalarResult();
+ if ($count == null)
+ $count = 0;
+ return $count;
}
/**
diff --git a/src/frontend/js/Components/Part/Editor/PartParameterGrid.js b/src/frontend/js/Components/Part/Editor/PartParameterGrid.js
@@ -63,7 +63,8 @@ Ext.define('PartKeepr.PartParameterGrid', {
renderer: function (val,p,rec) {
if (!Ext.isObject(val)) { return ""; }
- var foundRec = PartKeepr.getApplication().getUnitStore().findRecord("id", rec.get("unit_id"));
+ var unitStore = PartKeepr.getApplication().getUnitStore();
+ var foundRec = unitStore.findRecord("id", rec.get("unit_id"), 0, false, false, true);
if (foundRec) {
return val.value + " "+val.symbol + foundRec.get("symbol");
@@ -147,4 +148,4 @@ Ext.define('PartKeepr.PartParameterGrid', {
e.record.set("siprefix_id", f.siprefix_id);
e.record.set("value", f.value);
}
-});-
\ No newline at end of file
+});