Thu, 07 Feb 2019 15:35:32 +0100
Adjusted the monitor fermentation spinner behaviour.
14 | 1 | /***************************************************************************** |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
2 | * Copyright (C) 2014-2019 |
14 | 3 | * |
4 | * Michiel Broek <mbroek at mbse dot eu> | |
5 | * | |
6 | * This file is part of BrewCloud | |
7 | * | |
8 | * This is free software; you can redistribute it and/or modify it | |
9 | * under the terms of the GNU General Public License as published by the | |
10 | * Free Software Foundation; either version 2, or (at your option) any | |
11 | * later version. | |
12 | * | |
13 | * BrewCloud is distributed in the hope that it will be useful, but | |
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 | * General Public License for more details. | |
17 | * | |
18 | * You should have received a copy of the GNU General Public License | |
19 | * along with ThermFerm; see the file COPYING. If not, write to the Free | |
20 | * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | |
21 | *****************************************************************************/ | |
22 | ||
23 | ||
24 | function createDelElements() { | |
25 | $('#eventWindow').jqxWindow({ | |
26 | theme: theme, | |
27 | position: { x: 490, y: 210 }, | |
28 | width: 300, | |
34 | 29 | height: 175, |
14 | 30 | resizable: false, |
31 | isModal: true, | |
32 | modalOpacity: 0.4, | |
33 | okButton: $('#delOk'), | |
34 | cancelButton: $('#delCancel'), | |
35 | initContent: function () { | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
36 | $('#delOk').jqxButton({ template: "danger", width: '65px', theme: theme }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
37 | $('#delCancel').jqxButton({ template: "success", width: '65px', theme: theme }); |
14 | 38 | $('#delCancel').focus(); |
39 | } | |
40 | }); | |
41 | $('#eventWindow').jqxWindow('hide'); | |
42 | } | |
43 | ||
44 | ||
45 | $(document).ready(function () { | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
46 | |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
47 | var dataRecord = {}; |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
48 | |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
49 | function calcTotal() { |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
50 | |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
51 | $('#totval').val(dataRecord.cost * dataRecord.inventory); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
52 | if (dataRecord.form == 0) { // Liquid |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
53 | $("#pmpt_cost").html('Prijs per pak:'); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
54 | $("#pmpt_inventory").html('Voorraad pak(ken):'); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
55 | $("#pmpt_cells").html('Biljoen cellen per pak:'); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
56 | $("#inventory").jqxNumberInput({ decimalDigits: 0, spinButtonsStep: 1 }); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
57 | } else if (dataRecord.form == 1) { // Dry |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
58 | $("#pmpt_cost").html('Prijs per kg:'); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
59 | $("#pmpt_inventory").html('Voorraad gram:'); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
60 | $("#pmpt_cells").html('Biljoen cellen per gram:'); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
61 | $("#inventory").jqxNumberInput({ decimalDigits: 1, spinButtonsStep: 0.5 }); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
62 | } else { |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
63 | $("#pmpt_cost").html('Prijs per liter:'); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
64 | $("#pmpt_inventory").html('Voorraad ml:'); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
65 | $("#pmpt_cells").html('Biljoen cellen per ml:'); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
66 | $("#inventory").jqxNumberInput({ decimalDigits: 1, spinButtonsStep: 0.5 }); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
67 | } |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
68 | } |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
69 | |
14 | 70 | var url = "includes/db_inventory_yeasts.php"; |
71 | // prepare the data | |
72 | var source = { | |
73 | datatype: "json", | |
74 | cache: false, | |
75 | datafields: [ | |
76 | { name: 'record', type: 'number' }, | |
77 | { name: 'name', type: 'string' }, | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
78 | { name: 'type', type: 'int' }, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
79 | { name: 'form', type: 'int' }, |
14 | 80 | { name: 'laboratory', type: 'string' }, |
81 | { name: 'product_id', type: 'string' }, | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
82 | { name: 'min_temperature', type: 'float' }, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
83 | { name: 'max_temperature', type: 'float' }, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
84 | { name: 'flocculation', type: 'int' }, |
14 | 85 | { name: 'attenuation', type: 'float' }, |
86 | { name: 'notes', type: 'string' }, | |
87 | { name: 'best_for', type: 'string' }, | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
88 | { name: 'max_reuse', type: 'int' }, |
14 | 89 | { name: 'inventory', type: 'float' }, |
90 | { name: 'cost', type: 'float' }, | |
91 | { name: 'production_date', type: 'string' }, | |
200
7b2f11652d67
Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents:
198
diff
changeset
|
92 | { name: 'tht_date', type: 'string' }, |
7b2f11652d67
Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents:
198
diff
changeset
|
93 | { name: 'cells', type: 'float' } |
14 | 94 | ], |
95 | id: 'record', | |
96 | url: url, | |
97 | deleterow: function (rowid, commit) { | |
98 | // synchronize with the server - send delete command | |
99 | var data = "delete=true&" + $.param({ record: rowid }); | |
100 | $.ajax({ | |
101 | dataType: 'json', | |
102 | url: url, | |
103 | cache: false, | |
104 | data: data, | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
105 | type: "POST", |
14 | 106 | success: function (data, status, xhr) { |
107 | // delete command is executed. | |
108 | commit(true); | |
109 | }, | |
110 | error: function (jqXHR, textStatus, errorThrown) { | |
111 | commit(false); | |
112 | } | |
113 | }); | |
114 | }, | |
115 | addrow: function (rowid, rowdata, position, commit) { | |
116 | var data = "insert=true&" + $.param(rowdata); | |
117 | $.ajax({ | |
118 | dataType: 'json', | |
119 | url: url, | |
120 | cache: false, | |
121 | data: data, | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
122 | type: "POST", |
14 | 123 | success: function (data, status, xhr) { |
124 | commit(true); | |
125 | }, | |
126 | error: function(jqXHR, textStatus, errorThrown) { | |
127 | commit(false); | |
128 | } | |
129 | }); | |
130 | }, | |
131 | updaterow: function (rowid, rowdata, commit) { | |
132 | var data = "update=true&" + $.param(rowdata); | |
133 | $.ajax({ | |
134 | dataType: 'json', | |
135 | url: url, | |
136 | cache: false, | |
137 | data: data, | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
138 | type: "POST", |
14 | 139 | success: function (data, status, xhr) { |
140 | // update command is executed. | |
141 | commit(true); | |
142 | }, | |
143 | error: function(jqXHR, textStatus, errorThrown) { | |
144 | commit(false); | |
145 | } | |
146 | }); | |
147 | } | |
148 | }; | |
149 | // initialize the input fields. | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
150 | $("#name").jqxInput({ theme: theme, width: 640, height: 23 }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
151 | $("#laboratory").jqxInput({ theme: theme, width: 320, height: 23 }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
152 | $("#product_id").jqxInput({ theme: theme, width: 320, height: 23 }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
153 | $("#type").jqxDropDownList({ |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
154 | theme: theme, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
155 | source: YeastTypeAdapter, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
156 | valueMember: 'id', |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
157 | displayMember: 'nl', |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
158 | width: 180, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
159 | height: 23, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
160 | autoDropDownHeight: true |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
161 | }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
162 | $("#form").jqxDropDownList({ |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
163 | theme: theme, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
164 | source: YeastFormAdapter, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
165 | valueMember: 'id', |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
166 | displayMember: 'nl', |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
167 | selectedIndex: 0, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
168 | width: 180, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
169 | height: 23, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
170 | autoDropDownHeight: true |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
171 | }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
172 | $("#notes").jqxInput({ theme: theme, width: 800, height: 120 }); |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
173 | $("#best_for").jqxInput({ theme: theme, width: 320, height: 75 }); |
245
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
201
diff
changeset
|
174 | $("#inventory").jqxNumberInput( Spin1dec ); |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
175 | $("#production_date").jqxDateTimeInput( Dateopts ); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
176 | $("#min_temperature").jqxNumberInput( YeastT ); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
177 | $("#max_temperature").jqxNumberInput( YeastT ); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
178 | $("#flocculation").jqxDropDownList({ |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
179 | theme: theme, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
180 | source: FlocculationAdapter, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
181 | valueMember: 'id', |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
182 | displayMember: 'nl', |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
183 | width: 180, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
184 | height: 23, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
185 | autoDropDownHeight: true |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
186 | }); |
245
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
201
diff
changeset
|
187 | $("#attenuation").jqxNumberInput( Perc1dec ); |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
188 | $("#max_reuse").jqxNumberInput( PosInt ); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
189 | $("#max_reuse").jqxNumberInput({ max: 10 }); |
245
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
201
diff
changeset
|
190 | $("#cost").jqxNumberInput( Spin2dec ); |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
191 | $("#tht_date").jqxDateTimeInput( Dateopts ); |
245
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
201
diff
changeset
|
192 | $("#totval").jqxNumberInput( Spin2dec ); |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
193 | $("#totval").jqxNumberInput({ width: 90, readOnly: true, spinButtons: false }); |
245
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
201
diff
changeset
|
194 | $("#cells").jqxNumberInput( Spin1dec ); |
14 | 195 | |
196 | var dataAdapter = new $.jqx.dataAdapter(source); | |
197 | var editrow = -1; | |
198 | // initialize jqxGrid | |
199 | $("#jqxgrid").jqxGrid({ | |
200 | width: 1280, | |
201 | height: 630, | |
202 | source: dataAdapter, | |
203 | theme: theme, | |
204 | showstatusbar: true, | |
205 | localization: getLocalization(), | |
206 | renderstatusbar: function (statusbar) { | |
207 | var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); | |
34 | 208 | var addButton = $("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Nieuw</span></div>"); |
14 | 209 | container.append(addButton); |
210 | statusbar.append(container); | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
211 | addButton.jqxButton({ theme: theme, width: 90, height: 20 }); |
14 | 212 | // add new row. |
213 | addButton.click(function (event) { | |
214 | editrow = -1; | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
215 | $("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } }); |
14 | 216 | $("#name").val(''); |
217 | $("#laboratory").val(''); | |
218 | $("#product_id").val(''); | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
219 | $("#type").val(0); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
220 | $("#form").val(0); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
221 | $("#min_temperature").val(18); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
222 | $("#max_temperature").val(22); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
223 | $("#flocculation").val(0); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
224 | $("#attenuation").val(77); |
14 | 225 | $("#notes").val(''); |
226 | $("#best_for").val(''); | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
227 | $("#max_reuse").val(10); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
228 | $("#inventory").val(0); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
229 | $("#cost").val(0); |
14 | 230 | $("#production_date").val(''); |
231 | $("#tht_date").val(''); | |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
232 | $("#cells").val(1); |
14 | 233 | $("#popupWindow").jqxWindow('open'); |
234 | }); | |
235 | }, | |
236 | filterable: true, | |
237 | filtermode: 'excel', | |
238 | columns: [ | |
239 | { text: 'Laboratorium', datafield: 'laboratory', width: 150 }, | |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
240 | { text: 'Product ID', datafield: 'product_id', width: 120, menu: false }, |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
241 | { text: 'Gist naam', datafield: 'name', menu: false }, |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
242 | { text: 'Type', datafield: 'type', align: 'center', cellsalign: 'center', menu: false, width: 110, |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
243 | cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
244 | return "<div style='margin: 4px;' class='jqx-center-align'>" + YeastTypeData[value].nl + "</div>"; |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
245 | } |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
246 | }, |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
247 | { text: 'Vorm', datafield: 'form', align: 'center', cellsalign: 'center', menu: false, width: 110, |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
248 | cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
249 | return "<div style='margin: 4px;' class='jqx-center-align'>" + YeastFormData[value].nl + "</div>"; |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
250 | } |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
251 | }, |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
252 | { text: 'SVG', datafield: 'attenuation', width: 80, align: 'right', cellsalign: 'right', menu: false, cellsformat: 'p1' }, |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
253 | { text: 'Voorraad', datafield: 'inventory', width: 100, align: 'right', menu: false, cellsalign: 'right', |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
254 | cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
255 | if (value == 0) |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
256 | return "<div style='margin: 4px;' class='jqx-right-align'></div>"; |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
257 | if ((rowdata.form == 0) && (value > 1)) |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
258 | return "<div style='margin: 4px;' class='jqx-right-align'>"+dataAdapter.formatNumber(value,"f0")+" pakken</div>"; |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
259 | if (rowdata.form == 0) |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
260 | return "<div style='margin: 4px;' class='jqx-right-align'>"+dataAdapter.formatNumber(value,"f0")+" pak</div>"; |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
261 | if (rowdata.form == 1) |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
262 | return "<div style='margin: 4px;' class='jqx-right-align'>"+dataAdapter.formatNumber(value * 1000,"f1")+" gram</div>"; |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
263 | return "<div style='margin: 4px;' class='jqx-right-align'>"+dataAdapter.formatNumber(value * 1000,"f1")+" ml</div>"; |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
264 | } |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
265 | }, |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
266 | { text: 'Wijzig', datafield: 'Edit', columntype: 'button', width: 100, align: 'center', menu: false, cellsrenderer: function () { |
34 | 267 | return "Wijzig"; |
14 | 268 | }, buttonclick: function (row) { |
269 | // open the popup window when the user clicks a button. | |
270 | editrow = row; | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
271 | $("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } }); |
14 | 272 | // get the clicked row's data and initialize the input fields. |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
273 | dataRecord = $("#jqxgrid").jqxGrid('getrowdata', editrow); |
14 | 274 | $("#name").val(dataRecord.name); |
275 | $("#laboratory").val(dataRecord.laboratory); | |
276 | $("#product_id").val(dataRecord.product_id); | |
277 | $("#type").val(dataRecord.type); | |
278 | $("#form").val(dataRecord.form); | |
279 | $("#min_temperature").val(dataRecord.min_temperature); | |
280 | $("#max_temperature").val(dataRecord.max_temperature); | |
281 | $("#flocculation").val(dataRecord.flocculation); | |
282 | $("#attenuation").val(dataRecord.attenuation); | |
283 | $("#notes").val(dataRecord.notes); | |
284 | $("#best_for").val(dataRecord.best_for); | |
285 | $("#max_reuse").val(dataRecord.max_reuse); | |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
286 | if (dataRecord.form == 0) |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
287 | $("#inventory").val(dataRecord.inventory); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
288 | else |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
289 | $("#inventory").val(dataRecord.inventory * 1000); |
14 | 290 | $("#cost").val(dataRecord.cost); |
291 | $("#production_date").val(dataRecord.production_date); | |
292 | $("#tht_date").val(dataRecord.tht_date); | |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
293 | $("#cells").val(dataRecord.cells); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
294 | calcTotal(); |
14 | 295 | // show the popup window. |
296 | $("#popupWindow").jqxWindow('open'); | |
297 | } | |
298 | } | |
299 | ] | |
300 | }); | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
301 | |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
302 | $('#popupWindow').on('open', function (event) { calcTotal(); }); |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
303 | $("#cost").on('change', function (event) { |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
304 | dataRecord.cost = parseFloat(event.args.value); |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
305 | calcTotal(); |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
306 | }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
307 | $("#inventory").on('change', function (event) { |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
308 | if (dataRecord.form == 0) |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
309 | dataRecord.inventory = parseFloat(event.args.value); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
310 | else |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
311 | dataRecord.inventory = parseFloat(event.args.value) / 1000.0; |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
312 | calcTotal(); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
313 | }); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
314 | $("#form").on('select', function (event) { |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
315 | if (event.args) { |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
316 | dataRecord.form = event.args.index; |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
317 | calcTotal(); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
318 | } |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
319 | }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
320 | |
14 | 321 | // initialize the popup window and buttons. |
322 | $("#popupWindow").jqxWindow({ | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
323 | width: 1050, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
324 | height: 550, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
325 | resizable: false, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
326 | theme: theme, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
327 | isModal: true, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
328 | autoOpen: false, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
329 | cancelButton: $("#Cancel"), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
330 | modalOpacity: 0.40 |
14 | 331 | }); |
332 | $("#popupWindow").on('open', function () { | |
333 | $("#name").jqxInput('selectAll'); | |
334 | }); | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
335 | $("#Delete").jqxButton({ template: "danger", width: '90px', theme: theme }); |
14 | 336 | $("#Delete").click(function () { |
337 | if (editrow >= 0) { | |
338 | // Open a popup to confirm this action. | |
339 | $('#eventWindow').jqxWindow('open'); | |
340 | $("#delOk").click(function () { | |
341 | var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow); | |
342 | $("#jqxgrid").jqxGrid('deleterow', rowID); | |
343 | }); | |
344 | } | |
345 | $("#popupWindow").jqxWindow('hide'); | |
346 | }); | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
347 | $("#Cancel").jqxButton({ template: "primary", width: '90px', theme: theme }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
348 | $("#Save").jqxButton({ template: "success", width: '90px', theme: theme }); |
14 | 349 | // update the edited row when the user clicks the 'Save' button. |
350 | $("#Save").click(function () { | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
351 | var rowID = -1; |
14 | 352 | if (editrow >= 0) { |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
353 | rowID = $('#jqxgrid').jqxGrid('getrowid', editrow); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
354 | } |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
355 | if (dataRecord.form == 0) |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
356 | var n_inventory = parseFloat($("#inventory").jqxNumberInput('decimal')); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
357 | else |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
358 | var n_inventory = parseFloat($("#inventory").jqxNumberInput('decimal')) / 1000.0; |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
359 | var row = { |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
360 | record: rowID, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
361 | name: $("#name").val(), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
362 | type: $("#type").val(), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
363 | form: $("#form").val(), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
364 | laboratory: $("#laboratory").val(), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
365 | product_id: $("#product_id").val(), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
366 | min_temperature: parseInt($("#min_temperature").jqxNumberInput('decimal')), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
367 | max_temperature: parseInt($("#max_temperature").jqxNumberInput('decimal')), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
368 | flocculation: $("#flocculation").val(), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
369 | attenuation: parseFloat($("#attenuation").jqxNumberInput('decimal')), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
370 | notes: $("#notes").val(), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
371 | best_for: $("#best_for").val(), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
372 | max_reuse: parseInt($("#max_reuse").jqxNumberInput('decimal')), |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
373 | inventory: n_inventory, |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
374 | cost: parseFloat($("#cost").jqxNumberInput('decimal')), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
375 | production_date: $("#production_date").val(), |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
376 | tht_date: $("#tht_date").val(), |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
377 | cells: parseFloat($("#cells").jqxNumberInput('decimal')) |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
378 | }; |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
379 | if (editrow >= 0) { |
14 | 380 | $('#jqxgrid').jqxGrid('updaterow', rowID, row); |
381 | } else { | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
382 | $('#jqxgrid').jqxGrid('addrow', null, row); |
14 | 383 | } |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
384 | $("#popupWindow").jqxWindow('hide'); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
385 | location.reload( true ); // reload ourself. |
14 | 386 | }); |
387 | createDelElements(); | |
388 | }); | |
389 |