当前位置: 首页>>代码示例>>PHP>>正文


PHP access_get_project_level函数代码示例

本文整理汇总了PHP中access_get_project_level函数的典型用法代码示例。如果您正苦于以下问题:PHP access_get_project_level函数的具体用法?PHP access_get_project_level怎么用?PHP access_get_project_level使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了access_get_project_level函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: group_access_has_bug_level

 /**
  * Checks whether the users access level or the access level from
  * a group a user is in is higher. Return the user id with higher
  * access level.
  * @param object $p_event
  * @param array $p_chained_param array(array(user_project_level, user_id, project_id))
  * @return int user id
  */
 function group_access_has_bug_level($p_event, $p_chained_param)
 {
     $t_user_project_level = $p_chained_param[0];
     $t_user_id = $p_chained_param[1];
     $t_project_id = $p_chained_param[2];
     $t_group_user_id = 0;
     $t_group_access_level = 0;
     $t_users = plugin_table('users');
     $query = "SELECT group_user_id FROM {$t_users} WHERE user=" . db_param();
     $result = db_query_bound($query, array((int) $t_user_id));
     $count = db_num_rows($result);
     for ($i = 0; $i < $count; $i++) {
         $row = db_fetch_array($result);
         $t_level = access_get_project_level($t_project_id, $row['group_user_id']);
         if ($t_level >= $t_group_access_level) {
             $t_group_access_level = $t_level;
             $t_group_user_id = $row['group_user_id'];
         }
     }
     if ($t_user_project_level < $t_group_access_level) {
         return $t_group_user_id;
     } else {
         return $t_user_id;
     }
 }
开发者ID:svgaman,项目名称:ManageUsergroups,代码行数:33,代码来源:ManageUsergroups.php

示例2: print_status_option_list_plugin

function print_status_option_list_plugin($p_select_label, $p_current_value = 0, $p_allow_close = false, $p_project_id = ALL_PROJECTS)
{
    $t_current_auth = access_get_project_level($p_project_id);
    #Changement de la fonction de récupération des statuts
    $t_enum_list = get_status_option_list_plugin($t_current_auth, $p_current_value, true, $p_allow_close, $p_project_id);
    if (count($t_enum_list) > 1) {
        # resort the list into ascending order
        ksort($t_enum_list);
        reset($t_enum_list);
        echo '<select ', helper_get_tab_index(), ' name="' . $p_select_label . '">';
        foreach ($t_enum_list as $key => $val) {
            #On ne veut pas afficher la valeur @0@
            if ($val == '@0@') {
                continue;
            }
            echo '<option value="' . $key . '"';
            check_selected($key, $p_current_value, false);
            #fix 1.3.0
            echo '>' . $val . '</option>';
        }
        echo '</select>';
    } else {
        if (count($t_enum_list) == 1) {
            echo array_pop($t_enum_list);
        } else {
            echo MantisEnum::getLabel(lang_get('status_enum_string'), $p_current_value);
        }
    }
}
开发者ID:nenes25,项目名称:mantisbt_autochangestatus,代码行数:29,代码来源:functions.php

示例3: kanban_ajax_button_bug_change_status

/**
 * Print Change Status to: AJAXified button
 * This code is similar to button_bug_change_status except that the 
 * button is AJAXified.
 * Uses projax.php
 *
 * @param int $p_bug_id
 * @param int $t_project_id
 * @param int $t_user_id
 * @return null
 */
