Fri, 11 Oct 2019 11:44:37 +0200
Final style changes for the co2 meter screen.
12 | 1 | /***************************************************************************** |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
2 | * Copyright (C) 2014-2019 |
12 | 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, |
12 | 30 | resizable: false, |
31 | isModal: true, | |
32 | modalOpacity: 0.4, | |
33 | okButton: $('#delOk'), | |
34 | cancelButton: $('#delCancel'), | |
35 | initContent: function () { | |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
36 | $('#delOk').jqxButton({ template: "danger", width: '65px', theme: theme }); |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
37 | $('#delCancel').jqxButton({ template: "success", width: '65px', theme: theme }); |
12 | 38 | $('#delCancel').focus(); |
39 | } | |
40 | }); | |
41 | $('#eventWindow').jqxWindow('hide'); | |
42 | } | |
43 | ||
44 | ||
45 | $(document).ready(function () { | |
199
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
46 | |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
47 | function calcTotal(cost, inventory) { |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
48 | |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
49 | $('#totval').val(cost * (inventory / 1000)); |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
50 | } |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
51 | |
488
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
395
diff
changeset
|
52 | var dataRecord = {}, |
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
395
diff
changeset
|
53 | url = 'includes/db_inventory_hops.php', |
12 | 54 | // prepare the data |
488
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
395
diff
changeset
|
55 | source = { |
12 | 56 | datatype: "json", |
57 | cache: false, | |
58 | datafields: [ | |
59 | { name: 'record', type: 'number' }, | |
60 | { name: 'name', type: 'string' }, | |
61 | { name: 'alpha', type: 'float' }, | |
62 | { name: 'beta', type: 'float' }, | |
63 | { name: 'humulene', type: 'float' }, | |
64 | { name: 'caryophyllene', type: 'float' }, | |
65 | { name: 'cohumulone', type: 'float' }, | |
66 | { name: 'myrcene', type: 'float' }, | |
13 | 67 | { name: 'hsi', type: 'float' }, |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
68 | { name: 'type', type: 'int' }, |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
69 | { name: 'form', type: 'int' }, |
12 | 70 | { name: 'notes', type: 'string' }, |
71 | { name: 'origin', type: 'string' }, | |
72 | { name: 'substitutes', type: 'string' }, | |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
73 | { name: 'always_on_stock', type: 'int' }, |
12 | 74 | { name: 'inventory', type: 'float' }, |
75 | { name: 'cost', type: 'float' }, | |
76 | { name: 'production_date', type: 'string' }, | |
77 | { name: 'tht_date', type: 'string' }, | |
13 | 78 | { name: 'total_oil', type: 'float' } |
12 | 79 | ], |
80 | id: 'record', | |
81 | url: url, | |
82 | deleterow: function (rowid, commit) { | |
83 | // synchronize with the server - send delete command | |
84 | var data = "delete=true&" + $.param({ record: rowid }); | |
85 | $.ajax({ | |
86 | dataType: 'json', | |
87 | url: url, | |
88 | cache: false, | |
89 | data: data, | |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
90 | type: "POST", |
12 | 91 | success: function (data, status, xhr) { |
92 | commit(true); | |
488
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
395
diff
changeset
|
93 | location.reload( true ); |
12 | 94 | }, |
95 | error: function (jqXHR, textStatus, errorThrown) { | |
96 | commit(false); | |
97 | } | |
98 | }); | |
99 | }, | |
100 | addrow: function (rowid, rowdata, position, commit) { | |
101 | var data = "insert=true&" + $.param(rowdata); | |
102 | $.ajax({ | |
103 | dataType: 'json', | |
104 | url: url, | |
105 | cache: false, | |
106 | data: data, | |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
107 | type: "POST", |
12 | 108 | success: function (data, status, xhr) { |
109 | commit(true); | |
488
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
395
diff
changeset
|
110 | location.reload( true ); |
12 | 111 | }, |
112 | error: function(jqXHR, textStatus, errorThrown) { | |
113 | commit(false); | |
114 | } | |
115 | }); | |
116 | }, | |
117 | updaterow: function (rowid, rowdata, commit) { | |
118 | var data = "update=true&" + $.param(rowdata); | |
119 | $.ajax({ | |
120 | dataType: 'json', | |
121 | url: url, | |
122 | cache: false, | |
123 | data: data, | |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
124 | type: "POST", |
12 | 125 | success: function (data, status, xhr) { |
126 | commit(true); | |
488
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
395
diff
changeset
|
127 | location.reload( true ); |
12 | 128 | }, |
129 | error: function(jqXHR, textStatus, errorThrown) { | |
130 | commit(false); | |
131 | } | |
132 | }); | |
133 | } | |
488
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
395
diff
changeset
|
134 | }, |
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
395
diff
changeset
|
135 | dataAdapter = new $.jqx.dataAdapter(source), |
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
395
diff
changeset
|
136 | editrow = -1; |
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
395
diff
changeset
|
137 | |
12 | 138 | // initialize the input fields. |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
139 | $("#name").jqxInput({ theme: theme, width: 640, height: 23 }); |
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:
203
diff
changeset
|
140 | $("#alpha").jqxNumberInput( Perc1dec ); |
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:
203
diff
changeset
|
141 | $("#beta").jqxNumberInput( Perc1dec ); |
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:
203
diff
changeset
|
142 | $("#humulene").jqxNumberInput( Perc1dec ); |
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:
203
diff
changeset
|
143 | $("#caryophyllene").jqxNumberInput( Perc1dec ); |
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:
203
diff
changeset
|
144 | $("#cohumulone").jqxNumberInput( Perc1dec ); |
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:
203
diff
changeset
|
145 | $("#myrcene").jqxNumberInput( Perc1dec ); |
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:
203
diff
changeset
|
146 | $("#hsi").jqxNumberInput( Perc1dec ); |
12 | 147 | |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
148 | $("#type").jqxDropDownList({ |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
149 | theme: theme, |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
150 | source: HopTypeAdapter, |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
151 | valueMember: 'id', |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
152 | displayMember: 'nl', |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
153 | width: 150, |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
154 | height: 23, |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
155 | autoDropDownHeight: true |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
156 | }); |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
157 | $("#form").jqxDropDownList({ |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
158 | theme: theme, |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
159 | source: HopFormAdapter, |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
160 | valueMember: 'id', |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
161 | displayMember: 'nl', |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
162 | width: 150, |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
163 | height: 23, |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
164 | autoDropDownHeight: true |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
165 | }); |
13 | 166 | $("#notes").jqxInput({ theme: theme, width: 640, height: 100 }); |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
167 | $("#origin").jqxInput({ theme: theme, width: 320, height: 23 }); |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
168 | $("#substitutes").jqxInput({ theme: theme, width: 320, height: 23 }); |
12 | 169 | $("#always_on_stock").jqxCheckBox({ theme: theme, width: 120, height: 23 }); |
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:
203
diff
changeset
|
170 | $("#inventory").jqxNumberInput( Spin1dec ); |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
171 | $("#production_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:
203
diff
changeset
|
172 | $("#cost").jqxNumberInput( Spin2dec ); |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
173 | $("#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:
203
diff
changeset
|
174 | $("#total_oil").jqxNumberInput( Perc1dec ); |
269 | 175 | $("#totval").jqxNumberInput( Show2dec ); |
199
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
176 | |
12 | 177 | // initialize jqxGrid |
178 | $("#jqxgrid").jqxGrid({ | |
179 | width: 1280, | |
180 | height: 630, | |
181 | source: dataAdapter, | |
182 | theme: theme, | |
183 | showstatusbar: true, | |
184 | renderstatusbar: function (statusbar) { | |
488
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
395
diff
changeset
|
185 | var container, addButton, impButton; |
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
395
diff
changeset
|
186 | container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); |
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
395
diff
changeset
|
187 | 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>"); |
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
395
diff
changeset
|
188 | impButton = $("<div style='float: right; margin-right: 50px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Import</span></div>"); |
12 | 189 | container.append(addButton); |
311
f6fafccd8a6d
Added xml import for fermentables, hops, miscs, yeasts and styles. Fixed update IBU calculation in the editor hop popups.
Michiel Broek <mbroek@mbse.eu>
parents:
286
diff
changeset
|
190 | container.append(impButton); |
12 | 191 | statusbar.append(container); |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
192 | addButton.jqxButton({ theme: theme, width: 90, height: 20 }); |
311
f6fafccd8a6d
Added xml import for fermentables, hops, miscs, yeasts and styles. Fixed update IBU calculation in the editor hop popups.
Michiel Broek <mbroek@mbse.eu>
parents:
286
diff
changeset
|
193 | impButton.jqxButton({ theme: theme, width: 90, height: 20 }); |
12 | 194 | // add new row. |
195 | addButton.click(function (event) { | |
196 | editrow = -1; | |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
197 | $("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } }); |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
198 | $("#name").val('Nieuwe hop'); |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
199 | $("#alpha").val(0); |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
200 | $("#beta").val(0); |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
201 | $("#humulene").val(0); |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
202 | $("#caryophyllene").val(0); |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
203 | $("#cohumulone").val(0); |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
204 | $("#myrcene").val(0); |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
205 | $("#hsi").val(0); |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
206 | $("#type").val(0); |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
207 | $("#form").val(0); |
12 | 208 | $("#notes").val(''); |
209 | $("#origin").val(''); | |
210 | $("#substitutes").val(''); | |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
211 | $("#always_on_stock").val(0); |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
212 | $("#inventory").val(0); |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
213 | $("#cost").val(0); |
12 | 214 | $("#production_date").val(''); |
215 | $("#tht_date").val(''); | |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
216 | $("#total_oil").val(0); |
12 | 217 | $("#popupWindow").jqxWindow('open'); |
218 | }); | |
311
f6fafccd8a6d
Added xml import for fermentables, hops, miscs, yeasts and styles. Fixed update IBU calculation in the editor hop popups.
Michiel Broek <mbroek@mbse.eu>
parents:
286
diff
changeset
|
219 | impButton.click(function (event) { |
488
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
395
diff
changeset
|
220 | window.location.href = 'import_ingredients.php?select=hops'; |
311
f6fafccd8a6d
Added xml import for fermentables, hops, miscs, yeasts and styles. Fixed update IBU calculation in the editor hop popups.
Michiel Broek <mbroek@mbse.eu>
parents:
286
diff
changeset
|
221 | }); |
12 | 222 | }, |
223 | filterable: true, | |
224 | filtermode: 'excel', | |
225 | columns: [ | |
203
e29b53962cd1
Hops inventory disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
226 | { text: 'Herkomst', datafield: 'origin', width: 150 }, |
e29b53962cd1
Hops inventory disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
227 | { text: 'Hop Naam', datafield: 'name', menu: false }, |
286
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
284
diff
changeset
|
228 | { text: 'Soort', datafield: 'type', align: 'left', menu: false, width: 90, |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
229 | cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
286
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
284
diff
changeset
|
230 | return '<span style="margin: 4px; margin-top: 6px; float: left;">' + HopTypeData[value].nl + '</span>'; |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
231 | } |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
232 | }, |
286
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
284
diff
changeset
|
233 | { text: 'Vorm', datafield: 'form', align: 'left', menu: false, width: 90, |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
234 | cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
286
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
284
diff
changeset
|
235 | return '<span style="margin: 4px; margin-top: 6px; float: left;">' + HopFormData[value].nl + '</span>'; |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
236 | } |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
237 | }, |
203
e29b53962cd1
Hops inventory disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
238 | { text: 'Alpha %', datafield: 'alpha', width: 80, align: 'right', cellsalign: 'right', menu: false, cellsformat: 'p1' }, |
e29b53962cd1
Hops inventory disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
239 | { text: 'Beta %', datafield: 'beta', width: 80, align: 'right', cellsalign: 'right', menu: false, cellsformat: 'p1' }, |
e29b53962cd1
Hops inventory disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
240 | { text: 'Cohumuloon %%', datafield: 'cohumulone', width: 80, align: 'right', cellsalign: 'right', menu: false, cellsformat: 'p1' }, |
e29b53962cd1
Hops inventory disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
241 | { text: 'HSI', datafield: 'hsi', width: 60, align: 'right', cellsalign: 'right', menu: false, cellsformat: 'f1' }, |
e29b53962cd1
Hops inventory disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
242 | { text: 'Oogst datum', datafield: 'production_date', align: 'center', cellsalign: 'center', menu: false, width: 110 }, |
e29b53962cd1
Hops inventory disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
243 | { text: 'Voorraad', datafield: 'inventory', width: 100, align: 'right', cellsalign: 'right', menu: false, cellsformat: 'f1', |
e29b53962cd1
Hops inventory disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
244 | cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
286
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
284
diff
changeset
|
245 | var amount = ""; |
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
284
diff
changeset
|
246 | if (value > 0) { |
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
284
diff
changeset
|
247 | if (value < 1000) |
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
284
diff
changeset
|
248 | amount = dataAdapter.formatNumber(value,"f1")+" gr"; |
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
284
diff
changeset
|
249 | else |
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
284
diff
changeset
|
250 | amount = dataAdapter.formatNumber(value / 1000.0,"f1")+" kg"; |
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
284
diff
changeset
|
251 | } |
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
284
diff
changeset
|
252 | return '<span style="margin: 4px; margin-top: 6px; float: right;">' + amount + '</span>'; |
203
e29b53962cd1
Hops inventory disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
253 | } |
e29b53962cd1
Hops inventory disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
254 | }, |
488
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
395
diff
changeset
|
255 | { text: '', datafield: 'Wijzig', columntype: 'button', width: 100, align: 'center', menu: false, |
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
395
diff
changeset
|
256 | cellsrenderer: function () { |
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
395
diff
changeset
|
257 | return "Wijzig"; |
12 | 258 | }, buttonclick: function (row) { |
259 | // open the popup window when the user clicks a button. | |
260 | editrow = row; | |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
261 | $("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } }); |
12 | 262 | // get the clicked row's data and initialize the input fields. |
199
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
263 | dataRecord = $("#jqxgrid").jqxGrid('getrowdata', editrow); |
12 | 264 | $("#name").val(dataRecord.name); |
265 | $("#alpha").val(dataRecord.alpha); | |
266 | $("#beta").val(dataRecord.beta); | |
267 | $("#humulene").val(dataRecord.humulene); | |
268 | $("#caryophyllene").val(dataRecord.caryophyllene); | |
269 | $("#cohumulone").val(dataRecord.cohumulone); | |
270 | $("#myrcene").val(dataRecord.myrcene); | |
13 | 271 | $("#hsi").val(dataRecord.hsi); |
12 | 272 | $("#type").val(dataRecord.type); |
273 | $("#form").val(dataRecord.form); | |
274 | $("#notes").val(dataRecord.notes); | |
275 | $("#origin").val(dataRecord.origin); | |
276 | $("#substitutes").val(dataRecord.substitutes); | |
277 | $("#always_on_stock").val(dataRecord.always_on_stock); | |
278 | $("#inventory").val(dataRecord.inventory); | |
279 | $("#cost").val(dataRecord.cost); | |
280 | $("#production_date").val(dataRecord.production_date); | |
281 | $("#tht_date").val(dataRecord.tht_date); | |
13 | 282 | $("#total_oil").val(dataRecord.total_oil); |
199
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
283 | calcTotal(dataRecord.cost, dataRecord.inventory); |
12 | 284 | // show the popup window. |
285 | $("#popupWindow").jqxWindow('open'); | |
286 | } | |
287 | } | |
288 | ] | |
289 | }); | |
199
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
290 | |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
291 | $("#cost").on('change', function (event) { |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
292 | dataRecord.cost = parseFloat(event.args.value); |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
293 | calcTotal(dataRecord.cost, dataRecord.inventory); |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
294 | }); |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
295 | $("#inventory").on('change', function (event) { |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
296 | dataRecord.inventory = parseFloat(event.args.value); |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
297 | calcTotal(dataRecord.cost, dataRecord.inventory); |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
298 | }); |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
299 | |
12 | 300 | // initialize the popup window and buttons. |
301 | $("#popupWindow").jqxWindow({ | |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
302 | width: 1050, |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
303 | height: 550, |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
304 | resizable: false, |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
305 | theme: theme, |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
306 | isModal: true, |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
307 | autoOpen: false, |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
308 | cancelButton: $("#Cancel"), |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
309 | modalOpacity: 0.40 |
12 | 310 | }); |
311 | $("#popupWindow").on('open', function () { | |
312 | $("#name").jqxInput('selectAll'); | |
313 | }); | |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
314 | $("#Delete").jqxButton({ template: "danger", width: '90px', theme: theme }); |
12 | 315 | $("#Delete").click(function () { |
316 | if (editrow >= 0) { | |
317 | // Open a popup to confirm this action. | |
318 | $('#eventWindow').jqxWindow('open'); | |
319 | $("#delOk").click(function () { | |
320 | var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow); | |
321 | $("#jqxgrid").jqxGrid('deleterow', rowID); | |
322 | }); | |
323 | } | |
324 | $("#popupWindow").jqxWindow('hide'); | |
325 | }); | |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
326 | $("#Cancel").jqxButton({ template: "primary", width: '90px', theme: theme }); |
284
a93fcd87f561
Hops can be cloned to allow new crop, or different forms.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
327 | $("#Clone").jqxButton({ template: "warning", width: '90px', theme: theme }); |
a93fcd87f561
Hops can be cloned to allow new crop, or different forms.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
328 | $("#Clone").click(function () { |
a93fcd87f561
Hops can be cloned to allow new crop, or different forms.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
329 | var row = { |
a93fcd87f561
Hops can be cloned to allow new crop, or different forms.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
330 | record: -1, |
a93fcd87f561
Hops can be cloned to allow new crop, or different forms.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
331 | name: $("#name").val()+" kopie", |
a93fcd87f561
Hops can be cloned to allow new crop, or different forms.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
332 | alpha: parseFloat($("#alpha").jqxNumberInput('decimal')), |
a93fcd87f561
Hops can be cloned to allow new crop, or different forms.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
333 | beta: parseFloat($("#beta").jqxNumberInput('decimal')), |
a93fcd87f561
Hops can be cloned to allow new crop, or different forms.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
334 | humulene: parseFloat($("#humulene").jqxNumberInput('decimal')), |
a93fcd87f561
Hops can be cloned to allow new crop, or different forms.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
335 | caryophyllene: parseFloat($("#caryophyllene").jqxNumberInput('decimal')), |
a93fcd87f561
Hops can be cloned to allow new crop, or different forms.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
336 | cohumulone: parseFloat($("#cohumulone").jqxNumberInput('decimal')), |
a93fcd87f561
Hops can be cloned to allow new crop, or different forms.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
337 | myrcene: parseFloat($("#myrcene").jqxNumberInput('decimal')), |
a93fcd87f561
Hops can be cloned to allow new crop, or different forms.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
338 | hsi: parseFloat($("#hsi").jqxNumberInput('decimal')), |
a93fcd87f561
Hops can be cloned to allow new crop, or different forms.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
339 | type: $("#type").val(), |
a93fcd87f561
Hops can be cloned to allow new crop, or different forms.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
340 | form: $("#form").val(), |
a93fcd87f561
Hops can be cloned to allow new crop, or different forms.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
341 | notes: $("#notes").val(), |
a93fcd87f561
Hops can be cloned to allow new crop, or different forms.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
342 | origin: $("#origin").val(), |
a93fcd87f561
Hops can be cloned to allow new crop, or different forms.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
343 | substitutes: $("#substitutes").val(), |
a93fcd87f561
Hops can be cloned to allow new crop, or different forms.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
344 | always_on_stock: $("#always_on_stock").val(), |
a93fcd87f561
Hops can be cloned to allow new crop, or different forms.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
345 | inventory: 0, |
a93fcd87f561
Hops can be cloned to allow new crop, or different forms.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
346 | cost: parseFloat($("#cost").jqxNumberInput('decimal')), |
a93fcd87f561
Hops can be cloned to allow new crop, or different forms.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
347 | production_date: '', |
a93fcd87f561
Hops can be cloned to allow new crop, or different forms.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
348 | tht_date: '', |
a93fcd87f561
Hops can be cloned to allow new crop, or different forms.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
349 | total_oil: parseFloat($("#total_oil").jqxNumberInput('decimal')) |
a93fcd87f561
Hops can be cloned to allow new crop, or different forms.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
350 | }; |
a93fcd87f561
Hops can be cloned to allow new crop, or different forms.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
351 | $('#jqxgrid').jqxGrid('addrow', null, row); |
a93fcd87f561
Hops can be cloned to allow new crop, or different forms.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
352 | $("#popupWindow").jqxWindow('hide'); |
a93fcd87f561
Hops can be cloned to allow new crop, or different forms.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
353 | }); |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
354 | $("#Save").jqxButton({ template: "success", width: '90px', theme: theme }); |
12 | 355 | // update the edited row when the user clicks the 'Save' button. |
356 | $("#Save").click(function () { | |
488
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
395
diff
changeset
|
357 | var row, rowID = -1; |
12 | 358 | if (editrow >= 0) { |
488
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
395
diff
changeset
|
359 | rowID = $('#jqxgrid').jqxGrid('getrowid', editrow); |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
360 | } |
488
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
395
diff
changeset
|
361 | row = { |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
362 | record: rowID, |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
363 | name: $("#name").val(), |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
364 | alpha: parseFloat($("#alpha").jqxNumberInput('decimal')), |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
365 | beta: parseFloat($("#beta").jqxNumberInput('decimal')), |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
366 | humulene: parseFloat($("#humulene").jqxNumberInput('decimal')), |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
367 | caryophyllene: parseFloat($("#caryophyllene").jqxNumberInput('decimal')), |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
368 | cohumulone: parseFloat($("#cohumulone").jqxNumberInput('decimal')), |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
369 | myrcene: parseFloat($("#myrcene").jqxNumberInput('decimal')), |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
370 | hsi: parseFloat($("#hsi").jqxNumberInput('decimal')), |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
371 | type: $("#type").val(), |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
372 | form: $("#form").val(), |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
373 | notes: $("#notes").val(), |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
374 | origin: $("#origin").val(), |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
375 | substitutes: $("#substitutes").val(), |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
376 | always_on_stock: $("#always_on_stock").val(), |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
377 | inventory: parseFloat($("#inventory").jqxNumberInput('decimal')), |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
378 | cost: parseFloat($("#cost").jqxNumberInput('decimal')), |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
379 | production_date: $("#production_date").val(), |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
380 | tht_date: $("#tht_date").val(), |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
381 | total_oil: parseFloat($("#total_oil").jqxNumberInput('decimal')) |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
382 | }; |
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
383 | if (editrow >= 0) { |
12 | 384 | $('#jqxgrid').jqxGrid('updaterow', rowID, row); |
385 | } else { | |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
386 | $('#jqxgrid').jqxGrid('addrow', null, row); |
12 | 387 | } |
196
531d5458782f
Hops database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
388 | $("#popupWindow").jqxWindow('hide'); |
12 | 389 | }); |
390 | createDelElements(); | |
391 | }); | |
392 |