コード例 #1
0
function displayResultsCore($query, $fields)
{
    $result = db_query_bound($query);
    $nbRows = 0;
    while ($row = db_fetch_array($result)) {
        $nbRows++;
        $t_bug = bug_get($row['id']);
        print "<tr> \n";
        print '<td><a href="' . string_get_bug_view_url($row['id']) . '">' . bug_format_id($row['id']) . '</a></td>';
        //print "<td> ".string_get_bug_view_url( ))." </td>\n";
        print "<td> " . string_display_line(get_enum_element('status', $t_bug->status)) . " </td>\n";
        print "<td> " . category_get_row($t_bug->category_id)['name'] . " </td>\n";
        print "<td> " . $t_bug->summary . " </td>\n";
        print "<td> " . user_get_field($t_bug->reporter_id, 'username') . " </td>\n";
        if ($t_bug->handler_id != null) {
            print "<td> " . user_get_field($t_bug->handler_id, 'username') . " </td>\n";
        }
        if (sizeof($fields) > 0) {
            for ($i = 0; $i < sizeof($fields); $i++) {
                print "<td> " . $row[$fields[$i]] . " </td>\n";
            }
        }
        print "</tr>\n";
    }
    return $nbRows;
}
コード例 #2
0
/**
 * prepares the name of the user given the id.  also makes it an email link.
 * @param int $p_user_id
 * @return string
 */
function prepare_user_name($p_user_id)
{
    # Catch a user_id of NO_USER (like when a handler hasn't been assigned)
    if (NO_USER == $p_user_id) {
        return '';
    }
    $t_username = user_get_name($p_user_id);
    if (user_exists($p_user_id) && user_get_field($p_user_id, 'enabled')) {
        $t_username = string_display_line($t_username);
        // WK/BFE: Original-Zeile auskommentiert: , LB/BFE 2015
        //		return '<a href="' . string_sanitize_url( 'view_user_page.php?id=' . $p_user_id, true ) . '">' . $t_username . '</a>';
        // ersetzt durch: (Link auf view_user_page nur wenn globale Rolle mindestens $g_manage_user_threshold
        if (user_is_administrator(auth_get_current_user_id())) {
            return '<a href="' . string_sanitize_url('view_user_page.php?id=' . $p_user_id, true) . '">' . $t_username . '</a>';
        } else {
            return $t_username;
        }
        // WK/BFE: Ende der Modifikation
    } else {
        $t_result = '<font STYLE="text-decoration: line-through">';
        $t_result .= string_display_line($t_username);
        $t_result .= '</font>';
        return $t_result;
    }
}
コード例 #3
0
 function display($p_filter_value)
 {
     plugin_push_current('CustomerManagement');
     if (access_has_global_level(plugin_config_get('view_customer_fields_threshold'))) {
         return string_display_line($p_filter_value == 1 ? lang_get('yes') : lang_get('no'));
     }
     plugin_pop_current();
 }
コード例 #4
0
 function display($p_filter_value)
 {
     plugin_push_current('CustomerManagement');
     if (access_has_global_level(plugin_config_get('view_customer_fields_threshold'))) {
         if (is_numeric($p_filter_value)) {
             $group = CustomerManagementDao::getGroup((int) $p_filter_value);
             return string_display_line($group['name']);
         }
     }
     plugin_pop_current();
 }
コード例 #5
0
 public function display($p_bug, $p_columns_target)
 {
     plugin_push_current('CustomerManagement');
     if (access_has_global_level(plugin_config_get('view_customer_fields_threshold'))) {
         $bugData = CustomerManagementDao::getBugData($p_bug->id);
         if (count($bugData) > 0) {
             $isBillable = CustomerManagementDao::getService($bugData['is_billable']);
             echo string_display_line($isBillable ? lang_get('yes') : lang_get('no'));
         }
     }
     plugin_pop_current();
 }
コード例 #6
0
 public function display($p_bug, $p_columns_target)
 {
     plugin_push_current('CustomerManagement');
     if (access_has_global_level(plugin_config_get('view_customer_fields_threshold'))) {
         $bugData = CustomerManagementDao::getBugData($p_bug->id);
         if (count($bugData) > 0) {
             $group = CustomerManagementDao::getGroupForCustomer($bugData['customer_id']);
             echo string_display_line($group['name']);
         }
     }
     plugin_pop_current();
 }
コード例 #7
0
ファイル: prepare_api.php プロジェクト: rombert/mantisbt
/**
 * prepares the name of the user given the id.  also makes it an email link.
 * @param int $p_user_id
 * @return string
 */
function prepare_user_name( $p_user_id ) {
	# Catch a user_id of NO_USER (like when a handler hasn't been assigned)
	if( NO_USER == $p_user_id ) {
		return '';
	}

	$t_username = user_get_name( $p_user_id );
	$t_username = string_display_line( $t_username );
	if( user_exists( $p_user_id ) && user_get_field( $p_user_id, 'enabled' ) ) {
		return '<a class="user" href="' . string_sanitize_url( 'view_user_page.php?id=' . $p_user_id, true ) . '">' . $t_username . '</a>';
	} else {
		return '<del class="user">' . $t_username . '</del>';
	}
}
コード例 #8
0
/**
 * prepares the name of the user given the id.  also makes it an email link.
 * @param int $p_user_id
 * @return string
 */
