Removed checkboxes for brew and fermentation logs from the first tab. On the brewday and fermentation tabs added buttons to show log graphs. The buttuns are only enabled if there is a log.

Fri, 04 Jan 2019 21:51:59 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Fri, 04 Jan 2019 21:51:59 +0100
changeset 171
48cf3ea270f8
parent 170
71850ebe5a1c
child 172
684c651dd165

Removed checkboxes for brew and fermentation logs from the first tab. On the brewday and fermentation tabs added buttons to show log graphs. The buttuns are only enabled if there is a log.

www/js/prod_edit.js file | annotate | diff | comparison | revisions
www/prod_edit.php file | annotate | diff | comparison | revisions
--- a/www/js/prod_edit.js	Fri Jan 04 20:32:11 2019 +0100
+++ b/www/js/prod_edit.js	Fri Jan 04 21:51:59 2019 +0100
@@ -1259,6 +1259,9 @@
 			dataRecord.keg_carbonation_temp = parseFloat(event.args.value);
 			calcCarbonation();
 		});
+
+		$("#BLog").jqxButton({ disabled: (dataRecord.log_brew) ? false:true });
+		$("#FLog").jqxButton({ disabled: (dataRecord.log_fermentation) ? false:true });
 	};
 
 	$("#styleSelect").jqxDropDownList({
@@ -1549,8 +1552,6 @@
 			$("#birth").val(dataRecord.birth);
 			$("#stage").val(dataRecord.stage);
 			$("#notes").val(dataRecord.notes);
-			$("#log_brew").val(dataRecord.log_brew);
-			$("#log_fermentation").val(dataRecord.log_fermentation);
 			$("#inventory_reduced").val(dataRecord.inventory_reduced);
 			$("#locked").val(dataRecord.locked);
 			$("#eq_name").val(dataRecord.eq_name);
@@ -1749,14 +1750,8 @@
 			if (brewstage < 3) {
 				$('#jqxTabs').jqxTabs('disableAt', 9);
 				// If recipe not complete, disable 8 too.
-		//		$("#brew_log").jqxButton({ disabled: true });
-		//		$("#ferment_log").jqxButton({ disabled: true });
 			} else {
 				$('#jqxTabs').jqxTabs('enableAt', 9);
-		//		if (! dataRecord.log_brew)
-		//			$("#brew_log").jqxButton({ disabled: true });
-		//		if (! dataRecord.log_fermentation)
-		//			$("#ferment_log").jqxButton({ disabled: true });
 			}
 			if (brewstage < 4) { // At least primary
 				$('#jqxTabs').jqxTabs('disableAt', 10);
@@ -2876,8 +2871,6 @@
 	$("#birth").jqxInput({ theme: theme, width: 120, height: 23 });
 	$("#stage").jqxTooltip({ content: 'De productie fase van dit product.' });
 	$("#stage").jqxInput({ theme: theme, width: 100, height: 23 });
-	$("#log_brew").jqxCheckBox({ theme: theme, width: 120, height: 23, disabled : true });
-	$("#log_fermentation").jqxCheckBox({ theme: theme, width: 120, height: 23, disabled : true });
 	$("#inventory_reduced").jqxCheckBox({ theme: theme, width: 120, height: 23 });
 	$('#inventory_reduced').on('checked', function (event) {
 		// Call a script to do the work and block this.
@@ -3230,6 +3223,12 @@
 	$("#brew_fermenter_extrasugar").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 });
 	$("#brew_fermenter_ibu").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 0 });
 	$("#brew_fermenter_color").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 0 });
+	$("#BLog").jqxButton({ template: "info", width: '150px', theme: theme });
+	$("#BLog").click(function () {
+		// Open log in a new tab.
+		var url="log_brew.php?code=" + dataRecord.code;
+		window.open(url);
+	});
 
 	// Tab 10, Fermentation
 	// Note, fermentation temps changes must do calcCarbonation()
@@ -3266,6 +3265,12 @@
 	$("#fg").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 3, spinButtons: true, spinButtonsStep: 0.001 });
 	$("#final_abv").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
 	$("#final_svg").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
+	$("#FLog").jqxButton({ template: "info", width: '150px', theme: theme });
+	$("#FLog").click(function () {
+		// Open log in a new tab.
+		var url="log_fermentation.php?code=" + dataRecord.code;
+		window.open(url);
+	});
 
 	// Tab 11, Packaging
 	$("#package_date").jqxTooltip({ content: 'De verpakkings datum van dit bier.' });
@@ -3394,8 +3399,8 @@
 			birth: $("#birth").val(),
 			stage: $("#stage").val(),
 			notes: $("#notes").val(),
-			log_brew: $("#log_brew").val(),
-			log_fermentation: $("#log_fermentation").val(),
+			log_brew: dataRecord.log_brew,
+			log_fermentation: dataRecord.log_fermentation,
 			inventory_reduced: $("#inventory_reduced").val(),
 			locked: $("#locked").val(),
 			eq_name: $("#eq_name").val(),
--- a/www/prod_edit.php	Fri Jan 04 20:32:11 2019 +0100
+++ b/www/prod_edit.php	Fri Jan 04 21:51:59 2019 +0100
@@ -35,18 +35,13 @@
         <td align="left" style="vertical-align: top; padding: 3px;"><input id="stage" readonly /></td>
        </tr>
        <tr>
-        <td align="right" style="vertical-align: top;">Brouw log:</td>
-        <td align="left"><div id="log_brew"></div></td>
-        <td align="right" style="vertical-align: top;">Vergisting log:</td>
-        <td align="left"><div id="log_fermentation"></div></td>
+        <td colspan="2"> </td>
+        <td align="right" style="vertical-align: top;">Afgesloten:</td>
+        <td align="left"><div id="locked"></div></td>
         <td align="right" style="vertical-align: top;">Ingredienten afgeboekt:</td>
         <td align="left"><div id="inventory_reduced"></div></td>
        </tr>
        <tr>
-        <td align="right" style="vertical-align: top;">Afgesloten:</td>
-        <td align="left" colspan="5" ><div id="locked"></div></td>
-       </tr>
-       <tr>
         <td style="vertical-align: top; float: right; padding: 3px;">Opmerkingen:</td>
         <td colspan="5" style="padding: 3px;"><textarea id="notes"></textarea></td>
        </tr>
@@ -544,6 +539,9 @@
        <td><div style="float: left;" id="brew_fermenter_color"></div><div style="float: left; margin-left: 35px;" id="est_color"></div></td>
       </tr>
      </table>
+     <div style="float: right; margin-top: 20px; margin-bottom: 5px;">
+      <input style="margin-right: 600px;" type="button" id="BLog"  value="Brouw grafiek" />
+     </div>
     </div> <!-- Brewday -->
 
     <div> <!-- Vergisten -->
@@ -624,6 +622,9 @@
         <td align="left" style="vertical-align: top;"><div id="final_svg"></div></td>
        </tr>
       </table>
+      <div style="float: right; margin-top: 80px; margin-bottom: 5px;">
+       <input style="margin-right: 600px;" type="button" id="FLog"  value="Vergisting log" />
+      </div>
      </div>
     </div> <!-- Vergisten -->
 

mercurial