function kanban_ajax_button_bug_change_status($p_bug_id, $t_project_id, $t_user_id)
{
    global $g_projax;
    $t_bug_project_id = bug_get_field($p_bug_id, 'project_id');
    $t_bug_current_state = bug_get_field($p_bug_id, 'status');
    $t_current_access = access_get_project_level($t_bug_project_id);
    $t_enum_list = get_status_option_list($t_current_access, $t_bug_current_state, false, bug_get_field($p_bug_id, 'reporter_id') == auth_get_current_user_id() && ON == config_get('allow_reporter_close'), $t_bug_project_id);
    if (count($t_enum_list) > 0) {
        # resort the list into ascending order after noting the key from the first element (the default)
        $t_default_arr = each($t_enum_list);
        $t_default = $t_default_arr['key'];
        ksort($t_enum_list);
        reset($t_enum_list);
        echo "<div id=\"ajax_statuschange\"><form method=\"post\" id=\"ajax_status_form\" action=\"xmlhttprequest.php\">";
        # CSRF protection not required here - form does not result in modifications
        echo "<input type=\"hidden\" name=\"project_id\" id=\"project_id\" value=\"{$t_project_id}\" />";
        echo "<input type=\"hidden\" name=\"user_id\" id=\"user_id\" value=\"{$t_user_id}\" />";
        echo "<input type=\"hidden\" name=\"entrypoint\" id=\"entrypoint\" value=\"bug_update_status\" />";
        $t_button_text = lang_get('bug_status_to_button');
        // AJAX button options
        $options = array('url' => plugin_page('kanban_ajax_request'), 'with' => true, 'confirm' => lang_get('confirm_change_status'), 'success' => 'location.reload()', 'failure' => 'alert("Error: " ' + request . status + ')');
        echo $g_projax->submit_to_remote('ajax_status', $t_button_text, $options);
        echo " <select name=\"new_status\">";
        # space at beginning of line is important
        foreach ($t_enum_list as $key => $val) {
            echo "<option value=\"{$key}\" ";
            check_selected($key, $t_default);
            echo ">{$val}</option>";
        }
        echo '</select>';
        $t_bug_id = string_attribute($p_bug_id);
        echo "<input type=\"hidden\" name=\"id\" value=\"{$t_bug_id}\" />\n";
        echo "</form></div>\n";
    }
}
开发者ID:aberad,项目名称:MantisKanban,代码行数:46,代码来源:kanban_api.php

示例4: custom_function_override_print_bug_view_page_custom_buttons

function custom_function_override_print_bug_view_page_custom_buttons($p_bug_id)
{
    # Zuerst die lokalierten Buttontexte auslesen
    if (lang_get_current() === 'german') {
        $t_bfe_clone_issue_button = 'Klon in anderes Projekt...';
        $t_bfe_edit_failure_class_button = 'Fehlerklasse bearbeiten...';
    } else {
        $t_bfe_clone_issue_button = 'Clone To Other Project...';
        $t_bfe_edit_failure_class_button = 'Edit Failure Class...';
    }
    # Wenn Zugriff mindestens onsite developer, dann darf er Issues klonen
    if (access_has_project_level(50)) {
        echo '<td>';
        html_button_bug_clone_to_project($p_bug_id, $t_bfe_clone_issue_button);
        echo '</td>';
    }
    # Wenn Zugriff ändern von Fehlerklasse erlaubt, dann darf er sie ändern
    # Aber nur bis Status 'bestätigt' (40=confirmed)
    # Und nur für QS-Reporter (30) und ab Entwickler vor Ort (50) aufwärts
    if (custom_field_has_write_access(1, $p_bug_id)) {
        if (bug_get_field($p_bug_id, 'status') < 40) {
            if (access_compare_level(access_get_project_level(), array(30, 50, 55, 70, 90))) {
                echo '<td>';
                $t_bfe_bugs[] = $p_bug_id;
                $t_src = relationship_get_all_src($p_bug_id);
                $t_src_count = count($t_src);
                $t_dest = relationship_get_all_dest($p_bug_id);
                $t_dest_count = count($t_dest);
                if ($t_src_count || $t_dest_count) {
                    # Zunächst die Destination Bug IDs
                    for ($x = 0; $x < $t_src_count; $x++) {
                        $t_thisbugid = $t_src[$x]->dest_bug_id;
                        if (access_has_bug_level(50, $t_thisbugid)) {
                            $t_bfe_bugs[] = $t_thisbugid;
                        }
                    }
                    # und jetzt die Source Bug IDs
                    for ($y = 0; $y < $t_dest_count; $y++) {
                        $t_thisbugid = $t_dest[$y]->src_bug_id;
                        if (access_has_bug_level(50, $t_thisbugid)) {
                            $t_bfe_bugs[] = $t_thisbugid;
                        }
                    }
                }
                if (count($t_bfe_bugs) > 1) {
                    bfe_fehlerklasse_button('bug_actiongroup_page.php', $t_bfe_edit_failure_class_button, $t_bfe_bugs);
                } else {
                    html_button('bug_actiongroup_page.php', $t_bfe_edit_failure_class_button, array('bug_arr[]' => $p_bug_id, 'action' => 'custom_field_1'));
                }
                echo '</td>';
            }
        }
    }
}
开发者ID:bfekomsthoeft,项目名称:TTS_Praxisprojekt1,代码行数:54,代码来源:custom_functions_inc.php

