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) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
20 * @copyright Copyright (C) 2002 - 2011 MantisBT Team - mantisbt-dev@lists.sourceforge.net
21 * @link http://www.mantisbt.org
23 * @uses access_api.php
24 * @uses authentication_api.php
25 * @uses columns_api.php
26 * @uses constant_inc.php
27 * @uses current_user_api.php
30 * @uses helper_api.php
36 if ( !defined( 'MANAGE_COLUMNS_INC_ALLOW' ) ) {
40 require_api( 'access_api.php' );
41 require_api( 'authentication_api.php' );
42 require_api( 'columns_api.php' );
43 require_api( 'constant_inc.php' );
44 require_api( 'current_user_api.php' );
45 require_api( 'file_api.php' );
46 require_api( 'form_api.php' );
47 require_api( 'helper_api.php' );
48 require_api( 'html_api.php' );
49 require_api( 'lang_api.php' );
50 require_api( 'print_api.php' );
52 $t_manage_page = defined( 'MANAGE_COLUMNS' );
53 $t_account_page = defined( 'ACCOUNT_COLUMNS' );
55 $t_project_id = helper_get_current_project();
57 # Calculate the user id to set the configuration for.
58 if ( $t_manage_page ) {
61 $t_user_id = auth_get_current_user_id();
64 $t_columns = columns_get_all( $t_project_id );
65 $t_all = implode( ', ', $t_columns );
67 $t_columns = helper_get_columns_to_view( COLUMNS_TARGET_CSV_PAGE
, /* $p_viewable_only */ false, $t_user_id );
68 $t_csv = implode( ', ', $t_columns );
70 $t_columns = helper_get_columns_to_view( COLUMNS_TARGET_VIEW_PAGE
, /* $p_viewable_only */ false, $t_user_id );
71 $t_view_issues = implode( ', ', $t_columns );
73 $t_columns = helper_get_columns_to_view( COLUMNS_TARGET_PRINT_PAGE
, /* $p_viewable_only */ false, $t_user_id );
74 $t_print_issues = implode( ', ', $t_columns );
76 $t_columns = helper_get_columns_to_view( COLUMNS_TARGET_EXCEL_PAGE
, /* $p_viewable_only */ false, $t_user_id );
77 $t_excel = implode( ', ', $t_columns );
80 <div id
="manage-columns-div" class="form-container">
81 <form id
="manage-columns-form" method
="post" <?php
if ( file_allow_bug_upload() ) { echo 'enctype="multipart/form-data"'; } ?
> action
="manage_config_columns_set.php">
82 <fieldset
class="has-required">
83 <legend
><span
><?php
echo lang_get( 'manage_columns_config' ) ?
></span
></legend
>
85 if ( $t_account_page ) {
86 print_account_menu( 'account_manage_columns_page.php' );
89 <?php
echo form_security_field( 'manage_config_columns_set' ) ?
>
90 <input type
="hidden" name
="project_id" value
="<?php echo $t_project_id ?>" />
91 <input type
="hidden" name
="form_page" value
="<?php echo $t_account_page ? 'account' : 'manage'; ?>" />
93 <div
class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
94 <label
for="all-columns"><span
><?php
echo lang_get( 'all_columns_title' )?
></span
></label
>
95 <span
class="textarea"><textarea id
="all-columns" <?php
echo helper_get_tab_index() ?
> name
="all_columns" readonly
="readonly" cols
="80" rows
="5"><?php
echo $t_all ?
></textarea
></span
>
96 <span
class="label-style"></span
>
98 <div
class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
99 <label
for="view-issues-columns" class="required"><span
><?php
echo lang_get( 'view_issues_columns_title' )?
></span
></label
>
100 <span
class="textarea"><textarea id
="view-issues-columns" <?php
echo helper_get_tab_index() ?
> name
="view_issues_columns" cols
="80" rows
="5"><?php
echo $t_view_issues ?
></textarea
></span
>
101 <span
class="label-style"></span
>
103 <div
class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
104 <label
for="print-issues-columns" class="required"><span
><?php
echo lang_get( 'print_issues_columns_title' )?
></span
></label
>
105 <span
class="textarea"><textarea id
="print-issues-columns" <?php
echo helper_get_tab_index() ?
> name
="print_issues_columns" cols
="80" rows
="5"><?php
echo $t_print_issues ?
></textarea
></span
>
106 <span
class="label-style"></span
>
108 <div
class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
109 <label
for="csv-columns" class="required"><span
><?php
echo lang_get( 'csv_columns_title' )?
></span
></label
>
110 <span
class="textarea"><textarea id
="csv-columns" <?php
echo helper_get_tab_index() ?
> name
="csv_columns" cols
="80" rows
="5"><?php
echo $t_csv ?
></textarea
></span
>
111 <span
class="label-style"></span
>
113 <div
class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
114 <label
for="excel-columns" class="required"><span
><?php
echo lang_get( 'excel_columns_title' )?
></span
></label
>
115 <span
class="textarea"><textarea id
="excel-columns" <?php
echo helper_get_tab_index() ?
> name
="excel_columns" cols
="80" rows
="5"><?php
echo $t_excel ?
></textarea
></span
>
116 <span
class="label-style"></span
>
119 if ( $t_account_page ) {
120 if ( $t_project_id == ALL_PROJECTS
) { ?
>
121 <span
class="submit-button"><input
<?php
echo helper_get_tab_index() ?
> type
="submit" class="button" name
="update_columns_as_my_default" value
="<?php echo lang_get( 'update_columns_as_my_default' ) ?>" /></span
><?php
123 <span
class="submit-button"><input
<?php
echo helper_get_tab_index() ?
> type
="submit" class="button" name
="update_columns_for_current_project" value
="<?php echo lang_get( 'update_columns_for_current_project' ) ?>" /></span
><?php
128 if ( $t_manage_page && current_user_is_administrator() ) { ?
>
129 <span
class="submit-button"><input
<?php
echo helper_get_tab_index() ?
> type
="submit" class="button" name
="update_columns_as_global_default" value
="<?php echo lang_get( 'update_columns_as_global_default' ) ?>" /></span
><?php
135 <div id
="manage-columns-copy-div" class="form-container">
136 <form id
="manage-columns-copy-form" method
="post" action
="manage_columns_copy.php">
138 <?php
echo form_security_field( 'manage_columns_copy' ) ?
>
139 <input type
="hidden" name
="project_id" value
="<?php echo $t_project_id ?>" />
140 <input type
="hidden" name
="manage_page" value
="<?php echo $t_manage_page ?>" />
142 <select name
="other_project_id">
143 <?php
print_project_option_list( /* project_id */ null, /* include_all_projects */ true, /* filter_project_id */ $t_project_id ); ?
>
146 <?php
# Skip "Copy From" if the current project is ALL PROJECTS, the current page is management page, and the user is not administrator
147 if ( !$t_manage_page ||
( $t_project_id != ALL_PROJECTS
) ||
current_user_is_administrator() ) { ?
>
148 <input type
="submit" name
="copy_from" class="button" value
="<?php echo lang_get( 'copy_columns_from' ) ?>" /><?php
150 <input type
="submit" name
="copy_to" class="button" value
="<?php echo lang_get( 'copy_columns_to' ) ?>" />
156 if ( $t_account_page ) {
158 <div
class="form-container">
159 <form method
="post" action
="manage_config_columns_reset.php">
161 <?php
echo form_security_field( 'manage_config_columns_reset' ) ?
>
162 <span
class="submit-button"><input type
="submit" class="button" value
="<?php echo lang_get( 'reset_columns_configuration' ) ?>" /></span
>