Example #1
0
/**
 * List projects that the current user has access to
 * @param integer $p_parent_id         A parent project identifier.
 * @param integer $p_project_id        A project identifier.
 * @param integer $p_filter_project_id A filter project identifier.
 * @param boolean $p_trace             Whether to trace parent projects.
 * @param boolean $p_can_report_only   If true, disables projects in which user can't report issues; defaults to false (all projects enabled).
 * @param array   $p_parents           Array of parent projects.
 * @return void
 */
function print_subproject_option_list($p_parent_id, $p_project_id = null, $p_filter_project_id = null, $p_trace = false, $p_can_report_only = false, array $p_parents = array())
{
    if (config_get('subprojects_enabled') == OFF) {
        return;
    }
    array_push($p_parents, $p_parent_id);
    $t_user_id = auth_get_current_user_id();
    $t_project_ids = user_get_accessible_subprojects($t_user_id, $p_parent_id);
    $t_can_report = true;
    foreach ($t_project_ids as $t_id) {
        if ($p_can_report_only) {
            $t_report_bug_threshold = config_get('report_bug_threshold', null, $t_user_id, $t_id);
            $t_can_report = access_has_project_level($t_report_bug_threshold, $t_id, $t_user_id);
        }
        if ($p_trace) {
            $t_full_id = join($p_parents, ';') . ';' . $t_id;
        } else {
            $t_full_id = $t_id;
        }
        echo '<option value="' . $t_full_id . '"';
        check_selected($p_project_id, $t_full_id, false);
        check_disabled($t_id == $p_filter_project_id || !$t_can_report);
        echo '>' . str_repeat('&#160;', count($p_parents)) . str_repeat('&raquo;', count($p_parents)) . ' ' . string_attribute(project_get_field($t_id, 'name')) . '</option>' . "\n";
        print_subproject_option_list($t_id, $p_project_id, $p_filter_project_id, $p_trace, $p_can_report_only, $p_parents);
    }
}
Example #2
0
            }
        }
        if (0 < count($t_depends)) {
            $t_depends = implode($t_depends, '<br/>');
        } else {
            $t_depends = '<span class="small dependency_met">' . lang_get('plugin_no_depends') . '</span>';
        }
        echo '<tr>';
        echo '<td class="small center">', $t_name, '<input type="hidden" name="change_', $t_basename, '" value="1"/></td>';
        echo '<td class="small">', $t_description, $t_author, $t_url, '</td>';
        echo '<td class="small center">', $t_depends, '</td>';
        if ('MantisCore' == $t_basename) {
            echo '<td>&#160;</td><td>&#160;</td>';
        } else {
            echo '<td class="center">', '<select name="priority_' . $t_basename . '"', check_disabled($t_protected), '>', print_plugin_priority_list($t_priority), '</select>', '</td>';
            echo '<td class="center">', '<input type="checkbox" name="protected_' . $t_basename . '"', check_disabled($t_protected), check_checked($t_protected), ' />', '</select>', '</td>';
        }
        echo '<td class="center">';
        if ($t_upgrade) {
            print_bracket_link('manage_plugin_upgrade.php?name=' . $t_basename . form_security_param('manage_plugin_upgrade'), lang_get('plugin_upgrade'));
        }
        if (!$t_protected) {
            print_bracket_link('manage_plugin_uninstall.php?name=' . $t_basename . form_security_param('manage_plugin_uninstall'), lang_get('plugin_uninstall'));
        }
        echo '</td></tr>';
    }
    ?>
			</tbody>

			<tfoot>
				<tr>