function prepare_user_name($p_user_id)
{
    # Catch a user_id of NO_USER (like when a handler hasn't been assigned)
    if (NO_USER == $p_user_id) {
        return '';
    }
    $t_username = user_get_name($p_user_id);
    if (user_exists($p_user_id) && user_get_field($p_user_id, 'enabled')) {
        $t_username = string_display_line($t_username);
        return '<a href="' . string_sanitize_url('view_user_page.php?id=' . $p_user_id, true) . '">' . $t_username . '</a>';
    } else {
        $t_result = '<font STYLE="text-decoration: line-through">';
        $t_result .= string_display_line($t_username);
        $t_result .= '</font>';
        return $t_result;
    }
}
コード例 #9
0
function print_version_header($p_version_row)
{
    $t_project_id = $p_version_row['project_id'];
    $t_version_id = $p_version_row['id'];
    $t_version_name = $p_version_row['version'];
    $t_project_name = project_get_field($t_project_id, 'name');
    $t_release_title = '<a href="roadmap_page.php?project_id=' . $t_project_id . '">' . string_display_line($t_project_name) . '</a> - <a href="roadmap_page.php?version_id=' . $t_version_id . '">' . string_display_line($t_version_name) . '</a>';
    if (config_get('show_roadmap_dates')) {
        $t_version_timestamp = $p_version_row['date_order'];
        $t_scheduled_release_date = ' (' . lang_get('scheduled_release') . ' ' . string_display_line(date(config_get('short_date_format'), $t_version_timestamp)) . ')';
    } else {
        $t_scheduled_release_date = '';
    }
    echo '<tt>';
    echo '<br />', $t_release_title, $t_scheduled_release_date, lang_get('word_separator'), print_bracket_link('view_all_set.php?type=1&temporary=y&' . FILTER_PROPERTY_PROJECT_ID . '=' . $t_project_id . '&' . filter_encode_field_and_value(FILTER_PROPERTY_TARGET_VERSION, $t_version_name), lang_get('view_bugs_link')), '<br />';
    $t_release_title_without_hyperlinks = $t_project_name . ' - ' . $t_version_name . $t_scheduled_release_date;
    echo utf8_str_pad('', utf8_strlen($t_release_title_without_hyperlinks), '='), '<br />';
}
コード例 #10
0
/**
 * Print table body
 * @param $status_cols
 */
function print_tbody($status_cols)
{
    $storyboard_db_api = new storyboard_db_api();
    $project_spec_bug_ids = $storyboard_db_api->get_bugarray_by_project(helper_get_current_project());
    $types = $storyboard_db_api->select_all_types();
    echo '<tbody>';
    foreach ($types as $type) {
        echo '<tr>';
        echo '<td class="category">' . $type[1] . '</td>';
        foreach ($status_cols as $status_col) {
            echo '<td class="story_baord">';
            foreach ($project_spec_bug_ids as $project_spec_bug_id) {
                $card = $storyboard_db_api->select_story_card($project_spec_bug_id);
                if ($card[2] == $type[0]) {
                    $bug_status = bug_get_field($project_spec_bug_id, 'status');
                    if ($bug_status == $status_col) {
                        echo '<a href="' . string_get_bug_view_url($project_spec_bug_id) . '" class="rcv_tooltip">';
                        echo '<div class="story_card">';
                        echo string_display_line(bug_format_id($project_spec_bug_id));
                        echo '<span>';
                        print_story_card_title($project_spec_bug_id);
                        print_story_card_info('summary', bug_get_field($project_spec_bug_id, 'summary'), false);
                        print_story_card_info('description', bug_get_text_field($project_spec_bug_id, 'description'), false);
                        print_story_card_info('card_risk', $card[3], true);
                        print_story_card_info('card_story_pt', $card[4], true);
                        print_story_card_info('card_story_pt_post', $card[5], true);
                        print_story_card_info('card_acc_crit', $card[6], true);
                        echo '</span>';
                        echo '</div>';
                        echo '</a><br/><br/><br/>';
                    }
                }
            }
            echo '</td>';
        }
        echo '</tr>';
    }
    echo '</tbody>';
}
コード例 #11
0
 function renderLists()
 {
     $content = '';
     $status_codes = config_get('status_enum_string');
     $t_status_array = MantisEnum::getAssocArrayIndexedByValues($status_codes);
     foreach ($t_status_array as $status => $statusCode) {
         if ($statusCode != "backlog" && $statusCode != "closed") {
             $issues = $this->renderIssues($status);
             $statusName = string_display_line(get_enum_element('status', $status));
             $content .= '<div class="column">
                                 <div class="inside"
                                 style="background-color: ' . get_status_color($status) . '"
                                 id="' . $status . '">
                                 <h5 title="' . $status . '">' . $statusName . ' (' . sizeof($issues) . ')</h5>';
             $content .= implode("\n", $issues);
             $content .= '</div>';
             // inside
             $content .= '</div>';
             // column
         }
     }
     return $content;
 }
コード例 #12
0
        $t_user_name = '';
    }
    ?>
<!-- Repeated Info Row -->
		<tr <?php 
    echo helper_alternate_class();
    ?>
>
			<td>
				<?php 
    echo string_display(category_full_name($t_category['id'], $t_inherited, $f_project_id));
    ?>
			</td>
			<td>
				<?php 
    echo string_display_line($t_user_name);
    ?>
			</td>
			<td class="center">
				<?php 
    if (!$t_inherited) {
        $t_id = urlencode($t_id);
        $t_project_id = urlencode($f_project_id);
        print_button('manage_proj_cat_edit_page.php?id=' . $t_id . '&project_id=' . $t_project_id, lang_get('edit_link'));
        echo '&nbsp;';
        print_button('manage_proj_cat_delete.php?id=' . $t_id . '&project_id=' . $t_project_id, lang_get('delete_link'));
    }
    ?>
			</td>
		</tr>
