Пример #1
0
function html_login_info()
{
    $t_username = current_user_get_field('username');
    $t_access_level = get_enum_element('access_levels', current_user_get_access_level());
    $t_now = date(config_get('complete_date_format'));
    $t_realname = current_user_get_field('realname');
    print '<table class="hide">';
    print '<tr>';
    print '<td class="login-info-left">';
    if (current_user_is_anonymous()) {
        $t_return_page = $_SERVER['PHP_SELF'];
        if (isset($_SERVER['QUERY_STRING'])) {
            $t_return_page .= '?' . $_SERVER['QUERY_STRING'];
        }
        $t_return_page = string_url($t_return_page);
        print lang_get('anonymous') . ' | <a href="login_page.php?return=' . $t_return_page . '">' . lang_get('login_link') . '</a>';
        if (config_get('allow_signup') == ON) {
            print ' | <a href="signup_page.php">' . lang_get('signup_link') . '</a>';
        }
    } else {
        echo lang_get('logged_in_as'), ": <span class=\"italic\">", string_display($t_username), "</span> <span class=\"small\">";
        echo is_blank($t_realname) ? "({$t_access_level})" : "(" . string_display($t_realname) . " - {$t_access_level})";
        echo "</span>";
    }
    print '</td>';
    print '<td class="login-info-middle">';
    print "<span class=\"italic\">{$t_now}</span>";
    print '</td>';
    print '<td class="login-info-right">';
    print '<form method="post" name="form_set_project" action="set_project.php">';
    echo lang_get('email_project'), ': ';
    if (ON == config_get('show_extended_project_browser')) {
        print_extended_project_browser(helper_get_current_project_trace());
    } else {
        if (ON == config_get('use_javascript')) {
            print '<select name="project_id" class="small" onchange="document.forms.form_set_project.submit();">';
        } else {
            print '<select name="project_id" class="small">';
        }
        print_project_option_list(join(';', helper_get_current_project_trace()), true, null, true);
        print '</select> ';
    }
    print '<input type="submit" class="button-small" value="' . lang_get('switch') . '" />';
    if (OFF != config_get('rss_enabled')) {
        # Link to RSS issues feed for the selected project, including authentication details.
        print '<a href="' . rss_get_issues_feed_url() . '">';
        print '<img src="images/rss.gif" alt="' . lang_get('rss') . '" style="border-style: none; margin: 5px; vertical-align: middle;" />';
        print '</a>';
    }
    print '</form>';
    print '</td>';
    print '</tr>';
    print '</table>';
}
Пример #2
0
		<fieldset>
			<?php 
echo form_security_field('manage_columns_copy');
?>
			<input type="hidden" name="project_id" value="<?php 
echo $t_project_id;
?>
" />
			<input type="hidden" name="manage_page" value="<?php 
echo $t_manage_page;
?>
" />

			<select name="other_project_id">
				<?php 
print_project_option_list(null, true, $t_project_id);
?>
			</select>

			<?php 
# Skip "Copy From" if the current project is ALL PROJECTS, the current page is management page, and the user is not administrator
if (!$t_manage_page || $t_project_id != ALL_PROJECTS || current_user_is_administrator()) {
    ?>
			<input type="submit" name="copy_from" class="button" value="<?php 
    echo lang_get('copy_columns_from');
    ?>
" /><?php 
}
?>
			<input type="submit" name="copy_to" class="button" value="<?php 
echo lang_get('copy_columns_to');
			<input type="hidden" name="field_id" value="<?php 
echo $f_field_id;
?>
" />
			<?php 
echo form_security_field('manage_custom_field_proj_add');
?>
			<div class="field-container">
				<label for="custom-field-project-id"><span><?php 
echo lang_get('projects_title_label');
?>
</span></label>
				<span class="select">
					<select id="custom-field-project-id" name="project_id[]" multiple="multiple" size="5">
						<?php 
print_project_option_list(null, false);
?>
					</select>
				</span>
				<span class="label-style"></span>
			</div>
			<div class="field-container">
				<label for="custom-field-sequence"><span><?php 
echo lang_get('custom_field_sequence_label');
?>
</span></label>
				<span class="input"><input type="text" id="custom-field-sequence" name="sequence" value="0" /></span>
				<span class="label-style"></span>
			</div>
			<span class="submit-button"><input type="submit" class="button" value="<?php 
echo lang_get('link_custom_field_to_project_button');
Пример #4
0
				<span class="select">
					<select id="config-project-id" name="project_id">
						<option value="<?php 
        echo ALL_PROJECTS;
        ?>
"
							<?php 
        check_selected($t_edit_project_id, ALL_PROJECTS);
        ?>
>
							<?php 
        echo lang_get('all_projects');
        ?>
						</option>
						<?php 
        print_project_option_list($t_edit_project_id, false);
        ?>
					</select>
				</span>
				<span class="label-style"></span>
			</div>

			<!-- Config option name -->
			<div class="field-container">
				<label for="config-option"><span><?php 
        echo lang_get('configuration_option');
        ?>
</span></label>
				<span class="input">
					<input type="text" name="config_option"
						value="<?php 
Пример #5
0
	</td>
</tr>
<tr class="row-1">
	<td class="category">
		<?php 
echo lang_get('post_to');
?>
	</td>
	<td>
		<select name="project_id">
		<?php 
$t_sitewide = false;
if (current_user_is_administrator()) {
    $t_sitewide = true;
}
print_project_option_list($v_project_id, $t_sitewide);
?>
		</select>
	</td>
</tr>
<tr class="row-2">
	<td class="category">
		<?php 
echo lang_get('announcement');
?>
<br />
		<span class="small"><?php 
echo lang_get('stays_on_top');
?>
</span>
	</td>
