# HG changeset patch # User Michiel Broek # Date 1590260028 -7200 # Node ID 9c21125f584e316e66d95edbb4cb3d0f7b682610 # Parent 10ff024acff12eb1a518fba0b1821b4f83f42682 Added clone command to the equipment inventory. diff -r 10ff024acff1 -r 9c21125f584e www/inv_equipments.php --- a/www/inv_equipments.php Sat May 23 20:01:50 2020 +0200 +++ b/www/inv_equipments.php Sat May 23 20:53:48 2020 +0200 @@ -98,13 +98,10 @@ - - - - - - - + + + + diff -r 10ff024acff1 -r 9c21125f584e www/js/inv_equipments.js --- a/www/js/inv_equipments.js Sat May 23 20:01:50 2020 +0200 +++ b/www/js/inv_equipments.js Sat May 23 20:53:48 2020 +0200 @@ -349,6 +349,38 @@ $('#popupWindow').jqxWindow('hide'); }); $('#Cancel').jqxButton({ template: 'primary', width: '90px', theme: theme }); + $('#Clone').jqxButton({ template: 'warning', width: '90px', theme: theme }); + $('#Clone').click(function() { + var row = { + record: -1, + name: $('#name').val() + ' kopie', + boil_size: parseFloat($('#boil_size').jqxNumberInput('decimal')), + batch_size: parseFloat($('#batch_size').jqxNumberInput('decimal')), + tun_volume: parseFloat($('#tun_volume').jqxNumberInput('decimal')), + tun_weight: parseFloat($('#tun_weight').jqxNumberInput('decimal')), + tun_specific_heat: parseFloat($('#tun_specific_heat').jqxNumberInput('decimal')), + tun_material: $('#tun_material').val(), + tun_height: parseFloat($('#tun_height').jqxNumberInput('decimal')), + top_up_water: parseFloat($('#top_up_water').jqxNumberInput('decimal')), + trub_chiller_loss: parseFloat($('#trub_chiller_loss').jqxNumberInput('decimal')), + evap_rate: parseFloat($('#evap_rate').jqxNumberInput('decimal')), + boil_time: parseFloat($('#boil_time').jqxNumberInput('decimal')), + calc_boil_volume: $('#calc_boil_volume').val(), + top_up_kettle: parseFloat($('#top_up_kettle').jqxNumberInput('decimal')), + hop_utilization: parseFloat($('#hop_utilization').jqxNumberInput('decimal')), + notes: $('#notes').val(), + lauter_volume: parseFloat($('#lauter_volume').jqxNumberInput('decimal')), + lauter_height: parseFloat($('#lauter_height').jqxNumberInput('decimal')), + lauter_deadspace: parseFloat($('#lauter_deadspace').jqxNumberInput('decimal')), + kettle_volume: parseFloat($('#kettle_volume').jqxNumberInput('decimal')), + kettle_height: parseFloat($('#kettle_height').jqxNumberInput('decimal')), + mash_volume: parseFloat($('#mash_volume').jqxNumberInput('decimal')), + mash_max: parseFloat($('#mash_max').jqxNumberInput('decimal')), + efficiency: parseFloat($('#efficiency').jqxNumberInput('decimal')) + }; + $('#jqxgrid').jqxGrid('addrow', null, row); + $('#popupWindow').jqxWindow('hide'); + }); $('#Save').jqxButton({ template: 'success', width: '90px', theme: theme }); // update the edited row when the user clicks the 'Save' button. $('#Save').click(function() {