noalyss Version-9
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
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/**
21 * @class
22 *
23 */
24var TagGroup = function ()
25{
26 this.callback = "ajax_misc.php";
27 this.param_operation = "tag_set_group";
28 this.list_tag = "ol_tag_group";
29 this.div_tag_add = "d_tag_group_add";
30 /**
31 * Add a tag to group and redraw the div "div_tag_add"
32 * @param {int} p_tag_group_id
33 * @param {int} p_tag_id
34 * @param {int} p_dossier
35 */
36 this.add_tag = function (p_tag_group_id, p_select, p_dossier) {
37 waiting_box();
38 // retrieve value from p_select
39 var p_tag_id = $(p_select).value;
40 new Ajax.Request(this.callback, {
41 method: "get",
42 parameters: {op: this.param_operation, gDossier: p_dossier, act: "add", tag_group: p_tag_group_id, tag: p_tag_id},
43 onSuccess: function (req) {
44 remove_waiting_box();
45 // redraw div_tag_add
46 $("d_tag_group_add").update(req.responseText);
47 }
48 });
49 };
50 /**
51 * removing a tag from a group and redraw the div "div_tag_add"
52 * @param {int} p_tag_group_id
53 * @param {int} p_tag_id
54 * @param {int} p_dossier
55 */
56 this.remove = function (p_jt_tag, p_dossier) {
57 waiting_box();
58
59 new Ajax.Request(this.callback, {
60 method: "get",
61 parameters: {op: this.param_operation,
62 gDossier: p_dossier,
63 act: "remove",
64 jt_tag: p_jt_tag
65 },
66 onSuccess: function (req) {
67 remove_waiting_box();
68 // redraw div_tag_add
69 $("d_tag_group_add").update(req.responseText);
70 }
71 });
72 };
73};