Blame Identity/Models/Html/Mantis/1.1.2-1.fc9/account_prefs_inc.php

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
	#   $Revision: 2643 $
4c79b5
	#     $Author: al $    
4c79b5
	#       $Date: 2009-06-18 19:06:27 -0400 (Thu, 18 Jun 2009) $  
4c79b5
	#------------------------------
4c79b5
4c79b5
	$t_core_path = config_get( 'core_path' );
4c79b5
4c79b5
	require_once( $t_core_path.'user_pref_api.php' );
4c79b5
4c79b5
	function edit_account_prefs($p_user_id = null, $p_error_if_protected = true, $p_accounts_menu = true, $p_redirect_url = '') {
4c79b5
		if ( null === $p_user_id ) {
4c79b5
			$p_user_id = auth_get_current_user_id();
4c79b5
		}
4c79b5
4c79b5
		$t_redirect_url = $p_redirect_url;
4c79b5
		if ( is_blank( $t_redirect_url ) ) {
4c79b5
			$t_redirect_url = 'account_prefs_page.php';
4c79b5
		}
4c79b5
4c79b5
		# protected account check
4c79b5
		if ( user_is_protected( $p_user_id ) ) {
4c79b5
			if ( $p_error_if_protected ) {
4c79b5
				trigger_error( ERROR_PROTECTED_ACCOUNT, ERROR );
4c79b5
			} else {
4c79b5
				return;
4c79b5
			}
4c79b5
		}
4c79b5
4c79b5
	  if ( ! user_pref_exists( $p_user_id ) ) {
4c79b5
			user_pref_set_default( $p_user_id );
4c79b5
	  }
4c79b5
4c79b5
	    # prefix data with u_
4c79b5
		$t_pref = user_pref_get( $p_user_id );
4c79b5
?>
4c79b5
4c79b5

4c79b5
4c79b5
<form method="post" action="account_prefs_update.php">
4c79b5
<input type="hidden" name="user_id" value="<?php echo $p_user_id ?>" />
4c79b5
<input type="hidden" name="redirect_url" value="<?php echo $t_redirect_url ?>" />
4c79b5
4c79b5
4c79b5
	
4c79b5
		
4c79b5
	
4c79b5
	
4c79b5
		
4c79b5
			if ( $p_accounts_menu ) {
4c79b5
				print_account_menu( 'account_prefs_page.php' );
4c79b5
			}
4c79b5
		?>
4c79b5
	
4c79b5
4c79b5
4c79b5
	
4c79b5
		
4c79b5
	
4c79b5
	
4c79b5
		<select name="default_project">
4c79b5
			default_project ) ?>
4c79b5
		</select>
4c79b5
	
4c79b5
4c79b5
4c79b5
	
4c79b5
		
4c79b5
	
4c79b5
	
4c79b5
		<input type="checkbox" name="advanced_report" <?php check_checked( $t_pref->advanced_report, ON ); ?> />
4c79b5
	
4c79b5
4c79b5
4c79b5
	
4c79b5
		
4c79b5
	
4c79b5
	
4c79b5
		<input type="checkbox" name="advanced_view" <?php check_checked( $t_pref->advanced_view, ON ); ?> />
4c79b5
	
4c79b5
4c79b5
4c79b5
	
4c79b5
		
4c79b5
	
4c79b5
	
4c79b5
		<input type="checkbox" name="advanced_update" <?php check_checked( $t_pref->advanced_update, ON ); ?> />
4c79b5
	
4c79b5
4c79b5
4c79b5
	
4c79b5
		
4c79b5
	
4c79b5
	
4c79b5
		<input type="text" name="refresh_delay" size="4" maxlength="4" value="<?php echo $t_pref->refresh_delay ?>" />
4c79b5
	
4c79b5
4c79b5
4c79b5
	
4c79b5
		
4c79b5
	
4c79b5
	
4c79b5
		<input type="text" name="redirect_delay" size="1" maxlength="1" value="<?php echo $t_pref->redirect_delay ?>" />
4c79b5
	
4c79b5
4c79b5
4c79b5
	
4c79b5
		
4c79b5
	
4c79b5
	
4c79b5
		<label title="<?php echo lang_get( 'bugnote_order_asc' ); ?>">
4c79b5
		<input type="radio" name="bugnote_order" value="ASC" <?php check_checked( $t_pref->bugnote_order, 'ASC' ); ?> />
4c79b5
		</label>
4c79b5
4c79b5
		<label title="<?php echo lang_get( 'bugnote_order_desc' ); ?>">
4c79b5
		<input type="radio" name="bugnote_order" value="DESC" <?php check_checked( $t_pref->bugnote_order, 'DESC' ); ?> />
4c79b5
		</label>
