1<?php
2# MantisBT - A PHP based bugtracking system
3
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.
8#
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.
13#
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/>.
16
17/**
18 * Edit Project Versions
19 *
20 * @package MantisBT
21 * @copyright Copyright 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
22 * @copyright Copyright 2002  MantisBT Team - mantisbt-dev@lists.sourceforge.net
23 * @link http://www.mantisbt.org
24 *
25 * @uses core.php
26 * @uses access_api.php
27 * @uses authentication_api.php
28 * @uses config_api.php
29 * @uses constant_inc.php
30 * @uses event_api.php
31 * @uses form_api.php
32 * @uses gpc_api.php
33 * @uses helper_api.php
34 * @uses html_api.php
35 * @uses lang_api.php
36 * @uses string_api.php
37 * @uses version_api.php
38 */
39
40require_once( 'core.php' );
41require_api( 'access_api.php' );
42require_api( 'authentication_api.php' );
43require_api( 'config_api.php' );
44require_api( 'constant_inc.php' );
45require_api( 'event_api.php' );
46require_api( 'form_api.php' );
47require_api( 'gpc_api.php' );
48require_api( 'helper_api.php' );
49require_api( 'html_api.php' );
50require_api( 'lang_api.php' );
51require_api( 'string_api.php' );
52require_api( 'version_api.php' );
53
54auth_reauthenticate();
55
56$f_version_id = gpc_get_int( 'version_id' );
57
58$t_version = version_get( $f_version_id );
59
60access_ensure_project_level( config_get( 'manage_project_threshold' ), $t_version->project_id );
61
62layout_page_header();
63
64layout_page_begin( 'manage_overview_page.php' );
65
66print_manage_menu( 'manage_proj_ver_edit_page.php' );
67?>
68
69<div class="col-md-12 col-xs-12">
70	<div class="space-10"></div>
71	<div id="manage-proj-version-update-div" class="form-container">
72	<form id="manage-proj-version-update-form" method="post" action="manage_proj_ver_update.php">
73		<div class="widget-box widget-color-blue2">
74			<div class="widget-header widget-header-small">
75				<h4 class="widget-title lighter">
76					<?php print_icon( 'fa-share-alt', 'ace-icon' ); ?>
77					<?php echo lang_get( 'edit_project_version_title' ) ?>
78				</h4>
79			</div>
80		<div class="widget-body">
81		<div class="widget-main no-padding">
82		<div class="table-responsive">
83		<table class="table table-bordered table-condensed table-striped">
84		<fieldset>
85			<?php echo form_security_field( 'manage_proj_ver_update' ) ?>
86			<input type="hidden" name="version_id" value="<?php echo string_attribute( $t_version->id ) ?>" />
87			<tr>
88				<td class="category">
89					<?php echo lang_get( 'version' ) ?>
90				</td>
91				<td>
92					<input type="text" id="proj-version-new-version" name="new_version" class="input-sm" size="32" maxlength="64" value="<?php echo string_attribute( $t_version->version ) ?>" />
93				</td>
94			</tr>
95			<tr>
96				<td class="category">
97					<?php echo lang_get( 'date_order' ) ?>
98				</td>
99				<td>
100					<input type="text" id="proj-version-date-order" name="date_order" class="datetimepicker input-sm"
101						data-picker-locale="<?php echo lang_get_current_datetime_locale() ?>"
102						data-picker-format="<?php echo config_get( 'datetime_picker_format' ) ?>"
103						size="16" value="<?php echo (date_is_null( $t_version->date_order ) ? '' : string_attribute( date( config_get( 'normal_date_format' ), $t_version->date_order ) ) ) ?>" />
104					<?php print_icon( 'fa-calendar', 'fa-xlg datetimepicker' ); ?>
105				</td>
106			</tr>
107			<tr>
108				<td class="category">
109					<?php echo lang_get( 'description' ) ?>
110				</td>
111				<td>
112					<?php # Newline after opening textarea tag is intentional, see #25839 ?>
113					<textarea class="form-control" id="proj-version-description" name="description" cols="60" rows="5">
114<?php echo string_attribute( $t_version->description ) ?>
115</textarea>
116				</td>
117			</tr>
118			<tr>
119				<td class="category">
120					<?php echo lang_get( 'released' ) ?>
121				</td>
122				<td>
123					<label>
124						<input type="checkbox" class="ace" id="proj-version-released" name="released" <?php check_checked( (boolean)$t_version->released, VERSION_RELEASED ); ?> />
125						<span class="lbl"></span>
126					</label>
127				</td>
128			</tr>
129			<tr>
130				<td class="category">
131					<?php echo lang_get( 'obsolete' ) ?>
132				</td>
133				<td>
134					<label>
135						<input type="checkbox" class="ace" id="proj-version-obsolete" name="obsolete" <?php check_checked( (boolean)$t_version->obsolete, true ); ?> />
136						<span class="lbl"></span>
137					</label>
138				</td>
139			</tr>
140			<?php event_signal( 'EVENT_MANAGE_VERSION_UPDATE_FORM', array( $t_version->id ) ); ?>
141		</fieldset>
142		</table>
143			</div>
144			</div>
145			<div class="widget-toolbox padding-8 clearfix">
146				<span class="required pull-right"> * <?php echo lang_get( 'required' ) ?></span>
147				<input type="submit" class="btn btn-primary btn-white btn-round" value="<?php echo lang_get( 'update_version_button' ) ?>" />
148			</div>
149			</div>
150			</div>
151	</form>
152</div>
153</div>
154
155<div class="col-md-12 col-xs-12">
156	<form method="post" action="manage_proj_ver_delete.php" class="pull-right">
157		<fieldset>
158			<?php echo form_security_field( 'manage_proj_ver_delete' ) ?>
159			<input type="hidden" name="version_id" value="<?php echo string_attribute( $t_version->id ) ?>" />
160			<input type="submit" class="btn btn-sm btn-primary btn-white btn-round" value="<?php echo lang_get( 'delete_version_button' ) ?>" />
161		</fieldset>
162	</form>
163</div>
164
165<?php
166layout_page_end();
167