2 * Copyright (C) 2020 Dany De Bontridder <dany@alchimerys.be>
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.
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.
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.
18// Copyright (2002-2020) Author Dany De Bontridder <danydb@noalyss.eu>
21var TagGroup = function ()
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";
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
33 this.add_tag = function (p_tag_group_id, p_select, p_dossier) {
35 // retrieve value from p_select
36 var p_tag_id = $(p_select).value;
37 new Ajax.Request(this.callback, {
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) {
43 $("d_tag_group_add").update(req.responseText);
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
53 this.remove = function (p_jt_tag, p_dossier) {
56 new Ajax.Request(this.callback, {
58 parameters: {op: this.param_operation,
63 onSuccess: function (req) {
66 $("d_tag_group_add").update(req.responseText);