Пример #6
0
function html_login_info()
{
    $t_username = current_user_get_field('username');
    $t_access_level = get_enum_element('access_levels', current_user_get_access_level());
    $t_now = date(config_get('complete_date_format'));
    $t_realname = current_user_get_field('realname');
    print '<table class="hide">';
    print '<tr>';
    print '<td class="login-info-left">';
    if (current_user_is_anonymous()) {
        if (!php_version_at_least('4.1.0')) {
            global $_SERVER;
        }
        $t_return_page = $_SERVER['PHP_SELF'];
        if (isset($_SERVER['QUERY_STRING'])) {
            $t_return_page .= '?' . $_SERVER['QUERY_STRING'];
        }
        $t_return_page = string_url($t_return_page);
        print lang_get('anonymous') . ' | <a href="login_page.php?return=' . $t_return_page . '">' . lang_get('login_link') . '</a>';
        if (config_get('allow_signup') == ON) {
            print ' | <a href="signup_page.php">' . lang_get('signup_link') . '</a>';
        }
    } else {
        echo lang_get('logged_in_as'), ": <span class=\"italic\">", string_display($t_username), "</span> <span class=\"small\">";
        echo is_blank($t_realname) ? "({$t_access_level})" : "(", string_display($t_realname), " - {$t_access_level})";
        echo "</span>";
    }
    print '</td>';
    print '<td class="login-info-middle">';
    print "<span class=\"italic\">{$t_now}</span>";
    print '</td>';
    print '<td class="login-info-right">';
    print '<form method="post" name="form_set_project" action="set_project.php">';
    echo lang_get('email_project'), ': ';
    if (ON == config_get('use_javascript')) {
        print '<select name="project_id" class="small" onchange="document.forms.form_set_project.submit();">';
    } else {
        print '<select name="project_id" class="small">';
    }
    print_project_option_list(join(';', helper_get_current_project_trace()), true, null, true);
    print '</select> ';
    print '<input type="submit" class="button-small" value="' . lang_get('switch') . '" />';
    print '</form>';
    print '</td>';
    print '</tr>';
    print '</table>';
}
Пример #7
0
function print_filter_project_id()
{
    global $t_select_modifier, $t_filter, $f_view_type;
    ?>
		<!-- Project -->
		<select <?php 
    print $t_select_modifier;
    ?>
 name="project_id[]">
			<option value="<?php 
    echo META_FILTER_CURRENT;
    ?>
" <?php 
    check_selected($t_filter['project_id'], META_FILTER_CURRENT);
    ?>
>[<?php 
    echo lang_get('current');
    ?>
]</option>
			<?php 
    print_project_option_list($t_filter['project_id']);
    ?>
		</select>
		<?php 
}
Пример #8
0
function edit_account_prefs($p_user_id = null, $p_error_if_protected = true, $p_accounts_menu = true, $p_redirect_url = '')
{
    if (null === $p_user_id) {
        $p_user_id = auth_get_current_user_id();
    }
    $t_redirect_url = $p_redirect_url;
    if (is_blank($t_redirect_url)) {
        $t_redirect_url = 'account_prefs_page.php';
    }
    # protected account check
    if (user_is_protected($p_user_id)) {
        if ($p_error_if_protected) {
            trigger_error(ERROR_PROTECTED_ACCOUNT, ERROR);
        } else {
            return;
        }
    }
    if (!user_pref_exists($p_user_id)) {
        user_pref_set_default($p_user_id);
    }
    # prefix data with u_
    $t_pref = user_pref_get($p_user_id);
    # Account Preferences Form BEGIN
    ?>
<br />
<div align="center">
<form method="post" action="account_prefs_update.php">
<input type="hidden" name="user_id" value="<?php 
    echo $p_user_id;
    ?>
" />
<input type="hidden" name="redirect_url" value="<?php 
    echo $t_redirect_url;
    ?>
" />
<table class="width75" cellspacing="1">
<tr>
	<td class="form-title">
		<?php 
    echo lang_get('default_account_preferences_title');
    ?>
	</td>
	<td class="right">
		<?php 
    if ($p_accounts_menu) {
        print_account_menu('account_prefs_page.php');
    }
    ?>
	</td>
</tr>
<tr class="row-1">
	<td class="category" width="50%">
		<?php 
    echo lang_get('default_project');
    ?>
	</td>
	<td width="50%">
		<select name="default_project">
			<?php 
    print_project_option_list($t_pref->default_project);
    ?>
		</select>
	</td>
</tr>
<tr class="row-2">
	<td class="category">
		<?php 
    echo lang_get('advanced_report');
    ?>
	</td>
	<td>
		<input type="checkbox" name="advanced_report" <?php 
    check_checked($t_pref->advanced_report, ON);
    ?>
 />
	</td>
</tr>
<tr class="row-1">
	<td class="category">
		<?php 
    echo lang_get('advanced_view');
    ?>
	</td>
	<td>
		<input type="checkbox" name="advanced_view" <?php 
    check_checked($t_pref->advanced_view, ON);
    ?>
 />
	</td>
</tr>
<tr class="row-2">
	<td class="category">
		<?php 
    echo lang_get('advanced_update');
    ?>
	</td>
	<td>
		<input type="checkbox" name="advanced_update" <?php 
    check_checked($t_pref->advanced_update, ON);
    ?>
 />
	</td>
</tr>
<tr class="row-1">
	<td class="category">
		<?php 
    echo lang_get('refresh_delay');
    ?>
	</td>
	<td>
		<input type="text" name="refresh_delay" size="4" maxlength="4" value="<?php 
    echo $t_pref->refresh_delay;
    ?>
" />
	</td>
</tr>
<tr class="row-2">
	<td class="category">
		<?php 
    echo lang_get('redirect_delay');
    ?>
	</td>
	<td>
		<input type="text" name="redirect_delay" size="1" maxlength="1" value="<?php 
    echo $t_pref->redirect_delay;
    ?>
" />
	</td>
</tr>
<tr class="row-1">
	<td class="category">
		<?php 
    echo lang_get('bugnote_order');
    ?>
	</td>
	<td>
		<input type="radio" name="bugnote_order" value="ASC" <?php 
    check_checked($t_pref->bugnote_order, 'ASC');
    ?>
 /><?php 
    echo lang_get('bugnote_order_asc');
    ?>
		<input type="radio" name="bugnote_order" value="DESC" <?php 
    check_checked($t_pref->bugnote_order, 'DESC');
    ?>
 /><?php 
    echo lang_get('bugnote_order_desc');
    ?>
	</td>
</tr>
<?php 
    if (ON == config_get('enable_email_notification')) {
        ?>
<tr class="row-2">
	<td class="category">
		<?php 
        echo lang_get('email_on_new');
        ?>
	</td>
	<td>
		<input type="checkbox" name="email_on_new" <?php 
        check_checked($t_pref->email_on_new, ON);
        ?>
 />
		<?php 
        echo lang_get('with_minimum_severity');
        ?>
		<select name="email_on_new_min_severity">
			<option value="<?php 
        echo OFF;
        ?>
"><?php 
        echo lang_get('any');
        ?>
</option>
			<option value="<?php 
        echo OFF;
        ?>
"></option>
			<?php 
        print_enum_string_option_list('severity', $t_pref->email_on_new_min_severity);
        ?>
		</select>
	</td>
</tr>
<tr class="row-1">
	<td class="category">
		<?php 
        echo lang_get('email_on_assigned');
        ?>
	</td>
	<td>
		<input type="checkbox" name="email_on_assigned" <?php 
        check_checked($t_pref->email_on_assigned, ON);
        ?>
 />
		<?php 
        echo lang_get('with_minimum_severity');
        ?>
		<select name="email_on_assigned_min_severity">
			<option value="<?php 
        echo OFF;
        ?>
"><?php 
        echo lang_get('any');
        ?>
</option>
			<option value="<?php 
        echo OFF;
        ?>
"></option>
			<?php 
        print_enum_string_option_list('severity', $t_pref->email_on_assigned_min_severity);
        ?>
		</select>
	</td>
</tr>
<tr class="row-2">
	<td class="category">
		<?php 
        echo lang_get('email_on_feedback');
        ?>
	</td>
	<td>
		<input type="checkbox" name="email_on_feedback" <?php 
        check_checked($t_pref->email_on_feedback, ON);
        ?>
 />
		<?php 
        echo lang_get('with_minimum_severity');
        ?>
		<select name="email_on_feedback_min_severity">
			<option value="<?php 
        echo OFF;
        ?>
"><?php 
        echo lang_get('any');
        ?>
</option>
			<option value="<?php 
        echo OFF;
        ?>
"></option>
			<?php 
        print_enum_string_option_list('severity', $t_pref->email_on_feedback_min_severity);
        ?>
		</select>
	</td>
</tr>
<tr class="row-1">
	<td class="category">
		<?php 
        echo lang_get('email_on_resolved');
        ?>
	</td>
	<td>
		<input type="checkbox" name="email_on_resolved" <?php 
        check_checked($t_pref->email_on_resolved, ON);
        ?>
 />
		<?php 
        echo lang_get('with_minimum_severity');
        ?>
		<select name="email_on_resolved_min_severity">
			<option value="<?php 
        echo OFF;
        ?>
"><?php 
        echo lang_get('any');
        ?>
</option>
			<option value="<?php 
        echo OFF;
        ?>
"></option>
			<?php 
        print_enum_string_option_list('severity', $t_pref->email_on_resolved_min_severity);
        ?>
		</select>
	</td>
</tr>
<tr class="row-2">
	<td class="category">
		<?php 
        echo lang_get('email_on_closed');
        ?>
	</td>
	<td>
		<input type="checkbox" name="email_on_closed" <?php 
        check_checked($t_pref->email_on_closed, ON);
        ?>
 />
		<?php 
        echo lang_get('with_minimum_severity');
        ?>
		<select name="email_on_closed_min_severity">
			<option value="<?php 
        echo OFF;
        ?>
"><?php 
        echo lang_get('any');
        ?>
</option>
			<option value="<?php 
        echo OFF;
        ?>
"></option>
			<?php 
        print_enum_string_option_list('severity', $t_pref->email_on_closed_min_severity);
        ?>
		</select>
	</td>
</tr>
<tr class="row-1">
	<td class="category">
		<?php 
        echo lang_get('email_on_reopened');
        ?>
	</td>
	<td>
		<input type="checkbox" name="email_on_reopened" <?php 
        check_checked($t_pref->email_on_reopened, ON);
        ?>
 />
		<?php 
        echo lang_get('with_minimum_severity');
        ?>
		<select name="email_on_reopened_min_severity">
			<option value="<?php 
        echo OFF;
        ?>
"><?php 
        echo lang_get('any');
        ?>
</option>
			<option value="<?php 
        echo OFF;
        ?>
"></option>
			<?php 
        print_enum_string_option_list('severity', $t_pref->email_on_reopened_min_severity);
        ?>
		</select>
	</td>
</tr>
<tr class="row-2">
	<td class="category">
		<?php 
        echo lang_get('email_on_bugnote_added');
        ?>
	</td>
	<td>
		<input type="checkbox" name="email_on_bugnote" <?php 
        check_checked($t_pref->email_on_bugnote, ON);
        ?>
 />
		<?php 
        echo lang_get('with_minimum_severity');
        ?>
		<select name="email_on_bugnote_min_severity">
			<option value="<?php 
        echo OFF;
        ?>
"><?php 
        echo lang_get('any');
        ?>
</option>
			<option value="<?php 
        echo OFF;
        ?>
"></option>
			<?php 
        print_enum_string_option_list('severity', $t_pref->email_on_bugnote_min_severity);
        ?>
		</select>
	</td>
</tr>
<tr class="row-1">
	<td class="category">
		<?php 
        echo lang_get('email_on_status_change');
        ?>
	</td>
	<td>
		<input type="checkbox" name="email_on_status" <?php 
        check_checked($t_pref->email_on_status, ON);
        ?>
 />
		<?php 
        echo lang_get('with_minimum_severity');
        ?>
		<select name="email_on_status_min_severity">
			<option value="<?php 
        echo OFF;
        ?>
"><?php 
        echo lang_get('any');
        ?>
</option>
			<option value="<?php 
        echo OFF;
        ?>
"></option>
			<?php 
        print_enum_string_option_list('severity', $t_pref->email_on_status_min_severity);
        ?>
		</select>
	</td>
</tr>
<tr class="row-2">
	<td class="category">
		<?php 
        echo lang_get('email_on_priority_change');
        ?>
	</td>
	<td>
		<input type="checkbox" name="email_on_priority" <?php 
        check_checked($t_pref->email_on_priority, ON);
        ?>
 />
		<?php 
        echo lang_get('with_minimum_severity');
        ?>
		<select name="email_on_priority_min_severity">
			<option value="<?php 
        echo OFF;
        ?>
"><?php 
        echo lang_get('any');
        ?>
</option>
			<option value="<?php 
        echo OFF;
        ?>
"></option>
			<?php 
        print_enum_string_option_list('severity', $t_pref->email_on_priority_min_severity);
        ?>
		</select>
	</td>
</tr>
<tr class="row-1">
	<td class="category">
		<?php 
        echo lang_get('email_bugnote_limit');
        ?>
	</td>
	<td>
		<input type="text" name="email_bugnote_limit" maxlength="2" size="2" value="<?php 
        echo $t_pref->email_bugnote_limit;
        ?>
">
	</td>
</tr>
<?php 
    } else {
        ?>
		<input type="hidden" name="email_on_new"      value="<?php 
        echo $t_pref->email_on_new;
        ?>
" />
		<input type="hidden" name="email_on_assigned" value="<?php 
        echo $t_pref->email_on_assigned;
        ?>
" />
		<input type="hidden" name="email_on_feedback" value="<?php 
        echo $t_pref->email_on_feedback;
        ?>
" />
		<input type="hidden" name="email_on_resolved" value="<?php 
        echo $t_pref->email_on_resolved;
        ?>
" />
		<input type="hidden" name="email_on_closed"   value="<?php 
        echo $t_pref->email_on_closed;
        ?>
" />
		<input type="hidden" name="email_on_reopened" value="<?php 
        echo $t_pref->email_on_reopened;
        ?>
" />
		<input type="hidden" name="email_on_bugnote"  value="<?php 
        echo $t_pref->email_on_bugnote;
        ?>
" />
		<input type="hidden" name="email_on_status"   value="<?php 
        echo $t_pref->email_on_status;
        ?>
" />
		<input type="hidden" name="email_on_priority" value="<?php 
        echo $t_pref->email_on_priority;
        ?>
" />
		<input type="hidden" name="email_on_new_min_severity"      value="<?php 
        echo $t_pref->email_on_new_min_severity;
        ?>
" />
		<input type="hidden" name="email_on_assigned_min_severity" value="<?php 
        echo $t_pref->email_on_assigned_min_severity;
        ?>
" />
		<input type="hidden" name="email_on_feedback_min_severity" value="<?php 
        echo $t_pref->email_on_feedback_min_severity;
        ?>
" />
		<input type="hidden" name="email_on_resolved_min_severity" value="<?php 
        echo $t_pref->email_on_resolved_min_severity;
        ?>
" />
		<input type="hidden" name="email_on_closed_min_severity"   value="<?php 
        echo $t_pref->email_on_closed_min_severity;
        ?>
" />
		<input type="hidden" name="email_on_reopened_min_severity" value="<?php 
        echo $t_pref->email_on_reopened_min_severity;
        ?>
" />
		<input type="hidden" name="email_on_bugnote_min_severity"  value="<?php 
        echo $t_pref->email_on_bugnote_min_severity;
        ?>
" />
		<input type="hidden" name="email_on_status_min_severity"   value="<?php 
        echo $t_pref->email_on_status_min_severity;
        ?>
" />
		<input type="hidden" name="email_on_priority_min_severity" value="<?php 
        echo $t_pref->email_on_priority_min_severity;
        ?>
" />
		<input type="hidden" name="email_bugnote_limit" value="<?php 
        echo $t_pref->email_bugnote_limit;
        ?>
" />
<?php 
    }
    ?>
<tr class="row-2">
	<td class="category">
		<?php 
    echo lang_get('language');
    ?>
	</td>
	<td>
		<select name="language">
			<?php 
    print_language_option_list($t_pref->language);
    ?>
		</select>
	</td>
</tr>
<tr>
	<td colspan="2" class="center">
		<input type="submit" class="button" value="<?php 
    echo lang_get('update_prefs_button');
    ?>
" />
	</td>
</tr>
</table>
</form>
</div>

<br />

<div class="border-center">
	<form method="post" action="account_prefs_reset.php">
	<input type="hidden" name="user_id" value="<?php 
    echo $p_user_id;
    ?>
" />
	<input type="hidden" name="redirect_url" value="<?php 
    echo $t_redirect_url;
    ?>
" />
	<input type="submit" class="button" value="<?php 
    echo lang_get('reset_prefs_button');
    ?>
" />
	</form>
</div>

<?php 
}
Пример #9
0
	</td>