<?php 
コード例 #13
0
function cfdef_input_radio($p_field_def, $p_custom_field_value)
{
    $t_values = explode('|', custom_field_prepare_possible_values($p_field_def['possible_values']));
    $t_len = strlen($p_custom_field_value);
    if ($t_len >= 2 && $p_custom_field_value[0] == '|' && $p_custom_field_value[$t_len - 1] == '|') {
        $t_checked_value = substr($p_custom_field_value, 1, $t_len - 2);
    } else {
        $t_checked_value = $p_custom_field_value;
    }
    foreach ($t_values as $t_option) {
        echo '<input ', helper_get_tab_index(), ' type="radio" name="custom_field_' . $p_field_def['id'] . '"';
        if ($t_option == $t_checked_value) {
            echo ' value="' . string_attribute($t_option) . '" checked="checked">&#160;' . string_display_line($t_option) . '&#160;&#160;';
        } else {
            echo ' value="' . string_attribute($t_option) . '">&#160;' . string_display_line($t_option) . '&#160;&#160;';
        }
    }
}
コード例 #14
0
<!-- Email -->
<tr <?php 
echo helper_alternate_class();
?>
>
	<td class="category">
		<?php 
echo lang_get('email');
?>
	</td>
	<td>
		<?php 
// With LDAP
if ($t_ldap && ON == config_get('use_ldap_email')) {
    echo string_display_line(user_get_email($t_user_id));
} else {
    print_email_input('email', $t_user['email']);
}
?>
	</td>
</tr>

<!-- Access Level -->
<tr <?php 
echo helper_alternate_class();
?>
>
	<td class="category">
		<?php 
