Wed, 16 Oct 2019 21:05:03 +0200
Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1 | /***************************************************************************** |
208
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
2 | * Copyright (C) 2014-2019 |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
3 | * |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
4 | * Michiel Broek <mbroek at mbse dot eu> |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
5 | * |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
6 | * This file is part of Brewery Management System |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
7 | * |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
8 | * This is free software; you can redistribute it and/or modify it |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
9 | * under the terms of the GNU General Public License as published by the |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
10 | * Free Software Foundation; either version 2, or (at your option) any |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
11 | * later version. |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
12 | * |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
13 | * BrewCloud is distributed in the hope that it will be useful, but |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
16 | * General Public License for more details. |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
17 | * |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
18 | * You should have received a copy of the GNU General Public License |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
19 | * along with ThermFerm; see the file COPYING. If not, write to the Free |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
20 | * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
21 | *****************************************************************************/ |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
22 | |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
23 | |
11 | 24 | |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
25 | function createDelElements() { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
26 | $('#eventWindow').jqxWindow({ |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
27 | theme: theme, |
11 | 28 | position: { x: 490, y: 210 }, |
29 | width: 300, | |
41
a26a3d63e90f
Added toolstips and finished translation
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
30 | height: 175, |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
31 | resizable: false, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
32 | isModal: true, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
33 | modalOpacity: 0.4, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
34 | okButton: $('#delOk'), |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
35 | cancelButton: $('#delCancel'), |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
36 | initContent: function () { |
64
5d5fc6f7cbfe
Improved recipes import. Finished inventory_suppliers.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
37 | $('#delOk').jqxButton({ template: "danger", width: '65px', theme: theme }); |
5d5fc6f7cbfe
Improved recipes import. Finished inventory_suppliers.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
38 | $('#delCancel').jqxButton({ template: "success", width: '65px', theme: theme }); |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
39 | $('#delCancel').focus(); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
40 | } |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
41 | }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
42 | $('#eventWindow').jqxWindow('hide'); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
43 | } |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
44 | |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
45 | |
11 | 46 | |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
47 | $(document).ready(function () { |
488
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
208
diff
changeset
|
48 | |
41
a26a3d63e90f
Added toolstips and finished translation
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
49 | // tooltips |
a26a3d63e90f
Added toolstips and finished translation
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
50 | $("#name").jqxTooltip({ content: 'De naam van de leverancier.' }); |
a26a3d63e90f
Added toolstips and finished translation
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
51 | $("#address").jqxTooltip({ content: 'Het adres en huisnummer.' }); |
a26a3d63e90f
Added toolstips and finished translation
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
52 | $("#city").jqxTooltip({ content: 'De woonplaats of gemeente.' }); |
a26a3d63e90f
Added toolstips and finished translation
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
53 | $("#zip").jqxTooltip({ content: 'De postcode.' }); |
a26a3d63e90f
Added toolstips and finished translation
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
54 | $("#country").jqxTooltip({ content: 'Het land.' }); |
a26a3d63e90f
Added toolstips and finished translation
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
55 | $("#website").jqxTooltip({ content: 'Het website adres.' }); |
a26a3d63e90f
Added toolstips and finished translation
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
56 | $("#email").jqxTooltip({ content: 'Het email adres.' }); |
a26a3d63e90f
Added toolstips and finished translation
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
57 | $("#phone").jqxTooltip({ content: 'Het telefoon nummer.' }); |
a26a3d63e90f
Added toolstips and finished translation
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
58 | $("#notes").jqxTooltip({ content: 'Opmerkingen over deze leverancier.' }); |
488
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
208
diff
changeset
|
59 | |
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
208
diff
changeset
|
60 | var url = 'includes/db_inventory_suppliers.php', |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
61 | // prepare the data |
488
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
208
diff
changeset
|
62 | source = { |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
63 | datatype: "json", |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
64 | cache: false, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
65 | datafields: [ |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
66 | { name: 'record', type: 'number' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
67 | { name: 'name', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
68 | { name: 'address', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
69 | { name: 'city', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
70 | { name: 'zip', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
71 | { name: 'country', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
72 | { name: 'website', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
73 | { name: 'email', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
74 | { name: 'phone', type: 'string' }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
75 | { name: 'notes', type: 'string' } |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
76 | ], |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
77 | id: 'record', |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
78 | url: url, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
79 | deleterow: function (rowid, commit) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
80 | // synchronize with the server - send delete command |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
81 | var data = "delete=true&" + $.param({ record: rowid }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
82 | $.ajax({ |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
83 | dataType: 'json', |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
84 | url: url, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
85 | cache: false, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
86 | data: data, |
64
5d5fc6f7cbfe
Improved recipes import. Finished inventory_suppliers.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
87 | type: "POST", |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
88 | success: function (data, status, xhr) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
89 | commit(true); |
488
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
208
diff
changeset
|
90 | location.reload( true ); |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
91 | }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
92 | error: function (jqXHR, textStatus, errorThrown) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
93 | commit(false); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
94 | } |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
95 | }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
96 | }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
97 | addrow: function (rowid, rowdata, position, commit) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
98 | var data = "insert=true&" + $.param(rowdata); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
99 | $.ajax({ |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
100 | dataType: 'json', |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
101 | url: url, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
102 | cache: false, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
103 | data: data, |
64
5d5fc6f7cbfe
Improved recipes import. Finished inventory_suppliers.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
104 | type: "POST", |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
105 | success: function (data, status, xhr) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
106 | commit(true); |
488
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
208
diff
changeset
|
107 | location.reload( true ); |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
108 | }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
109 | error: function(jqXHR, textStatus, errorThrown) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
110 | commit(false); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
111 | } |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
112 | }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
113 | }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
114 | updaterow: function (rowid, rowdata, commit) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
115 | var data = "update=true&" + $.param(rowdata); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
116 | $.ajax({ |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
117 | dataType: 'json', |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
118 | url: url, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
119 | cache: false, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
120 | data: data, |
64
5d5fc6f7cbfe
Improved recipes import. Finished inventory_suppliers.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
121 | type: "POST", |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
122 | success: function (data, status, xhr) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
123 | commit(true); |
488
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
208
diff
changeset
|
124 | location.reload( true ); |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
125 | }, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
126 | error: function(jqXHR, textStatus, errorThrown) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
127 | commit(false); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
128 | } |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
129 | }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
130 | } |
488
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
208
diff
changeset
|
131 | }, |
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
208
diff
changeset
|
132 | dataAdapter = new $.jqx.dataAdapter(source), |
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
208
diff
changeset
|
133 | editrow = -1; |
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
208
diff
changeset
|
134 | |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
135 | // initialize the input fields. |
64
5d5fc6f7cbfe
Improved recipes import. Finished inventory_suppliers.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
136 | $("#name").jqxInput({ theme: theme, width: 640, height: 23 }); |
5d5fc6f7cbfe
Improved recipes import. Finished inventory_suppliers.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
137 | $("#address").jqxInput({ theme: theme, width: 350, height: 23 }); |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
138 | $("#zip").jqxInput({ theme: theme, width: 120, height: 23 }); |
64
5d5fc6f7cbfe
Improved recipes import. Finished inventory_suppliers.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
139 | $("#city").jqxInput({ theme: theme, width: 350, height: 23 }); |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
140 | $("#country").jqxInput({ theme: theme, width: 250, height: 23 }); |
64
5d5fc6f7cbfe
Improved recipes import. Finished inventory_suppliers.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
141 | $("#website").jqxInput({ theme: theme, width: 640, height: 23 }); |
5d5fc6f7cbfe
Improved recipes import. Finished inventory_suppliers.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
142 | $("#email").jqxInput({ theme: theme, width: 640, height: 23 }); |
5d5fc6f7cbfe
Improved recipes import. Finished inventory_suppliers.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
143 | $("#phone").jqxInput({ theme: theme, width: 175, height: 23 }); |
208
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
144 | $("#notes").jqxInput({ theme: theme, width: 800, height: 100 }); |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
145 | |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
146 | // initialize jqxGrid |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
147 | $("#jqxgrid").jqxGrid({ |
11 | 148 | width: 1280, |
149 | height: 630, | |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
150 | source: dataAdapter, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
151 | theme: theme, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
152 | showstatusbar: true, |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
153 | renderstatusbar: function (statusbar) { |
488
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
208
diff
changeset
|
154 | var addButton, container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); |
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
208
diff
changeset
|
155 | addButton = $("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Nieuw</span></div>"); |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
156 | container.append(addButton); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
157 | statusbar.append(container); |
208
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
158 | addButton.jqxButton({ theme: theme, width: 90, height: 20 }); |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
159 | // add new row. |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
160 | addButton.click(function (event) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
161 | editrow = -1; |
208
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
162 | $("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } }); |
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
163 | $("#name").val('Nieuwe leverancier'); |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
164 | $("#address").val(''); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
165 | $("#city").val(''); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
166 | $("#zip").val(''); |
208
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
167 | $("#country").val('Nederland'); |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
168 | $("#website").val(''); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
169 | $("#email").val(''); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
170 | $("#phone").val(''); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
171 | $("#notes").val(''); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
172 | $("#popupWindow").jqxWindow('open'); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
173 | }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
174 | }, |
208
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
175 | filterable: false, |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
176 | columns: [ |
64
5d5fc6f7cbfe
Improved recipes import. Finished inventory_suppliers.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
177 | { text: 'Leverancier naam', datafield: 'name' }, |
11 | 178 | { text: 'Adres', datafield: 'address', width: 300 }, |
179 | { text: 'Plaats', datafield: 'city', width: 250 }, | |
64
5d5fc6f7cbfe
Improved recipes import. Finished inventory_suppliers.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
180 | { text: 'Land', datafield: 'country', width: 200 }, |
5d5fc6f7cbfe
Improved recipes import. Finished inventory_suppliers.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
181 | { text: 'Telefoon', datafield: 'phone', width: 175 }, |
488
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
208
diff
changeset
|
182 | { text: 'Wijzig', datafield: 'Edit', width: 100, align: 'center', columntype: 'button', |
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
208
diff
changeset
|
183 | cellsrenderer: function () { |
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
208
diff
changeset
|
184 | return "Wijzig"; |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
185 | }, buttonclick: function (row) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
186 | // open the popup window when the user clicks a button. |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
187 | editrow = row; |
208
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
188 | $("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } }); |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
189 | // get the clicked row's data and initialize the input fields. |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
190 | var dataRecord = $("#jqxgrid").jqxGrid('getrowdata', editrow); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
191 | $("#name").val(dataRecord.name); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
192 | $("#address").val(dataRecord.address); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
193 | $("#city").val(dataRecord.city); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
194 | $("#zip").val(dataRecord.zip); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
195 | $("#country").val(dataRecord.country); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
196 | $("#website").val(dataRecord.website); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
197 | $("#email").val(dataRecord.email); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
198 | $("#phone").val(dataRecord.phone); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
199 | $("#notes").val(dataRecord.notes); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
200 | // show the popup window. |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
201 | $("#popupWindow").jqxWindow('open'); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
202 | } |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
203 | } |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
204 | ] |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
205 | }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
206 | // initialize the popup window and buttons. |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
207 | $("#popupWindow").jqxWindow({ |
208
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
208 | width: 1050, |
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
209 | height: 550, |
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
210 | resizable: false, |
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
211 | theme: theme, |
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
212 | isModal: true, |
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
213 | autoOpen: false, |
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
214 | cancelButton: $("#Cancel"), |
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
215 | modalOpacity: 0.40 |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
216 | }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
217 | $("#popupWindow").on('open', function () { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
218 | $("#name").jqxInput('selectAll'); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
219 | }); |
208
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
220 | $("#Delete").jqxButton({ template: "danger", width: '90px', theme: theme }); |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
221 | $("#Delete").click(function () { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
222 | if (editrow >= 0) { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
223 | // Open a popup to confirm this action. |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
224 | $('#eventWindow').jqxWindow('open'); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
225 | $("#delOk").click(function () { |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
226 | var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
227 | $("#jqxgrid").jqxGrid('deleterow', rowID); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
228 | }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
229 | } |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
230 | $("#popupWindow").jqxWindow('hide'); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
231 | }); |
208
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
232 | $("#Cancel").jqxButton({ template: "primary", width: '90px', theme: theme }); |
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
233 | $("#Save").jqxButton({ template: "success", width: '90px', theme: theme }); |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
234 | // update the edited row when the user clicks the 'Save' button. |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
235 | $("#Save").click(function () { |
488
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
208
diff
changeset
|
236 | var row, rowID = -1; |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
237 | if (editrow >= 0) { |
208
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
238 | rowID = $('#jqxgrid').jqxGrid('getrowid', editrow); |
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
239 | } |
488
77f1617b6994
Fixed inventory databases race conditions
Michiel Broek <mbroek@mbse.eu>
parents:
208
diff
changeset
|
240 | row = { |
208
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
241 | record: rowID, |
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
242 | name: $("#name").val(), |
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
243 | address: $("#address").val(), |
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
244 | city: $("#city").val(), |
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
245 | zip: $("#zip").val(), |
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
246 | country: $("#country").val(), |
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
247 | website: $("#website").val(), |
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
248 | email: $("#email").val(), |
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
249 | phone: $("#phone").val(), |
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
250 | notes: $("#notes").val() |
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
251 | }; |
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
252 | if (editrow >= 0) { |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
253 | $('#jqxgrid').jqxGrid('updaterow', rowID, row); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
254 | } else { |
208
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
255 | $('#jqxgrid').jqxGrid('addrow', null, row); |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
256 | } |
208
578c78abf058
Adjusted inventory suppliers screens to match the other screens.
Michiel Broek <mbroek@mbse.eu>
parents:
64
diff
changeset
|
257 | $("#popupWindow").jqxWindow('hide'); |
10
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
258 | }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
259 | createDelElements(); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
260 | }); |
606b4af8f918
Start of the merge with another unfinished project
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
261 |