</tr>
<tr class="row-1">
	<td class="category">
		<?php 
echo lang_get('post_to');
?>
	</td>
	<td>
		<select name="project_id">
		<?php 
$t_sitewide = false;
if (access_has_project_level(MANAGER)) {
    $t_sitewide = true;
}
print_project_option_list(helper_get_current_project(), $t_sitewide);
?>
		</select>
	</td>
</tr>
<tr>
	<td class="center" colspan="2">
		<input type="submit" value="<?php 
echo plugin_lang_get('post_faq_button');
?>
">
	</td>
</tr>
</table>
</form>
</div>
    echo helper_alternate_class();
    ?>
 valign="top">
	<td>
		<?php 
    echo lang_get('project_name');
    ?>
	</td>
	<td>
		<select name="project_id">
			<option value="0" selected="selected"><?php 
    echo lang_get('all_projects');
    ?>
</option>
			<?php 
    print_project_option_list(ALL_PROJECTS, false);
    ?>
		</select>
	</td>
</tr>
<tr <?php 
    echo helper_alternate_class();
    ?>
 valign="top">
	<td>
		<?php 
    echo lang_get('configuration_option');
    ?>
	</td>
	<td>
			<input type="text" name="config_option" value="" size="64" maxlength="64" />
Пример #11
0
?>
 >	
  <td class="category" width="60%">
		<?php 
echo lang_get('reminder_feedback_project_name');
?>
	</td>
	<td width="20%">
			<select name="reminder_feedback_project">
			<option value="0" ><?php 
echo lang_get('all_projects');
?>
</option>
			<?php 
$t_value = plugin_config_get('reminder_feedback_project');
print_project_option_list($t_value, FALSE, NULL, FALSE);
?>
			</select> 
	</td>
		</td><td>
</tr>

<tr <?php 
echo helper_alternate_class();
?>
>
	<td class="category" width="60%">
		<?php 
echo lang_get('reminder_feedback_status');
?>
	</td>
Пример #12
0
function edit_account_prefs($p_user_id = null, $p_error_if_protected = true, $p_accounts_menu = true, $p_redirect_url = '')
{
    if (null === $p_user_id) {
        $p_user_id = auth_get_current_user_id();
    }
    $t_redirect_url = $p_redirect_url;
    if (is_blank($t_redirect_url)) {
        $t_redirect_url = 'account_prefs_page.php';
    }
    # protected account check
    if (user_is_protected($p_user_id)) {
        if ($p_error_if_protected) {
            trigger_error(ERROR_PROTECTED_ACCOUNT, ERROR);
        } else {
            return;
        }
    }
    # prefix data with u_
    $t_pref = user_pref_get($p_user_id);
    # Account Preferences Form BEGIN
    ?>
<br />
<div align="center">
<form method="post" action="account_prefs_update.php">
<?php 
    echo form_security_field('account_prefs_update');
    ?>
<input type="hidden" name="user_id" value="<?php 
    echo $p_user_id;
    ?>
" />
<input type="hidden" name="redirect_url" value="<?php 
    echo $t_redirect_url;
    ?>
" />
<table class="width75" cellspacing="1">
<tr>
	<td class="form-title">
		<?php 
    echo lang_get('default_account_preferences_title');
    ?>
	</td>
	<td class="right">
		<?php 
    if ($p_accounts_menu) {
        print_account_menu('account_prefs_page.php');
    }
    ?>
	</td>
</tr>
<tr <?php 
    echo helper_alternate_class();
    ?>
>
	<td class="category" width="50%">
		<?php 
    echo lang_get('default_project');
    ?>
	</td>
	<td width="50%">
		<select name="default_project">
<?php 
    # Count number of available projects
    $t_projects = current_user_get_accessible_projects();
    $t_num_proj = count($t_projects);
    if ($t_num_proj == 1) {
        $t_num_proj += count(current_user_get_accessible_subprojects($t_projects[0]));
    }
    # Don't display "All projects" in selection list if there is only 1
    print_project_option_list($t_pref->default_project, $t_num_proj != 1);
    ?>
		</select>
	</td>
</tr>
<tr <?php 
    echo helper_alternate_class();
    ?>
>
	<td class="category">
		<?php 
    echo lang_get('refresh_delay');
    ?>
	</td>
	<td>
		<input type="text" name="refresh_delay" size="4" maxlength="4" value="<?php 
    echo $t_pref->refresh_delay;
    ?>
" /> <?php 
    echo lang_get('minutes');
    ?>
	</td>
</tr>
<tr <?php 
    echo helper_alternate_class();
    ?>
>
	<td class="category">
		<?php 
    echo lang_get('redirect_delay');
    ?>
	</td>
	<td>
		<input type="text" name="redirect_delay" size="4" maxlength="3" value="<?php 
    echo $t_pref->redirect_delay;
    ?>
" /> <?php 
    echo lang_get('seconds');
    ?>
	</td>
</tr>
<tr <?php 
    echo helper_alternate_class();
    ?>
>
	<td class="category">
		<?php 
    echo lang_get('bugnote_order');
    ?>
	</td>
	<td>
		<label><input type="radio" name="bugnote_order" value="ASC" <?php 
    check_checked($t_pref->bugnote_order, 'ASC');
    ?>
 /><?php 
    echo lang_get('bugnote_order_asc');
    ?>
</label>
		<label><input type="radio" name="bugnote_order" value="DESC" <?php 
    check_checked($t_pref->bugnote_order, 'DESC');
    ?>
 /><?php 
    echo lang_get('bugnote_order_desc');
    ?>
</label>
	</td>
</tr>
<?php 
    if (ON == config_get('enable_email_notification')) {
        ?>
<tr <?php 
        echo helper_alternate_class();
        ?>
>
	<td class="category">
		<?php 
        echo lang_get('email_on_new');
        ?>
	</td>
	<td>
		<input type="checkbox" name="email_on_new" <?php 
        check_checked($t_pref->email_on_new, ON);
        ?>
 />
		<?php 
        echo lang_get('with_minimum_severity');
        ?>
		<select name="email_on_new_min_severity">
			<option value="<?php 
        echo OFF;
        ?>
"><?php 
        echo lang_get('any');
        ?>
</option>
			<option disabled="disabled">-----</option>
			<?php 
        print_enum_string_option_list('severity', $t_pref->email_on_new_min_severity);
        ?>
		</select>
	</td>
</tr>
<tr <?php 
        echo helper_alternate_class();
        ?>
>
	<td class="category">
		<?php 
        echo lang_get('email_on_assigned');
        ?>
	</td>
	<td>
		<input type="checkbox" name="email_on_assigned" <?php 
        check_checked($t_pref->email_on_assigned, ON);
        ?>
 />
		<?php 
        echo lang_get('with_minimum_severity');
        ?>
		<select name="email_on_assigned_min_severity">
			<option value="<?php 
        echo OFF;
        ?>
"><?php 
        echo lang_get('any');
        ?>
</option>
			<option disabled="disabled">-----</option>
			<?php 
        print_enum_string_option_list('severity', $t_pref->email_on_assigned_min_severity);
        ?>
		</select>
	</td>
</tr>
<tr <?php 
        echo helper_alternate_class();
        ?>
>
	<td class="category">
		<?php 
        echo lang_get('email_on_feedback');
        ?>
	</td>
	<td>
		<input type="checkbox" name="email_on_feedback" <?php 
        check_checked($t_pref->email_on_feedback, ON);
        ?>
 />
		<?php 
        echo lang_get('with_minimum_severity');
        ?>
		<select name="email_on_feedback_min_severity">
			<option value="<?php 
        echo OFF;
        ?>
"><?php 
        echo lang_get('any');
        ?>
</option>
			<option disabled="disabled">-----</option>
			<?php 
        print_enum_string_option_list('severity', $t_pref->email_on_feedback_min_severity);
        ?>
		</select>
	</td>
</tr>
<tr <?php 
        echo helper_alternate_class();
        ?>
>
	<td class="category">
		<?php 
        echo lang_get('email_on_resolved');
        ?>
	</td>
	<td>
		<input type="checkbox" name="email_on_resolved" <?php 
        check_checked($t_pref->email_on_resolved, ON);
        ?>
 />
		<?php 
        echo lang_get('with_minimum_severity');
        ?>
		<select name="email_on_resolved_min_severity">
			<option value="<?php 
        echo OFF;
        ?>
"><?php 
        echo lang_get('any');
        ?>
</option>
			<option disabled="disabled">-----</option>
			<?php 
        print_enum_string_option_list('severity', $t_pref->email_on_resolved_min_severity);
        ?>
		</select>
	</td>
</tr>
<tr <?php 
        echo helper_alternate_class();
        ?>
>
	<td class="category">
		<?php 
        echo lang_get('email_on_closed');
        ?>
	</td>
	<td>
		<input type="checkbox" name="email_on_closed" <?php 
        check_checked($t_pref->email_on_closed, ON);
        ?>
 />
		<?php 
        echo lang_get('with_minimum_severity');
        ?>
		<select name="email_on_closed_min_severity">
			<option value="<?php 
        echo OFF;
        ?>
"><?php 
        echo lang_get('any');
        ?>
</option>
			<option disabled="disabled">-----</option>
			<?php 
        print_enum_string_option_list('severity', $t_pref->email_on_closed_min_severity);
        ?>
		</select>
	</td>
</tr>
<tr <?php 
        echo helper_alternate_class();
        ?>
>
	<td class="category">
		<?php 
        echo lang_get('email_on_reopened');
        ?>
	</td>
	<td>
		<input type="checkbox" name="email_on_reopened" <?php 
        check_checked($t_pref->email_on_reopened, ON);
        ?>
 />
		<?php 
        echo lang_get('with_minimum_severity');
        ?>
		<select name="email_on_reopened_min_severity">
			<option value="<?php 
        echo OFF;
        ?>
"><?php 
        echo lang_get('any');
        ?>
</option>
			<option disabled="disabled">-----</option>
			<?php 
        print_enum_string_option_list('severity', $t_pref->email_on_reopened_min_severity);
        ?>
		</select>
	</td>
</tr>
<tr <?php 
        echo helper_alternate_class();
        ?>
>
	<td class="category">
		<?php 
        echo lang_get('email_on_bugnote_added');
        ?>
	</td>
	<td>
		<input type="checkbox" name="email_on_bugnote" <?php 
        check_checked($t_pref->email_on_bugnote, ON);
        ?>
 />
		<?php 
        echo lang_get('with_minimum_severity');
        ?>
		<select name="email_on_bugnote_min_severity">
			<option value="<?php 
        echo OFF;
        ?>
"><?php 
        echo lang_get('any');
        ?>
</option>
			<option disabled="disabled">-----</option>
			<?php 
        print_enum_string_option_list('severity', $t_pref->email_on_bugnote_min_severity);
        ?>
		</select>
	</td>
</tr>
<tr <?php 
        echo helper_alternate_class();
        ?>
>
	<td class="category">
		<?php 
        echo lang_get('email_on_status_change');
        ?>
	</td>
	<td>
		<input type="checkbox" name="email_on_status" <?php 
        check_checked($t_pref->email_on_status, ON);
        ?>
 />
		<?php 
        echo lang_get('with_minimum_severity');
        ?>
		<select name="email_on_status_min_severity">
			<option value="<?php 
        echo OFF;
        ?>
"><?php 
        echo lang_get('any');
        ?>
</option>
			<option disabled="disabled">-----</option>
			<?php 
        print_enum_string_option_list('severity', $t_pref->email_on_status_min_severity);
        ?>
		</select>
	</td>
</tr>
<tr <?php 
        echo helper_alternate_class();
        ?>
>
	<td class="category">
		<?php 
        echo lang_get('email_on_priority_change');
        ?>
	</td>
	<td>
		<input type="checkbox" name="email_on_priority" <?php 
        check_checked($t_pref->email_on_priority, ON);
        ?>
 />
		<?php 
        echo lang_get('with_minimum_severity');
        ?>
		<select name="email_on_priority_min_severity">
			<option value="<?php 
        echo OFF;
        ?>
"><?php 
        echo lang_get('any');
        ?>
</option>
			<option disabled="disabled">-----</option>
			<?php 
        print_enum_string_option_list('severity', $t_pref->email_on_priority_min_severity);
        ?>
		</select>
	</td>
</tr>
<tr <?php 
        echo helper_alternate_class();
        ?>
>
	<td class="category">
		<?php 
        echo lang_get('email_bugnote_limit');
        ?>
	</td>
	<td>
		<input type="text" name="email_bugnote_limit" maxlength="2" size="2" value="<?php 
        echo $t_pref->email_bugnote_limit;
        ?>
" />
	</td>
</tr>
<?php 
    } else {
        ?>
		<input type="hidden" name="email_on_new"      value="<?php 
        echo $t_pref->email_on_new;
        ?>
" />
		<input type="hidden" name="email_on_assigned" value="<?php 
        echo $t_pref->email_on_assigned;
        ?>
" />
		<input type="hidden" name="email_on_feedback" value="<?php 
        echo $t_pref->email_on_feedback;
        ?>
" />
		<input type="hidden" name="email_on_resolved" value="<?php 
        echo $t_pref->email_on_resolved;
        ?>
" />
		<input type="hidden" name="email_on_closed"   value="<?php 
        echo $t_pref->email_on_closed;
        ?>
" />
		<input type="hidden" name="email_on_reopened" value="<?php 
        echo $t_pref->email_on_reopened;
        ?>
" />
		<input type="hidden" name="email_on_bugnote"  value="<?php 
        echo $t_pref->email_on_bugnote;
        ?>
" />
		<input type="hidden" name="email_on_status"   value="<?php 
        echo $t_pref->email_on_status;
        ?>
" />
		<input type="hidden" name="email_on_priority" value="<?php 
        echo $t_pref->email_on_priority;
        ?>
" />
		<input type="hidden" name="email_on_new_min_severity"      value="<?php 
        echo $t_pref->email_on_new_min_severity;
        ?>
" />
		<input type="hidden" name="email_on_assigned_min_severity" value="<?php 
        echo $t_pref->email_on_assigned_min_severity;
        ?>
" />
		<input type="hidden" name="email_on_feedback_min_severity" value="<?php 
        echo $t_pref->email_on_feedback_min_severity;
        ?>
" />
		<input type="hidden" name="email_on_resolved_min_severity" value="<?php 
        echo $t_pref->email_on_resolved_min_severity;
        ?>
" />
		<input type="hidden" name="email_on_closed_min_severity"   value="<?php 
        echo $t_pref->email_on_closed_min_severity;
        ?>
" />
		<input type="hidden" name="email_on_reopened_min_severity" value="<?php 
        echo $t_pref->email_on_reopened_min_severity;
        ?>
" />
		<input type="hidden" name="email_on_bugnote_min_severity"  value="<?php 
        echo $t_pref->email_on_bugnote_min_severity;
        ?>
" />
		<input type="hidden" name="email_on_status_min_severity"   value="<?php 
        echo $t_pref->email_on_status_min_severity;
        ?>
" />
		<input type="hidden" name="email_on_priority_min_severity" value="<?php 
        echo $t_pref->email_on_priority_min_severity;
        ?>
" />
		<input type="hidden" name="email_bugnote_limit" value="<?php 
        echo $t_pref->email_bugnote_limit;
        ?>
" />
<?php 
    }
    ?>
<tr <?php 
    echo helper_alternate_class();
    ?>
>
	<td class="category">
		<?php 
    echo lang_get('timezone');
    ?>
	</td>
	<td>
		<select name="timezone">
			<?php 
    print_timezone_option_list($t_pref->timezone ? $t_pref->timezone : config_get_global('default_timezone'));
    ?>
		</select>
	</td>
</tr>
<tr <?php 
    echo helper_alternate_class();
    ?>
>
	<td class="category">
		<?php 
    echo lang_get('language');
    ?>
	</td>
	<td>
		<select name="language">
			<?php 
    print_language_option_list($t_pref->language);
    ?>
		</select>
	</td>
</tr>
<?php 
    event_signal('EVENT_ACCOUNT_PREF_UPDATE_FORM', array($p_user_id));
    ?>
<tr>
	<td colspan="2" class="center">
		<input type="submit" class="button" value="<?php 
    echo lang_get('update_prefs_button');
    ?>
" />
	</td>
</tr>
</table>
</form>
</div>

<br />

<div class="border center">
	<form method="post" action="account_prefs_reset.php">
	<?php 
    echo form_security_field('account_prefs_reset');
    ?>
	<input type="hidden" name="user_id" value="<?php 
    echo $p_user_id;
    ?>
" />
	<input type="hidden" name="redirect_url" value="<?php 
    echo $t_redirect_url;
    ?>
" />
	<input type="submit" class="button" value="<?php 
    echo lang_get('reset_prefs_button');
    ?>
" />
	</form>
</div>

<?php 
}
echo helper_alternate_class();
?>
 >
	<td class="category" width="60%">
		<?php 
echo plugin_lang_get('project_name');
?>
	</td>
	<td width="20%">
		<select name="customid_project_id">
			<option value="0" selected="selected"><?php 
echo lang_get('all_projects');
?>
</option>
			<?php 
print_project_option_list(plugin_config_get('project_id'), false);
?>
		</select>
	</td>
</tr>

<tr <?php 
echo helper_alternate_class();
?>
 >
	<td class="category" width="60%">
		<?php 
echo lang_get('custom_field');
?>
	</td>
	<td width="20%">
Пример #14
0
			</tr>
		</form>
		<!-- Copy Users Form -->
		<form method="post" action="manage_proj_user_copy.php">
			<?php 
    echo form_security_field('manage_proj_user_copy');
    ?>
			<tr>
				<td class="left" colspan="3">
						<input type="hidden" name="project_id" value="<?php 
    echo $f_project_id;
    ?>
" />
						<select name="other_project_id">
							<?php 
    print_project_option_list(null, false, $f_project_id);
    ?>
						</select>
						<input type="submit" name="copy_from" class="button" value="<?php 
    echo lang_get('copy_users_from');
    ?>
" />
						<input type="submit" name="copy_to" class="button" value="<?php 
    echo lang_get('copy_users_to');
    ?>
" />
				</td>
			</tr>
		</form>
	</table>
</div>
Пример #15
0
/**
 * (10) Print the user's account information
 * Also print the select box where users can switch projects
 * @return void
 */
function html_login_info()
{
    $t_username = current_user_get_field('username');
    $t_access_level = get_enum_element('access_levels', current_user_get_access_level());
    $t_now = date(config_get('complete_date_format'));
    $t_realname = current_user_get_field('realname');
    # Login information
    echo '<div id="login-info">' . "\n";
    if (current_user_is_anonymous()) {
        $t_return_page = $_SERVER['SCRIPT_NAME'];
        if (isset($_SERVER['QUERY_STRING'])) {
            $t_return_page .= '?' . $_SERVER['QUERY_STRING'];
        }
        $t_return_page = string_url($t_return_page);
        echo "\t" . '<span id="logged-anon-label">' . lang_get('anonymous') . '</span>' . "\n";
        echo "\t" . '<span id="login-link"><a href="' . helper_mantis_url('login_page.php?return=' . $t_return_page) . '">' . lang_get('login_link') . '</a></span>' . "\n";
        if (config_get_global('allow_signup') == ON) {
            echo "\t" . '<span id="signup-link"><a href="' . helper_mantis_url('signup_page.php') . '">' . lang_get('signup_link') . '</a></span>' . "\n";
        }
    } else {
        echo "\t" . '<span id="logged-in-label">' . lang_get('logged_in_as') . '</span>' . "\n";
        echo "\t" . '<span id="logged-in-user">' . string_html_specialchars($t_username) . '</span>' . "\n";
        echo "\t" . '<span id="logged-in">';
        echo !is_blank($t_realname) ? "\t" . '<span id="logged-in-realname">' . string_html_specialchars($t_realname) . '</span>' . "\n" : '';
        echo "\t" . '<span id="logged-in-accesslevel" class="' . $t_access_level . '">' . $t_access_level . '</span>' . "\n";
        echo "\t" . '</span>' . "\n";
    }
    echo '</div>' . "\n";
    # RSS feed
    if (OFF != config_get('rss_enabled')) {
        echo '<div id="rss-feed">' . "\n";
        # Link to RSS issues feed for the selected project, including authentication details.
        echo "\t" . '<a href="' . htmlspecialchars(rss_get_issues_feed_url()) . '">' . "\n";
        echo "\t" . '<img src="' . helper_mantis_url('images/rss.png') . '" alt="' . lang_get('rss') . '" title="' . lang_get('rss') . '" />' . "\n";
        echo "\t" . '</a>' . "\n";
        echo '</div>' . "\n";
    }
    # Project Selector (hidden if only one project visisble to user)
    $t_show_project_selector = true;
    $t_project_ids = current_user_get_accessible_projects();
    if (count($t_project_ids) == 1) {
        $t_project_id = (int) $t_project_ids[0];
        if (count(current_user_get_accessible_subprojects($t_project_id)) == 0) {
            $t_show_project_selector = false;
        }
    }
    if ($t_show_project_selector) {
        echo '<div id="project-selector-div">';
        echo '<form method="post" id="form-set-project" action="' . helper_mantis_url('set_project.php') . '">';
        echo '<fieldset id="project-selector">';
        # CSRF protection not required here - form does not result in modifications
        echo '<label for="form-set-project-id">' . lang_get('email_project') . '</label>';
        echo '<select id="form-set-project-id" name="project_id">';
        print_project_option_list(join(';', helper_get_current_project_trace()), true, null, true);
        echo '</select> ';
        echo '<input type="submit" class="button" value="' . lang_get('switch') . '" />';
        echo '</fieldset>';
        echo '</form>';
        echo '</div>';
    } else {
        # User has only one project, set it as both current and default
        if (ALL_PROJECTS == helper_get_current_project()) {
            helper_set_current_project($t_project_id);
            if (!current_user_is_protected()) {
                current_user_set_default_project($t_project_id);
            }
            # Force reload of current page, except if we got here after
            # creating the first project
            $t_redirect_url = str_replace(config_get('short_path'), '', $_SERVER['REQUEST_URI']);
            if ('manage_proj_create.php' != $t_redirect_url) {
                html_meta_redirect($t_redirect_url, 0, false);
            }
        }
    }
    # Current time
    echo '<div id="current-time">' . $t_now . '</div>';
}
Пример #16
0
/**
 * Display html form to edit account preferences
 *
 * @param integer $p_user_id            A valid user identifier.
 * @param boolean $p_error_if_protected Whether to error if the account is protected.
 * @param boolean $p_accounts_menu      Display account preferences menu.
 * @param string  $p_redirect_url       Redirect URI.
 * @return void
 */
function edit_account_prefs($p_user_id = null, $p_error_if_protected = true, $p_accounts_menu = true, $p_redirect_url = '')
{
    if (null === $p_user_id) {
        $p_user_id = auth_get_current_user_id();
    }
    $t_redirect_url = $p_redirect_url;
    if (is_blank($t_redirect_url)) {
        $t_redirect_url = 'account_prefs_page.php';
    }
    # protected account check
    if (user_is_protected($p_user_id)) {
        if ($p_error_if_protected) {
            trigger_error(ERROR_PROTECTED_ACCOUNT, ERROR);
        } else {
            return;
        }
    }
    $t_pref = user_pref_get($p_user_id);
    # Account Preferences Form BEGIN
    ?>

<div id="account-prefs-update-div" class="form-container">
	<form id="account-prefs-update-form" method="post" action="account_prefs_update.php">
		<fieldset>
			<legend><span><?php 
    echo lang_get('default_account_preferences_title');
    ?>
</span></legend>
			<?php 
    echo form_security_field('account_prefs_update');
    ?>
			<input type="hidden" name="user_id" value="<?php 
    echo $p_user_id;
    ?>
" />
			<input type="hidden" name="redirect_url" value="<?php 
    echo $t_redirect_url;
    ?>
" />
		<?php 
    if ($p_accounts_menu) {
        print_account_menu('account_prefs_page.php');
    }
    ?>
			<div class="field-container">
				<label for="default-project-id"><span><?php 
    echo lang_get('default_project');
    ?>
</span></label>
				<span class="select">
					<select id="default-project-id" name="default_project">
<?php 
    # Count number of available projects
    $t_projects = current_user_get_accessible_projects();
    $t_num_proj = count($t_projects);
    if ($t_num_proj == 1) {
        $t_num_proj += count(current_user_get_accessible_subprojects($t_projects[0]));
    }
    # Don't display "All projects" in selection list if there is only 1
    print_project_option_list((int) $t_pref->default_project, $t_num_proj != 1);
    ?>
					</select>
				</span>
				<span class="label-style"></span>
			</div>
			<div class="field-container">
				<label for="refresh-delay"><span><?php 
    echo lang_get('refresh_delay');
    ?>
</span></label>
				<span class="input"><input id="refresh-delay" type="text" name="refresh_delay" size="4" maxlength="4" value="<?php 
    echo $t_pref->refresh_delay;
    ?>
" /> <?php 
    echo lang_get('minutes');
    ?>
</span>
				<span class="label-style"></span>
			</div>
			<div class="field-container">
				<label for="redirect-delay"><span><?php 
    echo lang_get('redirect_delay');
    ?>
</span></label>
				<span class="input"><input id="redirect-delay" type="text" name="redirect_delay" size="4" maxlength="3" value="<?php 
    echo $t_pref->redirect_delay;
    ?>
" /> <?php 
    echo lang_get('seconds');
    ?>
</span>
				<span class="label-style"></span>
			</div>
			<fieldset class="field-container">
				<legend><span><?php 
    echo lang_get('bugnote_order');
    ?>
</span></legend>
				<span class="radio"><input id="bugnote-order-desc" type="radio" name="bugnote_order" value="DESC" <?php 
    check_checked($t_pref->bugnote_order, 'DESC');
    ?>
 /></span>
				<label for="bugnote-order-desc"><span><?php 
    echo lang_get('bugnote_order_desc');
    ?>
</span></label>
				<span class="radio"><input id="bugnote-order-asc" type="radio" name="bugnote_order" value="ASC" <?php 
    check_checked($t_pref->bugnote_order, 'ASC');
    ?>
 /></span>
				<label for="bugnote-order-asc"><span><?php 
    echo lang_get('bugnote_order_asc');
    ?>
</span></label>
				<span class="label-style"></span>
			</fieldset>
			<?php 
    if (ON == config_get('enable_email_notification')) {
        ?>
			<fieldset class="field-container">
				<legend><label for="email-on-new"><?php 
        echo lang_get('email_on_new');
        ?>
</label></legend>
				<span class="checkbox"><input id="email-on-new" type="checkbox" name="email_on_new" <?php 
        check_checked((int) $t_pref->email_on_new, ON);
        ?>
 /></span>
				<label for="email-on-new-min-severity" class="email-on-severity-label"><span><?php 
        echo lang_get('with_minimum_severity');
        ?>
</span></label>
				<span class="select email-on-severity">
					<select id="email-on-new-min-severity" name="email_on_new_min_severity">
						<option value="<?php 
        echo OFF;
        ?>
"><?php 
        echo lang_get('any');
        ?>
</option>
						<option disabled="disabled">-----</option>
						<?php 
        print_enum_string_option_list('severity', (int) $t_pref->email_on_new_min_severity);
        ?>
					</select>
				</span>
				<span class="label-style"></span>
			</fieldset>
			<fieldset class="field-container">
				<legend><label for="email-on-assigned"><?php 
        echo lang_get('email_on_assigned');
        ?>
</label></legend>
				<span class="checkbox"><input id="email-on-assigned" type="checkbox" name="email_on_assigned" <?php 
        check_checked((int) $t_pref->email_on_assigned, ON);
        ?>
 /></span>
				<label for="email-on-assigned-min-severity" class="email-on-severity-label"><span><?php 
        echo lang_get('with_minimum_severity');
        ?>
</span></label>
				<span class="select email-on-severity">
					<select id="email-on-assigned-min-severity" name="email_on_assigned_min_severity">
						<option value="<?php 
        echo OFF;
        ?>
"><?php 
        echo lang_get('any');
        ?>
</option>
						<option disabled="disabled">-----</option>
						<?php 
        print_enum_string_option_list('severity', (int) $t_pref->email_on_assigned_min_severity);
        ?>
					</select>
				</span>
				<span class="label-style"></span>
			</fieldset>
			<fieldset class="field-container">
				<legend><label for="email-on-feedback"><?php 
        echo lang_get('email_on_feedback');
        ?>
</label></legend>
				<span class="checkbox"><input id="email-on-feedback" type="checkbox" name="email_on_feedback" <?php 
        check_checked((int) $t_pref->email_on_feedback, ON);
        ?>
 /></span>
				<label for="email-on-feedback-min-severity" class="email-on-severity-label"><span><?php 
        echo lang_get('with_minimum_severity');
        ?>
</span></label>
				<span class="select email-on-severity">
					<select id="email-on-feedback-min-severity" name="email_on_feedback_min_severity">
						<option value="<?php 
        echo OFF;
        ?>
"><?php 
        echo lang_get('any');
        ?>
</option>
						<option disabled="disabled">-----</option>
						<?php 
        print_enum_string_option_list('severity', (int) $t_pref->email_on_feedback_min_severity);
        ?>
					</select>
				</span>
				<span class="label-style"></span>
			</fieldset>
			<fieldset class="field-container">
				<legend><label for="email-on-resolved"><?php 
        echo lang_get('email_on_resolved');
        ?>
</label></legend>
				<span class="checkbox"><input id="email-on-resolved" type="checkbox" name="email_on_resolved" <?php 
        check_checked((int) $t_pref->email_on_resolved, ON);
        ?>
 /></span>
				<label for="email-on-resolved-min-severity" class="email-on-severity-label"><span><?php 
        echo lang_get('with_minimum_severity');
        ?>
</span></label>
				<span class="select email-on-severity">
					<select id="email-on-resolved-min-severity" name="email_on_resolved_min_severity">
						<option value="<?php 
        echo OFF;
        ?>
"><?php 
        echo lang_get('any');
        ?>
</option>
						<option disabled="disabled">-----</option>
						<?php 
        print_enum_string_option_list('severity', (int) $t_pref->email_on_resolved_min_severity);
        ?>
					</select>
				</span>
				<span class="label-style"></span>
			</fieldset>
			<fieldset class="field-container">
				<legend><label for="email-on-closed"><?php 
        echo lang_get('email_on_closed');
        ?>
</label></legend>
				<span class="checkbox"><input id="email-on-closed" type="checkbox" name="email_on_closed" <?php 
        check_checked((int) $t_pref->email_on_closed, ON);
        ?>
 /></span>
				<label for="email-on-closed-min-severity" class="email-on-severity-label"><span><?php 
        echo lang_get('with_minimum_severity');
        ?>
</span></label>
				<span class="select email-on-severity">
					<select id="email-on-closed-min-severity" name="email_on_closed_min_severity">
						<option value="<?php 
        echo OFF;
        ?>
"><?php 
        echo lang_get('any');
        ?>
</option>
						<option disabled="disabled">-----</option>
						<?php 
        print_enum_string_option_list('severity', (int) $t_pref->email_on_closed_min_severity);
        ?>
					</select>
				</span>
				<span class="label-style"></span>
			</fieldset>
			<fieldset class="field-container">
				<legend><label for="email-on-reopened"><?php 
        echo lang_get('email_on_reopened');
        ?>
</label></legend>
				<span class="checkbox"><input id="email-on-reopened" type="checkbox" name="email_on_reopened" <?php 
        check_checked((int) $t_pref->email_on_reopened, ON);
        ?>
 /></span>
				<label for="email-on-reopened-min-severity" class="email-on-severity-label"><span><?php 
        echo lang_get('with_minimum_severity');
        ?>
</span></label>
				<span class="select email-on-severity">
					<select id="email-on-reopened-min-severity" name="email_on_reopened_min_severity">
						<option value="<?php 
        echo OFF;
        ?>
"><?php 
        echo lang_get('any');
        ?>
</option>
						<option disabled="disabled">-----</option>
						<?php 
        print_enum_string_option_list('severity', (int) $t_pref->email_on_reopened_min_severity);
        ?>
					</select>
				</span>
				<span class="label-style"></span>
			</fieldset>
			<fieldset class="field-container">
				<legend><label for="email-on-bugnote-added"><?php 
        echo lang_get('email_on_bugnote_added');
        ?>
</label></legend>
				<span class="checkbox"><input id="email-on-bugnote-added" type="checkbox" name="email_on_bugnote" <?php 
        check_checked((int) $t_pref->email_on_bugnote, ON);
        ?>
 /></span>
				<label for="email-on-bugnote-min-severity" class="email-on-severity-label"><span><?php 
        echo lang_get('with_minimum_severity');
        ?>
</span></label>
				<span class="select email-on-severity">
					<select id="email-on-bugnote-min-severity" name="email_on_bugnote_min_severity">
						<option value="<?php 
        echo OFF;
        ?>
"><?php 
        echo lang_get('any');
        ?>
</option>
						<option disabled="disabled">-----</option>
						<?php 
        print_enum_string_option_list('severity', (int) $t_pref->email_on_bugnote_min_severity);
        ?>
					</select>
				</span>
				<span class="label-style"></span>
			</fieldset>
			<fieldset class="field-container">
				<legend><label for="email-on-status"><?php 
        echo lang_get('email_on_status_change');
        ?>
</label></legend>
				<span class="checkbox"><input id="email-on-status" type="checkbox" name="email_on_status" <?php 
        check_checked((int) $t_pref->email_on_status, ON);
        ?>
 /></span>
				<label for="email-on-status-min-severity" class="email-on-severity-label"><span><?php 
        echo lang_get('with_minimum_severity');
        ?>
</span></label>
				<span class="select email-on-severity">
					<select id="email-on-status-min-severity" name="email_on_status_min_severity">
						<option value="<?php 
        echo OFF;
        ?>
"><?php 
        echo lang_get('any');
        ?>
</option>
						<option disabled="disabled">-----</option>
						<?php 
        print_enum_string_option_list('severity', (int) $t_pref->email_on_status_min_severity);
        ?>
					</select>
				</span>
				<span class="label-style"></span>
			</fieldset>
			<fieldset class="field-container">
				<legend><label for="email-on-priority-change"><?php 
        echo lang_get('email_on_priority_change');
        ?>
</label></legend>
				<span class="checkbox"><input id="email-on-priority-change" type="checkbox" name="email_on_priority" <?php 
        check_checked((int) $t_pref->email_on_priority, ON);
        ?>
 /></span>
				<label for="email-on-priority-min-severity" class="email-on-severity-label"><span><?php 
        echo lang_get('with_minimum_severity');
        ?>
</span></label>
				<span class="select email-on-severity">
					<select id="email-on-priority-min-severity" name="email_on_priority_min_severity">
						<option value="<?php 
        echo OFF;
        ?>
"><?php 
        echo lang_get('any');
        ?>
</option>
						<option disabled="disabled">-----</option>
						<?php 
        print_enum_string_option_list('severity', (int) $t_pref->email_on_priority_min_severity);
        ?>
					</select>
				</span>
				<span class="label-style"></span>
			</fieldset>
			<div class="field-container">
				<label for="email-bugnote-limit"><span><?php 
        echo lang_get('email_bugnote_limit');
        ?>
</span></label>
				<span class="input"><input id="email-bugnote-limit" type="text" name="email_bugnote_limit" maxlength="2" size="2" value="<?php 
        echo $t_pref->email_bugnote_limit;
        ?>
" /></span>
				<span class="label-style"></span>
			</div>
<?php 
    } else {
        ?>
			<input type="hidden" name="email_on_new"      value="<?php 
        echo $t_pref->email_on_new;
        ?>
" />
			<input type="hidden" name="email_on_assigned" value="<?php 
        echo $t_pref->email_on_assigned;
        ?>
" />
			<input type="hidden" name="email_on_feedback" value="<?php 
        echo $t_pref->email_on_feedback;
        ?>
" />
			<input type="hidden" name="email_on_resolved" value="<?php 
        echo $t_pref->email_on_resolved;
        ?>
" />
			<input type="hidden" name="email_on_closed"   value="<?php 
        echo $t_pref->email_on_closed;
        ?>
" />
			<input type="hidden" name="email_on_reopened" value="<?php 
        echo $t_pref->email_on_reopened;
        ?>
" />
			<input type="hidden" name="email_on_bugnote"  value="<?php 
        echo $t_pref->email_on_bugnote;
        ?>
" />
			<input type="hidden" name="email_on_status"   value="<?php 
        echo $t_pref->email_on_status;
        ?>
" />
			<input type="hidden" name="email_on_priority" value="<?php 
        echo $t_pref->email_on_priority;
        ?>
" />
			<input type="hidden" name="email_on_new_min_severity"      value="<?php 
        echo $t_pref->email_on_new_min_severity;
        ?>
" />
			<input type="hidden" name="email_on_assigned_min_severity" value="<?php 
        echo $t_pref->email_on_assigned_min_severity;
        ?>
" />
			<input type="hidden" name="email_on_feedback_min_severity" value="<?php 
        echo $t_pref->email_on_feedback_min_severity;
        ?>
" />
			<input type="hidden" name="email_on_resolved_min_severity" value="<?php 
        echo $t_pref->email_on_resolved_min_severity;
        ?>
" />
			<input type="hidden" name="email_on_closed_min_severity"   value="<?php 
        echo $t_pref->email_on_closed_min_severity;
        ?>
" />
			<input type="hidden" name="email_on_reopened_min_severity" value="<?php 
        echo $t_pref->email_on_reopened_min_severity;
        ?>
" />
			<input type="hidden" name="email_on_bugnote_min_severity"  value="<?php 
        echo $t_pref->email_on_bugnote_min_severity;
        ?>
" />
			<input type="hidden" name="email_on_status_min_severity"   value="<?php 
        echo $t_pref->email_on_status_min_severity;
        ?>
" />
			<input type="hidden" name="email_on_priority_min_severity" value="<?php 
        echo $t_pref->email_on_priority_min_severity;
        ?>
" />
			<input type="hidden" name="email_bugnote_limit" value="<?php 
        echo $t_pref->email_bugnote_limit;
        ?>
" />
<?php 
    }
    ?>
			<div class="field-container">
				<label for="timezone"><span><?php 
    echo lang_get('timezone');
    ?>
</span></label>
				<span class="select">
					<select id="timezone" name="timezone">
						<?php 
    print_timezone_option_list($t_pref->timezone ? $t_pref->timezone : config_get_global('default_timezone'));
    ?>
					</select>
				</span>
				<span class="label-style"></span>
			</div>
			<div class="field-container">
				<label for="language"><span><?php 
    echo lang_get('language');
    ?>
</span></label>
				<span class="select">
					<select id="language" name="language">
						<?php 
    print_language_option_list($t_pref->language);
    ?>
					</select>
				</span>
				<span class="label-style"></span>
			</div>

			<?php 
    event_signal('EVENT_ACCOUNT_PREF_UPDATE_FORM', array($p_user_id));
    ?>
			<span class="submit-button"><input type="submit" class="button" value="<?php 
    echo lang_get('update_prefs_button');
    ?>
" /></span>
		</fieldset>
	</form>
</div>

<div id="account-prefs-reset-div" class="form-container">
	<form id="account-prefs-reset-form" method="post" action="account_prefs_reset.php">
		<fieldset>
			<?php 
    echo form_security_field('account_prefs_reset');
    ?>
			<input type="hidden" name="user_id" value="<?php 
    echo $p_user_id;
    ?>
" />
			<input type="hidden" name="redirect_url" value="<?php 
    echo $t_redirect_url;
    ?>
" />
			<span class="submit-button"><input type="submit" class="button" value="<?php 
    echo lang_get('reset_prefs_button');
    ?>
" /></span>
		</fieldset>
	</form>
</div>

<?php 
}
Пример #17
0
/**
 * (11) Print the user's account information
 * Also print the select box where users can switch projects
 * @return null
 */
