/**
 * Initialise bug action group api
 * @param string $p_action Custom action to run.
 * @return void
 */
function bug_group_action_init($p_action)
{
    $t_valid_actions = bug_group_action_get_commands(current_user_get_accessible_projects());
    $t_action = strtoupper($p_action);
    if (!isset($t_valid_actions[$t_action]) && !isset($t_valid_actions['EXT_' . $t_action])) {
        trigger_error(ERROR_GENERIC, ERROR);
    }
    $t_include_file = config_get_global('absolute_path') . 'bug_actiongroup_' . $p_action . '_inc.php';
    if (!file_exists($t_include_file)) {
        trigger_error(ERROR_GENERIC, ERROR);
    } else {
        require_once $t_include_file;
    }
}
예제 #2
0
/**
 * Print a dropdown list of all bug actions available to a user for a specified
 * set of projects.
 * @param array $p_projects An array containing one or more project IDs
 * @return null
 */
function print_all_bug_action_option_list($p_project_ids = null)
{
    $t_commands = bug_group_action_get_commands($p_project_ids);
    while (list($t_action_id, $t_action_label) = each($t_commands)) {
        echo '<option value="' . $t_action_id . '">' . $t_action_label . '</option>';
    }
}