4c79b5
	
4c79b5
4c79b5
4c79b5
	if ( ON == config_get( 'enable_email_notification' ) ) {
4c79b5
?>
4c79b5
4c79b5
	
4c79b5
		
4c79b5
	
4c79b5
	
4c79b5
		<input type="checkbox" name="email_on_new" <?php check_checked( $t_pref->email_on_new, ON ); ?> />
4c79b5
		
4c79b5
		<select name="email_on_new_min_severity">
4c79b5
			<option value="<?php echo OFF ?>"></option>
4c79b5
			<option value="<?php echo OFF ?>"></option>
4c79b5
			email_on_new_min_severity ) ?>
4c79b5
		</select>
4c79b5
	
4c79b5
4c79b5
4c79b5
	
4c79b5
		
4c79b5
	
4c79b5
	
4c79b5
		<input type="checkbox" name="email_on_assigned" <?php check_checked( $t_pref->email_on_assigned, ON ); ?> />
4c79b5
		
4c79b5
		<select name="email_on_assigned_min_severity">
4c79b5
			<option value="<?php echo OFF ?>"></option>
4c79b5
			<option value="<?php echo OFF ?>"></option>
4c79b5
			email_on_assigned_min_severity ) ?>
4c79b5
		</select>
4c79b5
	
4c79b5
4c79b5
4c79b5
	
4c79b5
		
4c79b5
	
4c79b5
	
4c79b5
		<input type="checkbox" name="email_on_feedback" <?php check_checked( $t_pref->email_on_feedback, ON ); ?> />
4c79b5
		
4c79b5
		<select name="email_on_feedback_min_severity">
4c79b5
			<option value="<?php echo OFF ?>"></option>
4c79b5
			<option value="<?php echo OFF ?>"></option>
4c79b5
			email_on_feedback_min_severity ) ?>
4c79b5
		</select>
4c79b5
	
4c79b5
4c79b5
4c79b5
	
4c79b5
		
4c79b5
	
4c79b5
	
4c79b5
		<input type="checkbox" name="email_on_resolved" <?php check_checked( $t_pref->email_on_resolved, ON ); ?> />
4c79b5
		
4c79b5
		<select name="email_on_resolved_min_severity">
4c79b5
			<option value="<?php echo OFF ?>"></option>
4c79b5
			<option value="<?php echo OFF ?>"></option>
4c79b5
			email_on_resolved_min_severity ) ?>
4c79b5
		</select>
4c79b5
	
4c79b5
4c79b5
4c79b5
	
4c79b5
		
4c79b5
	
4c79b5
	
4c79b5
		<input type="checkbox" name="email_on_closed" <?php check_checked( $t_pref->email_on_closed, ON ); ?> />
4c79b5
		
4c79b5
		<select name="email_on_closed_min_severity">
4c79b5
			<option value="<?php echo OFF ?>"></option>
4c79b5
			<option value="<?php echo OFF ?>"></option>
4c79b5
			email_on_closed_min_severity ) ?>
4c79b5
		</select>
4c79b5
	
4c79b5
4c79b5
4c79b5
	
4c79b5
		
4c79b5
	
4c79b5
	
4c79b5
		<input type="checkbox" name="email_on_reopened" <?php check_checked( $t_pref->email_on_reopened, ON ); ?> />
4c79b5
		
4c79b5
		<select name="email_on_reopened_min_severity">
4c79b5
			<option value="<?php echo OFF ?>"></option>
4c79b5
			<option value="<?php echo OFF ?>"></option>
4c79b5
			email_on_reopened_min_severity ) ?>
4c79b5
		</select>
4c79b5
	
4c79b5
4c79b5
4c79b5
	
4c79b5
		
4c79b5
	
4c79b5
	
4c79b5
		<input type="checkbox" name="email_on_bugnote" <?php check_checked( $t_pref->email_on_bugnote, ON ); ?> />
4c79b5
		
4c79b5
		<select name="email_on_bugnote_min_severity">
4c79b5
			<option value="<?php echo OFF ?>"></option>
4c79b5
			<option value="<?php echo OFF ?>"></option>
4c79b5
			email_on_bugnote_min_severity ) ?>
4c79b5
		</select>
4c79b5
	
4c79b5
4c79b5
4c79b5
	
4c79b5
		
4c79b5
	
4c79b5
	
4c79b5
		<input type="checkbox" name="email_on_status" <?php check_checked( $t_pref->email_on_status, ON ); ?> />
4c79b5
		
4c79b5
		<select name="email_on_status_min_severity">
4c79b5
			<option value="<?php echo OFF ?>"></option>
4c79b5
			<option value="<?php echo OFF ?>"></option>
4c79b5
			email_on_status_min_severity ) ?>
