# HG changeset patch # User Michiel Broek # Date 1546792128 -3600 # Node ID da16371538c328b4a3cbbe2e7c0c6235925b9f21 # Parent 12aacf0da9820ee7a8435f0d07808271a753c020 When importing from brouwhulp use 0 and 1 instead of false and true for boolean variables. Added Export button to the recipe editor. Added beerxml recipe export. diff -r 12aacf0da982 -r da16371538c3 www/import/from_brouwhulp.php --- a/www/import/from_brouwhulp.php Sat Jan 05 17:26:07 2019 +0100 +++ b/www/import/from_brouwhulp.php Sun Jan 06 17:28:48 2019 +0100 @@ -570,13 +570,13 @@ else $fadded = "Mash"; $fermentables .= ',"f_added":"'.$fadded.'"'; - ($fermentable->ADD_AFTER_BOIL== "TRUE") ? $fermentables .= ',"f_add_after_boil":true' : $fermentables .= ',"f_add_after_boil":false'; - ($fermentable->RECOMMEND_MASH== "TRUE") ? $fermentables .= ',"f_recommend_mash":true' : $fermentables .= ',"f_recommend_mash":false'; + ($fermentable->ADD_AFTER_BOIL== "TRUE") ? $fermentables .= ',"f_add_after_boil":1' : $fermentables .= ',"f_add_after_boil":0'; + ($fermentable->RECOMMEND_MASH== "TRUE") ? $fermentables .= ',"f_recommend_mash":1' : $fermentables .= ',"f_recommend_mash":0'; if ($fermentable->DISSOLVED_PROTEIN) $fermentables .= ',"f_dissolved_protein":' . floatval($fermentable->DISSOLVED_PROTEIN); else $fermentables .= ',"f_dissolved_protein":0'; - ($fermentable->ADJUST_TO_TOTAL_100 == "TRUE") ? $fermentables .= ',"f_adjust_to_total_100":true' : $fermentables .= ',"f_adjust_to_total_100":false'; + ($fermentable->ADJUST_TO_TOTAL_100 == "TRUE") ? $fermentables .= ',"f_adjust_to_total_100":1' : $fermentables .= ',"f_adjust_to_total_100":0'; $percent = floatval($fermentable->PERCENTAGE); $fermentables .= ',"f_percentage":' . round($percent * 10) / 10.0; if ($fermentable->DI_pH) @@ -668,7 +668,7 @@ } $miscs .= ',"m_type":"' . mysqli_real_escape_string($db, $misc->TYPE) . '"'; $miscs .= ',"m_use_use":"' . mysqli_real_escape_string($db, $misc->USE) . '"'; - ($misc->AMOUNT_IS_WEIGHT== "TRUE") ? $miscs .= ',"m_amount_is_weight":true' : $miscs.= ',"m_amount_is_weight":false'; + ($misc->AMOUNT_IS_WEIGHT== "TRUE") ? $miscs .= ',"m_amount_is_weight":1' : $miscs.= ',"m_amount_is_weight":0'; if ($misc->TIME) { if (mysqli_real_escape_string($db, $misc->USE) == "Secondary") $miscs .= ',"m_time":' . floatval($misc->TIME) / 1440; @@ -707,7 +707,7 @@ $yeasts .= ',"y_product_id":"' . mysqli_real_escape_string($db, $yeast->PRODUCT_ID) . '"'; $yeasts .= ',"y_type":"' . mysqli_real_escape_string($db, $yeast->TYPE) . '"'; $yeasts .= ',"y_form":"' . mysqli_real_escape_string($db, $yeast->FORM) . '"'; - ($yeast->AMOUNT_IS_WEIGHT== "TRUE") ? $yeasts .= ',"y_amount_is_weight":true' : $yeasts.= ',"y_amount_is_weight":false'; + ($yeast->AMOUNT_IS_WEIGHT== "TRUE") ? $yeasts .= ',"y_amount_is_weight":1' : $yeasts.= ',"y_amount_is_weight":0'; if ($yeast->ADD_TO_SECONDARY=="FALSE") { $yeasts .= ',"y_use":"Primary"'; $svg = floatval($yeast->ATTENUATION); diff -r 12aacf0da982 -r da16371538c3 www/js/rec_edit.js --- a/www/js/rec_edit.js Sat Jan 05 17:26:07 2019 +0100 +++ b/www/js/rec_edit.js Sun Jan 06 17:28:48 2019 +0100 @@ -2722,6 +2722,13 @@ window.open(url); }); + $("#Export").jqxButton({ template: "info", width: '80px', theme: theme }); + $("#Export").click(function () { + // Open print in a new tab. + var url="rec_export.php?record=" + my_record; + window.open(url); + }); + $("#Delete").jqxButton({ template: "danger", width: '80px', theme: theme }); $("#Delete").click(function () { // Open a popup to confirm this action. diff -r 12aacf0da982 -r da16371538c3 www/rec_edit.php --- a/www/rec_edit.php Sat Jan 05 17:26:07 2019 +0100 +++ b/www/rec_edit.php Sun Jan 06 17:28:48 2019 +0100 @@ -94,10 +94,11 @@
- + + - +
diff -r 12aacf0da982 -r da16371538c3 www/rec_export.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www/rec_export.php Sun Jan 06 17:28:48 2019 +0100 @@ -0,0 +1,587 @@ +