echo lang_get('access_level');
コード例 #15
0
echo '<td class="print-category">' . lang_get('bug_relationships') . '</td>';
echo '<td class="print" colspan="5">' . relationship_get_summary_html_preview($f_bug_id) . '</td></tr>';
if ($t_show_attachments) {
    echo '<tr class="print">';
    echo '<th class="print-category">', lang_get('attached_files'), '</th>';
    echo '<td class="print" colspan="5">';
    $t_attachments = file_get_visible_attachments($f_bug_id);
    $t_first_attachment = true;
    $t_path = config_get_global('path');
    foreach ($t_attachments as $t_attachment) {
        if ($t_first_attachment) {
            $t_first_attachment = false;
        } else {
            echo '<br />';
        }
        $c_filename = string_display_line($t_attachment['display_name']);
        $c_download_url = $t_path . htmlspecialchars($t_attachment['download_url']);
        $c_filesize = number_format($t_attachment['size']);
        $c_date_added = date(config_get('normal_date_format'), $t_attachment['date_added']);
        if (isset($t_attachment['icon'])) {
            echo '<img src="', $t_attachment['icon']['url'], '" alt="', $t_attachment['icon']['alt'], '" />&#160;';
        }
        echo $c_filename . ' (' . $c_filesize . ') <span class="italic">' . $c_date_added . '</span><br />' . $c_download_url;
        if ($t_attachment['preview'] && $t_attachment['type'] == 'image') {
            echo '<br /><img src="', $t_attachment['download_url'], '" alt="', $t_attachment['alt'], '" /><br />';
        }
    }
    echo '</td></tr>';
}
#
# Issue History
コード例 #16
0
ファイル: cfdef_standard.php プロジェクト: Kirill/mantisbt
function cfdef_input_radio($p_field_def, $p_custom_field_value)
{
    $t_values = explode('|', custom_field_prepare_possible_values($p_field_def['possible_values']));
    $t_len = strlen($p_custom_field_value);
    if ($t_len >= 2 && $p_custom_field_value[0] == '|' && $p_custom_field_value[$t_len - 1] == '|') {
        $t_checked_value = substr($p_custom_field_value, 1, $t_len - 2);
    } else {
        $t_checked_value = $p_custom_field_value;
    }
    for ($i = 0; $i < count($t_values); $i++) {
        $t_input_id = 'custom_field_' . $p_field_def['id'] . '_value_' . $i;
        $t_input_name = 'custom_field_' . $p_field_def['id'];
        echo "<input id=\"{$t_input_id}\" " . helper_get_tab_index() . " type=\"radio\" name=\"{$t_input_name}\" value=\"" . string_attribute($t_values[$i]) . '"';
        check_checked($t_checked_value, $t_values[$i]);
        echo " />\n";
        echo "<label for=\"{$t_input_id}\">" . string_display_line($t_values[$i]) . "</label>\n";
    }
}
コード例 #17
0
ファイル: account_sponsor_page.php プロジェクト: gtn/mantisbt
 $t_resolution = string_attribute(get_enum_element('resolution', $t_bug->resolution, auth_get_current_user_id(), $t_bug->project_id));
 $t_version_id = version_get_id($t_bug->fixed_in_version, $t_bug->project_id);
 if (false !== $t_version_id && VERSION_RELEASED == version_get_field($t_version_id, 'released')) {
     $t_released_label = '<a title="' . lang_get('released') . '">' . $t_bug->fixed_in_version . '</a>';
 } else {
     $t_released_label = $t_bug->fixed_in_version;
 }
 # choose color based on status
 $t_status_label = html_get_status_css_class($t_bug->status, auth_get_current_user_id(), $t_bug->project_id);
 echo '<tr class="' . $t_status_label . '">';
 echo '<td><a href="' . string_get_bug_view_url($t_sponsor_row['bug']) . '">' . bug_format_id($t_sponsor_row['bug']) . '</a></td>';
 echo '<td>' . string_display_line(project_get_field($t_bug->project_id, 'name')) . '&#160;</td>';
 echo '<td class="right">' . $t_released_label . '&#160;</td>';
 echo '<td><a title="' . $t_resolution . '"><span class="underline">' . $t_status . '</span>&#160;</a></td>';
 # summary
 echo '<td>' . string_display_line($t_bug->summary);
 if (VS_PRIVATE == $t_bug->view_state) {
     printf(' <img src="%s" alt="(%s)" title="%s" />', $t_icon_path . 'protected.gif', lang_get('private'), lang_get('private'));
 }
 echo '</td>';
 # describe sponsorship amount
 echo '<td>';
 print_user($t_sponsor->user_id);
 echo '</td>';
 echo '<td class="right">' . sponsorship_format_amount($t_sponsor->amount) . '</td>';
 echo '<td><select name="sponsor_' . $t_row['bug'] . '_' . $t_sponsor->id . '">';
 print_enum_string_option_list('sponsorship', $t_sponsor->paid);
 echo '</select></td>';
 echo '</tr>';
 if (SPONSORSHIP_PAID == $t_sponsor->paid) {
     $t_total_paid += $t_sponsor->amount;
コード例 #18
0
ファイル: filter_api.php プロジェクト: vipjaven/mantisbt
/**
 * Print plugin filter fields as defined by MantisFilter objects.
 * @param string $p_field_name    Field name.
 * @param object $p_filter_object Filter object.
 * @return void
 */
function print_filter_plugin_field($p_field_name, $p_filter_object)
{
    global $g_select_modifier, $g_filter, $f_view_type;
    $t_size = (int) $p_filter_object->size;
    switch ($p_filter_object->type) {
        case FILTER_TYPE_STRING:
            echo '<input name="', string_attribute($p_field_name), '"', $t_size > 0 ? ' size="' . $t_size . '"' : '', ' value="', string_attribute($g_filter[$p_field_name]), '"/>';
            break;
        case FILTER_TYPE_INT:
            echo '<input name="', string_attribute($p_field_name), '"', $t_size > 0 ? ' size="' . $t_size . '"' : '', ' value="', (int) $g_filter[$p_field_name], '"/>';
            break;
        case FILTER_TYPE_BOOLEAN:
            echo '<input name="', string_attribute($p_field_name), '" type="checkbox"', $t_size > 0 ? ' size="' . $t_size . '"' : '', check_checked((bool) $g_filter[$p_field_name]), '"/>';
            break;
        case FILTER_TYPE_MULTI_STRING:
            echo '<select', $g_select_modifier, $t_size > 0 ? ' size="' . $t_size . '"' : '', ' name="', string_attribute($p_field_name), '[]">', '<option value="', META_FILTER_ANY, '"', check_selected($g_filter[$p_field_name], META_FILTER_ANY), '>[', lang_get('any'), ']</option>';
            foreach ($p_filter_object->options() as $t_option_value => $t_option_name) {
                echo '<option value="', string_attribute($t_option_value), '" ', check_selected($g_filter[$p_field_name], $t_option_value), '>', string_display_line($t_option_name), '</option>';
            }
            echo '</select>';
            break;
        case FILTER_TYPE_MULTI_INT:
            echo '<select', $g_select_modifier, $t_size > 0 ? ' size="' . $t_size . '"' : '', ' name="', string_attribute($p_field_name), '[]">', '<option value="', META_FILTER_ANY, '"', check_selected($g_filter[$p_field_name], META_FILTER_ANY), '>[', lang_get('any'), ']</option>';
            foreach ($p_filter_object->options() as $t_option_value => $t_option_name) {
                echo '<option value="', (int) $t_option_value, '" ', check_selected($g_filter[$p_field_name], (int) $t_option_value), '>', string_display_line($t_option_name), '</option>';
            }
            echo '</select>';
            break;
    }
}
コード例 #19
0
/**
 * preg_replace_callback function for working with VCS links.
 */
function Source_Changeset_Link_Callback($p_matches)
{
    $t_url_type = strtolower($p_matches[1]);
    $t_repo_name = $p_matches[2];
    $t_revision = $p_matches[3];
    $t_repo_table = plugin_table('repository', 'Source');
    $t_changeset_table = plugin_table('changeset', 'Source');
    $t_file_table = plugin_table('file', 'Source');
    $t_query = "SELECT c.* FROM {$t_changeset_table} AS c\n\t\t\t\tJOIN {$t_repo_table} AS r ON r.id=c.repo_id\n\t\t\t\tWHERE c.revision LIKE " . db_param() . '
				AND r.name LIKE ' . db_param();
    $t_result = db_query_bound($t_query, array($t_revision . '%', $t_repo_name . '%'), 1);
    if (db_num_rows($t_result) > 0) {
        $t_row = db_fetch_array($t_result);
        $t_changeset = new SourceChangeset($t_row['repo_id'], $t_row['revision'], $t_row['branch'], $t_row['timestamp'], $t_row['author'], $t_row['message'], $t_row['user_id']);
        $t_changeset->id = $t_row['id'];
        $t_repo = SourceRepo::load($t_changeset->repo_id);
        $t_vcs = SourceVCS::repo($t_repo);
        if ($t_url_type == "v") {
            $t_url = $t_vcs->url_changeset($t_repo, $t_changeset);
        } else {
            $t_url = plugin_page('view') . '&id=' . $t_changeset->id;
        }
        $t_name = string_display_line($t_repo->name . ' ' . $t_vcs->show_changeset($t_repo, $t_changeset));
        if (!is_blank($t_url)) {
            return '<a href="' . $t_url . '">' . $t_name . '</a>';
        }
        return $t_name;
    }
    return $p_matches[0];
}
コード例 #20
0
 name="name" value="<?php 
echo $t_name;
?>
"/></td>
	<td><?php 
if (access_has_global_level(config_get('tag_edit_threshold'))) {
    if (ON == config_get('use_javascript')) {
        $t_username = prepare_user_name($t_tag_row['user_id']);
        echo ajax_click_to_edit($t_username, 'user_id', 'entrypoint=user_combobox&user_id=' . $t_tag_row['user_id'] . '&access_level=' . config_get('tag_create_threshold'));
    } else {
        echo '<select ', helper_get_tab_index(), ' name="user_id">';
        print_user_option_list($t_tag_row['user_id'], ALL_PROJECTS, config_get('tag_create_threshold'));
        echo '</select>';
    }
} else {
    echo string_display_line(user_get_name($t_tag_row['user_id']));
}
?>
</td>
	<td><?php 
echo date(config_get('normal_date_format'), $t_tag_row['date_created']);
?>
 </td>
	<td><?php 
echo date(config_get('normal_date_format'), $t_tag_row['date_updated']);
?>
 </td>
</tr>

<!-- spacer -->
<tr class="spacer">
コード例 #21
0
function show_revision($t_revision)
{
    static $s_can_drop = null;
    static $s_drop_token = null;
    static $s_user_access = null;
    if (is_null($s_can_drop)) {
        $s_can_drop = access_has_bug_level(config_get('bug_revision_drop_threshold'), $t_revision['bug_id']);
        $s_drop_token = form_security_param('bug_revision_drop');
    }
    switch ($t_revision['type']) {
        case REV_DESCRIPTION:
            $t_label = lang_get('description');
            break;
        case REV_STEPS_TO_REPRODUCE:
            $t_label = lang_get('steps_to_reproduce');
            break;
        case REV_ADDITIONAL_INFO:
            $t_label = lang_get('additional_information');
            break;
        case REV_BUGNOTE:
            if (is_null($s_user_access)) {
                $s_user_access = access_has_bug_level(config_get('private_bugnote_threshold'), $t_revision['bug_id']);
            }
            if (!$s_user_access) {
                return null;
            }
            $t_label = lang_get('bugnote');
            break;
        default:
            $t_label = '';
    }
    $t_by_string = sprintf(lang_get('revision_by'), string_display_line(date(config_get('normal_date_format'), $t_revision['timestamp'])), string_display_line(user_get_name($t_revision['user_id'])));
    ?>
<tr class="spacer"><td><a id="revision-<?php 
    echo $t_revision['id'];
    ?>
"></a></td></tr>

<tr <?php 
    echo helper_alternate_class();
    ?>
>
<th class="category"><?php 
    echo lang_get('revision');
    ?>
</th>
<td colspan="2"><?php 
    echo $t_by_string;
    ?>
</td>
<td class="center" width="5%">
<?php 
    if ($s_can_drop) {
        print_bracket_link('bug_revision_drop.php?id=' . $t_revision['id'] . $s_drop_token, lang_get('revision_drop'));
    }
    ?>
</tr>

<tr <?php 
    echo helper_alternate_class();
    ?>
>
<th class="category"><?php 
    echo $t_label;
    ?>
</th>
<td colspan="3"><?php 
    echo string_display_links($t_revision['value']);
    ?>
</td>
</tr>

	<?php 
}
コード例 #22
0
/** @ignore */
define('PLUGINS_DISABLED', true);
/**
 * MantisBT Core API's
 */
require_once 'core.php';
require_api('access_api.php');
require_api('authentication_api.php');
require_api('config_api.php');
require_api('form_api.php');
require_api('gpc_api.php');
require_api('helper_api.php');
require_api('lang_api.php');
require_api('plugin_api.php');
require_api('print_api.php');
require_api('string_api.php');
form_security_validate('manage_plugin_uninstall');
auth_reauthenticate();
access_ensure_global_level(config_get('manage_plugin_threshold'));
# register plugins and metadata without initializing
plugin_register_installed();
$f_basename = gpc_get_string('name');
$t_plugin = plugin_register($f_basename, true);
helper_ensure_confirmed(sprintf(lang_get('plugin_uninstall_message'), string_display_line($t_plugin->name)), lang_get('plugin_uninstall'));
if (!is_null($t_plugin)) {
    plugin_uninstall($t_plugin);
} else {
    plugin_force_uninstall($f_basename);
}
form_security_purge('manage_plugin_uninstall');
print_successful_redirect('manage_plugin_page.php');
コード例 #23
0
/**
 * return formatted string with all the details on the requested relationship
 * @param integer             $p_bug_id       A bug identifier.
 * @param BugRelationshipData $p_relationship A bug relationship object.
 * @param boolean             $p_html         Whether to return html or text output.
 * @param boolean             $p_html_preview Whether to include style/hyperlinks - if preview is false, we prettify the output.
 * @param boolean             $p_show_project Show Project details.
 * @return string
 */
function relationship_get_details($p_bug_id, BugRelationshipData $p_relationship, $p_html = false, $p_html_preview = false, $p_show_project = false)
{
    $t_summary_wrap_at = utf8_strlen(config_get('email_separator2')) - 28;
    $t_icon_path = config_get('icon_path');
    if ($p_bug_id == $p_relationship->src_bug_id) {
        # root bug is in the source side, related bug in the destination side
        $t_related_bug_id = $p_relationship->dest_bug_id;
        $t_related_project_name = project_get_name($p_relationship->dest_project_id);
        $t_relationship_descr = relationship_get_description_src_side($p_relationship->type);
    } else {
        # root bug is in the dest side, related bug in the source side
        $t_related_bug_id = $p_relationship->src_bug_id;
        $t_related_project_name = project_get_name($p_relationship->src_project_id);
        $t_relationship_descr = relationship_get_description_dest_side($p_relationship->type);
    }
    # related bug not existing...
    if (!bug_exists($t_related_bug_id)) {
        return '';
    }
    # user can access to the related bug at least as a viewer
    if (!access_has_bug_level(VIEWER, $t_related_bug_id)) {
        return '';
    }
    if ($p_html_preview == false) {
        $t_td = '<td>';
    } else {
        $t_td = '<td class="print">';
    }
    # get the information from the related bug and prepare the link
    $t_bug = bug_get($t_related_bug_id, false);
    $t_status_string = get_enum_element('status', $t_bug->status, auth_get_current_user_id(), $t_bug->project_id);
    $t_resolution_string = get_enum_element('resolution', $t_bug->resolution, auth_get_current_user_id(), $t_bug->project_id);
    $t_relationship_info_html = $t_td . string_no_break($t_relationship_descr) . '&#160;</td>';
    if ($p_html_preview == false) {
        $t_relationship_info_html .= '<td><a href="' . string_get_bug_view_url($t_related_bug_id) . '">' . string_display_line(bug_format_id($t_related_bug_id)) . '</a></td>';
        $t_relationship_info_html .= '<td><span class="issue-status" title="' . string_attribute($t_resolution_string) . '">' . string_display_line($t_status_string) . '</span></td>';
    } else {
        $t_relationship_info_html .= $t_td . string_display_line(bug_format_id($t_related_bug_id)) . '</td>';
        $t_relationship_info_html .= $t_td . string_display_line($t_status_string) . '&#160;</td>';
    }
    $t_relationship_info_text = utf8_str_pad($t_relationship_descr, 20);
    $t_relationship_info_text .= utf8_str_pad(bug_format_id($t_related_bug_id), 8);
    # get the handler name of the related bug
    $t_relationship_info_html .= $t_td;
    if ($t_bug->handler_id > 0) {
        $t_relationship_info_html .= string_no_break(prepare_user_name($t_bug->handler_id));
    }
    $t_relationship_info_html .= '&#160;</td>';
    # add project name
    if ($p_show_project) {
        $t_relationship_info_html .= $t_td . string_display_line($t_related_project_name) . '&#160;</td>';
    }
    # add summary
    if ($p_html == true) {
        $t_relationship_info_html .= $t_td . string_display_line_links($t_bug->summary);
        if (VS_PRIVATE == $t_bug->view_state) {
            $t_relationship_info_html .= sprintf(' <img src="%s" alt="(%s)" title="%s" />', $t_icon_path . 'protected.gif', lang_get('private'), lang_get('private'));
        }
    } else {
        if (utf8_strlen($t_bug->summary) <= $t_summary_wrap_at) {
            $t_relationship_info_text .= string_email_links($t_bug->summary);
        } else {
            $t_relationship_info_text .= utf8_substr(string_email_links($t_bug->summary), 0, $t_summary_wrap_at - 3) . '...';
        }
    }
    # add delete link if bug not read only and user has access level
    if (!bug_is_readonly($p_bug_id) && !current_user_is_anonymous() && $p_html_preview == false) {
        if (access_has_bug_level(config_get('update_bug_threshold'), $p_bug_id)) {
            $t_relationship_info_html .= ' [<a class="small" href="bug_relationship_delete.php?bug_id=' . $p_bug_id . '&amp;rel_id=' . $p_relationship->id . htmlspecialchars(form_security_param('bug_relationship_delete')) . '">' . lang_get('delete_link') . '</a>]';
        }
    }
    $t_relationship_info_html .= '&#160;</td>';
    $t_relationship_info_text .= "\n";
    if ($p_html_preview == false) {
        # choose color based on status
        $t_status_label = html_get_status_css_class($t_bug->status, auth_get_current_user_id(), $t_bug->project_id);
        $t_relationship_info_html = '<tr class="' . $t_status_label . '">' . $t_relationship_info_html . '</tr>' . "\n";
    } else {
        $t_relationship_info_html = '<tr>' . $t_relationship_info_html . '</tr>';
    }
    if ($p_html == true) {
        return $t_relationship_info_html;
    } else {
        return $t_relationship_info_text;
    }
}
コード例 #24
0
					</td>
				</tr>
			</table>
		</td>
		<td class="nopad" width="85%">
			<table class="hide" cellspacing="1">
			<tr>
				<td class="print">
					<?php 
        switch ($t_row['note_type']) {
            case REMINDER:
                echo '<div class="italic">' . lang_get('reminder_sent_to') . ': ';
                $t_note_attr = utf8_substr($t_row['note_attr'], 1, utf8_strlen($t_row['note_attr']) - 2);
                $t_to = array();
                foreach (explode('|', $t_note_attr) as $t_recipient) {
                    $t_to[] = string_display_line(user_get_name($t_recipient));
                }
                echo implode(', ', $t_to) . '</div><br />';
            default:
                echo $t_note;
        }
        ?>
				</td>
			</tr>
			</table>
		</td>
	</tr>
	<?php 
    }
    # end for loop
}
コード例 #25
0
ファイル: print_api.php プロジェクト: Tarendai/spring-website
function print_bug_attachments_list($p_bug_id)
{
    $t_attachments = file_get_visible_attachments($p_bug_id);
    $t_attachments_count = count($t_attachments);
    $i = 0;
    $image_previewed = false;
    foreach ($t_attachments as $t_attachment) {
        $t_file_display_name = string_display_line($t_attachment['display_name']);
        $t_filesize = number_format($t_attachment['size']);
        $t_date_added = date(config_get('normal_date_format'), $t_attachment['date_added']);
        if ($image_previewed) {
            $image_previewed = false;
            echo '<br />';
        }
        if ($t_attachment['can_download']) {
            $t_href_start = '<a href="' . string_attribute($t_attachment['download_url']) . '">';
            $t_href_end = '</a>';
            $t_href_clicket = " [<a href=\"file_download.php?file_id={$t_attachment['id']}&amp;type=bug\" target=\"_blank\">^</a>]";
        } else {
            $t_href_start = '';
            $t_href_end = '';
            $t_href_clicket = '';
        }
        if (!$t_attachment['exists']) {
            print_file_icon($t_file_display_name);
            echo '&#160;<span class="strike">' . $t_file_display_name . '</span>' . lang_get('word_separator') . '(' . lang_get('attachment_missing') . ')';
        } else {
            echo $t_href_start;
            print_file_icon($t_file_display_name);
            echo $t_href_end . '&#160;' . $t_href_start . $t_file_display_name . $t_href_end . $t_href_clicket . ' (' . $t_filesize . ' ' . lang_get('bytes') . ') ' . '<span class="italic">' . $t_date_added . '</span>';
        }
        if ($t_attachment['can_delete']) {
            echo '&#160;[';
            print_link('bug_file_delete.php?file_id=' . $t_attachment['id'] . form_security_param('bug_file_delete'), lang_get('delete_link'), false, 'small');
            echo ']';
        }
        if ($t_attachment['exists']) {
            if (FTP == config_get('file_upload_method') && $t_attachment['exists']) {
                echo ' (' . lang_get('cached') . ')';
            }
            if ($t_attachment['preview'] && $t_attachment['type'] == 'text') {
                $c_id = db_prepare_int($t_attachment['id']);
                $t_bug_file_table = db_get_table('mantis_bug_file_table');
                echo "<script type=\"text/javascript\" language=\"JavaScript\">\n<!--\nfunction swap_content( span ) {\ndisplayType = ( document.getElementById( span ).style.display == 'none' ) ? '' : 'none';\ndocument.getElementById( span ).style.display = displayType;\n}\n\n -->\n </script>";
                echo " <span id=\"hideSection_{$c_id}\">[<a class=\"small\" href='#' id='attmlink_" . $c_id . "' onclick='swap_content(\"hideSection_" . $c_id . "\");swap_content(\"showSection_" . $c_id . "\");return false;'>" . lang_get('show_content') . "</a>]</span>";
                echo " <span style='display:none' id=\"showSection_{$c_id}\">[<a class=\"small\" href='#' id='attmlink_" . $c_id . "' onclick='swap_content(\"hideSection_" . $c_id . "\");swap_content(\"showSection_" . $c_id . "\");return false;'>" . lang_get('hide_content') . "</a>]";
                echo "<pre>";
                /** @todo Refactor into a method that gets contents for download / preview. */
                switch (config_get('file_upload_method')) {
                    case DISK:
                        if ($t_attachment['exists']) {
                            $v_content = file_get_contents($t_attachment['diskfile']);
                        }
                        break;
                    case FTP:
                        if (file_exists($t_attachment['exists'])) {
                            file_get_contents($t_attachment['diskfile']);
                        } else {
                            $ftp = file_ftp_connect();
                            file_ftp_get($ftp, $t_attachment['diskfile'], $t_attachment['diskfile']);
                            file_ftp_disconnect($ftp);
                            $v_content = file_get_contents($t_attachment['diskfile']);
                        }
                        break;
                    default:
                        $query = "SELECT *\n\t                  \t\t\t\t\tFROM {$t_bug_file_table}\n\t\t\t\t            \t\t\tWHERE id=" . db_param();
                        $result = db_query_bound($query, array($c_id));
                        $row = db_fetch_array($result);
                        $v_content = $row['content'];
                }
                echo htmlspecialchars($v_content);
                echo "</pre></span>\n";
            }
            if ($t_attachment['can_download'] && $t_attachment['preview'] && $t_attachment['type'] == 'image') {
                $t_preview_style = 'border: 0;';
                $t_max_width = config_get('preview_max_width');
                if ($t_max_width > 0) {
                    $t_preview_style .= ' max-width:' . $t_max_width . 'px;';
                }
                $t_max_height = config_get('preview_max_height');
                if ($t_max_height > 0) {
                    $t_preview_style .= ' max-height:' . $t_max_height . 'px;';
                }
                $t_preview_style = 'style="' . $t_preview_style . '"';
                $t_title = file_get_field($t_attachment['id'], 'title');
                $t_image_url = $t_attachment['download_url'] . '&amp;show_inline=1' . form_security_param('file_show_inline');
                echo "\n<br />{$t_href_start}<img alt=\"{$t_title}\" {$t_preview_style} src=\"{$t_image_url}\" />{$t_href_end}";
                $image_previewed = true;
            }
        }
        if ($i != $t_attachments_count - 1) {
            echo "<br />\n";
            $i++;
        }
    }
}
コード例 #26
0
ファイル: custom_function_api.php プロジェクト: gtn/mantisbt
/**
 * Print the value of the custom field (if the field is applicable to the project of
 * the specified issue and the current user has read access to it.
 * see custom_function_default_print_column_title() for rules about column names.
 * @param string  $p_column         Name of field to show in the column.
 * @param BugData $p_bug            Bug object.
 * @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
 * @return void
 */
