Added yeast duplicate button

Mon, 04 Mar 2019 11:05:26 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Mon, 04 Mar 2019 11:05:26 +0100
changeset 314
f943efa07d9f
parent 313
9f45d09c2071
child 315
0df8d2db55fb

Added yeast duplicate button

README.design file | annotate | diff | comparison | revisions
www/inv_yeasts.php file | annotate | diff | comparison | revisions
www/js/inv_yeasts.js file | annotate | diff | comparison | revisions
--- a/README.design	Sun Mar 03 16:27:39 2019 +0100
+++ b/README.design	Mon Mar 04 11:05:26 2019 +0100
@@ -146,6 +146,7 @@
 Extra:
 
 Gisten alcohol_tolerance veld toevoegen.
+Gisten diastaticus bit toevoegen.
 Gist typen: kveik en brett? Apart of niet.
 
 
--- a/www/inv_yeasts.php	Sun Mar 03 16:27:39 2019 +0100
+++ b/www/inv_yeasts.php	Mon Mar 04 11:05:26 2019 +0100
@@ -83,7 +83,7 @@
       </tr>
       <tr>
        <td style="padding-top: 20px;" align="right"><input type="button" id="Delete" value="Verwijder" /></td>
-       <td align="right"></td>
+       <td style="padding-top: 20px;" align="left"><input type="button" id="Clone" value="Kloon" /></td>
        <td align="right"></td>
        <td style="padding-top: 20px;" align="left"><input style="margin-right: 5px;" type="button" id="Save" value="Sla op" /><input id="Cancel" type="button" value="Annuleer" /></td>
       </tr>
--- a/www/js/inv_yeasts.js	Sun Mar 03 16:27:39 2019 +0100
+++ b/www/js/inv_yeasts.js	Mon Mar 04 11:05:26 2019 +0100
@@ -366,6 +366,33 @@
 		$("#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",
+			type: $("#type").val(),
+			form: $("#form").val(),
+			laboratory: $("#laboratory").val(),
+			product_id: $("#product_id").val(),
+			min_temperature: parseInt($("#min_temperature").jqxNumberInput('decimal')),
+			max_temperature: parseInt($("#max_temperature").jqxNumberInput('decimal')),
+			flocculation: $("#flocculation").val(),
+			attenuation: parseFloat($("#attenuation").jqxNumberInput('decimal')),
+			notes: $("#notes").val(),
+			best_for: $("#best_for").val(),
+			max_reuse: parseInt($("#max_reuse").jqxNumberInput('decimal')),
+			inventory: 0,
+			cost: parseFloat($("#cost").jqxNumberInput('decimal')),
+			production_date: '',
+			tht_date: '',
+			cells: parseFloat($("#cells").jqxNumberInput('decimal')),
+			tolerance: parseFloat($("#tolerance").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 () {

mercurial