# HG changeset patch # User Michiel Broek # Date 1583422443 -3600 # Node ID 57bc32b5f4115c0819406a7be8835ad063788c56 # Parent 7509f9ed56860d002b53d2e4cc510636c7ab5459 Extended the max value for brix correction value to 1.09. Added setting of a private yeast lab for later use. Fixed missing some default setup values. diff -r 7509f9ed5686 -r 57bc32b5f411 www/includes/db_setup.php --- a/www/includes/db_setup.php Wed Mar 04 20:04:50 2020 +0100 +++ b/www/includes/db_setup.php Thu Mar 05 16:34:03 2020 +0100 @@ -34,6 +34,7 @@ $sql .= "', brix_correction='" . $_POST['brix_correction']; $sql .= "', grain_absorbtion='" . $_POST['grain_absorbtion']; $sql .= "', default_water='" . $default_water; + $sql .= "', my_yeastlab='" . $_POST['my_yeastlab']; $sql .= "' WHERE record='1';"; //syslog(LOG_NOTICE, $sql); $result = mysqli_query($connect, $sql); @@ -65,6 +66,7 @@ $data .= ',"brix_correction":' . floatval($row['brix_correction']); $data .= ',"grain_absorbtion":' . floatval($row['grain_absorbtion']); $data .= ',"default_water":"' . str_replace($escapers, $replacements, $default_water); + $data .= '","my_yeastlab":"' . str_replace($escapers, $replacements, $row['my_yeastlab']); $data .= '"}'; } header("Content-type: application/json"); diff -r 7509f9ed5686 -r 57bc32b5f411 www/js/global.js --- a/www/js/global.js Wed Mar 04 20:04:50 2020 +0100 +++ b/www/js/global.js Thu Mar 05 16:34:03 2020 +0100 @@ -683,6 +683,7 @@ console.log(status + ' ' + error); }, }), +yeastlablist = new $.jqx.dataAdapter(yeastInvSource, { autoBind: false, async: false, uniqueDataFields: ['laboratory'] }), // dropdownlist datasource from inventory_waters waterInvSource = { diff -r 7509f9ed5686 -r 57bc32b5f411 www/js/profile_setup.js --- a/www/js/profile_setup.js Wed Mar 04 20:04:50 2020 +0100 +++ b/www/js/profile_setup.js Thu Mar 05 16:34:03 2020 +0100 @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (C) 2019 + * Copyright (C) 2019-2020 * * Michiel Broek * @@ -47,7 +47,8 @@ { name: 'color_method', type: 'int' }, { name: 'brix_correction', type: 'float' }, { name: 'grain_absorbtion', type: 'float' }, - { name: 'default_water', type: 'string' } + { name: 'default_water', type: 'string' }, + { name: 'my_yeastlab', type: 'string' } ], url: url }, @@ -66,13 +67,13 @@ $('#ibu_method').val(dataRecord.ibu_method); $('#brix_correction').val(dataRecord.brix_correction); $('#grain_absorbtion').val(dataRecord.grain_absorbtion); + $('#default_water').jqxDropDownList('selectItem', dataRecord.default_water); + $('#my_yeastlab').jqxDropDownList('selectItem', dataRecord.my_yeastlab); }, loadError: function(jqXHR, status, error) { }, }); - dataAdapter.dataBind(); - // Tooltips $('#brewery_name').jqxTooltip({ content: 'De naam voor deze brouwerij.' }); $('#factor_mashhop').jqxTooltip({ content: 'Het efficientie percentage voor hop tijdens de maisch.' }); @@ -98,7 +99,7 @@ decimalDigits: 0, spinButtons: true, symbol: '%', symbolPosition: 'right' }); $('#factor_cryohop').jqxNumberInput({ inputMode: 'simple', theme: theme, width: 110, height: 23, min: -20, max: 150, decimalDigits: 0, spinButtons: true, symbol: '%', symbolPosition: 'right' }); - $('#brix_correction').jqxNumberInput({ inputMode: 'simple', theme: theme, width: 110, height: 23, min: 1.00, max: 1.05, decimalDigits: 2, spinButtons: true }); + $('#brix_correction').jqxNumberInput({ inputMode: 'simple', theme: theme, width: 110, height: 23, min: 1.00, max: 1.09, decimalDigits: 2, spinButtons: true }); $('#grain_absorbtion').jqxNumberInput({ inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0.5, max: 1.1, decimalDigits: 2, spinButtons: true }); $('#color_method').jqxDropDownList({ theme: theme, @@ -127,7 +128,18 @@ dropDownWidth: 300, autoDropDownHeight: true }); - $('#default_water').jqxDropDownList('selectItem', dataRecord.default_water); + $('#my_yeastlab').jqxDropDownList({ + placeHolder: 'Mijn gist laboratorium:', + theme: theme, + source: yeastlablist, + valueMember: 'laboratory', + displayMember: 'laboratory', + width: 250, + dropDownHorizontalAlignment: 'right', + dropDownWidth: 300, + autoDropDownHeight: true + }); + dataAdapter.dataBind(); $('#Save').jqxButton({ template: 'success', width: '90px', theme: theme }); $('#Save').click(function() { @@ -145,7 +157,8 @@ ibu_method: $('#ibu_method').val(), brix_correction: parseFloat($('#brix_correction').jqxNumberInput('decimal')), grain_absorbtion: parseFloat($('#grain_absorbtion').jqxNumberInput('decimal')), - default_water: $('#default_water').val() + default_water: $('#default_water').val(), + my_yeastlab: $('#my_yeastlab').val() }; data = 'update=true&' + $.param(row); $.ajax({ diff -r 7509f9ed5686 -r 57bc32b5f411 www/profile_setup.php --- a/www/profile_setup.php Wed Mar 04 20:04:50 2020 +0100 +++ b/www/profile_setup.php Thu Mar 05 16:34:03 2020 +0100 @@ -42,7 +42,9 @@ Hop plug factor: -
+
+ Mijn gist laboratorium: +
Wet hop factor: