function print_config_value_as_string($p_type, $p_value)
{
    switch ($p_type) {
        case CONFIG_TYPE_INT:
            $t_value = (int) $p_value;
            echo $t_value;
            return;
        case CONFIG_TYPE_STRING:
            $t_value = config_eval($p_value);
            echo string_nl2br(string_html_specialchars("'{$t_value}'"));
            return;
        case CONFIG_TYPE_COMPLEX:
            $t_value = unserialize($p_value);
            break;
        default:
            $t_value = config_eval($p_value);
            break;
    }
    echo '<pre>';
    if (function_exists('var_export')) {
        var_export($t_value);
    } else {
        print_r($t_value);
    }
    echo '</pre>';
}
 public function menu_manage($event, $user_id)
 {
     if (access_has_global_level(plugin_config_get("manage_customers_threshold"))) {
         $page = plugin_page("manage_customers");
         $label = plugin_lang_get("manage_customers");
         return '<a href="' . string_html_specialchars($page) . '">' . $label . '</a>';
     }
 }
/**
 * @param $types
 */
function print_document_selection($types)
{
    $project_id = gpc_get_int('project_id', helper_get_current_project());
    $specmanagement_database_api = new specmanagement_database_api();
    echo '<select name="version_id">';
    foreach ($types as $type) {
        $type_string = string_html_specialchars($type);
        $type_id = $specmanagement_database_api->get_type_id($type);
        $version_id_array = get_version_ids($type_id, $project_id);
        foreach ($version_id_array as $version_id) {
            $version_spec_project_id = version_get_field($version_id, 'project_id');
            if (project_includes_user($version_spec_project_id, auth_get_current_user_id()) || user_is_administrator(auth_get_current_user_id())) {
                $version_string = version_full_name($version_id);
                echo '<option value="' . $version_id . '">';
                echo $type_string . " - " . $version_string;
                echo '</option>';
            }
        }
    }
    echo '</select>';
}
function print_config_value_as_string($p_type, $p_value, $p_for_display = true)
{
    $t_corrupted = false;
    switch ($p_type) {
        case CONFIG_TYPE_DEFAULT:
            return;
        case CONFIG_TYPE_FLOAT:
            echo (double) $p_value;
            return;
        case CONFIG_TYPE_INT:
            echo (int) $p_value;
            return;
        case CONFIG_TYPE_STRING:
            $t_value = string_nl2br(string_html_specialchars(config_eval($p_value)));
            if ($p_for_display) {
                $t_value = '<p id="adm-config-value">' . "'{$t_value}'" . '</p>';
            }
            echo $t_value;
            return;
        case CONFIG_TYPE_COMPLEX:
            $t_value = @unserialize($p_value);
            if ($t_value === false) {
                $t_corrupted = true;
            }
            break;
        default:
            $t_value = config_eval($p_value);
            break;
    }
    if ($t_corrupted) {
        $t_output = $p_for_display ? lang_get('configuration_corrupted') : '';
    } else {
        $t_output = var_export($t_value, true);
    }
    if ($p_for_display) {
        echo '<pre id="adm-config-value">' . string_attribute($t_output) . '</pre>';
    } else {
        echo $t_output;
    }
}
function print_config_value_as_string($p_type, $p_value)
{
    $t_corrupted = false;
    switch ($p_type) {
        case CONFIG_TYPE_FLOAT:
            $t_value = (double) $p_value;
            echo $t_value;
            return;
        case CONFIG_TYPE_INT:
            $t_value = (int) $p_value;
            echo $t_value;
            return;
        case CONFIG_TYPE_STRING:
            $t_value = config_eval($p_value);
            echo string_nl2br(string_html_specialchars("'{$t_value}'"));
            return;
        case CONFIG_TYPE_COMPLEX:
            $t_value = @unserialize($p_value);
            if ($t_value === false) {
                $t_corrupted = true;
            }
            break;
        default:
            $t_value = config_eval($p_value);
            break;
    }
    echo '<pre>';
    if ($t_corrupted) {
        echo lang_get('configuration_corrupted');
    } else {
        if (function_exists('var_export')) {
            var_export($t_value);
        } else {
            print_r($t_value);
        }
    }
    echo '</pre>';
}
require_api('html_api.php');
require_api('lang_api.php');
require_api('print_api.php');
require_api('project_api.php');
require_api('string_api.php');
form_security_validate('manage_config_revert');
auth_reauthenticate();
$f_project_id = gpc_get_int('project', 0);
$f_revert = gpc_get_string('revert', '');
$f_return = gpc_get_string('return');
$t_access = true;
$t_revert_vars = explode(',', $f_revert);
array_walk($t_revert_vars, 'trim');
foreach ($t_revert_vars as $t_revert) {
    $t_access &= access_has_project_level(config_get_access($t_revert), $f_project_id);
}
if (!$t_access) {
    access_denied();
}
if ('' != $f_revert) {
    # Confirm with the user
    helper_ensure_confirmed(lang_get('config_delete_sure') . lang_get('word_separator') . string_html_specialchars(implode(', ', $t_revert_vars)) . lang_get('word_separator') . lang_get('in_project') . lang_get('word_separator') . project_get_name($f_project_id), lang_get('delete_config_button'));
    foreach ($t_revert_vars as $t_revert) {
        config_delete($t_revert, null, $f_project_id);
    }
}
form_security_purge('manage_config_revert');
$t_redirect_url = $f_return;
html_page_top(null, $t_redirect_url);
html_operation_successful($t_redirect_url);
html_page_bottom();
Exemple #7
0
$t_tags_related = tag_stats_related($f_tag_id);
if (count($t_tags_related)) {
    ?>
	<div class="field-container">
		<span class="display-label"><span><?php 
    echo lang_get('tag_related');
    ?>
</span></span>
		<div class="display-value">
			<table id="related-tags" class="tag-list">
<?php 
    foreach ($t_tags_related as $t_tag) {
        $t_name = string_display_line($t_tag['name']);
        $t_description = string_display_line($t_tag['description']);
        $t_count = $t_tag['count'];
        $t_link = string_html_specialchars('search.php?tag_string=' . urlencode('+' . $t_tag_row['name'] . config_get('tag_separator') . '+' . $t_name));
        $t_label = sprintf(lang_get('tag_related_issues'), $t_tag['count']);
        ?>
			<tr>
				<td><span class="tag-link"><a href="tag_view_page.php?tag_id=<?php 
        echo $t_tag['id'];
        ?>
" title="<?php 
        echo $t_description;
        ?>
"><?php 
        echo $t_name;
        ?>
</a></span></td>
				<td><span class="tag-filter"><a href="<?php 
        echo $t_link;
/**
 * Process a string for display in a text box
 * @param string $p_string String to be processed.
 * @return string
 */
function string_attribute($p_string)
{
    return string_html_specialchars($p_string);
}
Exemple #9
0
/**
 * Display a tag hyperlink.
 * If a bug ID is passed, the tag link will include a detach link if the
 * user has appropriate privileges.
 * @param array Tag row
 * @param integer Bug ID
 */
function tag_display_link($p_tag_row, $p_bug_id = 0)
{
    static $t_security_token = null;
    if (is_null($t_security_token)) {
        $t_security_token = htmlspecialchars(form_security_param('tag_detach'));
    }
    if (auth_get_current_user_id() == $p_tag_row['user_attached'] || auth_get_current_user_id() == $p_tag_row['user_id']) {
        $t_detach = config_get('tag_detach_own_threshold');
    } else {
        $t_detach = config_get('tag_detach_threshold');
    }
    $t_name = string_display_line($p_tag_row['name']);
    $t_description = string_display_line($p_tag_row['description']);
    echo "<a href='tag_view_page.php?tag_id={$p_tag_row['id']}' title='{$t_description}'>{$t_name}</a>";
    if ($p_bug_id > 0 && access_has_bug_level($t_detach, $p_bug_id)) {
        $t_tooltip = string_html_specialchars(sprintf(lang_get('tag_detach'), $t_name));
        echo " <a href='tag_detach.php?bug_id={$p_bug_id}&amp;tag_id={$p_tag_row['id']}{$t_security_token}'><img src='images/delete.png' class='delete-icon' title=\"{$t_tooltip}\" alt=\"X\"/></a>";
    }
    return true;
}
Exemple #10
0
function print_project_access_levels_option_list($p_val, $p_project_id = null)
{
    $t_current_user_access_level = access_get_project_level($p_project_id);
    $t_access_levels_enum_string = config_get('access_levels_enum_string');
    $t_enum_values = MantisEnum::getValues($t_access_levels_enum_string);
    foreach ($t_enum_values as $t_enum_value) {
        # a user must not be able to assign another user an access level that is higher than theirs.
        if ($t_enum_value > $t_current_user_access_level) {
            continue;
        }
        $t_access_level = get_enum_element('access_levels', $t_enum_value);
        echo '<option value="' . $t_enum_value . '"';
        check_selected($p_val, $t_enum_value);
        echo '>' . string_html_specialchars($t_access_level) . '</option>';
    }
}
function print_hidden_inputs($p_assoc_array)
{
    foreach ($p_assoc_array as $key => $val) {
        $key = string_html_specialchars($key);
        if (is_array($val)) {
            foreach ($val as $val2) {
                $val2 = string_html_specialchars($val2);
                print "<input type=\"hidden\" name=\"{$val}\\[\\]\" value=\"{$val2}\" />\n";
            }
        } else {
            $val = string_html_specialchars($val);
            print "<input type=\"hidden\" name=\"{$key}\" value=\"{$val}\" />\n";
        }
    }
}
 /**
  * RSS text processing.
  * @param string Event name
  * @param string Unformatted text
  * @return string Formatted text
  */
 function rss($p_event, $p_string)
 {
     static $s_text, $s_urls, $s_buglinks, $s_vcslinks;
     $t_string = $p_string;
     if (null === $s_text) {
         $s_text = plugin_config_get('process_text');
         $s_urls = plugin_config_get('process_urls');
         $s_buglinks = plugin_config_get('process_buglinks');
         $s_vcslinks = plugin_config_get('process_vcslinks');
     }
     if (ON == $s_text) {
         $t_string = string_strip_hrefs($t_string);
         $t_string = string_html_specialchars($t_string);
         $t_string = string_restore_valid_html_tags($t_string);
         $t_string = string_nl2br($t_string);
     }
     if (ON == $s_urls) {
         $t_string = string_insert_hrefs($t_string);
     }
     if (ON == $s_buglinks) {
         $t_string = string_process_bug_link($t_string, true, false, true);
         $t_string = string_process_bugnote_link($t_string, true, false, true);
     }
     if (ON == $s_vcslinks) {
         $t_string = string_process_cvs_link($t_string);
     }
     return $t_string;
 }
Exemple #13
0
        echo '<img src="' . $t_icon_path . 'protected.gif" width="8" height="15" alt="' . lang_get('private') . '" />';
    }
    ?>
		</span>
	</td>

	<?php 
    # -- Summary --
    ?>
	<td class="left my-buglist-description">
		<?php 
    if (ON == config_get('show_bug_project_links') && helper_get_current_project() != $t_bug->project_id) {
        echo '<span class="small project">[', string_display_line(project_get_name($t_bug->project_id)), '] </span>';
    }
    $t_bug_url = string_get_bug_view_url($t_bug->id, null);
    $t_bug_url_title = string_html_specialchars(sprintf(lang_get('label'), lang_get('issue_id') . $t_bug->id) . lang_get('word_separator') . $t_bug->summary);
    echo "<span class=\"small summary\"><a href=\"{$t_bug_url}\" title=\"{$t_bug_url_title}\">{$t_summary}</a></span><br />";
    ?>
		<?php 
    # type project name if viewing 'all projects' or bug is in subproject
    echo '<span class="small category">', string_display_line(category_full_name($t_bug->category_id, true, $t_bug->project_id)), '</span>';
    echo '<span class="small last-modified"> - ';
    if ($t_bug->last_updated > strtotime('-' . $t_filter[FILTER_PROPERTY_HIGHLIGHT_CHANGED] . ' hours')) {
        echo '<strong>' . $t_last_updated . '</strong>';
    } else {
        echo $t_last_updated;
    }
    echo '</span>';
    ?>
	</td>
</tr>
Exemple #14
0
					print error_string(ERROR_ACCESS_DENIED);
				} else {
					if ( !is_blank( $u_email ) ) {
						print_email_link( $u_email, $u_email );
					} else {
						echo " - ";
					}
				} ?>
		</span></span>
		<span class="label-style"></span>
	</div>
	<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
		<span class="display-label"><span><?php echo lang_get( 'realname' ) ?></span></span>
		<span class="display-value"><span><?php
			if ( ! ( $t_can_manage || $t_can_see_realname ) ) {
				print error_string(ERROR_ACCESS_DENIED);
			} else {
				echo string_display_line( $u_realname );
			} ?>
		</span></span>
		<span class="label-style"></span>
	</div>
	<span class="section-links">
	<?php if ( $t_can_manage ) { ?>
			<span id="manage-user-link"><a href="<?php echo string_html_specialchars( 'manage_user_edit_page.php?user_id=' . $f_user_id ); ?>"><?php echo lang_get( 'manage_user' ); ?></a></span>
	<?php } ?>
	</span>
</div><?php

html_page_bottom();
Exemple #15
0
function log_print_to_page()
{
    if (config_get_global('log_destination') === 'page' && auth_is_user_authenticated() && access_has_global_level(config_get('show_log_threshold'))) {
        global $g_log_events, $g_log_levels;
        echo "\n\n<!--Mantis Debug Log Output-->";
        echo "<hr />\n";
        echo "<table id=\"log-event-list\">\n";
        echo "\t<thead>\n";
        echo "\t\t<tr>\n";
        echo "\t\t\t<th>" . lang_get('log_page_number') . "</th>\n";
        echo "\t\t\t<th>" . lang_get('log_page_time') . "</th>\n";
        echo "\t\t\t<th>" . lang_get('log_page_caller') . "</th>\n";
        echo "\t\t\t<th>" . lang_get('log_page_event') . "</th>\n";
        echo "\t\t</tr>\n";
        echo "\t</thead>\n";
        echo "\t<tbody>\n";
        $t_unique_queries_count = 0;
        $t_total_query_execution_time = 0;
        $t_unique_queries = array();
        $t_total_queries_count = 0;
        $t_total_event_count = count($g_log_events);
        if ($t_total_event_count == 0) {
            echo "\t</tbody>\n\t</table>\n";
            echo "<!--END Mantis Debug Log Output-->\n\n";
            return;
        }
        for ($i = 0; $i < $t_total_event_count; $i++) {
            if ($g_log_events[$i][1] == LOG_DATABASE) {
                if (!in_array($g_log_events[$i][2][0], $t_unique_queries)) {
                    $t_unique_queries_count++;
                    $g_log_events[$i][2][2] = false;
                    array_push($t_unique_queries, $g_log_events[$i][2][0]);
                } else {
                    $g_log_events[$i][2][2] = true;
                }
                $t_total_query_execution_time += $g_log_events[$i][2][1];
            }
        }
        $t_count = array();
        foreach ($g_log_events as $t_log_event) {
            $t_level = $g_log_levels[$t_log_event[1]];
            $t_count[$t_log_event[1]]++;
            switch ($t_log_event[1]) {
                case LOG_DATABASE:
                    $t_total_queries_count++;
                    $t_query_duplicate_class = '';
                    if ($t_log_event[2][2]) {
                        $t_query_duplicate_class = ' class="duplicate-query"';
                    }
                    echo "\t\t<tr{$t_query_duplicate_class}><td>" . $t_level . '-' . $t_count[$t_log_event[1]] . "</td><td>" . $t_log_event[2][1] . "</td><td>" . string_html_specialchars($t_log_event[3]) . "</td><td>" . string_html_specialchars($t_log_event[2][0]) . "</td></tr>\n";
                    break;
                default:
                    echo "\t\t<tr><td>" . $t_level . '-' . $t_count[$t_log_event[1]] . "</td><td>" . $t_log_event[2][1] . "</td><td>" . string_html_specialchars($t_log_event[3]) . "</td><td>" . string_html_specialchars($t_log_event[2][0]) . "</td></tr>\n";
            }
        }
        # output any summary data
        if ($t_unique_queries_count != 0) {
            $t_unique_queries_executed = sprintf(lang_get('unique_queries_executed'), $t_unique_queries_count);
            echo "\t\t<tr><td>" . $g_log_levels[LOG_DATABASE] . '</td><td colspan="3">' . $t_unique_queries_executed . "</td></tr>\n";
        }
        if ($t_total_queries_count != 0) {
            $t_total_queries_executed = sprintf(lang_get('total_queries_executed'), $t_total_queries_count);
            echo "\t\t<tr><td>" . $g_log_levels[LOG_DATABASE] . '</td><td colspan="3">' . $t_total_queries_executed . "</td></tr>\n";
        }
        if ($t_total_query_execution_time != 0) {
            $t_total_query_time = sprintf(lang_get('total_query_execution_time'), $t_total_query_execution_time);
            echo "\t\t<tr><td>" . $g_log_levels[LOG_DATABASE] . '</td><td colspan="3">' . $t_total_query_time . "</td></tr>\n";
        }
        echo "\t</tbody>\n\t</table>\n";
    }
    echo "<!--END Mantis Debug Log Output-->\n\n";
}
<!-- Login Form BEGIN -->
<br />
<div align="center">
<form name="login_form" method="post" action="login.php">
<?php 
# CSRF protection not required here - form does not result in modifications
?>
<table class="width50" cellspacing="1">
<tr>
	<td class="form-title">
		<?php 
if (!is_blank($f_return)) {
    ?>
				<input type="hidden" name="return" value="<?php 
    echo string_html_specialchars($f_return);
    ?>
" />
				<?php 
}
echo lang_get('login_title');
?>
	</td>
	<td class="right">
	<?php 
if (ON == config_get('allow_anonymous_login')) {
    print_bracket_link('login_anon.php?return=' . string_url($f_return), lang_get('login_anonymously'));
}
?>
	</td>
</tr>
Exemple #17
0
/**
 * Display a tag hyperlink.
 * If a bug ID is passed, the tag link will include a detach link if the
 * user has appropriate privileges.
 * @param array   $p_tag_row Tag row.
 * @param integer $p_bug_id  The bug ID to display.
 * @return boolean
 */
function tag_display_link(array $p_tag_row, $p_bug_id = 0)
{
    static $s_security_token = null;
    if (is_null($s_security_token)) {
        $s_security_token = htmlspecialchars(form_security_param('tag_detach'));
    }
    echo tag_get_link($p_tag_row);
    if (isset($p_tag_row['user_attached']) && auth_get_current_user_id() == $p_tag_row['user_attached'] || auth_get_current_user_id() == $p_tag_row['user_id']) {
        $t_detach = config_get('tag_detach_own_threshold');
    } else {
        $t_detach = config_get('tag_detach_threshold');
    }
    if ($p_bug_id > 0 && access_has_bug_level($t_detach, $p_bug_id)) {
        $t_tooltip = string_html_specialchars(sprintf(lang_get('tag_detach'), string_display_line($p_tag_row['name'])));
        echo '<a href="tag_detach.php?bug_id=' . $p_bug_id . '&amp;tag_id=' . $p_tag_row['id'] . $s_security_token . '"><img src="images/delete.png" class="delete-icon" title="' . $t_tooltip . '" alt="X"/></a>';
    }
    return true;
}
/**
 * Display a list of changeset objects in tabular format.
 * Assumes that a table with four columns has already been defined.
 * @param array Changeset objects
 * @param array Repository objects
 */
function Source_View_Changesets($p_changesets, $p_repos = null, $p_show_repos = true)
{
    if (!is_array($p_changesets)) {
        return;
    }
    if (is_null($p_repos) || !is_array($p_repos)) {
        $t_repos = SourceRepo::load_by_changesets($p_changesets);
    } else {
        $t_repos = $p_repos;
    }
    $t_use_porting = config_get('plugin_Source_enable_porting');
    foreach ($p_changesets as $t_changeset) {
        $t_repo = $t_repos[$t_changeset->repo_id];
        $t_vcs = SourceVCS::repo($t_repo);
        $t_changeset->load_files();
        $t_author = Source_View_Author($t_changeset, false);
        $t_committer = Source_View_Committer($t_changeset, false);
        ?>

<tr class="row-1">
<td class="category" width="25%" rowspan="<?php 
        echo count($t_changeset->files) + 1;
        ?>
">
	<a name="changeset<?php 
        echo $t_changeset->id;
        ?>
"><?php 
        echo string_display(($p_show_repos ? $t_repo->name . ': ' : '') . $t_vcs->show_changeset($t_repo, $t_changeset));
        ?>
</a>
	<br/><span class="small"><?php 
        echo plugin_lang_get('timestamp', 'Source'), ': ', string_display_line($t_changeset->timestamp);
        ?>
</span>
	<br/><span class="small"><?php 
        echo plugin_lang_get('author', 'Source'), ': ', $t_author;
        ?>
</span>
	<?php 
        if ($t_committer && $t_committer != $t_author) {
            ?>
<br/><span class="small"><?php 
            echo plugin_lang_get('committer', 'Source'), ': ', $t_committer;
            ?>
</span><?php 
        }
        ?>
	<?php 
        if ($t_use_porting) {
            ?>
	<br/><span class="small"><?php 
            echo plugin_lang_get('ported', 'Source'), ': ', $t_changeset->ported ? string_display_line($t_changeset->ported) : (is_null($t_changeset->ported) ? plugin_lang_get('pending', 'Source') : plugin_lang_get('na', 'Source'));
            ?>
</span>
	<?php 
        }
        ?>
	<br/><span class="small-links">
		<?php 
        print_bracket_link(plugin_page('view', false, 'Source') . '&id=' . $t_changeset->id, plugin_lang_get('details', 'Source'));
        if ($t_url = $t_vcs->url_changeset($t_repo, $t_changeset)) {
            print_bracket_link($t_url, plugin_lang_get('diff', 'Source'));
        }
        ?>
</td>
<td colspan="3"><?php 
        # The commit message is manually transformed (adding href, bug and bugnote
        # links + nl2br) instead of calling string_display_links(), which avoids
        # unwanted html tags processing by the MantisCoreFormatting plugin.
        # Rationale: commit messages being plain text, any html they may contain
        # should not be considered as formatting and must be displayed as-is.
        echo string_nl2br(string_process_bugnote_link(string_process_bug_link(string_insert_hrefs(string_html_specialchars($t_changeset->message)))));
        ?>
</td>
</tr>

		<?php 
        foreach ($t_changeset->files as $t_file) {
            ?>
<tr class="row-2">
<td class="small mono" colspan="2"><?php 
            echo string_display_line($t_vcs->show_file($t_repo, $t_changeset, $t_file));
            ?>
</td>
<td class="center" width="12%"><span class="small-links">
		<?php 
            if ($t_url = $t_vcs->url_diff($t_repo, $t_changeset, $t_file)) {
                print_bracket_link($t_url, plugin_lang_get('diff', 'Source'));
            }
            if ($t_url = $t_vcs->url_file($t_repo, $t_changeset, $t_file)) {
                print_bracket_link($t_url, plugin_lang_get('file', 'Source'));
            }
            ?>
</span></td>
</tr>
		<?php 
        }
        ?>
<tr><td class="spacer"></td></tr>
		<?php 
    }
}
Exemple #19
0
	</div><?php 
$t_tags_related = tag_stats_related($f_tag_id);
if (count($t_tags_related)) {
    ?>
	<div class="field-container">
		<span class="display-label"><span><?php 
    echo lang_get('tag_related');
    ?>
</span></span>
		<div class="display-value"><div>
		<table id="related-tags" class="tag-list" cellpadding="5" cellspacing="1" border="1"><?php 
    foreach ($t_tags_related as $t_tag) {
        $t_name = string_display_line($t_tag['name']);
        $t_description = string_display_line($t_tag['description']);
        $t_count = $t_tag['count'];
        $t_link = string_html_specialchars('search.php?tag_string=' . urlencode("+{$t_tag_row['name']}" . config_get('tag_separator') . "+{$t_name}"));
        $t_label = sprintf(lang_get('tag_related_issues'), $t_tag['count']);
        ?>
			<tr>
				<td><span class="tag-link"><a href="tag_view_page.php?tag_id=<?php 
        echo $t_tag['id'];
        ?>
" title="<?php 
        echo $t_description;
        ?>
"><?php 
        echo $t_name;
        ?>
</a></span></td>
				<td><span class="tag-filter"><a href="<?php 
        echo $t_link;
Exemple #20
0
/**
 * Print the dropdown combo-box of existing tags.
 * When passed a bug ID, the option list will not contain any tags attached to the given bug.
 * @param integer Bug ID
 */
function print_tag_option_list($p_bug_id = 0)
{
    $t_rows = tag_get_candidates_for_bug($p_bug_id);
    echo '<option value="0">', string_html_specialchars(lang_get('tag_existing')), '</option>';
    foreach ($t_rows as $row) {
        $t_string = $row['name'];
        if (!empty($row['description'])) {
            $t_string .= ' - ' . utf8_substr($row['description'], 0, 20);
        }
        echo '<option value="', $row['id'], '" title="', string_attribute($row['name']), '">', string_attribute($t_string), '</option>';
    }
}
Exemple #21
0
function html_footer($p_file)
{
    global $g_timer, $g_queries_array, $g_request_time;
    # If a user is logged in, update their last visit time.
    # We do this at the end of the page so that:
    #  1) we can display the user's last visit time on a page before updating it
    #  2) we don't invalidate the user cache immediately after fetching it
    #  3) don't do this on the password verification or update page, as it causes the
    #    verification comparison to fail
    if (auth_is_user_authenticated() && !(is_page_name('verify.php') || is_page_name('account_update.php'))) {
        $t_user_id = auth_get_current_user_id();
        user_update_last_visit($t_user_id);
    }
    echo "\t", '<br />', "\n";
    echo "\t", '<hr size="1" />', "\n";
    echo '<table border="0" width="100%" cellspacing="0" cellpadding="0"><tr valign="top"><td>';
    if (ON == config_get('show_version')) {
        echo "\t", '<span class="timer"><a href="http://www.mantisbt.org/" title="Free Web Based Bug Tracker">Mantis ', MANTIS_VERSION, '</a>', '[<a href="http://www.mantisbt.org/"  title="Free Web Based Bug Tracker" target="_blank">^</a>]</span>', "\n";
    }
    echo "\t", '<address>Copyright &copy; 2000 - 2008 Mantis Group</address>', "\n";
    # only display webmaster email is current user is not the anonymous user
    if (!is_page_name('login_page.php') && !current_user_is_anonymous()) {
        echo "\t", '<address><a href="mailto:', config_get('webmaster_email'), '">', config_get('webmaster_email'), '</a></address>', "\n";
    }
    # print timings
    if (ON == config_get('show_timer')) {
        $g_timer->print_times();
    }
    # print db queries that were run
    if (helper_show_queries()) {
        $t_count = count($g_queries_array);
        echo "\t", $t_count, ' total queries executed.<br />', "\n";
        $t_unique_queries = 0;
        $t_shown_queries = array();
        for ($i = 0; $i < $t_count; $i++) {
            if (!in_array($g_queries_array[$i][0], $t_shown_queries)) {
                $t_unique_queries++;
                $g_queries_array[$i][3] = false;
                array_push($t_shown_queries, $g_queries_array[$i][0]);
            } else {
                $g_queries_array[$i][3] = true;
            }
        }
        echo "\t", $t_unique_queries . ' unique queries executed.<br />', "\n";
        if (ON == config_get('show_queries_list')) {
            echo "\t", '<table>', "\n";
            $t_total = 0;
            for ($i = 0; $i < $t_count; $i++) {
                $t_time = $g_queries_array[$i][1];
                $t_caller = $g_queries_array[$i][2];
                $t_total += $t_time;
                $t_style_tag = '';
                if (true == $g_queries_array[$i][3]) {
                    $t_style_tag = ' style="color: red;"';
                }
                echo "\t", '<tr valign="top"><td', $t_style_tag, '>', $i + 1, '</td>';
                echo '<td', $t_style_tag, '>', $t_time, '</td>';
                echo '<td', $t_style_tag, '><span style="color: gray;">', $t_caller, '</span><br />', string_html_specialchars($g_queries_array[$i][0]), '</td></tr>', "\n";
            }
            # @@@ Note sure if we should localize them given that they are debug info.  Will add if requested by users.
            echo "\t", '<tr><td></td><td>', $t_total, '</td><td>SQL Queries Total Time</td></tr>', "\n";
            echo "\t", '<tr><td></td><td>', round(microtime_float() - $g_request_time, 4), '</td><td>Page Request Total Time</td></tr>', "\n";
            echo "\t", '</table>', "\n";
        }
    }
    echo '</td><td><div align="right">';
    echo '<a href="http://www.mantisbt.org" title="Free Web Based Bug Tracker"><img src="images/mantis_logo_button.gif" width="88" height="35" alt="Powered by Mantis Bugtracker" border="0" /></a>';
    echo '</div></td></tr></table>';
}
Exemple #22
0
    foreach ($t_tags_attach as $t_tag_row) {
        if (!is_blank($t_tag_string)) {
            $t_tag_string .= config_get('tag_separator');
        }
        $t_tag_string .= $t_tag_row['name'];
    }
    foreach ($t_tags_failed as $t_tag_row) {
        echo '<tr>';
        if (-1 == $t_tag_row['id']) {
            echo '<th class="category">', lang_get('tag_create_denied'), '</th>';
        } else {
            if (-2 == $t_tag_row['id']) {
                echo '<th class="category">', lang_get('tag_invalid_name'), '</th>';
            }
        }
        echo '<td>', string_html_specialchars($t_tag_row['name']), '</td></tr>';
        if (!is_blank($t_tag_string)) {
            $t_tag_string .= config_get('tag_separator');
        }
        $t_tag_string .= $t_tag_row['name'];
    }
    ?>
	<tr class="spacer"><td colspan="2"></td></tr>
	<tr>
	<th class="category"><?php 
    echo lang_get('tag_attach_long');
    ?>
</th>
	<td>
<?php 
    print_tag_attach_form($f_bug_id, $t_tag_string);
}
?>
</td>
<td class="small-caption" colspan="<?php 
echo 1 * $t_custom_cols;
?>
"></td>
</tr>
<tr>
	<!-- Search field -->
	<td colspan="<?php 
echo 1 * $t_custom_cols;
?>
">
		<input type="text" size="16" name="search" value="<?php 
echo string_html_specialchars($t_filter['search']);
?>
" />
	</td>

	<td class="small-caption" colspan="<?php 
echo ($t_filter_cols - 2) * $t_custom_cols;
?>
"><?php 
if ($t_show_tags) {
    print_filter_tag_string();
}
?>
</td>

	<!-- Submit button -->
Exemple #24
0
function filter_draw_selection_area2($p_page_number, $p_for_screen = true, $p_expanded = true)
{
    $t_form_name_suffix = $p_expanded ? '_open' : '_closed';
    $t_filter = current_user_get_bug_filter();
    $t_filter = filter_ensure_valid_filter($t_filter);
    $t_project_id = helper_get_current_project();
    $t_page_number = (int) $p_page_number;
    $t_view_type = $t_filter['_view_type'];
    $t_tdclass = 'small-caption';
    $t_trclass = 'row-category2';
    $t_action = 'view_all_set.php?f=3';
    if ($p_for_screen == false) {
        $t_tdclass = 'print';
        $t_trclass = '';
        $t_action = 'view_all_set.php';
    }
    ?>

		<br />
		<form method="post" name="filters<?php 
    echo $t_form_name_suffix;
    ?>
" id="filters_form<?php 
    echo $t_form_name_suffix;
    ?>
" action="<?php 
    print $t_action;
    ?>
">
		<input type="hidden" name="type" value="1" />
		<?php 
    if ($p_for_screen == false) {
        print '<input type="hidden" name="print" value="1" />';
        print '<input type="hidden" name="offset" value="0" />';
    }
    ?>
		<input type="hidden" name="page_number" value="<?php 
    print $t_page_number;
    ?>
" />
		<input type="hidden" name="view_type" value="<?php 
    print $t_view_type;
    ?>
" />
		<table class="width100" cellspacing="1">

		<?php 
    $t_filter_cols = config_get('filter_custom_fields_per_row');
    if ($p_expanded) {
        $t_custom_cols = $t_filter_cols;
        $t_current_user_access_level = current_user_get_access_level();
        $t_accessible_custom_fields_ids = array();
        $t_accessible_custom_fields_names = array();
        $t_accessible_custom_fields_values = array();
        $t_num_custom_rows = 0;
        $t_per_row = 0;
        if (ON == config_get('filter_by_custom_fields')) {
            $t_custom_fields = custom_field_get_linked_ids($t_project_id);
            foreach ($t_custom_fields as $t_cfid) {
                $t_field_info = custom_field_cache_row($t_cfid, true);
                if ($t_field_info['access_level_r'] <= $t_current_user_access_level) {
                    $t_accessible_custom_fields_ids[] = $t_cfid;
                    $t_accessible_custom_fields_names[] = $t_field_info['name'];
                    $t_accessible_custom_fields_types[] = $t_field_info['type'];
                    $t_accessible_custom_fields_values[] = custom_field_distinct_values($t_cfid);
                }
            }
            if (count($t_accessible_custom_fields_ids) > 0) {
                $t_per_row = config_get('filter_custom_fields_per_row');
                $t_num_custom_rows = ceil(count($t_accessible_custom_fields_ids) / $t_per_row);
            }
        }
        $t_filters_url = 'view_filters_page.php?for_screen=' . $p_for_screen;
        if ('advanced' == $t_view_type) {
            $t_filters_url = $t_filters_url . '&amp;view_type=advanced';
        }
        $t_filters_url = $t_filters_url . '&amp;target_field=';
        $t_show_version = ON == config_get('show_product_version') || AUTO == config_get('show_product_version') && count(version_get_all_rows_with_subs($t_project_id)) > 0;
        # overload handler_id setting if user isn't supposed to see them (ref #6189)
        if (!access_has_project_level(config_get('view_handler_threshold'), $t_project_id)) {
            $t_filter['handler_id'] = array(META_FILTER_ANY);
        }
        ?>

		<tr <?php 
        print "class=\"" . $t_trclass . "\"";
        ?>
>
			<td class="small-caption" valign="top">
				<a href="<?php 
        print $t_filters_url . 'reporter_id[]';
        ?>
" id="reporter_id_filter"><?php 
        print lang_get('reporter');
        ?>
:</a>
			</td>
			<td class="small-caption" valign="top">
				<a href="<?php 
        print $t_filters_url . 'user_monitor[]';
        ?>
" id="user_monitor_filter"><?php 
        print lang_get('monitored_by');
        ?>
:</a>
			</td>
			<td class="small-caption" valign="top">
				<a href="<?php 
        print $t_filters_url . 'handler_id[]';
        ?>
" id="handler_id_filter"><?php 
        print lang_get('assigned_to');
        ?>
:</a>
			</td>
			<td colspan="2" class="small-caption" valign="top">
				<a href="<?php 
        print $t_filters_url . 'show_category[]';
        ?>
" id="show_category_filter"><?php 
        print lang_get('category');
        ?>
:</a>
			</td>
			<td class="small-caption" valign="top">
				<a href="<?php 
        print $t_filters_url . 'show_severity[]';
        ?>
" id="show_severity_filter"><?php 
        print lang_get('severity');
        ?>
:</a>
			</td>
			<td class="small-caption" valign="top">
				<a href="<?php 
        print $t_filters_url . 'show_resolution[]';
        ?>
" id="show_resolution_filter"><?php 
        print lang_get('resolution');
        ?>
:</a>
			</td>
			<td class="small-caption" valign="top">
				<a href="<?php 
        print $t_filters_url . 'show_profile[]';
        ?>
" id="show_profile_filter"><?php 
        print lang_get('profile');
        ?>
:</a>
			</td>
			<?php 
        if ($t_filter_cols > 8) {
            echo '<td class="small-caption" valign="top" colspan="' . ($t_filter_cols - 8) . '">&nbsp;</td>';
        }
        ?>
		</tr>

		<tr class="row-1">
			<td class="small-caption" valign="top" id="reporter_id_filter_target">
							<?php 
        $t_output = '';
        $t_any_found = false;
        if (count($t_filter['reporter_id']) == 0) {
            print lang_get('any');
        } else {
            $t_first_flag = true;
            foreach ($t_filter['reporter_id'] as $t_current) {
                $t_this_name = '';
                ?>
										<input type="hidden" name="reporter_id[]" value="<?php 
                echo $t_current;
                ?>
" />
										<?php 
                if ($t_current === 0 || is_blank($t_current) || META_FILTER_ANY == $t_current) {
                    $t_any_found = true;
                } else {
                    if (META_FILTER_MYSELF == $t_current) {
                        if (access_has_project_level(config_get('report_bug_threshold'))) {
                            $t_this_name = '[' . lang_get('myself') . ']';
                        } else {
                            $t_any_found = true;
                        }
                    } else {
                        if (META_FILTER_NONE == $t_current) {
                            $t_this_name = lang_get('none');
                        } else {
                            $t_this_name = user_get_name($t_current);
                        }
                    }
                }
                if ($t_first_flag != true) {
                    $t_output = $t_output . '<br />';
                } else {
                    $t_first_flag = false;
                }
                $t_output = $t_output . $t_this_name;
            }
            if (true == $t_any_found) {
                print lang_get('any');
            } else {
                print $t_output;
            }
        }
        ?>
			</td>
			<td class="small-caption" valign="top" id="user_monitor_filter_target">
							<?php 
        $t_output = '';
        $t_any_found = false;
        if (count($t_filter['user_monitor']) == 0) {
            print lang_get('any');
        } else {
            $t_first_flag = true;
            foreach ($t_filter['user_monitor'] as $t_current) {
                ?>
										<input type="hidden" name="user_monitor[]" value="<?php 
                echo $t_current;
                ?>
" />
										<?php 
                $t_this_name = '';
                if ($t_current === 0 || is_blank($t_current) || META_FILTER_ANY == $t_current) {
                    $t_any_found = true;
                } else {
                    if (META_FILTER_MYSELF == $t_current) {
                        if (access_has_project_level(config_get('monitor_bug_threshold'))) {
                            $t_this_name = '[' . lang_get('myself') . ']';
                        } else {
                            $t_any_found = true;
                        }
                    } else {
                        $t_this_name = user_get_name($t_current);
                    }
                }
                if ($t_first_flag != true) {
                    $t_output = $t_output . '<br />';
                } else {
                    $t_first_flag = false;
                }
                $t_output = $t_output . $t_this_name;
            }
            if (true == $t_any_found) {
                print lang_get('any');
            } else {
                print $t_output;
            }
        }
        ?>
			</td>
			<td class="small-caption" valign="top" id="handler_id_filter_target">
							<?php 
        $t_output = '';
        $t_any_found = false;
        if (count($t_filter['handler_id']) == 0) {
            print lang_get('any');
        } else {
            $t_first_flag = true;
            foreach ($t_filter['handler_id'] as $t_current) {
                ?>
										<input type="hidden" name="handler_id[]" value="<?php 
                echo $t_current;
                ?>
" />
										<?php 
                $t_this_name = '';
                if (META_FILTER_NONE == $t_current) {
                    $t_this_name = lang_get('none');
                } else {
                    if ($t_current === 0 || is_blank($t_current) || META_FILTER_ANY == $t_current) {
                        $t_any_found = true;
                    } else {
                        if (META_FILTER_MYSELF == $t_current) {
                            if (access_has_project_level(config_get('handle_bug_threshold'))) {
                                $t_this_name = '[' . lang_get('myself') . ']';
                            } else {
                                $t_any_found = true;
                            }
                        } else {
                            $t_this_name = user_get_name($t_current);
                        }
                    }
                }
                if ($t_first_flag != true) {
                    $t_output = $t_output . '<br />';
                } else {
                    $t_first_flag = false;
                }
                $t_output = $t_output . $t_this_name;
            }
            if (true == $t_any_found) {
                print lang_get('any');
            } else {
                print $t_output;
            }
        }
        ?>
			</td>
			<td colspan="2" class="small-caption" valign="top" id="show_category_filter_target">
							<?php 
        $t_output = '';
        $t_any_found = false;
        if (count($t_filter['show_category']) == 0) {
            print lang_get('any');
        } else {
            $t_first_flag = true;
            foreach ($t_filter['show_category'] as $t_current) {
                $t_current = stripslashes($t_current);
                ?>
										<input type="hidden" name="show_category[]" value="<?php 
                echo string_display($t_current);
                ?>
" />
										<?php 
                $t_this_string = '';
                if ($t_current == META_FILTER_ANY && is_numeric($t_current) || is_blank($t_current)) {
                    $t_any_found = true;
                } else {
                    $t_this_string = string_display($t_current);
                }
                if ($t_first_flag != true) {
                    $t_output = $t_output . '<br />';
                } else {
                    $t_first_flag = false;
                }
                $t_output = $t_output . $t_this_string;
            }
            if (true == $t_any_found) {
                print lang_get('any');
            } else {
                print $t_output;
            }
        }
        ?>
			</td>
			<td class="small-caption" valign="top" id="show_severity_filter_target">
							<?php 
        $t_output = '';
        $t_any_found = false;
        if (count($t_filter['show_severity']) == 0) {
            print lang_get('any');
        } else {
            $t_first_flag = true;
            foreach ($t_filter['show_severity'] as $t_current) {
                ?>
										<input type="hidden" name="show_severity[]" value="<?php 
                echo $t_current;
                ?>
" />
										<?php 
                $t_this_string = '';
                if ($t_current === META_FILTER_ANY || is_blank($t_current) || $t_current == 0) {
                    $t_any_found = true;
                } else {
                    $t_this_string = get_enum_element('severity', $t_current);
                }
                if ($t_first_flag != true) {
                    $t_output = $t_output . '<br />';
                } else {
                    $t_first_flag = false;
                }
                $t_output = $t_output . $t_this_string;
            }
            if (true == $t_any_found) {
                print lang_get('any');
            } else {
                print $t_output;
            }
        }
        ?>
			</td>
			<td class="small-caption" valign="top" id="show_resolution_filter_target">
							<?php 
        $t_output = '';
        $t_any_found = false;
        if (count($t_filter['show_resolution']) == 0) {
            print lang_get('any');
        } else {
            $t_first_flag = true;
            foreach ($t_filter['show_resolution'] as $t_current) {
                ?>
										<input type="hidden" name="show_resolution[]" value="<?php 
                echo $t_current;
                ?>
" />
										<?php 
                $t_this_string = '';
                if ($t_current === META_FILTER_ANY || is_blank($t_current) || $t_current === 0) {
                    $t_any_found = true;
                } else {
                    $t_this_string = get_enum_element('resolution', $t_current);
                }
                if ($t_first_flag != true) {
                    $t_output = $t_output . '<br />';
                } else {
                    $t_first_flag = false;
                }
                $t_output = $t_output . $t_this_string;
            }
            if (true == $t_any_found) {
                print lang_get('any');
            } else {
                print $t_output;
            }
        }
        ?>
			</td>
			<td class="small-caption" valign="top" id="show_profile_filter_target">
							<?php 
        $t_output = '';
        $t_any_found = false;
        if (count($t_filter['show_profile']) == 0) {
            print lang_get('any');
        } else {
            $t_first_flag = true;
            foreach ($t_filter['show_profile'] as $t_current) {
                ?>
										<input type="hidden" name="show_profile[]" value="<?php 
                echo $t_current;
                ?>
" />
										<?php 
                $t_this_string = '';
                if ($t_current === META_FILTER_ANY || is_blank($t_current) || $t_current === 0) {
                    $t_any_found = true;
                } else {
                    $t_profile = profile_get_row_direct($t_current);
                    $t_this_string = "{$t_profile['platform']} {$t_profile['os']} {$t_profile['os_build']}";
                }
                if ($t_first_flag != true) {
                    $t_output = $t_output . '<br />';
                } else {
                    $t_first_flag = false;
                }
                $t_output = $t_output . $t_this_string;
            }
            if (true == $t_any_found) {
                print lang_get('any');
            } else {
                print $t_output;
            }
        }
        ?>
			</td>
			<?php 
        if ($t_filter_cols > 8) {
            echo '<td class="small-caption" valign="top" colspan="' . ($t_filter_cols - 8) . '">&nbsp;</td>';
        }
        ?>
			</tr>

		<tr <?php 
        print "class=\"" . $t_trclass . "\"";
        ?>
>
			<td class="small-caption" valign="top">
				<a href="<?php 
        print $t_filters_url . 'show_status[]';
        ?>
" id="show_status_filter"><?php 
        print lang_get('status');
        ?>
:</a>
			</td>
			<td class="small-caption" valign="top">
				<?php 
        if ('simple' == $t_view_type) {
            ?>
					<a href="<?php 
            print $t_filters_url . 'hide_status[]';
            ?>
" id="hide_status_filter"><?php 
            print lang_get('hide_status');
            ?>
:</a>
				<?php 
        }
        ?>
			</td>
			<td class="small-caption" valign="top">
				<a href="<?php 
        print $t_filters_url . 'show_build[]';
        ?>
" id="show_build_filter"><?php 
        print lang_get('product_build');
        ?>
:</a>
			</td>
			<?php 
        if ($t_show_version) {
            ?>
			<td colspan="2" class="small-caption" valign="top">
				<a href="<?php 
            print $t_filters_url . 'show_version[]';
            ?>
" id="show_version_filter"><?php 
            print lang_get('product_version');
            ?>
:</a>
			</td>
			<td colspan="1" class="small-caption" valign="top">
				<a href="<?php 
            print $t_filters_url . 'fixed_in_version[]';
            ?>
" id="show_fixed_in_version_filter"><?php 
            print lang_get('fixed_in_version');
            ?>
:</a>
			</td>
			<?php 
        } else {
            ?>
			<td colspan="2" class="small-caption" valign="top">
				&nbsp;
			</td>
			<td colspan="1" class="small-caption" valign="top">
				&nbsp;
			</td>
			<?php 
        }
        ?>
			<td colspan="1" class="small-caption" valign="top">
				<a href="<?php 
        print $t_filters_url . 'show_priority[]';
        ?>
" id="show_priority_filter"><?php 
        print lang_get('priority');
        ?>
:</a>
			</td>
			<td colspan="1" class="small-caption" valign="top">
				<a href="<?php 
        echo $t_filters_url . 'target_version[]';
        ?>
" id="show_target_version_filter"><?php 
        echo lang_get('target_version');
        ?>
:</a>
			</td>
			<?php 
        if ($t_filter_cols > 8) {
            echo '<td class="small-caption" valign="top" colspan="' . ($t_filter_cols - 7) . '">&nbsp;</td>';
        }
        ?>
		</tr>

		<tr class="row-1">
			<td class="small-caption" valign="top" id="show_status_filter_target">
							<?php 
        $t_output = '';
        $t_any_found = false;
        if (count($t_filter['show_status']) == 0) {
            print lang_get('any');
        } else {
            $t_first_flag = true;
            foreach ($t_filter['show_status'] as $t_current) {
                ?>
										<input type="hidden" name="show_status[]" value="<?php 
                echo $t_current;
                ?>
" />
										<?php 
                $t_this_string = '';
                if ($t_current === META_FILTER_ANY || is_blank($t_current) || $t_current === 0) {
                    $t_any_found = true;
                } else {
                    $t_this_string = get_enum_element('status', $t_current);
                }
                if ($t_first_flag != true) {
                    $t_output = $t_output . '<br />';
                } else {
                    $t_first_flag = false;
                }
                $t_output = $t_output . $t_this_string;
            }
            if (true == $t_any_found) {
                print lang_get('any');
            } else {
                print $t_output;
            }
        }
        ?>
			</td>
			<td class="small-caption" valign="top" id="hide_status_filter_target">
							<?php 
        if ('simple' == $t_view_type) {
            $t_output = '';
            $t_none_found = false;
            if (count($t_filter['hide_status']) == 0) {
                print lang_get('none');
            } else {
                $t_first_flag = true;
                foreach ($t_filter['hide_status'] as $t_current) {
                    ?>
											<input type="hidden" name="hide_status[]" value="<?php 
                    echo $t_current;
                    ?>
" />
											<?php 
                    $t_this_string = '';
                    if ($t_current == META_FILTER_NONE || is_blank($t_current) || $t_current === 0) {
                        $t_none_found = true;
                    } else {
                        $t_this_string = get_enum_element('status', $t_current);
                    }
                    if ($t_first_flag != true) {
                        $t_output = $t_output . '<br />';
                    } else {
                        $t_first_flag = false;
                    }
                    $t_output = $t_output . $t_this_string;
                }
                $t_hide_status_post = '';
                if (count($t_filter['hide_status']) == 1) {
                    $t_hide_status_post = ' (' . lang_get('and_above') . ')';
                }
                if (true == $t_none_found) {
                    print lang_get('none');
                } else {
                    print $t_output . $t_hide_status_post;
                }
            }
        }
        ?>
			</td>
			<td class="small-caption" valign="top" id="show_build_filter_target">
							<?php 
        $t_output = '';
        $t_any_found = false;
        if (count($t_filter['show_build']) == 0) {
            print lang_get('any');
        } else {
            $t_first_flag = true;
            foreach ($t_filter['show_build'] as $t_current) {
                $t_current = stripslashes($t_current);
                ?>
										<input type="hidden" name="show_build[]" value="<?php 
                echo string_display($t_current);
                ?>
" />
										<?php 
                $t_this_string = '';
                if ($t_current == META_FILTER_ANY && is_numeric($t_current) || is_blank($t_current)) {
                    $t_any_found = true;
                } else {
                    if (META_FILTER_NONE == $t_current) {
                        $t_this_string = lang_get('none');
                    } else {
                        $t_this_string = string_display($t_current);
                    }
                }
                if ($t_first_flag != true) {
                    $t_output = $t_output . '<br />';
                } else {
                    $t_first_flag = false;
                }
                $t_output = $t_output . $t_this_string;
            }
            if (true == $t_any_found) {
                print lang_get('any');
            } else {
                print $t_output;
            }
        }
        ?>
			</td>
			<?php 
        if ($t_show_version) {
            ?>
			<td colspan="2" class="small-caption" valign="top" id="show_version_filter_target">
							<?php 
            $t_output = '';
            $t_any_found = false;
            if (count($t_filter['show_version']) == 0) {
                print lang_get('any');
            } else {
                $t_first_flag = true;
                foreach ($t_filter['show_version'] as $t_current) {
                    $t_current = stripslashes($t_current);
                    ?>
										<input type="hidden" name="show_version[]" value="<?php 
                    echo string_display($t_current);
                    ?>
" />
										<?php 
                    $t_this_string = '';
                    if ($t_current == META_FILTER_ANY && is_numeric($t_current) || is_blank($t_current)) {
                        $t_any_found = true;
                    } else {
                        if (META_FILTER_NONE == $t_current) {
                            $t_this_string = lang_get('none');
                        } else {
                            $t_this_string = string_display($t_current);
                        }
                    }
                    if ($t_first_flag != true) {
                        $t_output = $t_output . '<br />';
                    } else {
                        $t_first_flag = false;
                    }
                    $t_output = $t_output . $t_this_string;
                }
                if (true == $t_any_found) {
                    print lang_get('any');
                } else {
                    print $t_output;
                }
            }
            ?>
			</td>
			<td colspan="1" class="small-caption" valign="top" id="show_fixed_in_version_filter_target">
							<?php 
            $t_output = '';
            $t_any_found = false;
            if (count($t_filter['fixed_in_version']) == 0) {
                print lang_get('any');
            } else {
                $t_first_flag = true;
                foreach ($t_filter['fixed_in_version'] as $t_current) {
                    $t_current = stripslashes($t_current);
                    ?>
										<input type="hidden" name="fixed_in_version[]" value="<?php 
                    echo string_display($t_current);
                    ?>
" />
										<?php 
                    $t_this_string = '';
                    if ($t_current == META_FILTER_ANY && is_numeric($t_current) || is_blank($t_current)) {
                        $t_any_found = true;
                    } else {
                        if (META_FILTER_NONE == $t_current) {
                            $t_this_string = lang_get('none');
                        } else {
                            $t_this_string = string_display($t_current);
                        }
                    }
                    if ($t_first_flag != true) {
                        $t_output = $t_output . '<br />';
                    } else {
                        $t_first_flag = false;
                    }
                    $t_output = $t_output . $t_this_string;
                }
                if (true == $t_any_found) {
                    print lang_get('any');
                } else {
                    print $t_output;
                }
            }
            ?>
			</td>
			<?php 
        } else {
            ?>
			<td colspan="2" class="small-caption" valign="top">
				&nbsp;
			</td>
			<td colspan="1" class="small-caption" valign="top">
				&nbsp;
			</td>
			<?php 
        }
        ?>
			<td colspan="1" class="small-caption" valign="top" id="show_priority_filter_target">
              <?php 
        $t_output = '';
        $t_any_found = false;
        if (count($t_filter['show_priority']) == 0) {
            print lang_get('any');
        } else {
            $t_first_flag = true;
            foreach ($t_filter['show_priority'] as $t_current) {
                ?>
										<input type="hidden" name="show_priority[]" value="<?php 
                echo $t_current;
                ?>
" />
										<?php 
                $t_this_string = '';
                if ($t_current === META_FILTER_ANY || is_blank($t_current) || $t_current === 0) {
                    $t_any_found = true;
                } else {
                    $t_this_string = get_enum_element('priority', $t_current);
                }
                if ($t_first_flag != true) {
                    $t_output = $t_output . '<br />';
                } else {
                    $t_first_flag = false;
                }
                $t_output = $t_output . $t_this_string;
            }
            if (true == $t_any_found) {
                print lang_get('any');
            } else {
                print $t_output;
            }
        }
        ?>
	    	</td>
			<td colspan="1" class="small-caption" valign="top" id="show_target_version_filter_target">
							<?php 
        $t_output = '';
        $t_any_found = false;
        if (count($t_filter['target_version']) == 0) {
            print lang_get('any');
        } else {
            $t_first_flag = true;
            foreach ($t_filter['target_version'] as $t_current) {
                $t_current = stripslashes($t_current);
                ?>
										<input type="hidden" name="target_version[]" value="<?php 
                echo string_display($t_current);
                ?>
" />
										<?php 
                $t_this_string = '';
                if ($t_current == META_FILTER_ANY && is_numeric($t_current) || is_blank($t_current)) {
                    $t_any_found = true;
                } else {
                    if (META_FILTER_NONE == $t_current) {
                        $t_this_string = lang_get('none');
                    } else {
                        $t_this_string = string_display($t_current);
                    }
                }
                if ($t_first_flag != true) {
                    $t_output = $t_output . '<br />';
                } else {
                    $t_first_flag = false;
                }
                $t_output = $t_output . $t_this_string;
            }
            if (true == $t_any_found) {
                print lang_get('any');
            } else {
                print $t_output;
            }
        }
        ?>
			</td>
			<?php 
        if ($t_filter_cols > 8) {
            echo '<td class="small-caption" valign="top" colspan="' . ($t_filter_cols - 7) . '">&nbsp;</td>';
        }
        ?>

		</tr>

		<tr <?php 
        print "class=\"" . $t_trclass . "\"";
        ?>
>
			<td class="small-caption" valign="top">
				<a href="<?php 
        print $t_filters_url . 'per_page';
        ?>
" id="per_page_filter"><?php 
        print lang_get('show');
        ?>
:</a>
			</td>
			<td class="small-caption" valign="top">
				<a href="<?php 
        print $t_filters_url . 'view_state';
        ?>
" id="view_state_filter"><?php 
        print lang_get('view_status');
        ?>
:</a>
			</td>
			<td class="small-caption" valign="top">
				<a href="<?php 
        print $t_filters_url . 'sticky_issues';
        ?>
" id="sticky_issues_filter"><?php 
        print lang_get('sticky');
        ?>
:</a>
			</td>
			<td class="small-caption" valign="top" colspan="2">
				<a href="<?php 
        print $t_filters_url . 'highlight_changed';
        ?>
" id="highlight_changed_filter"><?php 
        print lang_get('changed');
        ?>
:</a>
			</td>
			<td class="small-caption" valign="top" >
				<a href="<?php 
        print $t_filters_url . 'do_filter_by_date';
        ?>
" id="do_filter_by_date_filter"><?php 
        print lang_get('use_date_filters');
        ?>
:</a>
			</td>
			<td class="small-caption" valign="top" colspan="2">
				<a href="<?php 
        print $t_filters_url . 'relationship_type';
        ?>
" id="relationship_type_filter"><?php 
        print lang_get('bug_relationships');
        ?>
:</a>
			</td>
			<?php 
        if ($t_filter_cols > 8) {
            echo '<td class="small-caption" valign="top" colspan="' . ($t_filter_cols - 8) . '">&nbsp;</td>';
        }
        ?>
		</tr>
		<tr class="row-1">
			<td class="small-caption" valign="top" id="per_page_filter_target">
				<?php 
        echo $t_filter['per_page'] == 0 ? lang_get('all') : $t_filter['per_page'];
        ?>
				<input type="hidden" name="per_page" value="<?php 
        echo $t_filter['per_page'];
        ?>
" />
			</td>
			<td class="small-caption" valign="top" id="view_state_filter_target">
				<?php 
        if (VS_PUBLIC === $t_filter['view_state']) {
            print lang_get('public');
        } else {
            if (VS_PRIVATE === $t_filter['view_state']) {
                print lang_get('private');
            } else {
                print lang_get('any');
                $t_filter['view_state'] = META_FILTER_ANY;
            }
        }
        ?>
				<input type="hidden" name="view_state" value="<?php 
        echo $t_filter['view_state'];
        ?>
" />
			</td>
			<td class="small-caption" valign="top" id="sticky_issues_filter_target">
				<?php 
        $t_sticky_filter_state = gpc_string_to_bool($t_filter['sticky_issues']);
        print $t_sticky_filter_state ? lang_get('yes') : lang_get('no');
        ?>
				<input type="hidden" name="sticky_issues" value="<?php 
        echo $t_sticky_filter_state ? 'on' : 'off';
        ?>
" />
			</td>
			<td class="small-caption" valign="top" colspan="2" id="highlight_changed_filter_target">
				<?php 
        print $t_filter['highlight_changed'];
        ?>
				<input type="hidden" name="highlight_changed" value="<?php 
        echo $t_filter['highlight_changed'];
        ?>
" />
			</td>
			<td class="small-caption" valign="top"  id="do_filter_by_date_filter_target">
							<?php 
        if (ON == config_get('dhtml_filters') && ON == config_get('use_javascript')) {
            ?>
		<script type="text/javascript" language="JavaScript">
		<!--
			function SwitchDateFields() {
		    	// All fields need to be enabled to go back to the script
				document.filters_open.start_month.disabled = ! document.filters_open.do_filter_by_date.checked;
				document.filters_open.start_day.disabled = ! document.filters_open.do_filter_by_date.checked;
				document.filters_open.start_year.disabled = ! document.filters_open.do_filter_by_date.checked;
				document.filters_open.end_month.disabled = ! document.filters_open.do_filter_by_date.checked;
				document.filters_open.end_day.disabled = ! document.filters_open.do_filter_by_date.checked;
				document.filters_open.end_year.disabled = ! document.filters_open.do_filter_by_date.checked;

		   		return true;
			}
		// -->
		</script>
							<?php 
        }
        # end if dhtml_filters
        if ('on' == $t_filter['do_filter_by_date']) {
            ?>
								<input type="hidden" name="do_filter_by_date" value="<?php 
            echo $t_filter['do_filter_by_date'];
            ?>
" />
								<input type="hidden" name="start_month" value="<?php 
            echo $t_filter['start_month'];
            ?>
" />
								<input type="hidden" name="start_day" value="<?php 
            echo $t_filter['start_day'];
            ?>
" />
								<input type="hidden" name="start_year" value="<?php 
            echo $t_filter['start_year'];
            ?>
" />
								<input type="hidden" name="end_month" value="<?php 
            echo $t_filter['end_month'];
            ?>
" />
								<input type="hidden" name="end_day" value="<?php 
            echo $t_filter['end_day'];
            ?>
" />
								<input type="hidden" name="end_year" value="<?php 
            echo $t_filter['end_year'];
            ?>
" />
								<?php 
            $t_chars = preg_split('//', config_get('short_date_format'), -1, PREG_SPLIT_NO_EMPTY);
            $t_time = mktime(0, 0, 0, $t_filter['start_month'], $t_filter['start_day'], $t_filter['start_year']);
            foreach ($t_chars as $t_char) {
                if (strcasecmp($t_char, "M") == 0) {
                    print ' ';
                    print date('F', $t_time);
                }
                if (strcasecmp($t_char, "D") == 0) {
                    print ' ';
                    print date('d', $t_time);
                }
                if (strcasecmp($t_char, "Y") == 0) {
                    print ' ';
                    print date('Y', $t_time);
                }
            }
            print ' - ';
            $t_time = mktime(0, 0, 0, $t_filter['end_month'], $t_filter['end_day'], $t_filter['end_year']);
            foreach ($t_chars as $t_char) {
                if (strcasecmp($t_char, "M") == 0) {
                    print ' ';
                    print date('F', $t_time);
                }
                if (strcasecmp($t_char, "D") == 0) {
                    print ' ';
                    print date('d', $t_time);
                }
                if (strcasecmp($t_char, "Y") == 0) {
                    print ' ';
                    print date('Y', $t_time);
                }
            }
        } else {
            print lang_get('no');
        }
        ?>
			</td>

			<td class="small-caption" valign="top" colspan="2" id="relationship_type_filter_target">
							<input type="hidden" name="relationship_type" value="<?php 
        echo $t_filter['relationship_type'];
        ?>
" />
							<input type="hidden" name="relationship_bug" value="<?php 
        echo $t_filter['relationship_bug'];
        ?>
" />
							<?php 
        $c_rel_type = $t_filter['relationship_type'];
        $c_rel_bug = $t_filter['relationship_bug'];
        if (-1 == $c_rel_type || 0 == $c_rel_bug) {
            print lang_get('any');
        } else {
            print relationship_get_description_for_history($c_rel_type) . ' ' . $c_rel_bug;
        }
        ?>
			</td>
			<?php 
        if ($t_filter_cols > 8) {
            echo '<td class="small-caption" valign="top" colspan="' . ($t_filter_cols - 8) . '">&nbsp;</td>';
        }
        ?>
		</tr>
		<tr <?php 
        print "class=\"" . $t_trclass . "\"";
        ?>
>
			<td class="small-caption" valign="top">
				<a href="<?php 
        echo $t_filters_url . 'platform';
        ?>
" id="platform_filter"><?php 
        echo lang_get('platform');
        ?>
:</a>
			</td>
			<td class="small-caption" valign="top">
				<a href="<?php 
        print $t_filters_url . 'os';
        ?>
" id="os_filter"><?php 
        echo lang_get('os');
        ?>
:</a>
			</td>
			<td class="small-caption" valign="top">
				<a href="<?php 
        print $t_filters_url . 'os_build';
        ?>
" id="os_build_filter"><?php 
        echo lang_get('os_version');
        ?>
:</a>
			</td>
			<td class="small-caption" valign="top" colspan="5">
				<?php 
        if (access_has_global_level(config_get('tag_view_threshold'))) {
            ?>
				<a href="<?php 
            print $t_filters_url . 'tag_string';
            ?>
" id="tag_string_filter"><?php 
            echo lang_get('tags');
            ?>
:</a>
				<?php 
        }
        ?>
			</td>
			<?php 
        if ($t_filter_cols > 8) {
            echo '<td class="small-caption" valign="top" colspan="' . ($t_filter_cols - 8) . '">&nbsp;</td>';
        }
        ?>
		</tr>
		<tr class="row-1">
			<td class="small-caption" valign="top" id="platform_filter_target">
				<?php 
        print_multivalue_field(FILTER_PROPERTY_PLATFORM, $t_filter[FILTER_PROPERTY_PLATFORM]);
        ?>
			</td>
			<td class="small-caption" valign="top" id="os_filter_target">
				<?php 
        print_multivalue_field(FILTER_PROPERTY_OS, $t_filter[FILTER_PROPERTY_OS]);
        ?>
			</td>
			<td class="small-caption" valign="top" id="os_build_filter_target">
				<?php 
        print_multivalue_field(FILTER_PROPERTY_OS_BUILD, $t_filter[FILTER_PROPERTY_OS_BUILD]);
        ?>
			</td>
			<td class="small-caption" valign="top" id="tag_string_filter_target" colspan="5">
				<?php 
        $t_tag_string = $t_filter['tag_string'];
        if ($t_filter['tag_select'] != 0) {
            $t_tag_string .= is_blank($t_tag_string) ? '' : config_get('tag_separator');
            $t_tag_string .= tag_get_field($t_filter['tag_select'], 'name');
        }
        print $t_tag_string;
        ?>
				<input type="hidden" name="tag_string" value="<?php 
        echo $t_tag_string;
        ?>
"/>
			</td>
		</tr>
		<?php 
        if (ON == config_get('filter_by_custom_fields')) {
            # -- Custom Field Searching --
            if (count($t_accessible_custom_fields_ids) > 0) {
                $t_per_row = config_get('filter_custom_fields_per_row');
                $t_num_fields = count($t_accessible_custom_fields_ids);
                $t_row_idx = 0;
                $t_col_idx = 0;
                $t_fields = "";
                $t_values = "";
                for ($i = 0; $i < $t_num_fields; $i++) {
                    if ($t_col_idx == 0) {
                        $t_fields = '<tr class="' . $t_trclass . '">';
                        $t_values = '<tr class="row-1">';
                    }
                    if (isset($t_accessible_custom_fields_names[$i])) {
                        $t_fields .= '<td class="small-caption" valign="top"> ';
                        $t_fields .= '<a href="' . $t_filters_url . 'custom_field_' . $t_accessible_custom_fields_ids[$i] . '[]" id="custom_field_' . $t_accessible_custom_fields_ids[$i] . '_filter">';
                        $t_fields .= string_display(lang_get_defaulted($t_accessible_custom_fields_names[$i]));
                        $t_fields .= '</a> </td> ';
                    }
                    $t_output = '';
                    $t_any_found = false;
                    $t_values .= '<td class="small-caption" valign="top" id="custom_field_' . $t_accessible_custom_fields_ids[$i] . '_filter_target"> ';
                    if (!isset($t_filter['custom_fields'][$t_accessible_custom_fields_ids[$i]])) {
                        $t_values .= lang_get('any');
                    } else {
                        if ($t_accessible_custom_fields_types[$i] == CUSTOM_FIELD_TYPE_DATE) {
                            # @@@ moved embedded javascript here from print_filter_custom_field_date
                            #  it appears not to load properly on Firefox and other browsers if loaded through the httpxmlreq
                            $t_field_id = $t_accessible_custom_fields_ids[$i];
                            $t_js_toggle_func = "toggle_custom_date_field_" . $t_field_id . "_controls";
                            if (ON == config_get('dhtml_filters') && ON == config_get('use_javascript')) {
                                ?>
	<script type="text/javascript" language="JavaScript">
	<!--
	function <?php 
                                echo $t_js_toggle_func . "_start";
                                ?>
(disable) {
			document.filters_open.custom_field_<?php 
                                echo $t_field_id;
                                ?>
_start_year.disabled = disable ;
			document.filters_open.custom_field_<?php 
                                echo $t_field_id;
                                ?>
_start_month.disabled = disable ;
			document.filters_open.custom_field_<?php 
                                echo $t_field_id;
                                ?>
_start_day.disabled = disable ;
	} ;

	function <?php 
                                echo $t_js_toggle_func . "_end";
                                ?>
(disable) {
			document.filters_open.custom_field_<?php 
                                echo $t_field_id;
                                ?>
_end_year.disabled = disable ;
			document.filters_open.custom_field_<?php 
                                echo $t_field_id;
                                ?>
_end_month.disabled = disable ;
			document.filters_open.custom_field_<?php 
                                echo $t_field_id;
                                ?>
_end_day.disabled = disable ;
	} ;

	function <?php 
                                echo $t_js_toggle_func;
                                ?>
() {
		switch (document.filters_open.custom_field_<?php 
                                echo $t_field_id;
                                ?>
_control.selectedIndex) {
		case <?php 
                                echo CUSTOM_FIELD_DATE_ANY;
                                ?>
:
		case <?php 
                                echo CUSTOM_FIELD_DATE_NONE;
                                ?>
:
			<?php 
                                echo $t_js_toggle_func . "_start";
                                ?>
(true) ;
			<?php 
                                echo $t_js_toggle_func . "_end";
                                ?>
(true) ;
			break ;
		case <?php 
                                echo CUSTOM_FIELD_DATE_BETWEEN;
                                ?>
:
			<?php 
                                echo $t_js_toggle_func . "_start";
                                ?>
(false) ;
			<?php 
                                echo $t_js_toggle_func . "_end";
                                ?>
(false) ;
			break ;
		default:
			<?php 
                                echo $t_js_toggle_func . "_start";
                                ?>
(false) ;
			<?php 
                                echo $t_js_toggle_func . "_end";
                                ?>
(true) ;
			break ;
		}
	}
	// -->
	</script>
<?php 
                            }
                            # end if dhtml_filters
                            $t_short_date_format = config_get('short_date_format');
                            if (!isset($t_filter['custom_fields'][$t_accessible_custom_fields_ids[$i]][1])) {
                                $t_filter['custom_fields'][$t_accessible_custom_fields_ids[$i]][1] = 0;
                            }
                            $t_start = date($t_short_date_format, $t_filter['custom_fields'][$t_accessible_custom_fields_ids[$i]][1]);
                            if (!isset($t_filter['custom_fields'][$t_accessible_custom_fields_ids[$i]][2])) {
                                $t_filter['custom_fields'][$t_accessible_custom_fields_ids[$i]][2] = 0;
                            }
                            $t_end = date($t_short_date_format, $t_filter['custom_fields'][$t_accessible_custom_fields_ids[$i]][2]);
                            switch ($t_filter['custom_fields'][$t_accessible_custom_fields_ids[$i]][0]) {
                                case CUSTOM_FIELD_DATE_ANY:
                                    $t_values .= lang_get('any');
                                    break;
                                case CUSTOM_FIELD_DATE_NONE:
                                    $t_values .= lang_get('none');
                                    break;
                                case CUSTOM_FIELD_DATE_BETWEEN:
                                    $t_values .= lang_get('between') . '<br />';
                                    $t_values .= $t_start . '<br />' . $t_end;
                                    break;
                                case CUSTOM_FIELD_DATE_ONORBEFORE:
                                    $t_values .= lang_get('on_or_before') . '<br />';
                                    $t_values .= $t_end;
                                    break;
                                case CUSTOM_FIELD_DATE_BEFORE:
                                    $t_values .= lang_get('before') . '<br />';
                                    $t_values .= $t_end;
                                    break;
                                case CUSTOM_FIELD_DATE_ON:
                                    $t_values .= lang_get('on') . '<br />';
                                    $t_values .= $t_start;
                                    break;
                                case CUSTOM_FIELD_DATE_AFTER:
                                    $t_values .= lang_get('after') . '<br />';
                                    $t_values .= $t_start;
                                    break;
                                case CUSTOM_FIELD_DATE_ONORAFTER:
                                    $t_values .= lang_get('on_or_after') . '<br />';
                                    $t_values .= $t_start;
                                    break;
                            }
                        } else {
                            $t_first_flag = true;
                            foreach ($t_filter['custom_fields'][$t_accessible_custom_fields_ids[$i]] as $t_current) {
                                $t_current = stripslashes($t_current);
                                $t_this_string = '';
                                if ($t_current == META_FILTER_ANY && is_numeric($t_current) || is_blank($t_current)) {
                                    $t_any_found = true;
                                } else {
                                    if (META_FILTER_NONE == $t_current && is_numeric($t_current)) {
                                        $t_this_string = lang_get('none');
                                    } else {
                                        $t_this_string = string_display($t_current);
                                    }
                                }
                                if ($t_first_flag != true) {
                                    $t_output = $t_output . '<br />';
                                } else {
                                    $t_first_flag = false;
                                }
                                $t_output = $t_output . $t_this_string;
                                $t_values .= '<input type="hidden" name="custom_field_' . $t_accessible_custom_fields_ids[$i] . '[]" value="' . string_display($t_current) . '" />';
                            }
                        }
                        if (true == $t_any_found) {
                            $t_values .= lang_get('any');
                        } else {
                            $t_values .= $t_output;
                        }
                    }
                    $t_values .= ' </td>';
                    $t_col_idx++;
                    if ($t_col_idx == $t_per_row) {
                        if ($t_filter_cols > $t_per_row) {
                            $t_fields .= '<td colspan="' . ($t_filter_cols - $t_per_row) . '">&nbsp;</td> ';
                            $t_values .= '<td colspan="' . ($t_filter_cols - $t_per_row) . '">&nbsp;</td> ';
                        }
                        $t_fields .= '</tr>' . "\n";
                        $t_values .= '</tr>' . "\n";
                        echo $t_fields;
                        echo $t_values;
                        $t_col_idx = 0;
                        $t_row_idx++;
                    }
                }
                if ($t_col_idx > 0) {
                    if ($t_col_idx < $t_per_row) {
                        $t_fields .= '<td colspan="' . ($t_per_row - $t_col_idx) . '">&nbsp;</td> ';
                        $t_values .= '<td colspan="' . ($t_per_row - $t_col_idx) . '">&nbsp;</td> ';
                    }
                    if ($t_filter_cols > $t_per_row) {
                        $t_fields .= '<td colspan="' . ($t_filter_cols - $t_per_row) . '">&nbsp;</td> ';
                        $t_values .= '<td colspan="' . ($t_filter_cols - $t_per_row) . '">&nbsp;</td> ';
                    }
                    $t_fields .= '</tr>' . "\n";
                    $t_values .= '</tr>' . "\n";
                    echo $t_fields;
                    echo $t_values;
                }
            }
        }
        ?>
		<tr class="row-1">
			<td class="small-caption" valign="top">
				<a href="<?php 
        print $t_filters_url . 'show_sort';
        ?>
" id="show_sort_filter"><?php 
        print lang_get('sort');
        ?>
:</a>
			</td>
			<td class="small-caption" valign="top" colspan="2" id="show_sort_filter_target">
				<?php 
        $t_sort_fields = split(',', $t_filter['sort']);
        $t_dir_fields = split(',', $t_filter['dir']);
        for ($i = 0; $i < 2; $i++) {
            if (isset($t_sort_fields[$i])) {
                if (0 < $i) {
                    echo ", ";
                }
                $t_sort = $t_sort_fields[$i];
                if (strpos($t_sort, 'custom_') === 0) {
                    $t_field_name = string_display(lang_get_defaulted(substr($t_sort, strlen('custom_'))));
                } else {
                    $t_field_name = string_get_field_name($t_sort);
                }
                echo $t_field_name . " " . lang_get('bugnote_order_' . strtolower($t_dir_fields[$i]));
                echo "<input type=\"hidden\" name=\"sort_{$i}\" value=\"{$t_sort_fields[$i]}\" />";
                echo "<input type=\"hidden\" name=\"dir_{$i}\" value=\"{$t_dir_fields[$i]}\" />";
            }
        }
        ?>
			</td>
			<?php 
        if ('advanced' == $t_view_type) {
            ?>
					<td class="small-caption" valign="top" colspan="2">
						<a href="<?php 
            print $t_filters_url . 'project_id';
            ?>
" id="project_id_filter"><?php 
            print lang_get('email_project');
            ?>
:</a>
					</td>
					<td class="small-caption" valign="top"  id="project_id_filter_target">
						<?php 
            $t_output = '';
            if (!is_array($t_filter['project_id'])) {
                $t_filter['project_id'] = array($t_filter['project_id']);
            }
            if (count($t_filter['project_id']) == 0) {
                print lang_get('current');
            } else {
                $t_first_flag = true;
                foreach ($t_filter['project_id'] as $t_current) {
                    ?>
									<input type="hidden" name="project_id[]" value="<?php 
                    echo $t_current;
                    ?>
" />
									<?php 
                    $t_this_name = '';
                    if (META_FILTER_CURRENT == $t_current) {
                        $t_this_name = lang_get('current');
                    } else {
                        $t_this_name = project_get_name($t_current);
                    }
                    if ($t_first_flag != true) {
                        $t_output = $t_output . '<br />';
                    } else {
                        $t_first_flag = false;
                    }
                    $t_output = $t_output . $t_this_name;
                }
                print $t_output;
            }
            ?>
					</td>
					<?php 
            if ($t_filter_cols > 6) {
                echo '<td class="small-caption" valign="top" colspan="' . ($t_filter_cols - 5) . '">&nbsp;</td>';
            }
        } else {
            if ($t_filter_cols > 3) {
                echo '<td class="small-caption" valign="top" colspan="' . ($t_filter_cols - 2) . '">&nbsp;</td>';
            }
        }
        ?>
		</tr>
		<?php 
    }
    // expanded
    ?>
		<tr>
			<td colspan="2">
				<?php 
    collapse_icon('filter');
    echo lang_get('search');
    ?>
:
				<input type="text" size="16" name="search" value="<?php 
    print string_html_specialchars($t_filter['search']);
    ?>
" />

				<input type="submit" name="filter" class="button-small" value="<?php 
    print lang_get('filter_button');
    ?>
" />
			</td>
			</form>
			<td class="center" colspan="<?php 
    echo $t_filter_cols - 6;
    ?>
"> <!-- use this label for padding -->
				<?php 
    if (ON == config_get('dhtml_filters')) {
        $f_switch_view_link = 'view_all_set.php?type=6&amp;view_type=';
    } else {
        $f_switch_view_link = 'view_filters_page.php?view_type=';
    }
    if (SIMPLE_ONLY != config_get('view_filters') && ADVANCED_ONLY != config_get('view_filters')) {
        if ('advanced' == $t_view_type) {
            print_bracket_link($f_switch_view_link . 'simple', lang_get('simple_filters'));
        } else {
            print_bracket_link($f_switch_view_link . 'advanced', lang_get('advanced_filters'));
        }
        print_bracket_link('permalink_page.php?url=' . urlencode(filter_get_url($t_filter)), lang_get('create_filter_link'), true);
    }
    ?>
			</td>
			<td class="right" colspan="4">
			<?php 
    $t_stored_queries_arr = array();
    $t_stored_queries_arr = filter_db_get_available_queries();
    if (count($t_stored_queries_arr) > 0) {
        ?>
					<form method="get" name="list_queries<?php 
        echo $t_form_name_suffix;
        ?>
" action="view_all_set.php">
					<input type="hidden" name="type" value="3" />
					<?php 
        if (ON == config_get('use_javascript')) {
            echo "<select name=\"source_query_id\" onchange=\"document.forms.list_queries{$t_form_name_suffix}.submit();\">";
        } else {
            print '<select name="source_query_id">';
        }
        ?>
					<option value="-1"><?php 
        print '[' . lang_get('reset_query') . ']';
        ?>
</option>
					<option value="-1"></option>
					<?php 
        foreach ($t_stored_queries_arr as $t_query_id => $t_query_name) {
            print '<option value="' . $t_query_id . '">' . $t_query_name . '</option>';
        }
        ?>
					</select>
					<input type="submit" name="switch_to_query_button" class="button-small" value="<?php 
        print lang_get('use_query');
        ?>
" />
					</form>
					<form method="post" name="open_queries" action="query_view_page.php">
					<input type="submit" name="switch_to_query_button" class="button-small" value="<?php 
        print lang_get('open_queries');
        ?>
" />
					</form>
				<?php 
    } else {
        ?>
					<form method="get" name="reset_query" action="view_all_set.php">
					<input type="hidden" name="type" value="3" />
					<input type="hidden" name="source_query_id" value="-1" />
					<input type="submit" name="reset_query_button" class="button-small" value="<?php 
        print lang_get('reset_query');
        ?>
" />
					</form>
				<?php 
    }
    if (access_has_project_level(config_get('stored_query_create_threshold'))) {
        ?>
					<form method="post" name="save_query" action="query_store_page.php">
					<input type="submit" name="save_query_button" class="button-small" value="<?php 
        print lang_get('save_query');
        ?>
" />
					</form>
			<?php 
    } else {
        ?>
			<?php 
    }
    ?>
			</td>
		</tr>
		</table>
<?php 
}
Exemple #25
0
        }
    }
}
?>

