# HG changeset patch # User Michiel Broek # Date 1550955396 -3600 # Node ID a93fcd87f561075810fc9743675a7553616d0f30 # Parent 879b81864e4e396c314863b2b472f2045221eab9 Hops can be cloned to allow new crop, or different forms. diff -r 879b81864e4e -r a93fcd87f561 www/inv_hops.php --- a/www/inv_hops.php Sat Feb 23 21:07:14 2019 +0100 +++ b/www/inv_hops.php Sat Feb 23 21:56:36 2019 +0100 @@ -85,7 +85,7 @@ - + diff -r 879b81864e4e -r a93fcd87f561 www/js/inv_hops.js --- a/www/js/inv_hops.js Sat Feb 23 21:07:14 2019 +0100 +++ b/www/js/inv_hops.js Sat Feb 23 21:56:36 2019 +0100 @@ -313,6 +313,34 @@ $("#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", + alpha: parseFloat($("#alpha").jqxNumberInput('decimal')), + beta: parseFloat($("#beta").jqxNumberInput('decimal')), + humulene: parseFloat($("#humulene").jqxNumberInput('decimal')), + caryophyllene: parseFloat($("#caryophyllene").jqxNumberInput('decimal')), + cohumulone: parseFloat($("#cohumulone").jqxNumberInput('decimal')), + myrcene: parseFloat($("#myrcene").jqxNumberInput('decimal')), + hsi: parseFloat($("#hsi").jqxNumberInput('decimal')), + type: $("#type").val(), + form: $("#form").val(), + notes: $("#notes").val(), + origin: $("#origin").val(), + substitutes: $("#substitutes").val(), + always_on_stock: $("#always_on_stock").val(), + inventory: 0, + cost: parseFloat($("#cost").jqxNumberInput('decimal')), + production_date: '', + tht_date: '', + total_oil: parseFloat($("#total_oil").jqxNumberInput('decimal')) + }; + $('#jqxgrid').jqxGrid('addrow', null, row); + $("#popupWindow").jqxWindow('hide'); + location.reload( true ); // reload ourself. + }); $("#Save").jqxButton({ template: "success", width: '90px', theme: theme }); // update the edited row when the user clicks the 'Save' button. $("#Save").click(function () {