www/js/rec_main.js

Wed, 06 Dec 2023 20:26:00 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 06 Dec 2023 20:26:00 +0100
changeset 855
2d328a2a4025
parent 815
5714ea86187d
permissions
-rw-r--r--

Fixed init scripts names in Makefile. Update crontasks to use the database to check the log entries for products.

67
883e897aad40 Start building the workflow in the scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 /*****************************************************************************
813
752bb80362fb Changed button text
Michiel Broek <mbroek@mbse.eu>
parents: 524
diff changeset
2 * Copyright (C) 2018-2022
67
883e897aad40 Start building the workflow in the scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 *
883e897aad40 Start building the workflow in the scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4 * Michiel Broek <mbroek at mbse dot eu>
883e897aad40 Start building the workflow in the scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 *
883e897aad40 Start building the workflow in the scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 * This file is part of BMS
883e897aad40 Start building the workflow in the scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 *
883e897aad40 Start building the workflow in the scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 * This is free software; you can redistribute it and/or modify it
883e897aad40 Start building the workflow in the scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 * under the terms of the GNU General Public License as published by the
883e897aad40 Start building the workflow in the scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 * Free Software Foundation; either version 2, or (at your option) any
883e897aad40 Start building the workflow in the scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 * later version.
883e897aad40 Start building the workflow in the scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 *
883e897aad40 Start building the workflow in the scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 * BrewCloud is distributed in the hope that it will be useful, but
883e897aad40 Start building the workflow in the scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
883e897aad40 Start building the workflow in the scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
883e897aad40 Start building the workflow in the scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 * General Public License for more details.
883e897aad40 Start building the workflow in the scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 *
883e897aad40 Start building the workflow in the scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
883e897aad40 Start building the workflow in the scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19 * along with ThermFerm; see the file COPYING. If not, write to the Free
883e897aad40 Start building the workflow in the scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
883e897aad40 Start building the workflow in the scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21 *****************************************************************************/
883e897aad40 Start building the workflow in the scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22
883e897aad40 Start building the workflow in the scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
23
473
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
24 $(document).ready(function() {
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
25 var source = {
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
26 datatype: 'json',
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
27 cache: false,
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
28 datafields: [
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
29 { name: 'record', type: 'number' },
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
30 { name: 'st_name', type: 'string' },
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
31 { name: 'st_letter', type: 'string' },
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
32 { name: 'st_guide', type: 'string' },
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
33 { name: 'name', type: 'string' },
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
34 { name: 'est_og', type: 'float' },
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
35 { name: 'est_color', type: 'float' },
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
36 { name: 'est_ibu', type: 'float' },
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
37 { name: 'est_abv', type: 'float' },
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
38 ],
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
39 id: 'record',
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
40 url: 'includes/db_recipes.php'
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
41 },
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
42 dataAdapter = new $.jqx.dataAdapter(source);
471
0bf73d605604 Code optimize and compress.
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
43
473
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
44 // initialize jqxGrid
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
45 $('#jqxgrid').jqxGrid({
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
46 width: 1280,
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
47 height: 630,
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
48 source: dataAdapter,
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
49 groupable: true,
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
50 theme: theme,
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
51 filterable: true,
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
52 filtermode: 'excel',
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
53 columns: [
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
54 { text: 'Stijlgids', datafield: 'st_guide', width: 120 },
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
55 { text: 'Letter', datafield: 'st_letter', width: 60 },
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
56 { text: 'Stijl', datafield: 'st_name', width: 160 },
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
57 { text: 'Naam', datafield: 'name' },
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
58 { text: 'OG', datafield: 'est_og', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f3' },
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
59 { text: 'EBC', datafield: 'est_color', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f0' },
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
60 { text: 'IBU', datafield: 'est_ibu', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f0' },
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
61 { text: 'ABV', datafield: 'est_abv', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'p1' },
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
62 { text: '', datafield: 'Edit', width: 120, align: 'center', columntype: 'button', cellsrenderer: function() {
813
752bb80362fb Changed button text
Michiel Broek <mbroek@mbse.eu>
parents: 524
diff changeset
63 return 'Bekijk';
473
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
64 }, buttonclick: function(row) {
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
65 var datarecord = dataAdapter.records[row];
815
5714ea86187d Renamed scripts rec_edit.* to rec_view.*. Removed the add recipe button from the recipe tree selecctor.
Michiel Broek <mbroek@mbse.eu>
parents: 813
diff changeset
66 window.location.href = 'rec_view.php?record=' + datarecord.record + '&return=rec_main.php';
473
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
67 }
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
68 }
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
69 ],
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
70 groups: ['st_guide', 'st_letter']
5c7566f6d42a gjslint fixes.
Michiel Broek <mbroek@mbse.eu>
parents: 471
diff changeset
71 });
67
883e897aad40 Start building the workflow in the scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
72 });

mercurial