www/js/profile_setup.js

Mon, 04 Feb 2019 15:21:49 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Mon, 04 Feb 2019 15:21:49 +0100
changeset 240
a85c1d4c4d12
parent 218
38499e3859fa
child 270
cf4b4b63eb36
permissions
-rw-r--r--

Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.

99
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 /*****************************************************************************
218
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
2 * Copyright (C) 2019
99
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 *
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4 * Michiel Broek <mbroek at mbse dot eu>
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 *
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 * This file is part of BMS
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 *
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 * This is free software; you can redistribute it and/or modify it
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 * under the terms of the GNU General Public License as published by the
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 * Free Software Foundation; either version 2, or (at your option) any
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 * later version.
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 *
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 * BrewCloud is distributed in the hope that it will be useful, but
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 * General Public License for more details.
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 *
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19 * along with ThermFerm; see the file COPYING. If not, write to the Free
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21 *****************************************************************************/
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
23
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
24 $(document).ready(function () {
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
25
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
26 var dataRecord = {};
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
27
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
28 // dropdownlist datasource from inventory_waters, must load sync
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
29 var waterUrl = "getwatersources.php";
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
30 var waterInvSource = {
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
31 datatype: "json",
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
32 datafields: [
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
33 { name: 'name', type: 'string' },
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
34 ],
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
35 url: waterUrl,
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
36 async: false
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
37 };
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
38 var waterlist = new $.jqx.dataAdapter(waterInvSource);
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
39
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
40 var url = "includes/db_setup.php";
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
41
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
42 // Tooltips
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
43 $("#brewery_name").jqxTooltip({ content: 'De naam voor deze brouwerij.' });
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
44 $("#factor_mashhop").jqxTooltip({ content: 'Het efficientie percentage voor hop tijdens de maisch.' });
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
45 $("#factor_fwh").jqxTooltip({ content: 'Het efficientie percentage voor First Wort Hop.' });
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
46 $("#factor_pellet").jqxTooltip({ content: 'Het efficientie percentage bij gebruik van hop pellets.' });
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
47 $("#factor_plug").jqxTooltip({ content: 'Het efficientie percentage bij gebruik van hop plugs.' });
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
48 $("#brix_correction").jqxTooltip({ content: 'Omzettingsfactor voor Plato naar Brix' });
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
49 $("#grain_absorbtion").jqxTooltip({ content: 'Absorbtie van water door graan (L/Kg)' });
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
50
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
51 // Prepare the data
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
52 var source = {
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
53 datatype: "json",
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
54 cache: false,
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
55 datafields: [
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
56 { name: 'brewery_name', type: 'string' },
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
57 /* { name: 'brewery_logo', type: 'array' }, */
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
58 { name: 'factor_mashhop', type: 'number' },
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
59 { name: 'factor_fwh', type: 'number' },
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
60 { name: 'factor_pellet', type: 'number' },
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
61 { name: 'factor_plug', type: 'number' },
218
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
62 { name: 'ibu_method', type: 'int' },
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
63 { name: 'color_method', type: 'int' },
99
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
64 { name: 'brix_correction', type: 'float' },
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
65 { name: 'grain_absorbtion', type: 'float' },
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
66 { name: 'default_water', type: 'string' }
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
67 ],
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
68 url: url
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
69 };
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
70
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
71 // Load data and select one record.
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
72 var dataAdapter = new $.jqx.dataAdapter(source, {
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
73 loadComplete: function () {
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
74 var records = dataAdapter.records;
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
75 dataRecord = records[0];
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
76 $("#brewery_name").val(dataRecord.brewery_name);
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
77 $("#factor_mashhop").val(dataRecord.factor_mashhop);
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
78 $("#factor_fwh").val(dataRecord.factor_fwh);
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
79 $("#factor_pellet").val(dataRecord.factor_pellet);
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
80 $("#factor_plug").val(dataRecord.factor_plug);
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
81 $("#color_method").val(dataRecord.color_method);
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
82 $("#ibu_method").val(dataRecord.ibu_method);
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
83 $("#brix_correction").val(dataRecord.brix_correction);
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
84 $("#grain_absorbtion").val(dataRecord.grain_absorbtion);
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
85 $("#default_water").val(dataRecord.default_water);
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
86 },
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
87 loadError: function (jqXHR, status, error) {
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
88 },
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
89 });
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
90 dataAdapter.dataBind();
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
91
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
92 // Editers
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
93 $("#brewery_name").jqxInput({ theme: theme, width: 640, height: 23 });
218
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
94 $("#factor_fwh").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 110, height: 23, min: -50, max: 50, decimalDigits: 0, spinButtons: true, symbol: '%', symbolPosition: 'right' });
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
95 $("#factor_mashhop").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 110, height: 23, min: -50, max: 50, decimalDigits: 0, spinButtons: true, symbol: '%', symbolPosition: 'right' });
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
96 $("#factor_pellet").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 110, height: 23, min: 0, max: 20, decimalDigits: 0, spinButtons: true, symbol: '%', symbolPosition: 'right' });
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
97 $("#factor_plug").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 110, height: 23, min: 0, max: 20, decimalDigits: 0, spinButtons: true, symbol: '%', symbolPosition: 'right' });
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
98 $("#brix_correction").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 110, height: 23, min: 1.00, max: 1.05, decimalDigits: 2, spinButtons: true, spinButtonsStep: 0.01 });
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
99 $("#grain_absorbtion").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 110, height: 23, min: 0.5, max: 1.1, decimalDigits: 2, spinButtons: true, spinButtonsStep: 0.01 });
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
100 $("#color_method").jqxDropDownList({
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
101 theme: theme,
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
102 source: ColorMethodAdapter,
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
103 valueMember: 'id',
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
104 displayMember: 'nl',
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
105 width: 180,
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
106 autoDropDownHeight: true
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
107 });
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
108 $("#ibu_method").jqxDropDownList({
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
109 theme: theme,
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
110 source: IBUmethodAdapter,
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
111 valueMember: 'id',
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
112 displayMember: 'nl',
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
113 width: 180,
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
114 autoDropDownHeight: true
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
115 });
99
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
116 $('#default_water').jqxDropDownList({
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
117 placeHolder: "Kies water:",
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
118 theme: theme,
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
119 source: waterlist,
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
120 valueMember: "name",
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
121 displayMember: "name",
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
122 width: 250,
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
123 dropDownHorizontalAlignment: 'right',
218
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
124 dropDownWidth: 300,
38499e3859fa Global setup switched to dropdown indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
125 autoDropDownHeight: true
99
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
126 });
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
127 $('#default_water').jqxDropDownList( 'selectItem', dataRecord.default_water );
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
128
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
129 $("#Save").jqxButton({ template: "success", width: '90px', theme: theme });
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
130 $("#Save").click(function () {
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
131 var row = {
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
132 record: 1,
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
133 brewery_name: $("#brewery_name").val(),
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
134 factor_mashhop: $("#factor_mashhop").val(),
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
135 factor_fwh: $("#factor_fwh").val(),
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
136 factor_pellet: $("#factor_pellet").val(),
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
137 factor_plug: $("#factor_plug").val(),
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
138 color_method: $("#color_method").val(),
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
139 ibu_method: $("#ibu_method").val(),
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
140 brix_correction: parseFloat($("#brix_correction").jqxNumberInput('decimal')),
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
141 grain_absorbtion: parseFloat($("#grain_absorbtion").jqxNumberInput('decimal')),
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
142 default_water: $("#default_water").val()
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
143 };
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
144 var data = "update=true&" + $.param(row);
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
145 $.ajax({
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
146 dataType: 'json',
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
147 url: url,
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
148 cache: false,
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
149 data: data,
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
150 type: "POST",
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
151 success: function (data, status, xhr) {
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
152 // update command is executed.
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
153 //window.location.href = my_return;
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
154 },
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
155 error: function(jqXHR, textStatus, errorThrown) {
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
156 }
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
157 });
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
158 });
f433193f7bb6 Removed default water setting from the inventory_waters table. Added global setup record with default settings and the default water selection. Added a setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
159 });

mercurial