commit e3c9f6a7de271ca92b1b01c6a97bc1edc8bf50a3
parent 71dd507118c8e558e2ca7be3a7aeb10e253d32d3
Author: Felicitus <felicitus@felicitus.org>
Date: Sat, 28 Nov 2015 16:16:44 +0100
Added manufacturer part number filter, fixes #489
Diffstat:
1 file changed, 16 insertions(+), 0 deletions(-)
diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartFilterPanel.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartFilterPanel.js
@@ -35,6 +35,7 @@ Ext.define('PartKeepr.PartFilterPanel', {
stockFilter: null,
partsWithoutPrice: null,
distributorOrderNumberFilter: null,
+ manufacturerPartNumberFilter: null,
createDateField: null,
createDateFilterSelect: null,
createDateFilter: null,
@@ -91,6 +92,7 @@ Ext.define('PartKeepr.PartFilterPanel', {
this.distributorOrderNumberFilter,
this.distributorFilter,
this.manufacturerFilter,
+ this.manufacturerPartNumberFilter,
this.footprintFilter,
this.statusFilter,
this.conditionFilter,
@@ -161,6 +163,7 @@ Ext.define('PartKeepr.PartFilterPanel', {
this.categoryFilter.setValue({category: 'all'});
this.stockFilter.setValue({stock: 'any'});
this.distributorOrderNumberFilter.setValue("");
+ this.manufacturerPartNumberFilter.setValue("");
this.createDateFilterSelect.setValue("");
this.createDateField.setValue("");
@@ -280,6 +283,11 @@ Ext.define('PartKeepr.PartFilterPanel', {
anchor: '100%'
});
+ this.manufacturerPartNumberFilter = Ext.create("Ext.form.field.Text", {
+ fieldLabel: i18n("Manufacturer Part Number"),
+ anchor: '100%'
+ });
+
this.createDateField = Ext.create("Ext.form.field.Date", {
flex: 1
});
@@ -534,6 +542,14 @@ Ext.define('PartKeepr.PartFilterPanel', {
}));
}
+ if (this.manufacturerPartNumberFilter.getValue() !== "") {
+ filters.push(Ext.create("Ext.util.Filter", {
+ property: 'manufacturers.partNumber',
+ operator: "LIKE",
+ value: "%" + this.manufacturerPartNumberFilter.getValue() + "%"
+ }));
+ }
+
if (this.distributorFilterCheckbox.getValue() === true) {
filters.push(Ext.create("Ext.util.Filter", {
property: 'distributors.distributor',