function html_login_info()
{
    $t_username = current_user_get_field('username');
    $t_access_level = get_enum_element('access_levels', current_user_get_access_level());
    $t_now = date(config_get('complete_date_format'));
    $t_realname = current_user_get_field('realname');
    echo '<table class="hide">';
    echo '<tr>';
    echo '<td class="login-info-left">';
    if (current_user_is_anonymous()) {
        $t_return_page = $_SERVER['SCRIPT_NAME'];
        if (isset($_SERVER['QUERY_STRING'])) {
            $t_return_page .= '?' . $_SERVER['QUERY_STRING'];
        }
        $t_return_page = string_url($t_return_page);
        echo lang_get('anonymous') . ' | <a href="' . helper_mantis_url('login_page.php?return=' . $t_return_page) . '">' . lang_get('login_link') . '</a>';
        if (config_get_global('allow_signup') == ON) {
            echo ' | <a href="' . helper_mantis_url('signup_page.php') . '">' . lang_get('signup_link') . '</a>';
        }
    } else {
        echo lang_get('logged_in_as'), ": <span class=\"italic\">", string_html_specialchars($t_username), "</span> <span class=\"small\">";
        echo is_blank($t_realname) ? "({$t_access_level})" : "(" . string_html_specialchars($t_realname) . " - {$t_access_level})";
        echo "</span>";
    }
    echo '</td>';
    echo '<td class="login-info-middle">';
    echo "<span class=\"italic\">{$t_now}</span>";
    echo '</td>';
    echo '<td class="login-info-right">';
    # Project Selector hidden if only one project visisble to user
    $t_show_project_selector = true;
    $t_project_ids = current_user_get_accessible_projects();
    if (count($t_project_ids) == 1) {
        $t_project_id = (int) $t_project_ids[0];
        if (count(current_user_get_accessible_subprojects($t_project_id)) == 0) {
            $t_show_project_selector = false;
        }
    }
    if ($t_show_project_selector) {
        echo '<form method="post" name="form_set_project" action="' . helper_mantis_url('set_project.php') . '">';
        # CSRF protection not required here - form does not result in modifications
        echo lang_get('email_project'), ': ';
        if (ON == config_get('show_extended_project_browser')) {
            print_extended_project_browser(helper_get_current_project_trace());
        } else {
            if (ON == config_get('use_javascript')) {
                echo '<select name="project_id" class="small" onchange="document.forms.form_set_project.submit();">';
            } else {
                echo '<select name="project_id" class="small">';
            }
            print_project_option_list(join(';', helper_get_current_project_trace()), true, null, true);
            echo '</select> ';
        }
        echo '<input type="submit" class="button-small" value="' . lang_get('switch') . '" />';
        echo '</form>';
    } else {
        # User has only one project, set it as both current and default
        if (ALL_PROJECTS == helper_get_current_project()) {
            helper_set_current_project($t_project_id);
            if (!current_user_is_protected()) {
                current_user_set_default_project($t_project_id);
            }
            # Force reload of current page, except if we got here after
            # creating the first project
            $t_redirect_url = str_replace(config_get('short_path'), '', $_SERVER['REQUEST_URI']);
            if ('manage_proj_create.php' != $t_redirect_url) {
                html_meta_redirect($t_redirect_url, 0, false);
            }
        }
    }
    if (OFF != config_get('rss_enabled')) {
        # Link to RSS issues feed for the selected project, including authentication details.
        echo '<a href="' . htmlspecialchars(rss_get_issues_feed_url()) . '">';
        echo '<img src="' . helper_mantis_url('images/rss.png') . '" alt="' . lang_get('rss') . '" style="border-style: none; margin: 5px; vertical-align: middle;" />';
        echo '</a>';
    }
    echo '</td>';
    echo '</tr>';
    echo '</table>';
}
Пример #18
0
/**
 * Print project field
 * @return void
 */
