Wed, 29 Jan 2020 13:26:01 +0100
New products field log_ispindel. Add check for ispindel log to crontasks.php Added log_ispindel to prod_edit, pprod_divide, prod_new and prod_duplicate. Renamed some log_fermentation vergisting names into klimaatkast.
--- a/www/crontasks.php Tue Jan 21 21:16:26 2020 +0100 +++ b/www/crontasks.php Wed Jan 29 13:26:01 2020 +0100 @@ -76,7 +76,7 @@ /* * Check fementation logs. */ -$query = "SELECT record,code,name,log_brew,log_fermentation FROM products;"; +$query = "SELECT record,code,name,log_brew,log_fermentation,log_ispindel FROM products;"; $result = mysqli_query($connect, $query); while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { $logfile = "log/fermentation/" . $row['code'] . " " . $row['name'] . ".log"; @@ -89,6 +89,16 @@ syslog(LOG_NOTICE, $query); $result1 = mysqli_query($connect, $query); } + $logfile = "log/ispindel/" . $row['code'] . " " . $row['name'] . ".log"; + if (file_exists($logfile)) + $ok = 1; + else + $ok = 0; + if ($ok != $row['log_ispindel']) { + $query = "UPDATE products SET log_ispindel='" . $ok . "' WHERE record='" . $row['record'] . "';"; + syslog(LOG_NOTICE, $query); + $result1 = mysqli_query($connect, $query); + } }
--- a/www/includes/db_divides.php Tue Jan 21 21:16:26 2020 +0100 +++ b/www/includes/db_divides.php Wed Jan 29 13:26:01 2020 +0100 @@ -101,6 +101,7 @@ $sql .= "', notes='" . mysqli_real_escape_string($link, $row['notes']); $sql .= "', log_brew='" . $row['log_brew']; $sql .= "', log_fermentation='" . $row['log_fermentation']; + $sql .= "', log_ispindel='" . $row['log_ispindel']; $sql .= "', inventory_reduced='" . $row['inventory_reduced'];; $sql .= "', locked='" . $row['locked'];; // Equipment
--- a/www/includes/db_product.php Tue Jan 21 21:16:26 2020 +0100 +++ b/www/includes/db_product.php Wed Jan 29 13:26:01 2020 +0100 @@ -40,6 +40,7 @@ $sql .= "', notes='" . mysqli_real_escape_string($connect, $_POST['notes']); $sql .= "', log_brew='" . $_POST['log_brew']; $sql .= "', log_fermentation='" . $_POST['log_fermentation']; + $sql .= "', log_ispindel='" . $_POST['log_ispindel']; $sql .= "', inventory_reduced='" . $_POST['inventory_reduced']; $sql .= "', locked='" . $_POST['locked']; // Equipment @@ -681,6 +682,7 @@ $brew .= ',"notes":"' . str_replace($escapers, $replacements, $row['notes']); $brew .= '","log_brew":' . $row['log_brew']; $brew .= ',"log_fermentation":' . $row['log_fermentation']; + $brew .= ',"log_ispindel":' . $row['log_ispindel']; $brew .= ',"inventory_reduced":' . $row['inventory_reduced']; $brew .= ',"locked":' . $row['locked']; $brew .= ',"eq_name":"' . str_replace($escapers, $replacements, $row['eq_name']);
--- a/www/js/log_fermentation.js Tue Jan 21 21:16:26 2020 +0100 +++ b/www/js/log_fermentation.js Wed Jan 29 13:26:01 2020 +0100 @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (C) 2019 + * Copyright (C) 2019-2020 * * Michiel Broek <mbroek at mbse dot eu> * @@ -131,7 +131,7 @@ '<head>' + '<link rel="stylesheet" href="jqwidgets/styles/jqx.base.css" type="text/css" />' + '<meta charset="utf-8" />' + - '<title>' + my_code + ' ' + my_name + ' vergisting</title>' + + '<title>' + my_code + ' ' + my_name + ' klimaatkast</title>' + '</head>' + '<body>' + content + '</body></html>'; document.write(pageContent); @@ -141,12 +141,12 @@ $('#print').jqxButton({ template: 'primary', width: 125, theme: theme }); $('#pdfButton').click(function() { - $('#fermenter_chart').jqxChart('saveAsPDF', 'vergisting_' + my_code + '.pdf', getExportServer()); + $('#fermenter_chart').jqxChart('saveAsPDF', 'klimaatkast_' + my_code + '.pdf', getExportServer()); }); $('#pdfButton').jqxButton({ template: 'primary', width: 125, theme: theme }); $('#pngButton').click(function() { - $('#fermenter_chart').jqxChart('saveAsPNG', 'vergisting_' + my_code + '.png', getExportServer()); + $('#fermenter_chart').jqxChart('saveAsPNG', 'klimaatkast_' + my_code + '.png', getExportServer()); }); $('#pngButton').jqxButton({ template: 'primary', width: 125, theme: theme });
--- a/www/js/prod_divide.js Tue Jan 21 21:16:26 2020 +0100 +++ b/www/js/prod_divide.js Wed Jan 29 13:26:01 2020 +0100 @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (C) 2019 + * Copyright (C) 2019-2020 * * Michiel Broek <mbroek at mbse dot eu> * @@ -83,6 +83,7 @@ { name: 'notes', type: 'string' }, { name: 'log_brew', type: 'int' }, { name: 'log_fermentation', type: 'int' }, + { name: 'log_ispindel', type: 'int' }, { name: 'inventory_reduced', type: 'int' }, { name: 'locked', type: 'int' }, { name: 'eq_name', type: 'string' },
--- a/www/js/prod_edit.js Tue Jan 21 21:16:26 2020 +0100 +++ b/www/js/prod_edit.js Wed Jan 29 13:26:01 2020 +0100 @@ -117,6 +117,7 @@ { name: 'notes', type: 'string' }, { name: 'log_brew', type: 'int' }, { name: 'log_fermentation', type: 'int' }, + { name: 'log_ispindel', type: 'int' }, { name: 'inventory_reduced', type: 'int' }, { name: 'locked', type: 'int' }, { name: 'eq_name', type: 'string' }, @@ -4122,6 +4123,7 @@ }); $('#BLog').jqxButton({ disabled: (dataRecord.log_brew) ? false : true}); $('#FLog').jqxButton({ disabled: (dataRecord.log_fermentation) ? false : true}); + $('#ILog').jqxButton({ disabled: (dataRecord.log_ispindel) ? false : true}); } $('#styleSelect').jqxDropDownList({ @@ -4247,6 +4249,7 @@ notes: $('#notes').val(), log_brew: dataRecord.log_brew, log_fermentation: dataRecord.log_fermentation, + log_ispindel: dataRecord.log_ispindel, inventory_reduced: dataRecord.inventory_reduced, locked: dataRecord.locked, eq_name: $('#eq_name').val(), @@ -5946,6 +5949,11 @@ // Open log in a new tab. window.open('log_fermentation.php?code=' + dataRecord.code + '&name=' + dataRecord.name); }); + $('#ILog').jqxButton({ template: 'info', width: '150px', theme: theme }); + $('#ILog').click(function() { + // Open log in a new tab. + window.open('log_ispindel.php?code=' + dataRecord.code + '&name=' + dataRecord.name); + }); // Tab 11, Packaging // TODO: high gravity packaging, extra water and recalc abv, color and ibu.
--- a/www/js/prod_new.js Tue Jan 21 21:16:26 2020 +0100 +++ b/www/js/prod_new.js Wed Jan 29 13:26:01 2020 +0100 @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (C) 2018-2019 + * Copyright (C) 2018-2020 * * Michiel Broek <mbroek at mbse dot eu> * @@ -256,6 +256,7 @@ notes: $('#notes').val(), log_brew: 0, log_fermentation: 0, + log_ispindel: 0, inventory_reduced: 0, locked: 0, eq_name: $('#eq_name').val(),
--- a/www/log_fermentation.php Tue Jan 21 21:16:26 2020 +0100 +++ b/www/log_fermentation.php Wed Jan 29 13:26:01 2020 +0100 @@ -1,6 +1,6 @@ <?php require_once($_SERVER['DOCUMENT_ROOT'].'/includes/global.inc.php'); -page_header('Vergisting grafiek', "log_fermentation"); +page_header('Klimaatkast grafiek', "log_fermentation"); ?> <div id="MainPanel">
--- a/www/prod_duplicate.php Tue Jan 21 21:16:26 2020 +0100 +++ b/www/prod_duplicate.php Wed Jan 29 13:26:01 2020 +0100 @@ -33,6 +33,7 @@ $sql .= "', notes='" . mysqli_real_escape_string($link, $row['notes']); $sql .= "', log_brew='0"; $sql .= "', log_fermentation='0"; +$sql .= "', log_ispindel='0"; $sql .= "', inventory_reduced='0"; $sql .= "', locked='0"; // Equipment
--- a/www/prod_edit.php Tue Jan 21 21:16:26 2020 +0100 +++ b/www/prod_edit.php Wed Jan 29 13:26:01 2020 +0100 @@ -736,7 +736,8 @@ </tr> </table> <div style="float: right; margin-top: 55px; margin-bottom: 5px;"> - <input style="margin-right: 600px;" type="button" id="FLog" value="Vergisting log" /> + <input style="margin-right: 100px;" type="button" id="FLog" value="Klimaatkast log" /> + <input style="margin-right: 475px;" type="button" id="ILog" value="Vergisting log" /> </div> </div> </div> <!-- Vergisten -->
--- a/www/rec_toproduct.php Tue Jan 21 21:16:26 2020 +0100 +++ b/www/rec_toproduct.php Wed Jan 29 13:26:01 2020 +0100 @@ -33,7 +33,7 @@ $sql .= "', birth='" . date("Y-m-d"); $sql .= "', stage='1"; $sql .= "', notes='" . mysqli_real_escape_string($link, $row['notes']); -$sql .= "', log_brew='0', log_fermentation='0', inventory_reduced='0', locked='0"; +$sql .= "', log_brew='0', log_fermentation='0', log_ispindel='0', inventory_reduced='0', locked='0"; // Equipment $sql .= "', eq_name='Kies zelf een installatie!"; $sql .= "', eq_boil_size='" . $row['boil_size'];