function custom_function_default_print_column_value($p_column, BugData $p_bug, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE)
{
    if (COLUMNS_TARGET_CSV_PAGE == $p_columns_target) {
        $t_column_start = '';
        $t_column_end = '';
        $t_column_empty = '';
    } else {
        $t_column_start = '<td class="column-%s">';
        $t_column_end = '</td>';
        $t_column_empty = '&#160;';
    }
    $t_custom_field = column_get_custom_field_name($p_column);
    if ($t_custom_field !== null) {
        printf($t_column_start, 'custom-' . $t_custom_field);
        $t_field_id = custom_field_get_id_from_name($t_custom_field);
        if ($t_field_id === false) {
            echo '@', $t_custom_field, '@';
        } else {
            $t_issue_id = $p_bug->id;
            $t_project_id = $p_bug->project_id;
            if (custom_field_is_linked($t_field_id, $t_project_id)) {
                $t_def = custom_field_get_definition($t_field_id);
                print_custom_field_value($t_def, $t_field_id, $t_issue_id);
            } else {
                # field is not linked to project
                echo $t_column_empty;
            }
        }
        echo $t_column_end;
    } else {
        $t_plugin_columns = columns_get_plugin_columns();
        if ($p_columns_target != COLUMNS_TARGET_CSV_PAGE) {
            $t_function = 'print_column_' . $p_column;
        } else {
            $t_function = 'csv_format_' . $p_column;
        }
        if (function_exists($t_function)) {
            if ($p_columns_target != COLUMNS_TARGET_CSV_PAGE) {
                $t_function($p_bug, $p_columns_target);
            } else {
                $t_function($p_bug);
            }
        } else {
            if (isset($t_plugin_columns[$p_column])) {
                $t_column_object = $t_plugin_columns[$p_column];
                print_column_plugin($t_column_object, $p_bug, $p_columns_target);
            } else {
                printf($t_column_start, $p_column);
                if (isset($p_bug->{$p_column})) {
                    echo string_display_line($p_bug->{$p_column}) . $t_column_end;
                } else {
                    echo '@' . $p_column . '@' . $t_column_end;
                }
            }
        }
    }
}
コード例 #27
0
ファイル: print_api.php プロジェクト: nextgens/mantisbt
/**
 * Prints a single textual line of information about an attachment including download link, file
 * size and upload timestamp.
 * @param array $p_attachment An attachment arrray from within the array returned by the file_get_visible_attachments() function
 */
