# HG changeset patch # User Michiel Broek # Date 1551390658 -3600 # Node ID d0f7b4ab000f68796d5a7848e0e631ee97bc2eec # Parent 72bcc7ac60da9ddfae37a42fc68e747f07d10045 Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted. diff -r 72bcc7ac60da -r d0f7b4ab000f www/Makefile --- a/www/Makefile Thu Feb 28 15:40:14 2019 +0100 +++ b/www/Makefile Thu Feb 28 22:50:58 2019 +0100 @@ -10,11 +10,11 @@ inv_equipments.php inv_fermentables.php inv_hops.php inv_instock.php \ inv_miscs.php inv_suppliers.php inv_waters.php inv_yeasts.php log_brew.php \ log_fermentation.php mon_brewer.php mon_fermenter.php mon_node.php \ - prod_archive_code.php prod_archive_date.php prod_archive_name.php \ - prod_edit.php prod_export.php prod_impbrew.php prod_inprod.php prod_new.php \ - prod_print.php prod_reduce.php profile_fermentation.php \ + prod_archive_code.php prod_archive_date.php prod_archive_name.php prod_beerxml.php \ + prod_duplicate.php prod_edit.php prod_export.php prod_impbrew.php prod_inprod.php prod_new.php \ + prod_print.php prod_reduce.php prod_torecipe.php profile_fermentation.php \ profile_mash.php profile_setup.php profile_styles.php profile_water.php \ - rec_edit.php rec_export.php rec_main.php rec_new.php rec_print.php \ + rec_beerxml.php rec_edit.php rec_export.php rec_main.php rec_new.php rec_print.php \ upl_brew.php version.php SUB = version.php.in images/* css/* jqwidgets/* jqwidgets/styles/* \ jqwidgets/styles/images/* jqwidgets/globalization/* js/* \ diff -r 72bcc7ac60da -r d0f7b4ab000f www/css/style.css --- a/www/css/style.css Thu Feb 28 15:40:14 2019 +0100 +++ b/www/css/style.css Thu Feb 28 22:50:58 2019 +0100 @@ -40,6 +40,7 @@ } +#export_table, #about_table { width: 960px; background: #353536; @@ -50,6 +51,7 @@ } + #node_table { width: 600px; background: #353536; diff -r 72bcc7ac60da -r d0f7b4ab000f www/includes/global.inc.php --- a/www/includes/global.inc.php Thu Feb 28 15:40:14 2019 +0100 +++ b/www/includes/global.inc.php Thu Feb 28 22:50:58 2019 +0100 @@ -50,6 +50,10 @@ $my_name = $_GET['name']; else $my_name = ''; +if (isset($_GET['select'])) + $my_select = $_GET['select']; +else + $my_select = ''; $escapers = array("\\", "/", "\"", "\n", "\r", "\t", "\x08", "\x0c"); $replacements = array("\\\\", "\\/", "\\\"", "\\n", "\\r", "\\t", "\\f", "\\b"); @@ -93,6 +97,7 @@ global $my_return; global $my_name; global $my_code; + global $my_select; global $my_brewery_name; global $my_factor_mashhop; global $my_factor_fwh; @@ -118,9 +123,10 @@ var theme = ""; var my_record = ""; var my_return = ""; - var my_name= ""; - var my_code= ""; - var my_uuid= ""; + var my_name = ""; + var my_code = ""; + var my_uuid = ""; + var my_select = ""; var my_brewery_name = ""; var my_factor_mashhop = ""; var my_factor_fwh = ""; diff -r 72bcc7ac60da -r d0f7b4ab000f www/js/prod_edit.js --- a/www/js/prod_edit.js Thu Feb 28 15:40:14 2019 +0100 +++ b/www/js/prod_edit.js Thu Feb 28 22:50:58 2019 +0100 @@ -1765,11 +1765,10 @@ } /* - * When the brew is in progress or done, block equipment select. + * When the brew is in progress or done, block equipment select and delete. */ - if (dataRecord.stage > 1) + if (dataRecord.stage > 1) { $("#equipmentSelect").jqxDropDownList({ disabled: true }); - if (dataRecord.stage > 0) { $("#Delete").jqxButton({ disabled: true }); } @@ -5307,8 +5306,9 @@ $("#Export").jqxButton({ template: "info", width: '80px', theme: theme }); $("#Export").click(function () { saveRecord(); - var url="prod_beerxml.php?record=" + my_record; - window.open(url); + var url="prod_export.php?record=" + my_record + "&return=" + my_return + "&select=" + my_select + + "&code=" + dataRecord.code + "&name=" + dataRecord.name; + window.location.href = url; }); $("#Delete").jqxButton({ template: "danger", width: '80px', theme: theme }); diff -r 72bcc7ac60da -r d0f7b4ab000f www/js/prod_export.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www/js/prod_export.js Thu Feb 28 22:50:58 2019 +0100 @@ -0,0 +1,62 @@ +/***************************************************************************** + * Copyright (C) 2019 + * + * Michiel Broek + * + * This file is part of BMS + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2, or (at your option) any + * later version. + * + * BrewCloud is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with ThermFerm; see the file COPYING. If not, write to the Free + * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + *****************************************************************************/ + + +$(document).ready(function () { + + var choice = 0; + + $("#name").html(my_name); + $("#code").html(my_code); + $("#jqxRadioButton1").jqxRadioButton({ theme: theme, width: 250, height: 23 }); + $("#jqxRadioButton2").jqxRadioButton({ theme: theme, width: 250, height: 23 }); + $("#jqxRadioButton3").jqxRadioButton({ theme: theme, width: 250, height: 23 }); + $('#jqxRadioButton1').on('checked', function (event) { + $('#Start').jqxButton({ disabled: false }); + choice = 1; + }); + $('#jqxRadioButton2').on('checked', function (event) { + $('#Start').jqxButton({ disabled: false }); + choice = 2; + }); + $('#jqxRadioButton3').on('checked', function (event) { + $('#Start').jqxButton({ disabled: false }); + choice = 3; + }); + + $('#Start').jqxButton({ template: "success", width: '100px', theme: theme, disabled: true }); + $('#Start').click(function () { + if (choice == 1) { + var url="prod_beerxml.php?record=" + my_record; + window.open(url); + } else if (choice == 2) { + var url="prod_duplicate.php?record=" + my_record; + window.open(url); + } else if (choice == 3) { + var url="prod_torecipe.php?record=" + my_record; + window.open(url); + } + // Return to the original product + window.location.href = my_return + "?record=" + my_record; + }); + +}); diff -r 72bcc7ac60da -r d0f7b4ab000f www/js/rec_export.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www/js/rec_export.js Thu Feb 28 22:50:58 2019 +0100 @@ -0,0 +1,27 @@ +/***************************************************************************** + * Copyright (C) 2019 + * + * Michiel Broek + * + * This file is part of BMS + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2, or (at your option) any + * later version. + * + * BrewCloud is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with ThermFerm; see the file COPYING. If not, write to the Free + * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + *****************************************************************************/ + + +$(document).ready(function () { + + +}); diff -r 72bcc7ac60da -r d0f7b4ab000f www/prod_duplicate.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www/prod_duplicate.php Thu Feb 28 22:50:58 2019 +0100 @@ -0,0 +1,221 @@ +window.close();"; +exit; diff -r 72bcc7ac60da -r d0f7b4ab000f www/prod_export.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www/prod_export.php Thu Feb 28 22:50:58 2019 +0100 @@ -0,0 +1,42 @@ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Export product
 
Naam:
Code:
Maak beerxml bestand:
Dupliceer als nieuw product:
Copieer als recept:
 
+
+
+ + diff -r 72bcc7ac60da -r d0f7b4ab000f www/prod_torecipe.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www/prod_torecipe.php Thu Feb 28 22:50:58 2019 +0100 @@ -0,0 +1,110 @@ +window.close();"; +exit; diff -r 72bcc7ac60da -r d0f7b4ab000f www/rec_export.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www/rec_export.php Thu Feb 28 22:50:58 2019 +0100 @@ -0,0 +1,11 @@ + + +
+
+ +