noalyss Version-9
taggroup.js
Go to the documentation of this file.
1/*
2 * Copyright (C) 2020 Dany De Bontridder <dany@alchimerys.be>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18// Copyright (2002-2020) Author Dany De Bontridder <danydb@noalyss.eu>
19
20
21var TagGroup = function ()
22{
23 this.callback = "ajax_misc.php";
24 this.param_operation = "tag_set_group";
25 this.list_tag = "ol_tag_group";
26 this.div_tag_add = "d_tag_group_add";
27 /**
28 * Add a tag to group and redraw the div "div_tag_add"
29 * @param {int} p_tag_group_id
30 * @param {int} p_tag_id
31 * @param {int} p_dossier
32 */
33 this.add_tag = function (p_tag_group_id, p_select, p_dossier) {
34 waiting_box();
35 // retrieve value from p_select
36 var p_tag_id = $(p_select).value;
37 new Ajax.Request(this.callback, {
38 method: "get",
39 parameters: {op: this.param_operation, gDossier: p_dossier, act: "add", tag_group: p_tag_group_id, tag: p_tag_id},
40 onSuccess: function (req) {
41 remove_waiting_box();
42 // redraw div_tag_add
43 $("d_tag_group_add").update(req.responseText);
44 }
45 });
46 };
47 /**
48 * removing a tag from a group and redraw the div "div_tag_add"
49 * @param {int} p_tag_group_id
50 * @param {int} p_tag_id
51 * @param {int} p_dossier
52 */
53 this.remove = function (p_jt_tag, p_dossier) {
54 waiting_box();
55
56 new Ajax.Request(this.callback, {
57 method: "get",
58 parameters: {op: this.param_operation,
59 gDossier: p_dossier,
60 act: "remove",
61 jt_tag: p_jt_tag
62 },
63 onSuccess: function (req) {
64 remove_waiting_box();
65 // redraw div_tag_add
66 $("d_tag_group_add").update(req.responseText);
67 }
68 });
69 };
70};