function print_bug_attachment_header($p_attachment)
{
    echo "\n";
    if ($p_attachment['exists']) {
        if ($p_attachment['can_download']) {
            echo '<a href="' . string_attribute($p_attachment['download_url']) . '">';
        }
        print_file_icon($p_attachment['display_name']);
        if ($p_attachment['can_download']) {
            echo '</a>';
        }
        echo lang_get('word_separator');
        if ($p_attachment['can_download']) {
            echo '<a href="' . string_attribute($p_attachment['download_url']) . '">';
        }
        echo string_display_line($p_attachment['display_name']);
        if ($p_attachment['can_download']) {
            echo '</a>';
        }
        echo lang_get('word_separator') . '(' . number_format($p_attachment['size']) . lang_get('word_separator') . lang_get('bytes') . ')';
        echo lang_get('word_separator') . '<span class="italic">' . date(config_get('normal_date_format'), $p_attachment['date_added']) . '</span>';
    } else {
        print_file_icon($p_attachment['display_name']);
        echo lang_get('word_separator') . '<span class="strike">' . string_display_line($p_attachment['display_name']) . '</span>' . lang_get('word_separator') . '(' . lang_get('attachment_missing') . ')';
    }
    if ($p_attachment['can_delete']) {
        echo lang_get('word_separator') . '[';
        print_link('bug_file_delete.php?file_id=' . $p_attachment['id'] . form_security_param('bug_file_delete'), lang_get('delete_link'), false, 'small');
        echo ']';
    }
    if ($p_attachment['exists']) {
        if (config_get('file_upload_method') == FTP) {
            echo lang_get('word_separator') . '(' . lang_get('cached') . ')';
        }
    }
}
コード例 #28
0
<?php 
    # Loop on all time tracking entries
    $t_sum_in_minutes = 0;
    foreach ($t_bugnote_stats as $t_item) {
        $t_sum_in_minutes += $t_item['sum_time_tracking'];
        $t_item['sum_time_tracking'] = db_minutes_to_hhmm($t_item['sum_time_tracking']);
        ?>

	<tr <?php 
        echo helper_alternate_class();
        ?>
>
		<td class="small-caption">
			<?php 
        echo string_display_line($t_item[$t_name_field]);
        ?>
		</td>
		<td class="small-caption">
			<?php 
        echo $t_item['sum_time_tracking'];
        ?>
		</td>
	</tr>
<?php 
    }
    # end for loop
    ?>
	<tr class="row-category2">
		<td class="small-caption bold">
			<?php 
