Thu, 05 Dec 2019 13:25:54 +0100
Version 0.3.25
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 | |
525
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
24 | $(document).ready(function() { |
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
|
25 | |
525
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
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 | |
525
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
28 | $('#name').html(my_name); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
29 | $('#code').html(my_code); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
30 | $('#jqxRadioButton1').jqxRadioButton({ theme: theme, width: 250, height: 23 }); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
31 | $('#jqxRadioButton2').jqxRadioButton({ theme: theme, width: 250, height: 23 }); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
32 | $('#jqxRadioButton3').jqxRadioButton({ theme: theme, width: 250, height: 23 }); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
33 | $('#jqxRadioButton4').jqxRadioButton({ theme: theme, width: 250, height: 23 }); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
34 | $('#jqxRadioButton5').jqxRadioButton({ theme: theme, width: 250, height: 23 }); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
35 | $('#jqxRadioButton6').jqxRadioButton({ theme: theme, width: 250, height: 23 }); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
36 | $('#jqxRadioButton7').jqxRadioButton({ theme: theme, width: 250, height: 23 }); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
37 | if ((my_split != 0) || (my_stage >= 6)) { |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
38 | $('#jqxRadioButton3').jqxRadioButton({ disabled: true }); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
39 | document.getElementById('pmpt3').style.color = 'red'; |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
40 | } |
497
0fe366d953ab
Prepare screens for product divide batch.
Michiel Broek <mbroek@mbse.eu>
parents:
494
diff
changeset
|
41 | |
525
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
42 | $('#jqxRadioButton1').on('checked', function(event) { |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
43 | $('#Start').jqxButton({ disabled: false }); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
44 | choice = 1; |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
45 | }); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
46 | $('#jqxRadioButton2').on('checked', function(event) { |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
47 | $('#Start').jqxButton({ disabled: false }); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
48 | choice = 2; |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
49 | }); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
50 | $('#jqxRadioButton3').on('checked', function(event) { |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
51 | $('#Start').jqxButton({ disabled: false }); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
52 | choice = 3; |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
53 | }); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
54 | $('#jqxRadioButton4').on('checked', function(event) { |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
55 | $('#Start').jqxButton({ disabled: false }); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
56 | choice = 4; |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
57 | }); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
58 | $('#jqxRadioButton5').on('checked', function(event) { |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
59 | $('#Start').jqxButton({ disabled: false }); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
60 | choice = 5; |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
61 | }); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
62 | $('#jqxRadioButton6').on('checked', function(event) { |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
63 | $('#Start').jqxButton({ disabled: false }); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
64 | choice = 6; |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
65 | }); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
66 | $('#jqxRadioButton7').on('checked', function(event) { |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
67 | $('#Start').jqxButton({ disabled: false }); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
68 | choice = 7; |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
69 | }); |
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
|
70 | |
525
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
71 | $('#Start').jqxButton({ template: 'success', width: '100px', theme: theme, disabled: true }); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
72 | $('#Start').click(function() { |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
73 | if (choice == 1) { |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
74 | window.open('prod_beerxml.php?record=' + my_record); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
75 | } else if (choice == 2) { |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
76 | window.open('prod_duplicate.php?record=' + my_record); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
77 | } else if (choice == 3) { |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
78 | window.location.href = 'prod_divide.php?record=' + my_record + '&return=' + my_return; |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
79 | } else if (choice == 4) { |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
80 | window.open('prod_torecipe.php?record=' + my_record); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
81 | } else if (choice == 5) { |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
82 | window.open('prod_print.php?record=' + my_record); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
83 | } else if (choice == 6) { |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
84 | window.open('prod_checklist.php?record=' + my_record); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
85 | } else if (choice == 7) { |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
86 | window.open('prod_forum.php?record=' + my_record); |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
87 | } |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
88 | // Return to the original product |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
89 | if (choice != 3) |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
90 | window.location.href = 'prod_edit.php?record=' + my_record + '&return=' + my_return; |
8bbc5730aaa8
Code cleanup and manual compress
Michiel Broek <mbroek@mbse.eu>
parents:
498
diff
changeset
|
91 | }); |
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
|
92 | |
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
|
93 | }); |