Sat, 23 May 2020 20:53:48 +0200
Added clone command to the equipment inventory.
www/inv_equipments.php | file | annotate | diff | comparison | revisions | |
www/js/inv_equipments.js | file | annotate | diff | comparison | revisions |
--- 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 @@ <td colspan="2"></td> </tr> <tr> - <td style="padding-top: 10px; float: right;"><input type="button" id="Delete" value="Verwijder" /></td> - <td></td> - <td></td> - <td style="padding-top: 10px;"> - <input style="margin-right: 5px;" type="button" id="Save" value="Sla op" /> - <input id="Cancel" type="button" value="Annuleer" /> - </td> + <td style="padding-top: 20px;" align="right"><input type="button" id="Delete" value="Verwijder" /></td> + <td style="padding-top: 20px;" align="left"><input type="button" id="Clone" value="Kloon" /></td> + <td style="padding-top: 20px;" align="right"><input type="button" id="Save" value="Sla op" /></td> + <td style="padding-top: 20px;" align="left"><input id="Cancel" type="button" value="Annuleer" /></td> </tr> </table> </div>
--- 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() {