partkeepr

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

commit b3d6345c21dc2b0047bd3a6fb902a962328399dc
parent 7d50640b0662d8eafd3418e940d61ef4eb65aa3c
Author: Felicitus <felicitus@felicitus.org>
Date:   Tue,  1 May 2012 21:05:58 +0200

Added internal part number, fixes #156

Diffstat:
Msrc/backend/de/RaumZeitLabor/PartKeepr/Part/Part.php | 28+++++++++++++++++++++++++++-
Msrc/frontend/js/Components/Part/Editor/PartEditor.js | 4++++
Msrc/frontend/js/Models/Part.js | 1+
3 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/src/backend/de/RaumZeitLabor/PartKeepr/Part/Part.php b/src/backend/de/RaumZeitLabor/PartKeepr/Part/Part.php @@ -156,6 +156,13 @@ class Part extends BaseEntity implements Serializable, Deserializable { **/ private $projects; + /** + * The internal part number + * @Column(type="string",nullable=true) + * @var string + */ + private $internalPartNumber; + public function __construct () { $this->distributors = new \Doctrine\Common\Collections\ArrayCollection(); $this->manufacturers = new \Doctrine\Common\Collections\ArrayCollection(); @@ -183,6 +190,22 @@ class Part extends BaseEntity implements Serializable, Deserializable { } /** + * Sets the internal part number for this part + * @param string $partnumber + */ + public function setInternalPartNumber ($partNumber) { + $this->internalPartNumber = $partNumber; + } + + /** + * Returns the internal part number for this part + * @return string the internal part number + */ + public function getInternalPartNumber () { + return $this->internalPartNumber; + } + + /** * Sets the part unit * * @param PartUnit $partUnit The part unit object to set @@ -444,7 +467,7 @@ class Part extends BaseEntity implements Serializable, Deserializable { "parameters" => $this->serializeChildren($this->getParameters()), "createDate" => $this->getCreateDate()->format("Y-m-d H:i:s"), "needsReview" => $this->getReviewFlag(), - + "internalPartNumber" => $this->getInternalPartNumber(), // Additional things we serialize to make displaying stuff in the frontend easier "categoryName" => is_object($this->category) ? $this->category->getName() : null, "footprintName" => is_object($this->footprint) ? $this->footprint->getName() : null, @@ -465,6 +488,9 @@ class Part extends BaseEntity implements Serializable, Deserializable { case "comment": $this->setComment($value); break; + case "internalPartNumber": + $this->setInternalPartNumber($value); + break; case "footprint": try { $footprint = Footprint::loadById($value); diff --git a/src/frontend/js/Components/Part/Editor/PartEditor.js b/src/frontend/js/Components/Part/Editor/PartEditor.js @@ -93,6 +93,10 @@ Ext.define('PartKeepr.PartEditor', { fieldLabel: '', boxLabel: i18n("Needs Review"), name: 'needsReview' + },{ + xtype: 'textfield', + fieldLabel: i18n("Internal Part Number"), + name: 'internalPartNumber' }]; // Creates the distributor grid diff --git a/src/frontend/js/Models/Part.js b/src/frontend/js/Models/Part.js @@ -26,6 +26,7 @@ Ext.define("PartKeepr.Part", { { name: 'categoryName', type: 'string'}, { name: 'categoryPath', type: 'string'}, { name: 'projects', type: 'string'}, + { name: 'internalPartNumber', type: 'string'}, { name: 'attachmentCount', type: 'int'}, { name: 'partUnitDefault',