<!-- Login Form BEGIN -->
<div id="login-div" class="form-container">
	<form id="login-form" method="post" action="login.php">
		<fieldset>
			<legend><span><?php 
echo lang_get('login_title');
?>
</span></legend>
			<?php 
if (!is_blank($f_return)) {
    echo '<input type="hidden" name="return" value="', string_html_specialchars($f_return), '" />';
}
if ($t_upgrade_required) {
    echo '<input type="hidden" name="install" value="true" />';
}
# CSRF protection not required here - form does not result in modifications
echo '<ul id="login-links">';
if (ON == config_get('allow_anonymous_login')) {
    echo '<li><a href="login_anon.php?return=' . string_url($f_return) . '">' . lang_get('login_anonymously') . '</a></li>';
}
if (ON == config_get_global('allow_signup') && LDAP != config_get_global('login_method') && ON == config_get('enable_email_notification')) {
    echo '<li><a href="signup_page.php">', lang_get('signup_link'), '</a></li>';
}
# lost password feature disabled or reset password via email disabled -> stop here!
if (LDAP != config_get_global('login_method') && ON == config_get('lost_password_feature') && ON == config_get('send_reset_password') && ON == config_get('enable_email_notification')) {
    echo '<li><a href="lost_pwd_page.php">', lang_get('lost_password_link'), '</a></li>';
/** 
 * Process a string for display in a text box
 */
function string_attribute($p_string)
{
    $p_string = string_html_specialchars($p_string);
    return $p_string;
}
html_page_top(lang_get('select_project_button'));
?>

<!-- Project Select Form BEGIN -->
<div id="select-project-div" class="form-container">
	<form id="select-project-form" method="post" action="set_project.php">
		<?php 
# CSRF protection not required here - form does not result in modifications
?>
		<fieldset>
			<legend><span><?php 
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>
Exemple #28
0
		<span class="display-label"><span><?php 
echo lang_get('realname');
?>
</span></span>
		<span class="display-value"><span><?php 
if (!($t_can_manage || $t_can_see_realname)) {
    print error_string(ERROR_ACCESS_DENIED);
} else {
    echo string_display_line($u_realname);
}
?>
		</span></span>
		<span class="label-style"></span>
	</div>
	<span class="section-links">
	<?php 
if ($t_can_manage) {
    ?>
			<span id="manage-user-link"><a href="<?php 
    echo string_html_specialchars('manage_user_edit_page.php?user_id=' . $f_user_id);
    ?>
"><?php 
    echo lang_get('manage_user');
    ?>
</a></span>
	<?php 
}
?>
	</span>
</div><?php 
html_page_bottom();
Exemple #29
0
function error_string($p_error)
{
    global $g_error_parameters;
    $MANTIS_ERROR = lang_get('MANTIS_ERROR');
    # We pad the parameter array to make sure that we don't get errors if
    #  the caller didn't give enough parameters for the error string
    $t_padding = array_pad(array(), 10, '');
    $t_error = $MANTIS_ERROR[$p_error];
    return string_html_specialchars(call_user_func_array('sprintf', array_merge(array($t_error), $g_error_parameters, $t_padding)));
}
Exemple #30
0
/**
 * Print the menu bar with a list of projects to which the user has access
 * @return null
 */
function print_subproject_menu_bar($p_project_id, $p_parents = '')
{
    $t_subprojects = current_user_get_accessible_subprojects($p_project_id);
    $t_char = ':';
    foreach ($t_subprojects as $t_subproject) {
        echo $t_char . ' <a href="' . helper_mantis_url('set_project.php?project_id=' . $p_parents . $t_subproject) . '">' . string_html_specialchars(project_get_field($t_subproject, 'name')) . '</a>';
        print_subproject_menu_bar($t_subproject, $p_parents . $t_subproject . ';');
        $t_char = ',';
    }
}