noalyss Version-9
cfgtags.inc.php
Go to the documentation of this file.
1<?php
2/*
3 * This file is part of NOALYSS.
4 *
5 * NOALYSS is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * NOALYSS is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with NOALYSS; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19// Copyright Author Dany De Bontridder danydb@aevalys.eu
20if (!defined('ALLOWED'))
21 die('Appel direct ne sont pas permis');
22
23/**
24 * @file
25 * @brief Manage the tags
26 *
27 */
28
29/* * *****************************************************************************
30 * Tags
31 *
32 * ***************************************************************************** */
33$tabs=new Html_Tab("tg", _("Etiquette"));
34
35ob_start();
38if (isset($_POST['save_tag_sb']))
39{
40 if (!isset($_POST['remove']))
41 {
42 try
43 {
44 $uos->check();
45 $tag->save($_POST);
46 $uos->save();
47 }
48 catch (Exception $e)
49 {
50 alert("déjà sauvé");
51 }
52 }
53 else
54 {
55 $tag->remove($_POST);
56 }
57}
58?>
59<div style="margin-left:5%;width:90%">
60 <p class="info">
61 <?php echo _("Vous pouvez utiliser ceci comme des étiquettes pour marquer des documents ou
62 comme des dossiers pour rassembler des documents. Un document peut appartenir
63 à plusieurs dossiers ou avoir plusieurs étiquettes."); ?>
64 </p>
65<?php
66$tag->show_list();
67$js=sprintf("onclick=\"show_tag('%s','%s','%s','p')\"", Dossier::id(), $_REQUEST['ac'], '-1');
68echo HtmlInput::button("tag_add", "Création étiquette", $js);
69?>
70</div>
71<?php
72$tabs->set_content(ob_get_contents());
73ob_end_clean();
74/* * *****************************************************************************
75 * Group of Tags
76 *
77 * ***************************************************************************** */
78$tag_group=new Html_Tab("grp_tg", _("Groupe étiquettes"));
79
80$obj=new Tag_Group_SQL($cn);
82$obj_manage->set_callback("ajax_misc.php");
83$obj_manage->add_json_param("op", "tag_group");
84ob_start();
85$obj_manage->display_table();
86$r=ob_get_contents();
87$tag_group->set_content($r);
88ob_end_clean();
89
90
92$out->add($tabs);
93$out->add($tag_group);
94$out->output();
95$obj_manage->create_js_script();
96?>
97<script>
98 $('divtg').show();
99 $('tabtg').className = 'tabs_selected';
100 $('divgrp_tg').hide();
101 $('tabgrp_tg').className = 'tabs';
102 var o_tagGroup=new TagGroup();
103</script>
p($p_string)
Definition: ac_common.php:39
alert($p_msg, $buffer=false)
alert in javascript
Definition: ac_common.php:738
$opd_description style
$_REQUEST['ac']
$obj_manage
Definition: cfgtags.inc.php:81
$out
Definition: cfgtags.inc.php:91
$js
Definition: cfgtags.inc.php:67
$tag
Definition: cfgtags.inc.php:36
$r
Definition: cfgtags.inc.php:86
$obj
Definition: cfgtags.inc.php:80
$uos
Definition: cfgtags.inc.php:37
$tabs
Definition: cfgtags.inc.php:33
$tag_group
Definition: cfgtags.inc.php:78
static id()
return the 'gDossier' value after a check
Tab Element.
static button($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
Display the tabs.
Objec to check a double insert into the database, this duplicate occurs after a refresh of the web pa...
manage tag_group table
Tag operations or actions to linked them together.
Definition: tag.class.php:32
$_POST['ac']
Definition: do.php:310