|
|
4c79b5 |
|
|
|
4c79b5 |
# Mantis - a php based bugtracking system
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
|
|
|
4c79b5 |
# Copyright (C) 2002 - 2007 Mantis Team - mantisbt-dev@lists.sourceforge.net
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# Mantis is free software: you can redistribute it and/or modify
|
|
|
4c79b5 |
# it under the terms of the GNU General Public License as published by
|
|
|
4c79b5 |
# the Free Software Foundation, either version 2 of the License, or
|
|
|
4c79b5 |
# (at your option) any later version.
|
|
|
4c79b5 |
#
|
|
|
4c79b5 |
# Mantis is distributed in the hope that it will be useful,
|
|
|
4c79b5 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
4c79b5 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
4c79b5 |
# GNU General Public License for more details.
|
|
|
4c79b5 |
#
|
|
|
4c79b5 |
# You should have received a copy of the GNU General Public License
|
|
|
4c79b5 |
# along with Mantis. If not, see <http://www.gnu.org/licenses/>.
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# --------------------------------------------------------
|
|
|
4c79b5 |
# $Id: manage_proj_edit_page.php,v 1.104.2.2 2007-10-19 07:25:59 vboctor Exp $
|
|
|
4c79b5 |
# --------------------------------------------------------
|
|
|
4c79b5 |
|
|
|
4c79b5 |
require_once( 'core.php' );
|
|
|
4c79b5 |
|
|
|
4c79b5 |
$t_core_path = config_get( 'core_path' );
|
|
|
4c79b5 |
|
|
|
4c79b5 |
require_once( $t_core_path . 'category_api.php' );
|
|
|
4c79b5 |
require_once( $t_core_path . 'version_api.php' );
|
|
|
4c79b5 |
require_once( $t_core_path . 'custom_field_api.php' );
|
|
|
4c79b5 |
require_once( $t_core_path . 'icon_api.php' );
|
|
|
4c79b5 |
|
|
|
4c79b5 |
auth_reauthenticate();
|
|
|
4c79b5 |
|
|
|
4c79b5 |
$f_project_id = gpc_get_int( 'project_id' );
|
|
|
4c79b5 |
|
|
|
4c79b5 |
access_ensure_project_level( config_get( 'manage_project_threshold' ), $f_project_id );
|
|
|
4c79b5 |
|
|
|
4c79b5 |
$row = project_get_row( $f_project_id );
|
|
|
4c79b5 |
|
|
|
4c79b5 |
html_page_top1( project_get_field( $f_project_id, 'name' ) );
|
|
|
4c79b5 |
html_page_top2();
|
|
|
4c79b5 |
|
|
|
4c79b5 |
print_manage_menu( 'manage_proj_edit_page.php' );
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<form method="post" action="manage_proj_update.php">
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<input type="hidden" name="project_id" value="<?php echo $f_project_id ?>" />
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<input type="text" name="name" size="50" maxlength="128" value="<?php echo string_attribute( $row['name'] ) ?>" />
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<select name="status">
|
|
|
4c79b5 |
|
|
|
4c79b5 |
</select>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<input type="checkbox" name="enabled" <?php check_checked( $row['enabled'], ON ); ?> />
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<select name="view_state">
|
|
|
4c79b5 |
|
|
|
4c79b5 |
</select>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<input type="text" name="file_path" size="50" maxlength="250" value="<?php echo string_attribute( $row['file_path'] ) ?>" />
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<textarea name="description" cols="60" rows="5"></textarea>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<input type="submit" class="button" value="<?php echo lang_get( 'update_project_button' ) ?>" />
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
</form>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# You must have global permissions to delete projects
|
|
|
4c79b5 |
if ( access_has_global_level ( config_get( 'delete_project_threshold' ) ) ) { ?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<form method="post" action="manage_proj_delete.php">
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<input type="hidden" name="project_id" value="<?php echo $f_project_id ?>" />
|
|
|
4c79b5 |
<input type="submit" class="button" value="<?php echo lang_get( 'delete_project_button' ) ?>" />
|
|
|
4c79b5 |
</form>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# reset the class counter
|
|
|
4c79b5 |
helper_alternate_class( 0 );
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# Check the user's global access level before allowing project creation
|
|
|
4c79b5 |
if ( access_has_global_level ( config_get( 'create_project_threshold' ) ) ) {
|
|
|
4c79b5 |
print_button( 'manage_proj_create_page.php?parent_id=' . $f_project_id, lang_get( 'create_new_subproject_link' ) );
|
|
|
4c79b5 |
}
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
$t_subproject_ids = current_user_get_accessible_subprojects( $f_project_id, /* show_disabled */ true );
|
|
|
4c79b5 |
|
|
|
4c79b5 |
if ( Array() != $t_subproject_ids ) {
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
foreach ( $t_subproject_ids as $t_subproject_id ) {
|
|
|
4c79b5 |
$t_subproject = project_get_row( $t_subproject_id );
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
print_button( 'manage_proj_edit_page.php?project_id=' . $t_subproject['id'], lang_get( 'edit_link' ) );
|
|
|
4c79b5 |
echo ' ';
|
|
|
4c79b5 |
print_button( 'manage_proj_subproj_delete.php?project_id=' . $f_project_id . '&subproject_id=' . $t_subproject['id'] . form_security_param( 'manage_proj_subproj_delete' ), lang_get( 'unlink_link' ) );
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
} # End of foreach loop over subprojects
|
|
|
4c79b5 |
} # End of hiding subproject listing if there are no subprojects
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<form method="post" action="manage_proj_subproj_add.php">
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<input type="hidden" name="project_id" value="<?php echo $f_project_id ?>" />
|
|
|
4c79b5 |
<select name="subproject_id">
|
|
|
4c79b5 |
|
|
|
4c79b5 |
$t_all_subprojects = project_hierarchy_get_subprojects( $f_project_id, /* $p_show_disabled */ true );
|
|
|
4c79b5 |
$t_all_subprojects[] = $f_project_id;
|
|
|
4c79b5 |
$t_manage_access = config_get( 'manage_project_threshold' );
|
|
|
4c79b5 |
|
|
|
4c79b5 |
$t_projects = project_get_all_rows();
|
|
|
4c79b5 |
|
|
|
4c79b5 |
$t_projects = multi_sort( $t_projects, 'name', ASCENDING );
|
|
|
4c79b5 |
|
|
|
4c79b5 |
foreach ( $t_projects as $t_project ) {
|
|
|
4c79b5 |
if ( in_array( $t_project['id'], $t_all_subprojects ) ||
|
|
|
4c79b5 |
in_array( $f_project_id, project_hierarchy_get_all_subprojects( $t_project['id'] ) ) ||
|
|
|
4c79b5 |
! access_has_project_level( $t_manage_access, $t_project['id'] ) ) {
|
|
|
4c79b5 |
continue;
|
|
|
4c79b5 |
}
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
<option value="<?php echo $t_project['id'] ?>"></option>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
} # End looping over projects
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
</select>
|
|
|
4c79b5 |
<input type="submit" value="<?php echo lang_get('add_subproject'); ?>">
|
|
|
4c79b5 |
</form>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
$t_categories = category_get_all_rows( $f_project_id );
|
|
|
4c79b5 |
|
|
|
4c79b5 |
if ( count( $t_categories ) > 0 ) {
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
}
|
|
|
4c79b5 |
|
|
|
4c79b5 |
foreach ( $t_categories as $t_category ) {
|
|
|
4c79b5 |
$t_name = $t_category['category'];
|
|
|
4c79b5 |
|
|
|
4c79b5 |
if ( NO_USER != $t_category['user_id'] && user_exists( $t_category['user_id'] )) {
|
|
|
4c79b5 |
$t_user_name = user_get_name( $t_category['user_id'] );
|
|
|
4c79b5 |
} else {
|
|
|
4c79b5 |
$t_user_name = '';
|
|
|
4c79b5 |
}
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
$t_name = urlencode( $t_name );
|
|
|
4c79b5 |
|
|
|
4c79b5 |
print_button( 'manage_proj_cat_edit_page.php?project_id=' . $f_project_id . '&category=' . $t_name, lang_get( 'edit_link' ) );
|
|
|
4c79b5 |
echo ' ';
|
|
|
4c79b5 |
print_button( 'manage_proj_cat_delete.php?project_id=' . $f_project_id . '&category=' . $t_name . form_security_param( 'manage_proj_cat_delete' ), lang_get( 'delete_link' ) );
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
} # end for loop
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<form method="post" action="manage_proj_cat_add.php">
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<input type="hidden" name="project_id" value="<?php echo $f_project_id ?>" />
|
|
|
4c79b5 |
<input type="text" name="category" size="32" maxlength="64" />
|
|
|
4c79b5 |
<input type="submit" class="button" value="<?php echo lang_get( 'add_category_button' ) ?>" />
|
|
|
4c79b5 |
</form>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<form method="post" action="manage_proj_cat_copy.php">
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<input type="hidden" name="project_id" value="<?php echo $f_project_id ?>" />
|
|
|
4c79b5 |
<select name="other_project_id">
|
|
|
4c79b5 |
|
|
|
4c79b5 |
</select>
|
|
|
4c79b5 |
<input type="submit" name="copy_from" class="button" value="<?php echo lang_get( 'copy_categories_from' ) ?>" />
|
|
|
4c79b5 |
<input type="submit" name="copy_to" class="button" value="<?php echo lang_get( 'copy_categories_to' ) ?>" />
|
|
|
4c79b5 |
</form>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# reset the class counter
|
|
|
4c79b5 |
helper_alternate_class( 0 );
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
$t_versions = version_get_all_rows( $f_project_id );
|
|
|
4c79b5 |
|
|
|
4c79b5 |
if ( count( $t_versions ) > 0 ) {
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
}
|
|
|
4c79b5 |
|
|
|
4c79b5 |
foreach ( $t_versions as $t_version ) {
|
|
|
4c79b5 |
$t_name = $t_version['version'];
|
|
|
4c79b5 |
$t_released = $t_version['released'];
|
|
|
4c79b5 |
$t_date_order = $t_version['date_order'];
|
|
|
4c79b5 |
$t_date_formatted = string_format_complete_date( $t_version['date_order'] );
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
$t_version_id = version_get_id( $t_name, $f_project_id );
|
|
|
4c79b5 |
|
|
|
4c79b5 |
print_button( 'manage_proj_ver_edit_page.php?version_id=' . $t_version_id, lang_get( 'edit_link' ) );
|
|
|
4c79b5 |
echo ' ';
|
|
|
4c79b5 |
print_button( 'manage_proj_ver_delete.php?version_id=' . $t_version_id . form_security_param( 'manage_proj_ver_delete' ), lang_get( 'delete_link' ) );
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
} # end for loop
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<form method="post" action="manage_proj_ver_add.php">
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<input type="hidden" name="project_id" value="<?php echo $f_project_id ?>" />
|
|
|
4c79b5 |
<input type="text" name="version" size="32" maxlength="64" />
|
|
|
4c79b5 |
<input type="submit" name="add_version" class="button" value="<?php echo lang_get( 'add_version_button' ) ?>" />
|
|
|
4c79b5 |
<input type="submit" name="add_and_edit_version" class="button" value="<?php echo lang_get( 'add_and_edit_version_button' ) ?>" />
|
|
|
4c79b5 |
</form>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<form method="post" action="manage_proj_ver_copy.php">
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<input type="hidden" name="project_id" value="<?php echo $f_project_id ?>" />
|
|
|
4c79b5 |
<select name="other_project_id">
|
|
|
4c79b5 |
|
|
|
4c79b5 |
</select>
|
|
|
4c79b5 |
<input type="submit" name="copy_from" class="button" value="<?php echo lang_get( 'copy_versions_from' ) ?>" />
|
|
|
4c79b5 |
<input type="submit" name="copy_to" class="button" value="<?php echo lang_get( 'copy_versions_to' ) ?>" />
|
|
|
4c79b5 |
</form>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# reset the class counter
|
|
|
4c79b5 |
helper_alternate_class( 0 );
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# You need either global permissions or project-specific permissions to link
|
|
|
4c79b5 |
# custom fields
|
|
|
4c79b5 |
if ( access_has_project_level( config_get( 'custom_field_link_threshold' ), $f_project_id ) &&
|
|
|
4c79b5 |
( count( custom_field_get_ids() ) > 0 ) ) {
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
$t_custom_fields = custom_field_get_linked_ids( $f_project_id );
|
|
|
4c79b5 |
|
|
|
4c79b5 |
if ( count( $t_custom_fields ) > 0 ) {
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
$t_index = 0;
|
|
|
4c79b5 |
|
|
|
4c79b5 |
$t_custom_field_security = form_security_field( 'manage_proj_custom_field_update' );
|
|
|
4c79b5 |
|
|
|
4c79b5 |
foreach( $t_custom_fields as $t_field_id ) {
|
|
|
4c79b5 |
$t_desc = custom_field_get_definition( $t_field_id );
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<form method="post" action="manage_proj_custom_field_update.php">
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<input type="hidden" name="project_id" value="<?php echo $f_project_id ?>" />
|
|
|
4c79b5 |
<input type="hidden" name="field_id" value="<?php echo $t_field_id ?>" />
|
|
|
4c79b5 |
<input type="text" name="sequence" value="<?php echo custom_field_get_sequence( $t_field_id, $f_project_id ) ?>" size="2" />
|
|
|
4c79b5 |
<input type="submit" class="button-small" value="<?php echo lang_get( 'update' ) ?>" />
|
|
|
4c79b5 |
</form>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
$t_index++;
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# You need global permissions to edit custom field defs
|
|
|
4c79b5 |
print_button( "manage_proj_custom_field_remove.php?field_id={$t_field_id}&project_id={$f_project_id}", lang_get( 'remove_link' ) );
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
} # end for loop
|
|
|
4c79b5 |
}
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<form method="post" action="manage_proj_custom_field_add_existing.php">
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<input type="hidden" name="project_id" value="<?php echo $f_project_id ?>" />
|
|
|
4c79b5 |
<select name="field_id">
|
|
|
4c79b5 |
|
|
|
4c79b5 |
$t_custom_fields = custom_field_get_ids();
|
|
|
4c79b5 |
|
|
|
4c79b5 |
foreach( $t_custom_fields as $t_field_id )
|
|
|
4c79b5 |
{
|
|
|
4c79b5 |
if( !custom_field_is_linked( $t_field_id, $f_project_id ) ) {
|
|
|
4c79b5 |
$t_desc = custom_field_get_definition( $t_field_id );
|
|
|
4c79b5 |
echo "<option value=\"$t_field_id\">" . string_attribute( $t_desc['name'] ) . '</option>' ;
|
|
|
4c79b5 |
}
|
|
|
4c79b5 |
}
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
</select>
|
|
|
4c79b5 |
<input type="submit" class="button" value="<?php echo lang_get( 'add_existing_custom_field' ) ?>" />
|
|
|
4c79b5 |
</form>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<form method="post" action="manage_proj_custom_field_copy.php">
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<input type="hidden" name="project_id" value="<?php echo $f_project_id ?>" />
|
|
|
4c79b5 |
<select name="other_project_id">
|
|
|
4c79b5 |
|
|
|
4c79b5 |
</select>
|
|
|
4c79b5 |
<input type="submit" name="copy_from" class="button" value="<?php echo lang_get( 'copy_from' ) ?>" />
|
|
|
4c79b5 |
<input type="submit" name="copy_to" class="button" value="<?php echo lang_get( 'copy_to' ) ?>" />
|
|
|
4c79b5 |
</form>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
}
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
if ( VS_PUBLIC == project_get_field( $f_project_id, 'view_state' ) ) {
|
|
|
4c79b5 |
echo lang_get( 'public_project_msg' );
|
|
|
4c79b5 |
} else {
|
|
|
4c79b5 |
echo lang_get( 'private_project_msg' );
|
|
|
4c79b5 |
}
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# We want to allow people with global permissions and people with high enough
|
|
|
4c79b5 |
# permissions on the project we are editing
|
|
|
4c79b5 |
if ( access_has_project_level( config_get( 'project_user_threshold' ), $f_project_id ) ) {
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<form method="post" action="manage_proj_user_add.php">
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<input type="hidden" name="project_id" value="<?php echo $f_project_id ?>" />
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<select name="user_id[]" multiple="multiple" size="10">
|
|
|
4c79b5 |
|
|
|
4c79b5 |
</select>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<select name="access_level">
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
</select>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<input type="submit" class="button" value="<?php echo lang_get( 'add_user_button' ) ?>" />
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
</form>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<form method="post" action="manage_proj_user_copy.php">
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<input type="hidden" name="project_id" value="<?php echo $f_project_id ?>" />
|
|
|
4c79b5 |
<select name="other_project_id">
|
|
|
4c79b5 |
|
|
|
4c79b5 |
</select>
|
|
|
4c79b5 |
<input type="submit" name="copy_from" class="button" value="<?php echo lang_get( 'copy_users_from' ) ?>" />
|
|
|
4c79b5 |
<input type="submit" name="copy_to" class="button" value="<?php echo lang_get( 'copy_users_to' ) ?>" />
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
</form>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
}
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
$t_users = project_get_all_user_rows( $f_project_id );
|
|
|
4c79b5 |
$t_display = array();
|
|
|
4c79b5 |
$t_sort = array();
|
|
|
4c79b5 |
foreach ( $t_users as $t_user ) {
|
|
|
4c79b5 |
$t_user_name = string_attribute( $t_user['username'] );
|
|
|
4c79b5 |
$t_sort_name = strtolower( $t_user_name );
|
|
|
4c79b5 |
if ( ( isset( $t_user['realname'] ) ) && ( $t_user['realname'] > "" ) && ( ON == config_get( 'show_realname' ) ) ){
|
|
|
4c79b5 |
$t_user_name = string_attribute( $t_user['realname'] ) . " (" . $t_user_name . ")";
|
|
|
4c79b5 |
if ( ON == config_get( 'sort_by_last_name') ) {
|
|
|
4c79b5 |
$t_sort_name_bits = split( ' ', strtolower( $t_user_name ), 2 );
|
|
|
4c79b5 |
$t_sort_name = $t_sort_name_bits[1] . ', ' . $t_sort_name_bits[1];
|
|
|
4c79b5 |
} else {
|
|
|
4c79b5 |
$t_sort_name = strtolower( $t_user_name );
|
|
|
4c79b5 |
}
|
|
|
4c79b5 |
}
|
|
|
4c79b5 |
$t_display[] = $t_user_name;
|
|
|
4c79b5 |
$t_sort[] = $t_sort_name;
|
|
|
4c79b5 |
}
|
|
|
4c79b5 |
array_multisort( $t_sort, SORT_ASC, SORT_STRING, $t_users, $t_display );
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# reset the class counter
|
|
|
4c79b5 |
helper_alternate_class( 0 );
|
|
|
4c79b5 |
|
|
|
4c79b5 |
$t_user_remove_security = form_security_param( 'manage_proj_user_remove' );
|
|
|
4c79b5 |
|
|
|
4c79b5 |
for ($i = 0; $i < count( $t_sort ); $i++ ) {
|
|
|
4c79b5 |
$t_user = $t_users[$i];
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
$t_email = user_get_email( $t_user['id'] );
|
|
|
4c79b5 |
print_email_link( $t_email, $t_email );
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# You need global or project-specific permissions to remove users
|
|
|
4c79b5 |
# from this project
|
|
|
4c79b5 |
if ( access_has_project_level( config_get( 'project_user_threshold' ), $f_project_id ) ) {
|
|
|
4c79b5 |
if ( project_includes_user( $f_project_id, $t_user['id'] ) ) {
|
|
|
4c79b5 |
print_button( 'manage_proj_user_remove.php?project_id=' . $f_project_id . '&user_id=' . $t_user['id'] . $t_user_remove_security, lang_get( 'remove_link' ) );
|
|
|
4c79b5 |
}
|
|
|
4c79b5 |
}
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
} # end for
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# You need global or project-specific permissions to remove users
|
|
|
4c79b5 |
# from this project
|
|
|
4c79b5 |
if ( access_has_project_level( config_get( 'project_user_threshold' ), $f_project_id ) ) {
|
|
|
4c79b5 |
print_button( 'manage_proj_user_remove.php?project_id=' . $f_project_id . $t_user_remove_security, lang_get( 'remove_all_link' ) );
|
|
|
4c79b5 |
}
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|