示例5: html_button_bug_change_status

function html_button_bug_change_status($p_bug_id)
{
    $t_bug_project_id = bug_get_field($p_bug_id, 'project_id');
    $t_bug_current_state = bug_get_field($p_bug_id, 'status');
    $t_current_access = access_get_project_level($t_bug_project_id);
    $t_enum_list = get_status_option_list($t_current_access, $t_bug_current_state, false, bug_get_field($p_bug_id, 'reporter_id') == auth_get_current_user_id() && ON == config_get('allow_reporter_close'));
    if (count($t_enum_list) > 0) {
        # resort the list into ascending order after noting the key from the first element (the default)
        $t_default_arr = each($t_enum_list);
        $t_default = $t_default_arr['key'];
        ksort($t_enum_list);
        reset($t_enum_list);
        echo "<form method=\"post\" action=\"bug_change_status_page.php\">";
        $t_button_text = lang_get('bug_status_to_button');
        echo "<input type=\"submit\" class=\"button\" value=\"{$t_button_text}\" />";
        echo " <select name=\"new_status\">";
        # space at beginning of line is important
        foreach ($t_enum_list as $key => $val) {
            echo "<option value=\"{$key}\" ";
            check_selected($key, $t_default);
            echo ">{$val}</option>";
        }
        echo '</select>';
        $t_bug_id = string_attribute($p_bug_id);
        echo "<input type=\"hidden\" name=\"bug_id\" value=\"{$t_bug_id}\" />\n";
        echo "</form>\n";
    }
}
开发者ID:amjadtbssm,项目名称:website,代码行数:28,代码来源:html_api.php

