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/>.
18 * This include file prints out the bug file upload form
19 * It POSTs to bug_file_add.php
22 * @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
23 * @copyright Copyright (C) 2002 - 2010 MantisBT Team - mantisbt-dev@lists.sourceforge.net
24 * @link http://www.mantisbt.org
26 * @uses collapse_api.php
27 * @uses config_api.php
31 * @uses utility_api.php
34 require_api( 'collapse_api.php' );
35 require_api( 'config_api.php' );
36 require_api( 'file_api.php' );
37 require_api( 'form_api.php' );
38 require_api( 'lang_api.php' );
39 require_api( 'utility_api.php' );
41 # check if we can allow the upload... bail out if we can't
42 if ( !file_allow_bug_upload( $f_bug_id ) ) {
46 $t_max_file_size = (int)min( ini_get_number( 'upload_max_filesize' ), ini_get_number( 'post_max_size' ), config_get( 'max_file_size' ) );
51 collapse_open( 'upload_form' );
53 <form method
="post" enctype
="multipart/form-data" action
="bug_file_add.php">
54 <?php
echo form_security_field( 'bug_file_add' ) ?
>
56 <table
class="width100" cellspacing
="1">
58 <td
class="form-title" colspan
="2">
60 collapse_icon( 'upload_form' );
61 echo lang_get( 'upload_file' ) ?
>
65 <td
class="category" width
="15%">
66 <?php
echo lang_get( 'select_file' ) ?
><br
/>
67 <?php
//FIXME: hard coded "k" in here. ?>
68 <span
class="small"><?php
echo lang_get( 'max_file_size_label' ) . lang_get( 'word_separator' ) . number_format( $t_max_file_size/1000 ) ?
>k
</span
>
71 <input type
="hidden" name
="bug_id" value
="<?php echo $f_bug_id ?>" />
72 <input type
="hidden" name
="max_file_size" value
="<?php echo $t_max_file_size ?>" />
73 <input name
="file" type
="file" size
="40" />
74 <input type
="submit" class="button" value
="<?php echo lang_get( 'upload_file_button' ) ?>" />
80 collapse_closed( 'upload_form' );
82 <table
class="width100" cellspacing
="1">
84 <td
class="form-title" colspan
="2">
86 collapse_icon( 'upload_form' );
87 echo lang_get( 'upload_file' ) ?
>
93 collapse_end( 'upload_form' );