function print_filter_project_id()
{
    global $g_select_modifier, $g_filter;
    ?>
		<!-- Project -->
		<select <?php 
    echo $g_select_modifier;
    ?>
 name="<?php 
    echo FILTER_PROPERTY_PROJECT_ID;
    ?>
[]">
			<option value="<?php 
    echo META_FILTER_CURRENT;
    ?>
"
				<?php 
    check_selected($g_filter[FILTER_PROPERTY_PROJECT_ID], META_FILTER_CURRENT);
    ?>
>
				[<?php 
    echo lang_get('current');
    ?>
]
			</option>
			<?php 
    print_project_option_list($g_filter[FILTER_PROPERTY_PROJECT_ID]);
    ?>
		</select>
		<?php 
}
Пример #19
0
/**
 * (11) Print the user's account information
 * Also print the select box where users can switch projects
 * @return null
 */
function html_login_info()
{
    $t_username = current_user_get_field('username');
    $t_access_level = get_enum_element('access_levels', current_user_get_access_level());
    $t_now = date(config_get('complete_date_format'));
    $t_realname = current_user_get_field('realname');
    echo '<div id="login-info">';
    if (current_user_is_anonymous()) {
        $t_return_page = $_SERVER['SCRIPT_NAME'];
        if (isset($_SERVER['QUERY_STRING'])) {
            $t_return_page .= '?' . $_SERVER['QUERY_STRING'];
        }
        $t_return_page = string_url($t_return_page);
        echo '<span id="logged-anon-label">' . lang_get('anonymous') . '</span>';
        echo '<span id="login-link"><a href="' . helper_mantis_url('login_page.php?return=' . $t_return_page) . '">' . lang_get('login_link') . '</a></span>';
        if (config_get_global('allow_signup') == ON) {
            echo '<span id="signup-link"><a href="' . helper_mantis_url('signup_page.php') . '">' . lang_get('signup_link') . '</a></span>';
        }
    } else {
        echo '<span id="logged-in-label">' . lang_get('logged_in_as') . '</span>';
        echo '<span id="logged-in-user">' . string_html_specialchars($t_username) . '</span>';
        echo '<span id="logged-in">';
        echo !is_blank($t_realname) ? '<span id="logged-in-realname">' . string_html_specialchars($t_realname) . '</span>' : '';
        echo '<span id="logged-in-accesslevel" class="' . $t_access_level . '">' . $t_access_level . '</span>';
        echo '</span>';
    }
    echo '</div>';
    $t_show_project_selector = true;
    if (count(current_user_get_accessible_projects()) == 1) {
        // >1
        $t_project_ids = current_user_get_accessible_projects();
        $t_project_id = (int) $t_project_ids[0];
        if (count(current_user_get_accessible_subprojects($t_project_id)) == 0) {
            $t_show_project_selector = false;
        }
    }
    if (OFF != config_get('rss_enabled')) {
        echo '<div id="rss-feed">';
        # Link to RSS issues feed for the selected project, including authentication details.
        echo '<a href="' . htmlspecialchars(rss_get_issues_feed_url()) . '">';
        echo '<img src="' . helper_mantis_url('images/rss.png') . '" alt="' . lang_get('rss') . '" title="' . lang_get('rss') . '" />';
        echo '</a>';
        echo '</div>';
    }
    if ($t_show_project_selector) {
        echo '<form method="post" id="form-set-project" action="' . helper_mantis_url('set_project.php') . '">';
        echo '<fieldset id="project-selector">';
        # CSRF protection not required here - form does not result in modifications
        echo '<label for="form-set-project-id">' . lang_get('email_project') . '</label>';
        echo '<select id="form-set-project-id" name="project_id">';
        print_project_option_list(join(';', helper_get_current_project_trace()), true, null, true);
        echo '</select> ';
        echo '<input type="submit" class="button" value="' . lang_get('switch') . '" />';
        echo '</fieldset>';
        echo '</form>';
        echo '<div id="current-time">' . $t_now . '</div>';
    } else {
        echo '<div id="current-time-centered">' . $t_now . '</div>';
    }
}
Пример #20
0
echo lang_get('choose_project');
?>
</span></legend>
			<input type="hidden" name="ref" value="<?php 
echo string_html_specialchars($f_ref);
?>
" />
			<div class="field-container">
				<label for="select-project-id"><span><?php 
echo lang_get('select_project_button');
?>
</span></label>
				<span class="select">
					<select id="select-project-id" name="project_id">
						<?php 
print_project_option_list(ALL_PROJECTS, false, null, true, true);
?>
					</select>
				</span>
				<span class="label-style"></span>
			</div>
			<div class="field-container">
				<label for="set-default"><span><?php 
echo lang_get('make_default');
?>
</span></label>
				<span class="checkbox"><input id="set-default" type="checkbox" name="make_default" /></span>
				<span class="label-style"></span>
			</div>
			<span class="submit-button"><input type="submit" class="button" value="<?php 
echo lang_get('select_project_button');
Пример #21
0
		if ( $t_manage_page && current_user_is_administrator() ) { ?>
			<span class="submit-button"><input <?php echo helper_get_tab_index() ?> type="submit" class="button" name="update_columns_as_global_default" value="<?php echo lang_get( 'update_columns_as_global_default' ) ?>" /></span><?php
		} ?>
		</fieldset>
	</form>
</div>

<div id="manage-columns-copy-div" class="form-container">
	<form id="manage-columns-copy-form" method="post" action="manage_columns_copy.php">
		<fieldset>
			<?php echo form_security_field( 'manage_columns_copy' ) ?>
			<input type="hidden" name="project_id" value="<?php echo $t_project_id ?>" />
			<input type="hidden" name="manage_page" value="<?php echo $t_manage_page ?>" />

			<select name="other_project_id">
				<?php print_project_option_list( /* project_id */ null, /* include_all_projects */ true, /* filter_project_id */ $t_project_id ); ?>
			</select>

			<?php # Skip "Copy From" if the current project is ALL PROJECTS, the current page is management page, and the user is not administrator
			if ( !$t_manage_page || ( $t_project_id != ALL_PROJECTS ) || current_user_is_administrator() ) { ?>
			<input type="submit" name="copy_from" class="button" value="<?php echo lang_get( 'copy_columns_from' ) ?>" /><?php
			} ?>
			<input type="submit" name="copy_to" class="button" value="<?php echo lang_get( 'copy_columns_to' ) ?>" />
		</fieldset>
	</form>
</div>

<?php
if ( $t_account_page ) {
?>
<div class="form-container">