# HG changeset patch # User Michiel Broek # Date 1580300761 -3600 # Node ID 10b61aacb1c1de384cb7b19f7267f070f2359963 # Parent 112c278be8037f1c22a101aded8d226bed9eacb9 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. diff -r 112c278be803 -r 10b61aacb1c1 www/crontasks.php --- 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); + } } diff -r 112c278be803 -r 10b61aacb1c1 www/includes/db_divides.php --- 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 diff -r 112c278be803 -r 10b61aacb1c1 www/includes/db_product.php --- 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']); diff -r 112c278be803 -r 10b61aacb1c1 www/js/log_fermentation.js --- 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 * @@ -131,7 +131,7 @@ '' + '' + '' + - '' + my_code + ' ' + my_name + ' vergisting' + + '' + my_code + ' ' + my_name + ' klimaatkast' + '' + '' + content + ''; 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 }); diff -r 112c278be803 -r 10b61aacb1c1 www/js/prod_divide.js --- 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 * @@ -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' }, diff -r 112c278be803 -r 10b61aacb1c1 www/js/prod_edit.js --- 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. diff -r 112c278be803 -r 10b61aacb1c1 www/js/prod_new.js --- 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 * @@ -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(), diff -r 112c278be803 -r 10b61aacb1c1 www/log_fermentation.php --- 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 @@
diff -r 112c278be803 -r 10b61aacb1c1 www/prod_duplicate.php --- 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 diff -r 112c278be803 -r 10b61aacb1c1 www/prod_edit.php --- 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 @@
- + +
diff -r 112c278be803 -r 10b61aacb1c1 www/rec_toproduct.php --- 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'];