4c79b5
		</select>
4c79b5
	
4c79b5
4c79b5
4c79b5
	
4c79b5
		
4c79b5
	
4c79b5
	
4c79b5
		<input type="checkbox" name="email_on_priority" <?php check_checked( $t_pref->email_on_priority , ON); ?> />
4c79b5
		
4c79b5
		<select name="email_on_priority_min_severity">
4c79b5
			<option value="<?php echo OFF ?>"></option>
4c79b5
			<option value="<?php echo OFF ?>"></option>
4c79b5
			email_on_priority_min_severity ) ?>
4c79b5
		</select>
4c79b5
	
4c79b5
4c79b5
4c79b5
	
4c79b5
		
4c79b5
	
4c79b5
	
4c79b5
		<input type="text" name="email_bugnote_limit" maxlength="2" size="2" value="<?php echo $t_pref->email_bugnote_limit ?>">
4c79b5
	
4c79b5
4c79b5
4c79b5
		<input type="hidden" name="email_on_new"      value="<?php echo $t_pref->email_on_new ?>" />
4c79b5
		<input type="hidden" name="email_on_assigned" value="<?php echo $t_pref->email_on_assigned ?>" />
4c79b5
		<input type="hidden" name="email_on_feedback" value="<?php echo $t_pref->email_on_feedback ?>" />
4c79b5
		<input type="hidden" name="email_on_resolved" value="<?php echo $t_pref->email_on_resolved ?>" />
4c79b5
		<input type="hidden" name="email_on_closed"   value="<?php echo $t_pref->email_on_closed ?>" />
4c79b5
		<input type="hidden" name="email_on_reopened" value="<?php echo $t_pref->email_on_reopened ?>" />
4c79b5
		<input type="hidden" name="email_on_bugnote"  value="<?php echo $t_pref->email_on_bugnote ?>" />
4c79b5
		<input type="hidden" name="email_on_status"   value="<?php echo $t_pref->email_on_status ?>" />
4c79b5
		<input type="hidden" name="email_on_priority" value="<?php echo $t_pref->email_on_priority ?>" />
4c79b5
		<input type="hidden" name="email_on_new_min_severity"      value="<?php echo $t_pref->email_on_new_min_severity ?>" />
4c79b5
		<input type="hidden" name="email_on_assigned_min_severity" value="<?php echo $t_pref->email_on_assigned_min_severity ?>" />
4c79b5
		<input type="hidden" name="email_on_feedback_min_severity" value="<?php echo $t_pref->email_on_feedback_min_severity ?>" />
4c79b5
		<input type="hidden" name="email_on_resolved_min_severity" value="<?php echo $t_pref->email_on_resolved_min_severity ?>" />
4c79b5
		<input type="hidden" name="email_on_closed_min_severity"   value="<?php echo $t_pref->email_on_closed_min_severity ?>" />
4c79b5
		<input type="hidden" name="email_on_reopened_min_severity" value="<?php echo $t_pref->email_on_reopened_min_severity ?>" />
4c79b5
		<input type="hidden" name="email_on_bugnote_min_severity"  value="<?php echo $t_pref->email_on_bugnote_min_severity ?>" />
4c79b5
		<input type="hidden" name="email_on_status_min_severity"   value="<?php echo $t_pref->email_on_status_min_severity ?>" />
4c79b5
		<input type="hidden" name="email_on_priority_min_severity" value="<?php echo $t_pref->email_on_priority_min_severity ?>" />
4c79b5
		<input type="hidden" name="email_bugnote_limit" value="<?php echo $t_pref->email_bugnote_limit ?>" />
4c79b5
4c79b5
4c79b5
	
4c79b5
		
4c79b5
	
4c79b5
	
4c79b5
		<select name="language">
4c79b5
			language ) ?>
4c79b5
		</select>
4c79b5
	
4c79b5
4c79b5
4c79b5
	
4c79b5
		<input type="submit" class="button" value="<?php echo lang_get( 'update_prefs_button' ) ?>" />
4c79b5
	
4c79b5
4c79b5
4c79b5
</form>
4c79b5
4c79b5
4c79b5

4c79b5
4c79b5
4c79b5
	<form method="post" action="account_prefs_reset.php">
4c79b5
	<input type="hidden" name="user_id" value="<?php echo $p_user_id ?>" />
4c79b5
	<input type="hidden" name="redirect_url" value="<?php echo $t_redirect_url ?>" />
4c79b5
	<input type="submit" class="button" value="<?php echo lang_get( 'reset_prefs_button' ) ?>" />
4c79b5
	</form>
4c79b5
4c79b5
4c79b5
4c79b5
	} # end of edit_account_prefs()
4c79b5
?>