コード例 #29
0
ファイル: columns_api.php プロジェクト: N0ctrnl/mantisbt
/**
 * Print column content for column overdue
 *
 * @param BugData $p_bug bug object
 * @param int $p_columns_target see COLUMNS_TARGET_* in constant_inc.php
 * @return null
 * @access public
 */
function print_column_overdue($p_bug, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE)
{
    global $t_icon_path;
    echo '<td class="column-overdue">';
    if (access_has_bug_level(config_get('due_date_view_threshold'), $p_bug->id) && !date_is_null($p_bug->due_date) && bug_is_overdue($p_bug->id)) {
        $t_overdue_text = lang_get('overdue');
        $t_overdue_text_hover = $t_overdue_text . '. Due date was: ' . string_display_line(date(config_get('short_date_format'), $p_bug->due_date));
        echo '<img src="' . $t_icon_path . 'overdue.png" alt="' . $t_overdue_text . '" title="' . $t_overdue_text_hover . '" />';
    } else {
        echo '&#160;';
    }
    echo '</td>';
}
コード例 #30
0
ファイル: bug_update_page.php プロジェクト: N0ctrnl/mantisbt
$t_show_steps_to_reproduce = in_array('steps_to_reproduce', $t_fields);
$t_steps_to_reproduce_textarea = $t_show_steps_to_reproduce ? string_textarea($t_bug->steps_to_reproduce) : '';
if (NO_USER == $t_bug->handler_id) {
    $t_handler_name = '';
} else {
    $t_handler_name = string_display_line(user_get_name($t_bug->handler_id));
}
$t_can_change_view_state = $t_show_view_state && access_has_project_level(config_get('change_view_status_threshold'));
if ($t_show_product_version) {
    $t_product_version_released_mask = VERSION_RELEASED;
    if (access_has_project_level(config_get('report_issues_for_unreleased_versions_threshold'))) {
        $t_product_version_released_mask = VERSION_ALL;
    }
}
$t_formatted_bug_id = $t_show_id ? bug_format_id($f_bug_id) : '';
$t_project_name = $t_show_project ? string_display_line(project_get_name($t_bug->project_id)) : '';
if ($t_show_due_date) {
    require_js('jscalendar/calendar.js');
    require_js('jscalendar/lang/calendar-en.js');
    require_js('jscalendar/calendar-setup.js');
    require_css('calendar-blue.css');
}
html_page_top(bug_format_summary($f_bug_id, SUMMARY_CAPTION));
print_recently_visited();
?>
<br />
<div id="bug-update" class="form-container">

	<form name="update_bug_form" method="post" action="bug_update.php">
		<?php 
echo form_security_field('bug_update');