/
manage_proj_edit_page.php
324 lines (307 loc) · 8.92 KB
/
manage_proj_edit_page.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
<?php
# Mantis - a php based bugtracking system
# Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
# Copyright (C) 2002 Mantis Team - mantisbt-dev@lists.sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
?>
<?php require_once( 'core.php' ) ?>
<?php login_cookie_check() ?>
<?php
check_access( MANAGER );
$f_project_id = gpc_get_int( 'f_project_id' );
$f_action = gpc_get_string( 'f_action', '' );
# If Deleteing item redirect to delete script
if ( 'delete' == $f_action ) {
print_header_redirect( 'manage_proj_delete.php?f_project_id='.$f_project_id );
}
$c_project_id = db_prepare_int( $f_project_id );
$query = "SELECT *
FROM $g_mantis_project_table
WHERE id='$c_project_id'";
$result = db_query( $query );
$row = db_fetch_array( $result );
extract( $row, EXTR_PREFIX_ALL, 'v' );
$v_name = string_edit_text( $v_name );
$v_description = string_edit_textarea( $v_description );
$v_file_path = string_edit_text( $v_file_path );
?>
<?php print_page_top1() ?>
<?php print_page_top2() ?>
<?php print_manage_menu( 'manage_proj_edit_page.php' ) ?>
<br />
<div align="center">
<form method="post" action="manage_proj_update.php">
<table class="width75" cellspacing="1">
<tr>
<td class="form-title" colspan="2">
<input type="hidden" name="f_project_id" value="<?php echo $f_project_id ?>" />
<?php echo lang_get( 'edit_project_title' ) ?>
</td>
</tr>
<tr class="row-1">
<td class="category" width="25%">
<?php echo lang_get( 'project_name' ) ?>
</td>
<td width="75%">
<input type="text" name="f_name" size="64" maxlength="128" value="<?php echo $v_name ?>" />
</td>
</tr>
<tr class="row-2">
<td class="category">
<?php echo lang_get( 'status' ) ?>
</td>
<td>
<select name="f_status">
<?php print_enum_string_option_list( 'project_status', $v_status ) ?>
</select>
</td>
</tr>
<tr class="row-1">
<td class="category">
<?php echo lang_get( 'enabled' ) ?>
</td>
<td>
<input type="checkbox" name="f_enabled" <?php check_checked( $v_enabled, ON ); ?> />
</td>
</tr>
<tr class="row-2">
<td class="category">
<?php echo lang_get( 'view_status' ) ?>
</td>
<td>
<select name="f_view_state">
<?php print_enum_string_option_list( 'view_state', $v_view_state) ?>
</select>
</td>
</tr>
<?php
if ( config_get( 'allow_file_upload' ) ) {
?>
<tr class="row-1">
<td class="category">
<?php echo lang_get( 'upload_file_path' ) ?>
</td>
<td>
<input type="text" name="f_file_path" size="70" maxlength="250" value="<?php echo $v_file_path ?>" />
</td>
</tr>
<?php
}
?>
<tr class="row-2">
<td class="category">
<?php echo lang_get( 'description' ) ?>
</td>
<td>
<textarea name="f_description" cols="60" rows="5" wrap="virtual"><?php echo $v_description ?></textarea>
</td>
</tr>
<tr>
<td>
</td>
<td>
<input type="submit" value="<?php echo lang_get( 'update_project_button' ) ?>" />
</td>
</tr>
</table>
</form>
</div>
<br />
<?php if ( access_level_check_greater_or_equal ( ADMINISTRATOR ) ) { ?>
<div class="border-center">
<form method="post" action="manage_proj_delete.php">
<input type="hidden" name="f_project_id" value="<?php echo $f_project_id ?>" />
<input type="submit" value="<?php echo lang_get( 'delete_project_button' ) ?>" />
</form>
</div>
<?php } ?>
<br />
<div align="center">
<table class="width75" cellspacing="1">
<tr>
<td class="form-title" colspan="2">
<?php echo lang_get( 'categories_and_version_title' ) ?>
</td>
</tr>
<tr class="row-category">
<td width="100%">
<?php echo lang_get( 'categories' ) ?>
</td>
</tr>
<tr>
<td width="100%">
<table width="100%" cellspacing="1">
<?php
$result = category_get_all( $f_project_id );
$category_count = db_num_rows( $result );
for ($i=0;$i<$category_count;$i++) {
$row = db_fetch_array( $result );
$t_category = $row['category'];
$t2_category = urlencode( $t_category );
$c_user_id = (integer)$row['user_id'];
if ( $c_user_id != 0 ) {
$c_user_name = user_get_field( $c_user_id, 'username' );
} else {
$c_user_name = '';
}
?>
<tr <?php echo helper_alternate_class() ?>>
<td width="50%">
<?php echo $t_category ?>
</td>
<td width="25%">
<?php echo $c_user_name ?>
</td>
<td class="center" width="25%">
<?php
print_bracket_link( 'manage_proj_cat_edit_page.php?f_project_id='.$f_project_id.'&f_category='.$t2_category.'&f_assigned_to='.$c_user_id, lang_get( 'edit_link' ) );
PRINT ' ';
print_bracket_link( 'manage_proj_cat_delete.php?f_project_id='.$f_project_id.'&f_category='.$t2_category, lang_get( 'delete_link' ) );
?>
</td>
</tr>
<?php } # end for loop ?>
</table>
</td>
</tr>
<tr>
<td class="left">
<form method="post" action="manage_proj_cat_add.php">
<input type="hidden" name="f_project_id" value="<?php echo $f_project_id ?>" />
<input type="text" name="f_category" size="32" maxlength="64" />
<input type="submit" value="<?php echo lang_get( 'add_category_button' ) ?>" />
</form>
</td>
</tr>
<tr>
<td class="left">
<form method="post" action="manage_proj_cat_copy.php">
<input type="hidden" name="f_project_id" value="<?php echo $f_project_id ?>" />
<select name="f_other_project_id">
<?php print_project_option_list( null, false ) ?>
</select>
<input type="submit" name="f_copy_from" value="<?php echo lang_get( 'copy_categories_from' ) ?>" />
<input type="submit" name="f_copy_to" value="<?php echo lang_get( 'copy_categories_to' ) ?>" />
</form>
</td>
</tr>
<tr>
<td>
<hr />
</td>
</tr>
<tr class="row-category">
<td width="100%">
<?php echo lang_get( 'versions' ) ?>
</td>
</tr>
<tr>
<td width="100%">
<table width="100%">
<?php
$result = version_get_all( $f_project_id );
$version_count = db_num_rows( $result );
for ($i=0;$i<$version_count;$i++) {
$row = db_fetch_array( $result );
$t_version = $row['version'];
$t2_version = urlencode( $t_version );
$t_date_order = $row['date_order'];
$t2_date_order = urlencode( $t_date_order );
?>
<tr <?php echo helper_alternate_class() ?>>
<td width="50%">
<?php echo $t_version ?>
</td>
<td class="center" width="25%">
<?php echo $t_date_order ?>
</td>
<td class="center" width="25%">
<?php
print_bracket_link( 'manage_proj_ver_edit_page.php?f_project_id='.$f_project_id.'&f_version='.$t2_version.'&f_date_order='.$t2_date_order, lang_get( 'edit_link' ) );
PRINT ' ';
print_bracket_link( 'manage_proj_ver_delete.php?f_project_id='.$f_project_id.'&f_version='.$t2_version.'&f_date_order='.$t2_date_order, lang_get( 'delete_link' ) );
?>
</td>
</tr>
<?php } # end for loop ?>
</table>
</td>
</tr>
<tr>
<td class="left">
<form method="post" action="manage_proj_ver_add.php">
<input type="hidden" name="f_project_id" value="<?php echo $f_project_id ?>" />
<input type="text" name="f_version" size="32" maxlength="64" />
<input type="submit" value="<?php echo lang_get( 'add_version_button' ) ?>" />
</form>
</td>
</tr>
</table>
</div>
<?php if( ON == config_get( 'use_experimental_custom_fields' ) ) { ?>
<br />
<div align="center">
<table class="width75" cellspacing="1">
<tr>
<td class="form-title" colspan="2">
<?php echo lang_get( 'custom_fields_setup' ) ?>
</td>
</tr>
<tr class="row-category">
<td width="100%">
<?php echo lang_get( 'custom_fields' ) ?>
</td>
</tr>
<tr>
<td width="100%">
<table width="100%" cellspacing="1">
<?php
$t_custom_fields = custom_field_get_bound_ids( $f_project_id );
foreach( $t_custom_fields as $t_field_id ) {
$t_desc = custom_field_get_definition( $t_field_id );
?>
<tr <?php echo helper_alternate_class() ?>>
<td width="50%">
<?php echo $t_desc['name'] ?>
</td>
<td width="25%">
<?php echo $t_field_id ?>
</td>
<td class="center" width="25%">
<?php
print_bracket_link( "manage_custom_field_edit_page.php?f_field_id=$t_field_id", lang_get( 'edit_link' ) );
echo ' ';
print_bracket_link( "manage_proj_custom_field_remove.php?f_field_id=$t_field_id&f_project_id=$f_project_id", lang_get( 'remove_link' ) );
?>
</td>
</tr>
<?php } # end for loop ?>
</table>
</td>
</tr>
<tr>
<td class="left">
<form method="post" action="manage_proj_custom_field_add_existing.php">
<input type="hidden" name="f_project_id" value="<?php echo $f_project_id ?>" />
<select name="f_field_id">
<?php
$t_custom_fields = custom_field_get_ids();
foreach( $t_custom_fields as $t_field_id )
{
if( !custom_field_in_project( $t_field_id, $f_project_id ) ) {
$t_desc = custom_field_get_definition( $t_field_id );
echo "<option value=\"$t_field_id\">" . $t_desc['name'] . '</option>' ;
}
}
?>
</select>
<input type="submit" value="<?php echo lang_get( 'add_existing_custom_field' ) ?>" />
</form>
</td>
</tr>
</table>
</div>
<?php } // ON = config_get( 'use_experimental_custom_fields' ) ?>
<?php print_page_bot1( __FILE__ ) ?>