2 # MantisBT - A PHP based bugtracking system
4 # MantisBT is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 2 of the License, or
7 # (at your option) any later version.
9 # MantisBT 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 MantisBT. If not, see <http://www.gnu.org/licenses/>.
19 * @copyright Copyright (C) 2002 - 2010 MantisBT Team - mantisbt-dev@lists.sourceforge.net
20 * @link http://www.mantisbt.org
23 * @uses access_api.php
24 * @uses authentication_api.php
25 * @uses compress_api.php
26 * @uses config_api.php
29 * @uses helper_api.php
33 * @uses string_api.php
38 require_once( 'core.php' );
39 require_api( 'access_api.php' );
40 require_api( 'authentication_api.php' );
41 require_api( 'compress_api.php' );
42 require_api( 'config_api.php' );
43 require_api( 'form_api.php' );
44 require_api( 'gpc_api.php' );
45 require_api( 'helper_api.php' );
46 require_api( 'html_api.php' );
47 require_api( 'lang_api.php' );
48 require_api( 'print_api.php' );
49 require_api( 'string_api.php' );
50 require_api( 'tag_api.php' );
51 require_api( 'user_api.php' );
53 access_ensure_global_level( config_get( 'tag_view_threshold' ) );
56 $f_tag_id = gpc_get_int( 'tag_id' );
57 $t_tag_row = tag_get( $f_tag_id );
59 $t_name = string_display_line( $t_tag_row['name'] );
60 $t_description = string_display( $t_tag_row['description'] );
62 html_page_top( sprintf( lang_get( 'tag_details' ), $t_name ) );
66 <table
class="width100" cellspacing
="1">
70 <td
class="form-title" colspan
="2">
71 <?php
echo sprintf( lang_get( 'tag_details' ), $t_name ) ?
>
74 <td
class="right" colspan
="3">
75 <?php
print_bracket_link( 'search.php?tag_string='.urlencode($t_tag_row['name']), sprintf( lang_get( 'tag_filter_default' ), tag_stats_attached( $f_tag_id ) ) ); ?
>
80 <tr
class="row-category">
81 <td width
="15%"><?php
echo lang_get( 'tag_id' ) ?
></td
>
82 <td width
="25%"><?php
echo lang_get( 'tag_name' ) ?
></td
>
83 <td width
="20%"><?php
echo lang_get( 'tag_creator' ) ?
></td
>
84 <td width
="20%"><?php
echo lang_get( 'tag_created' ) ?
></td
>
85 <td width
="20%"><?php
echo lang_get( 'tag_updated' ) ?
></td
>
88 <tr
<?php
echo helper_alternate_class() ?
>>
89 <td
><?php
echo $t_tag_row['id'] ?
></td
>
90 <td
><?php
echo $t_name ?
></td
>
91 <td
><?php
echo string_display_line( user_get_name($t_tag_row['user_id']) ) ?
></td
>
92 <td
><?php
echo date( config_get( 'normal_date_format' ), $t_tag_row['date_created'] ) ?
> </td
>
93 <td
><?php
echo date( config_get( 'normal_date_format' ), $t_tag_row['date_updated'] ) ?
> </td
>
102 <tr
<?php
echo helper_alternate_class() ?
>>
103 <td
class="category"><?php
echo lang_get( 'tag_description' ) ?
></td
>
104 <td colspan
="4"><?php
echo $t_description ?
></td
>
109 $t_tags_related = tag_stats_related( $f_tag_id );
110 if ( count( $t_tags_related ) ) {
111 echo '<tr ',helper_alternate_class(),'>';
112 echo '<td class="category" rowspan="',count( $t_tags_related ),'">',lang_get( 'tag_related' ),'</td>';
115 foreach( $t_tags_related as $t_tag ) {
116 $t_name = string_display_line( $t_tag['name'] );
117 $t_description = string_display_line( $t_tag['description'] );
118 $t_count = $t_tag['count'];
120 echo ( $i > 0 ?
'<tr '.helper_alternate_class().'>' : '' );
121 echo "<td><a href='tag_view_page.php?tag_id=$t_tag[id]' title='$t_description'>$t_name</a></td>\n";
122 echo '<td colspan="3">';
123 print_bracket_link( 'search.php?tag_string='.urlencode("+$t_tag_row[name]".config_get('tag_separator')."+$t_name"), sprintf( lang_get( 'tag_related_issues' ), $t_tag['count'] ) );
135 $t_can_edit = access_has_global_level( config_get( 'tag_edit_threshold' ) );
136 $t_can_edit_own = $t_can_edit ||
auth_get_current_user_id() == tag_get_field( $f_tag_id, 'user_id' )
137 && access_has_global_level( config_get( 'tag_edit_own_threshold' ) );
139 if ( $t_can_edit_own ) { ?
>
140 <form action
="tag_update_page.php" method
="post">
141 <?php
# CSRF protection not required here - form does not result in modifications ?>
142 <input type
="hidden" name
="tag_id" value
="<?php echo $f_tag_id ?>" />
143 <input type
="submit" class="button" value
="<?php echo lang_get( 'tag_update_button' ) ?>" />
145 <?php
} if ( $t_can_edit ) { ?
>
146 <form action
="tag_delete.php" method
="post">
147 <?php
echo form_security_field( 'tag_delete' ) ?
>
148 <input type
="hidden" name
="tag_id" value
="<?php echo $f_tag_id ?>" />
149 <input type
="submit" class="button" value
="<?php echo lang_get( 'tag_delete_button' ) ?>" />