www/js/rec_export.js

Sun, 12 May 2019 15:16:35 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sun, 12 May 2019 15:16:35 +0200
changeset 359
98354ef399cd
parent 303
98c2afc88780
child 494
af28ebe4a779
permissions
-rw-r--r--

Lot's of improvements for recipes and products database load and save. Insert missing yeast tolerance field for old products and recipes. Recipe locked and calc_acid fields coverted to integer. In recipe edit screen removed the Print button. It is now included in the export screen. Added recipe export to forum screen.

302
d0f7b4ab000f Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 /*****************************************************************************
d0f7b4ab000f Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2 * Copyright (C) 2019
d0f7b4ab000f Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 *
d0f7b4ab000f Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4 * Michiel Broek <mbroek at mbse dot eu>
d0f7b4ab000f Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 *
d0f7b4ab000f Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 * This file is part of BMS
d0f7b4ab000f Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 *
d0f7b4ab000f Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 * This is free software; you can redistribute it and/or modify it
d0f7b4ab000f Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 * under the terms of the GNU General Public License as published by the
d0f7b4ab000f Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 * Free Software Foundation; either version 2, or (at your option) any
d0f7b4ab000f Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 * later version.
d0f7b4ab000f Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 *
d0f7b4ab000f Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 * BrewCloud is distributed in the hope that it will be useful, but
d0f7b4ab000f Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
d0f7b4ab000f Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
d0f7b4ab000f Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 * General Public License for more details.
d0f7b4ab000f Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 *
d0f7b4ab000f Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
d0f7b4ab000f Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19 * along with ThermFerm; see the file COPYING. If not, write to the Free
d0f7b4ab000f Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
d0f7b4ab000f Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21 *****************************************************************************/
d0f7b4ab000f Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22
d0f7b4ab000f Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
23
d0f7b4ab000f Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
24 $(document).ready(function () {
d0f7b4ab000f Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
25
303
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
26 var choice = 0;
302
d0f7b4ab000f Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
27
303
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
28 $("#name").html(my_name);
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
29 $("#jqxRadioButton1").jqxRadioButton({ theme: theme, width: 250, height: 23 });
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
30 $("#jqxRadioButton2").jqxRadioButton({ theme: theme, width: 250, height: 23 });
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
31 $("#jqxRadioButton3").jqxRadioButton({ theme: theme, width: 250, height: 23 });
359
98354ef399cd Lot's of improvements for recipes and products database load and save. Insert missing yeast tolerance field for old products and recipes. Recipe locked and calc_acid fields coverted to integer. In recipe edit screen removed the Print button. It is now included in the export screen. Added recipe export to forum screen.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
32 $("#jqxRadioButton4").jqxRadioButton({ theme: theme, width: 250, height: 23 });
98354ef399cd Lot's of improvements for recipes and products database load and save. Insert missing yeast tolerance field for old products and recipes. Recipe locked and calc_acid fields coverted to integer. In recipe edit screen removed the Print button. It is now included in the export screen. Added recipe export to forum screen.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
33 $("#jqxRadioButton5").jqxRadioButton({ theme: theme, width: 250, height: 23 });
303
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
34 $('#jqxRadioButton1').on('checked', function (event) {
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
35 $('#Start').jqxButton({ disabled: false });
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
36 choice = 1;
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
37 });
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
38 $('#jqxRadioButton2').on('checked', function (event) {
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
39 $('#Start').jqxButton({ disabled: false });
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
40 choice = 2;
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
41 });
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
42 $('#jqxRadioButton3').on('checked', function (event) {
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
43 $('#Start').jqxButton({ disabled: false });
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
44 choice = 3;
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
45 });
359
98354ef399cd Lot's of improvements for recipes and products database load and save. Insert missing yeast tolerance field for old products and recipes. Recipe locked and calc_acid fields coverted to integer. In recipe edit screen removed the Print button. It is now included in the export screen. Added recipe export to forum screen.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
46 $('#jqxRadioButton4').on('checked', function (event) {
98354ef399cd Lot's of improvements for recipes and products database load and save. Insert missing yeast tolerance field for old products and recipes. Recipe locked and calc_acid fields coverted to integer. In recipe edit screen removed the Print button. It is now included in the export screen. Added recipe export to forum screen.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
47 $('#Start').jqxButton({ disabled: false });
98354ef399cd Lot's of improvements for recipes and products database load and save. Insert missing yeast tolerance field for old products and recipes. Recipe locked and calc_acid fields coverted to integer. In recipe edit screen removed the Print button. It is now included in the export screen. Added recipe export to forum screen.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
48 choice = 4;
98354ef399cd Lot's of improvements for recipes and products database load and save. Insert missing yeast tolerance field for old products and recipes. Recipe locked and calc_acid fields coverted to integer. In recipe edit screen removed the Print button. It is now included in the export screen. Added recipe export to forum screen.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
49 });
98354ef399cd Lot's of improvements for recipes and products database load and save. Insert missing yeast tolerance field for old products and recipes. Recipe locked and calc_acid fields coverted to integer. In recipe edit screen removed the Print button. It is now included in the export screen. Added recipe export to forum screen.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
50 $('#jqxRadioButton5').on('checked', function (event) {
98354ef399cd Lot's of improvements for recipes and products database load and save. Insert missing yeast tolerance field for old products and recipes. Recipe locked and calc_acid fields coverted to integer. In recipe edit screen removed the Print button. It is now included in the export screen. Added recipe export to forum screen.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
51 $('#Start').jqxButton({ disabled: false });
98354ef399cd Lot's of improvements for recipes and products database load and save. Insert missing yeast tolerance field for old products and recipes. Recipe locked and calc_acid fields coverted to integer. In recipe edit screen removed the Print button. It is now included in the export screen. Added recipe export to forum screen.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
52 choice = 5;
98354ef399cd Lot's of improvements for recipes and products database load and save. Insert missing yeast tolerance field for old products and recipes. Recipe locked and calc_acid fields coverted to integer. In recipe edit screen removed the Print button. It is now included in the export screen. Added recipe export to forum screen.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
53 });
303
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
54
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
55 $('#Start').jqxButton({ template: "success", width: '100px', theme: theme, disabled: true });
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
56 $('#Start').click(function () {
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
57 if (choice == 1) {
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
58 var url="rec_beerxml.php?record=" + my_record;
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
59 window.open(url);
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
60 } else if (choice == 2) {
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
61 var url="rec_duplicate.php?record=" + my_record;
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
62 window.open(url);
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
63 } else if (choice == 3) {
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
64 var url="rec_toproduct.php?record=" + my_record;
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
65 window.open(url);
359
98354ef399cd Lot's of improvements for recipes and products database load and save. Insert missing yeast tolerance field for old products and recipes. Recipe locked and calc_acid fields coverted to integer. In recipe edit screen removed the Print button. It is now included in the export screen. Added recipe export to forum screen.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
66 } else if (choice == 4) {
98354ef399cd Lot's of improvements for recipes and products database load and save. Insert missing yeast tolerance field for old products and recipes. Recipe locked and calc_acid fields coverted to integer. In recipe edit screen removed the Print button. It is now included in the export screen. Added recipe export to forum screen.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
67 var url="rec_print.php?record=" + my_record;
98354ef399cd Lot's of improvements for recipes and products database load and save. Insert missing yeast tolerance field for old products and recipes. Recipe locked and calc_acid fields coverted to integer. In recipe edit screen removed the Print button. It is now included in the export screen. Added recipe export to forum screen.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
68 window.open(url);
98354ef399cd Lot's of improvements for recipes and products database load and save. Insert missing yeast tolerance field for old products and recipes. Recipe locked and calc_acid fields coverted to integer. In recipe edit screen removed the Print button. It is now included in the export screen. Added recipe export to forum screen.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
69 } else if (choice == 5) {
98354ef399cd Lot's of improvements for recipes and products database load and save. Insert missing yeast tolerance field for old products and recipes. Recipe locked and calc_acid fields coverted to integer. In recipe edit screen removed the Print button. It is now included in the export screen. Added recipe export to forum screen.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
70 var url="rec_forum.php?record=" + my_record;
98354ef399cd Lot's of improvements for recipes and products database load and save. Insert missing yeast tolerance field for old products and recipes. Recipe locked and calc_acid fields coverted to integer. In recipe edit screen removed the Print button. It is now included in the export screen. Added recipe export to forum screen.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
71 window.open(url);
98354ef399cd Lot's of improvements for recipes and products database load and save. Insert missing yeast tolerance field for old products and recipes. Recipe locked and calc_acid fields coverted to integer. In recipe edit screen removed the Print button. It is now included in the export screen. Added recipe export to forum screen.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
72 }
98354ef399cd Lot's of improvements for recipes and products database load and save. Insert missing yeast tolerance field for old products and recipes. Recipe locked and calc_acid fields coverted to integer. In recipe edit screen removed the Print button. It is now included in the export screen. Added recipe export to forum screen.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
73 // Return to the original recipe
98354ef399cd Lot's of improvements for recipes and products database load and save. Insert missing yeast tolerance field for old products and recipes. Recipe locked and calc_acid fields coverted to integer. In recipe edit screen removed the Print button. It is now included in the export screen. Added recipe export to forum screen.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
74 window.location.href = "rec_edit.php?record=" + my_record + "&return=" + my_return;
303
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents: 302
diff changeset
75 });
302
d0f7b4ab000f Added product export screen with choices to export to beerxml, duplicate product or copy to recipe. Products in wait state can now be deleted.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
76 });

mercurial