示例6: access_ensure_project_level

            $t_project_ids[] = $t_project_id;
        }
    }
} else {
    access_ensure_project_level(config_get('view_changelog_threshold'), $t_project_id);
    $t_project_ids = user_get_all_accessible_subprojects($t_user_id, $t_project_id);
    array_unshift($t_project_ids, $t_project_id);
}
$t_project_index = 0;
version_cache_array_rows($t_project_ids);
category_cache_array_rows_by_project($t_project_ids);
foreach ($t_project_ids as $t_project_id) {
    $t_project_name = project_get_field($t_project_id, 'name');
    $t_can_view_private = access_has_project_level(config_get('private_bug_threshold'), $t_project_id);
    $t_limit_reporters = config_get('limit_reporters');
    $t_user_access_level_is_reporter = REPORTER == access_get_project_level($t_project_id);
    $t_resolved = config_get('bug_resolved_status_threshold');
    $t_bug_table = db_get_table('mantis_bug_table');
    $t_relation_table = db_get_table('mantis_bug_relationship_table');
    # grab version info for later use
    $t_version_rows = version_get_all_rows($t_project_id, null, false);
    # cache category info, but ignore the results for now
    category_get_all_rows($t_project_id);
    $t_project_header_printed = false;
    foreach ($t_version_rows as $t_version_row) {
        $t_version_header_printed = false;
        $t_version = $t_version_row['version'];
        $t_version_id = $t_version_row['id'];
        # Skip all versions except the specified one (if any).
        if ($f_version_id != -1 && $f_version_id != $t_version_id) {
            continue;
开发者ID:WebuddhaInc,项目名称:mantisbt-plugin-wbquickreport,代码行数:31,代码来源:changelog_page.php

示例7: html_button_bug_change_status

/**
 * Print Change Status to: button
 * This code is similar to print_status_option_list except
 * there is no masking, except for the current state
 *
 * @param BugData $p_bug Bug object
 * @return null
 */
function html_button_bug_change_status($p_bug)
{
    $t_current_access = access_get_project_level($p_bug->project_id);
    # User must have rights to change status to use this button
    if (!access_has_bug_level(config_get('update_bug_status_threshold'), $p_bug->id)) {
        return;
    }
    $t_enum_list = get_status_option_list($t_current_access, $p_bug->status, false, bug_is_user_reporter($p_bug->id, auth_get_current_user_id()) && access_has_bug_level(config_get('report_bug_threshold'), $p_bug->id) && ON == config_get('allow_reporter_close'), $p_bug->project_id);
    if (count($t_enum_list) > 0) {
        # resort the list into ascending order after noting the key from the first element (the default)
        $t_default_arr = each($t_enum_list);
        $t_default = $t_default_arr['key'];
        ksort($t_enum_list);
        reset($t_enum_list);
        echo "<form method=\"post\" action=\"bug_change_status_page.php\">";
        # CSRF protection not required here - form does not result in modifications
        $t_button_text = lang_get('bug_status_to_button');
        echo "<input type=\"submit\" class=\"button\" value=\"{$t_button_text}\" />";
        echo " <select name=\"new_status\">";
        # space at beginning of line is important
        foreach ($t_enum_list as $key => $val) {
            echo "<option value=\"{$key}\" ";
            check_selected($key, $t_default);
            echo ">{$val}</option>";
        }
        echo '</select>';
        $t_bug_id = string_attribute($p_bug->id);
        echo "<input type=\"hidden\" name=\"id\" value=\"{$t_bug_id}\" />\n";
        echo "</form>\n";
    }
}
开发者ID:Tarendai,项目名称:spring-website,代码行数:39,代码来源:html_api.php

示例8: bug_get_bugnote_stats_array

/**
 * For a list of bug ids, returns an array of bugnote stats.
 * If a bug has no visible bugnotes, returns "false" as the stats item for that bug id.
 * @param array $p_bugs_id         Array of Integer representing bug identifiers.
 * @param integer|null $p_user_id  User for checking access levels. null defaults to current user
 * @return array                   Array of bugnote stats
 * @access public
 * @uses database_api.php
 */
function bug_get_bugnote_stats_array(array $p_bugs_id, $p_user_id = null)
{
    $t_id_array = array();
    foreach ($p_bugs_id as $t_id) {
        $t_id_array[$t_id] = (int) $t_id;
    }
    if (empty($t_id_array)) {
        return array();
    }
    if (null === $p_user_id) {
        $t_user_id = auth_get_current_user_id();
    } else {
        $t_user_id = $p_user_id;
    }
    db_param_push();
    $t_params = array();
    $t_in_clause_elems = array();
    foreach ($t_id_array as $t_id) {
        $t_in_clause_elems[] = db_param();
        $t_params[] = $t_id;
    }
    $t_query = 'SELECT n.id, n.bug_id, n.reporter_id, n.view_state, n.last_modified, n.date_submitted, b.project_id' . ' FROM {bugnote} n JOIN {bug} b ON (n.bug_id = b.id)' . ' WHERE n.bug_id IN (' . implode(', ', $t_in_clause_elems) . ')' . ' ORDER BY b.project_id, n.bug_id, n.last_modified';
    # perform query
    $t_result = db_query($t_query, $t_params);
    $t_counter = 0;
    $t_stats = array();
    # We need to check for each bugnote if it has permissions to view in respective project.
    # bugnotes are grouped by project_id and bug_id to save calls to config_get
    $t_current_project_id = null;
    $t_current_bug_id = null;
    while ($t_query_row = db_fetch_array($t_result)) {
        $c_bug_id = (int) $t_query_row['bug_id'];
        if (0 == $t_counter || $t_current_project_id !== $t_query_row['project_id']) {
            # evaluating a new project from the rowset
            $t_current_project_id = $t_query_row['project_id'];
            $t_user_access_level = access_get_project_level($t_query_row['project_id'], $t_user_id);
            $t_private_bugnote_visible = access_compare_level($t_user_access_level, config_get('private_bugnote_threshold', null, $t_user_id, $t_query_row['project_id']));
        }
        if (0 == $t_counter || $t_current_bug_id !== $c_bug_id) {
            # evaluating a new bug from the rowset
            $t_current_bug_id = $c_bug_id;
            $t_note_count = 0;
            $t_last_submit_date = 0;
        }
        $t_note_visible = $t_private_bugnote_visible || $t_query_row['reporter_id'] == $t_user_id || VS_PUBLIC == $t_query_row['view_state'];
        if ($t_note_visible) {
            # only count the bugnote if user has access
            $t_stats[$c_bug_id]['bug_id'] = $c_bug_id;
            $t_stats[$c_bug_id]['last_modified'] = $t_query_row['last_modified'];
            $t_stats[$c_bug_id]['count'] = ++$t_note_count;
            $t_stats[$c_bug_id]['last_modified_bugnote'] = $t_query_row['id'];
            if ($t_query_row['date_submitted'] > $t_last_submit_date) {
                $t_last_submit_date = $t_query_row['date_submitted'];
                $t_stats[$c_bug_id]['last_submitted_bugnote'] = $t_query_row['id'];
            }
            if (isset($t_id_array[$c_bug_id])) {
                unset($t_id_array[$c_bug_id]);
            }
        }
        $t_counter++;
    }
    # The remaining bug ids, are those without visible notes. Save false as cached value
    foreach ($t_id_array as $t_id) {
        $t_stats[$t_id] = false;
    }
    return $t_stats;
}
开发者ID:spring,项目名称:spring-website,代码行数:76,代码来源:bug_api.php

示例9: access_has_bug_level

/**
 * Check the current user's access against the given value and return true
 * if the user's access is equal to or higher, false otherwise.
 * This function looks up the bug's project and performs an access check
 * against that project
 * @param int $p_access_level integer representing access level
 * @param int $p_bug_id integer representing bug id to check access against
 * @param int|null $p_user_id integer representing user id, defaults to null to use current user
 * @return bool whether user has access level specified
 * @access public
 */
function access_has_bug_level($p_access_level, $p_bug_id, $p_user_id = null)
{
    if ($p_user_id === null) {
        $p_user_id = auth_get_current_user_id();
    }
    # Deal with not logged in silently in this case
    # @@@ we may be able to remove this and just error
    #     and once we default to anon login, we can remove it for sure
    if (empty($p_user_id) && !auth_is_user_authenticated()) {
        return false;
    }
    $t_project_id = bug_get_field($p_bug_id, 'project_id');
    $t_bug_is_user_reporter = bug_is_user_reporter($p_bug_id, $p_user_id);
    $t_access_level = access_get_project_level($t_project_id, $p_user_id);
    # check limit_Reporter (Issue #4769)
    # reporters can view just issues they reported
    $t_limit_reporters = config_get('limit_reporters', null, $p_user_id, $t_project_id);
    if ($t_limit_reporters && !$t_bug_is_user_reporter) {
        # Here we only need to check that the current user has an access level
        # higher than the lowest needed to report issues (report_bug_threshold).
        # To improve performance, esp. when processing for several projects, we
        # build a static array holding that threshold for each project
        static $s_thresholds = array();
        if (!isset($s_thresholds[$t_project_id])) {
            $t_report_bug_threshold = config_get('report_bug_threshold', null, $p_user_id, $t_project_id);
            if (!is_array($t_report_bug_threshold)) {
                $s_thresholds[$t_project_id] = $t_report_bug_threshold + 1;
            } else {
                if (empty($t_report_bug_threshold)) {
                    $s_thresholds[$t_project_id] = NOBODY;
                } else {
                    sort($t_report_bug_threshold);
                    $s_thresholds[$t_project_id] = $t_report_bug_threshold[0] + 1;
                }
            }
        }
        if (!access_compare_level($t_access_level, $s_thresholds[$t_project_id])) {
            return false;
        }
    }
    # If the bug is private and the user is not the reporter, then
    # they must also have higher access than private_bug_threshold
    if (!$t_bug_is_user_reporter && bug_get_field($p_bug_id, 'view_state') == VS_PRIVATE) {
        $t_private_bug_threshold = config_get('private_bug_threshold', null, $p_user_id, $t_project_id);
        return access_compare_level($t_access_level, $t_private_bug_threshold) && access_compare_level($t_access_level, $p_access_level);
    }
    return access_compare_level($t_access_level, $p_access_level);
}
开发者ID:N0ctrnl,项目名称:mantisbt,代码行数:59,代码来源:access_api.php

示例10: require_api

require_api('html_api.php');
require_api('lang_api.php');
require_api('print_api.php');
require_api('project_api.php');
require_api('user_api.php');
form_security_validate('manage_proj_user_remove');
auth_reauthenticate();
$f_project_id = gpc_get_int('project_id');
$f_user_id = gpc_get_int('user_id', 0);
# We should check both since we are in the project section and an
#  admin might raise the first threshold and not realize they need
#  to raise the second
access_ensure_project_level(config_get('manage_project_threshold'), $f_project_id);
access_ensure_project_level(config_get('project_user_threshold'), $f_project_id);
if (0 == $f_user_id) {
    # Confirm with the user
    helper_ensure_confirmed(lang_get('remove_all_users_sure_msg'), lang_get('remove_all_users_button'));
    project_remove_all_users($f_project_id, access_get_project_level($f_project_id));
} else {
    # Don't allow removal of users from the project who have a higher access level than the current user
    access_ensure_project_level(access_get_project_level($f_project_id, $f_user_id), $f_project_id);
    $t_user = user_get_row($f_user_id);
    # Confirm with the user
    helper_ensure_confirmed(lang_get('remove_user_sure_msg') . '<br/>' . lang_get('username_label') . lang_get('word_separator') . $t_user['username'], lang_get('remove_user_button'));
    project_remove_user($f_project_id, $f_user_id);
}
form_security_purge('manage_proj_user_remove');
$t_redirect_url = 'manage_proj_edit_page.php?project_id=' . $f_project_id;
html_page_top(null, $t_redirect_url);
html_operation_successful($t_redirect_url);
html_page_bottom();
开发者ID:nextgens,项目名称:mantisbt,代码行数:31,代码来源:manage_proj_user_remove.php

示例11: auth_reauthenticate

auth_reauthenticate();

$f_project_id		= gpc_get_int( 'project_id' );
$f_other_project_id	= gpc_get_int( 'other_project_id' );
$f_copy_from		= gpc_get_bool( 'copy_from' );
$f_copy_to			= gpc_get_bool( 'copy_to' );

if ( $f_copy_from ) {
	$t_src_project_id = $f_other_project_id;
	$t_dst_project_id = $f_project_id;
} else if ( $f_copy_to ) {
	$t_src_project_id = $f_project_id;
	$t_dst_project_id = $f_other_project_id;
} else {
	/** @todo Should this become a separate error? */
	trigger_error( ERROR_CATEGORY_NO_ACTION, ERROR );
}

# We should check both since we are in the project section and an
#  admin might raise the first threshold and not realize they need
#  to raise the second
access_ensure_project_level( config_get( 'manage_project_threshold' ), $t_dst_project_id );
access_ensure_project_level( config_get( 'project_user_threshold' ), $t_dst_project_id );

project_copy_users( $t_dst_project_id, $t_src_project_id, access_get_project_level( $t_dst_project_id ) );

form_security_purge( 'manage_proj_user_copy' );

print_header_redirect( 'manage_proj_edit_page.php?project_id=' . $f_project_id );
开发者ID:rombert,项目名称:mantisbt,代码行数:29,代码来源:manage_proj_user_copy.php

示例12: write_bug_rows

function write_bug_rows($p_rows)
{
    $user_array = get_user_array();
    $alive_user_ids = array();
    $issues_array_html = '';
    $allowed_statuses_html = '';
    print '<div id="taskodrome_data" hidden="true">
    ';
    $users = '';
    $user_number = count($user_array);
    for ($i = 0; $i != $user_number; $i++) {
        $users .= '<p hidden="true" class="user_data" ';
        $users .= 'name="' . $user_array[$i]->name . '" ';
        $users .= 'id="' . $user_array[$i]->id . '"';
        $users .= '></p>';
        $alive_user_ids[$user_array[$i]->id] = 1;
    }
    print $users;
    $t_rows = count($p_rows);
    for ($i = 0; $i < $t_rows; $i++) {
        $t_row = $p_rows[$i];
        $handler_id = $t_row->handler_id;
        if (!array_key_exists($t_row->handler_id, $alive_user_ids)) {
            $handler_id = 0;
        }
        $issues_array_html .= '<p hidden="true" class="issue_data" ';
        $issues_array_html .= 'id="' . $t_row->id . '" ';
        $issues_array_html .= 'summary="' . htmlentities($t_row->summary) . '" ';
        $issues_array_html .= 'status="' . $t_row->status . '" ';
        $issues_array_html .= 'handler_id="' . $handler_id . '" ';
        $issues_array_html .= 'topColor="#0000FF" ';
        $issues_array_html .= 'bottomColor="#FF0000" ';
        $issues_array_html .= 'updateTime="' . $t_row->last_updated . '"';
        $issues_array_html .= '></p>';
        $t_all_statuses = get_status_option_list(access_get_project_level($t_row->project_id), $t_row->status, true, false, $t_row->project_id);
        $allowed_statuses_html .= '<p hidden="true" class="status_pair" ';
        $allowed_statuses_html .= 'id="' . $t_row->id . '" ';
        $src_status_str = '';
        $dst_status_str = '';
        foreach ($t_all_statuses as $src_status => $src_st) {
            $src_status_str .= $src_status . ';';
            $t_enum_list = get_status_option_list(access_get_project_level($t_row->project_id), $src_status, true, bug_is_user_reporter($t_row->id, auth_get_current_user_id()) && access_has_bug_level(config_get('report_bug_threshold'), $t_row->id) && ON == config_get('allow_reporter_close'), $t_row->project_id);
            foreach ($t_enum_list as $dst_status => $dst_st) {
                $dst_status_str .= $dst_status . ',';
            }
            $dst_status_str .= ';';
        }
        $allowed_statuses_html .= 'src_status="' . $src_status_str . '" ';
        $allowed_statuses_html .= 'dst_status="' . $dst_status_str . '"';
        $allowed_statuses_html .= '></p>';
    }
    print $issues_array_html;
    print $allowed_statuses_html;
    $status_order = null;
    foreach (plugin_config_get("status_board_order") as $t_value) {
        $status_order .= $t_value . ';';
    }
    print '<p hidden="true" class="status_board_order" value="' . $status_order . '"></p>';
    print '<p hidden="true" id="cooldown_period_days" value="' . plugin_config_get("cooldown_period_days") . '"></p>';
    print '<p hidden="true" id="cooldown_period_hours" value="' . plugin_config_get("cooldown_period_hours") . '"></p>';
    print '</div>';
    print '<section class="tabs">
    <br>

    <input type="radio" id="radio_dg" name="group" >
    <input type="radio" id="radio_sg" name="group" >

    [ <label id="label_dg" class="radio_label" for="radio_dg" >' . plugin_lang_get("assignment_board") . '</label> ]
    [ <label id="label_sg" class="radio_label" for="radio_sg" >' . plugin_lang_get("status_board") . '</label> ]

    <div class="tabs_cont">
    <div id="tab_c1">
    ';
    print '<div id="dev-grid" class="grid">
    <canvas id="panel">
    </canvas>
    </div>
    ';
    print '</div>';
    print '<div id="tab_c2">
    <div id="st-grid" class="grid">
    <canvas id="panel_st">
    </canvas>
    </div>
    ';
    html_page_bottom();
    print '</div>';
    print '</div>
    </section>
    ';
}
开发者ID:AuthenticEshkinKot,项目名称:Taskodrome,代码行数:91,代码来源:main.php

示例13: html_button_bug_change_status

/**
 * Print Change Status to: button
 * This code is similar to print_status_option_list except
 * there is no masking, except for the current state
 *
 * @param BugData $p_bug A valid bug object.
 * @return void
 */
function html_button_bug_change_status(BugData $p_bug)
{
    $t_current_access = access_get_project_level($p_bug->project_id);
    # User must have rights to change status to use this button
    if (!access_has_bug_level(config_get('update_bug_status_threshold'), $p_bug->id)) {
        return;
    }
    $t_enum_list = get_status_option_list($t_current_access, $p_bug->status, false, bug_is_user_reporter($p_bug->id, auth_get_current_user_id()) && access_has_bug_level(config_get('report_bug_threshold'), $p_bug->id) && ON == config_get('allow_reporter_close'), $p_bug->project_id);
    if (count($t_enum_list) > 0) {
        # resort the list into ascending order after noting the key from the first element (the default)
        $t_default_arr = each($t_enum_list);
        $t_default = $t_default_arr['key'];
        ksort($t_enum_list);
        reset($t_enum_list);
        echo '<form method="post" action="bug_change_status_page.php">';
        # CSRF protection not required here - form does not result in modifications
        $t_button_text = lang_get('bug_status_to_button');
        echo '<input type="submit" class="button" value="' . $t_button_text . '" />';
        echo ' <select name="new_status">';
        # space at beginning of line is important
        foreach ($t_enum_list as $t_key => $t_val) {
            echo '<option value="' . $t_key . '" ';
            check_selected($t_key, $t_default);
            echo '>' . $t_val . '</option>';
        }
        echo '</select>';
        $t_bug_id = string_attribute($p_bug->id);
        echo '<input type="hidden" name="id" value="' . $t_bug_id . '" />' . "\n";
        echo '<input type="hidden" name="change_type" value="' . BUG_UPDATE_TYPE_CHANGE_STATUS . '" />' . "\n";
        echo '</form>' . "\n";
    }
}
开发者ID:vipjaven,项目名称:mantisbt,代码行数:40,代码来源:html_api.php

示例14: access_has_project_level

function access_has_project_level($p_access_level, $p_project_id = null, $p_user_id = null)
{
    # Short circuit the check in this case
    if (NOBODY == $p_access_level) {
        return false;
    }
    if (null === $p_user_id) {
        $p_user_id = auth_get_current_user_id();
    }
    if (null === $p_project_id) {
        $p_project_id = helper_get_current_project();
    }
    $t_access_level = access_get_project_level($p_project_id, $p_user_id);
    return access_compare_level($t_access_level, $p_access_level);
}
开发者ID:jin255ff,项目名称:company_website,代码行数:15,代码来源:access_api.php

示例15: print_project_access_levels_option_list

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');
    # Add [default access level] to add the user to a project
    # with his default access level.
    print "<option value=\"" . DEFAULT_ACCESS_LEVEL . "\"";
    print ">[" . lang_get('default_access_level') . "]</option>";
    $t_arr = explode_enum_string($t_access_levels_enum_string);
    $enum_count = count($t_arr);
    for ($i = 0; $i < $enum_count; $i++) {
        $t_elem = explode_enum_arr($t_arr[$i]);
        # a user must not be able to assign another user an access level that is higher than theirs.
        if ($t_elem[0] > $t_current_user_access_level) {
            continue;
        }
        $t_access_level = get_enum_element('access_levels', $t_elem[0]);
        print "<option value=\"{$t_elem['0']}\"";
        check_selected($p_val, $t_elem[0]);
        print ">{$t_access_level}</option>";
    }
    # end for
}
开发者ID:jin255ff,项目名称:company_website,代码行数:23,代码来源:print_api.php


注:本文中的access_get_project_level函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。