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


PHP access_can_close_bug函数代码示例

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


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

示例1: foreach

foreach ($f_bug_arr as $t_bug_id) {
    bug_ensure_exists($t_bug_id);
    $t_bug = bug_get($t_bug_id, true);
    if ($t_bug->project_id != helper_get_current_project()) {
        # in case the current project is not the same project of the bug we are viewing...
        # ... override the current project. This to avoid problems with categories and handlers lists etc.
        $g_project_override = $t_bug->project_id;
        # @todo (thraxisp) the next line goes away if the cache was smarter and used project
        config_flush_cache();
        # flush the config cache so that configs are refetched
    }
    $t_status = $t_bug->status;
    switch ($f_action) {
        case 'CLOSE':
            $t_closed = config_get('bug_closed_status_threshold');
            if (access_can_close_bug($t_bug)) {
                if ($t_status < $t_closed && bug_check_workflow($t_status, $t_closed)) {
                    # @todo we need to issue a helper_call_custom_function( 'issue_update_validate', array( $f_bug_id, $t_bug_data, $f_bugnote_text ) );
                    bug_close($t_bug_id, $f_bug_notetext, $f_bug_noteprivate);
                    helper_call_custom_function('issue_update_notify', array($t_bug_id));
                } else {
                    $t_failed_ids[$t_bug_id] = lang_get('bug_actiongroup_status');
                }
            } else {
                $t_failed_ids[$t_bug_id] = lang_get('bug_actiongroup_access');
            }
            break;
        case 'DELETE':
            if (access_has_bug_level(config_get('delete_bug_threshold'), $t_bug_id)) {
                event_signal('EVENT_BUG_DELETED', array($t_bug_id));
                bug_delete($t_bug_id);
开发者ID:gtn,项目名称:mantisbt,代码行数:31,代码来源:bug_actiongroup.php

示例2: access_ensure_can_close_bug

/**
 * Make sure that the user can close the specified bug
 * @see access_can_close_bug
 * @param BugData $p_bug Bug to check access against
 * @param int|null $p_user_id integer representing user id, defaults to null to use current user
 * @access public
 */
function access_ensure_can_close_bug($p_bug, $p_user_id = null)
{
    if (!access_can_close_bug($p_bug, $p_user_id)) {
        access_denied();
    }
}
开发者ID:N0ctrnl,项目名称:mantisbt,代码行数:13,代码来源:access_api.php

示例3: lang_get

    }
    echo '</tr>';
}
#
# Status, Resolution
#
if ($t_show_status || $t_show_resolution) {
    echo '<tr>';
    $t_spacer = 2;
    if ($t_show_status) {
        # Status
        echo '<th class="category"><label for="status">' . lang_get('status') . '</label></th>';
        # choose color based on status
        $status_label = html_get_status_css_class($t_bug->status);
        echo '<td class="' . $status_label . '">';
        print_status_option_list('status', $t_bug->status, access_can_close_bug($t_bug), $t_bug->project_id);
        echo '</td>';
    } else {
        $t_spacer += 2;
    }
    if ($t_show_resolution) {
        # Resolution
        echo '<th class="category"><label for="resolution">' . lang_get('resolution') . '</label></th>';
        echo '<td><select ' . helper_get_tab_index() . ' id="resolution" name="resolution">';
        print_enum_string_option_list('resolution', $t_bug->resolution);
        echo '</select></td>';
    } else {
        $t_spacer += 2;
    }
    # spacer
    if ($t_spacer > 0) {
开发者ID:N0ctrnl,项目名称:mantisbt,代码行数:31,代码来源:bug_update_page.php

示例4: html_button_bug_close

/**
 * Print a button to close the given bug
 * @param BugData $p_bug Bug object
 * @return null
 */
function html_button_bug_close($p_bug)
{
    if (access_can_close_bug($p_bug)) {
        $t_closed_status = config_get('bug_closed_status_threshold', null, null, $p_bug->project_id);
        html_button('bug_change_status_page.php', lang_get('close_bug_button'), array('id' => $p_bug->id, 'new_status' => $t_closed_status));
    }
}
开发者ID:nextgens,项目名称:mantisbt,代码行数:12,代码来源:html_api.php

示例5: bug_get

 $t_bug = bug_get($t_bug_id, true);
 if ($t_bug->project_id != helper_get_current_project()) {
     # in case the current project is not the same project of the bug we are viewing...
     # ... override the current project. This to avoid problems with categories and handlers lists etc.
     $g_project_override = $t_bug->project_id;
     # @@@ (thraxisp) the next line goes away if the cache was smarter and used project
     config_flush_cache();
     # flush the config cache so that configs are refetched
 }
 $t_status = $t_bug->status;
 switch ($f_action) {
     case 'CLOSE':
         if (access_can_close_bug($t_bug_id) && $t_status < CLOSED && bug_check_workflow($t_status, CLOSED)) {
             bug_close($t_bug_id);
         } else {
             if (!access_can_close_bug($t_bug_id)) {
                 $t_failed_ids[$t_bug_id] = lang_get('bug_actiongroup_access');
             } else {
                 $t_failed_ids[$t_bug_id] = lang_get('bug_actiongroup_status');
             }
         }
         break;
     case 'DELETE':
         if (access_has_bug_level(config_get('delete_bug_threshold'), $t_bug_id)) {
             bug_delete($t_bug_id);
         } else {
             $t_failed_ids[$t_bug_id] = lang_get('bug_actiongroup_access');
         }
         break;
     case 'MOVE':
         if (access_has_bug_level(config_get('move_bug_threshold'), $t_bug_id)) {
开发者ID:centaurustech,项目名称:BenFund,代码行数:31,代码来源:bug_actiongroup.php

示例6: config_get

$t_reopen_resolution = config_get('bug_reopen_resolution');
$t_resolve_issue = false;
$t_close_issue = false;
$t_reopen_issue = false;
if ($t_existing_bug->status < $t_resolved_status && $t_updated_bug->status >= $t_resolved_status && $t_updated_bug->status < $t_closed_status) {
    $t_resolve_issue = true;
} else {
    if ($t_existing_bug->status < $t_closed_status && $t_updated_bug->status >= $t_closed_status) {
        $t_close_issue = true;
    } else {
        if ($t_existing_bug->status >= $t_resolved_status && $t_updated_bug->status <= config_get('bug_reopen_status')) {
            $t_reopen_issue = true;
        }
    }
}
$t_reporter_closing = $f_update_type == BUG_UPDATE_TYPE_CLOSE && bug_is_user_reporter($f_bug_id, $t_current_user_id) && access_can_close_bug($t_existing_bug, $t_current_user_id);
$t_reporter_reopening = ($f_update_type == BUG_UPDATE_TYPE_REOPEN || $t_reopen_issue) && bug_is_user_reporter($f_bug_id, $t_current_user_id) && access_can_reopen_bug($t_existing_bug, $t_current_user_id);
if (!$t_reporter_reopening && !$t_reporter_closing) {
    # Ensure that the user has permission to update bugs. This check also factors
    # in whether the user has permission to view private bugs. The
    # $g_limit_reporters option is also taken into consideration.
    access_ensure_bug_level(config_get('update_bug_threshold'), $f_bug_id);
    # Check if the bug is in a read-only state and whether the current user has
    # permission to update read-only bugs.
    if (bug_is_readonly($f_bug_id)) {
        error_parameters($f_bug_id);
        trigger_error(ERROR_BUG_READ_ONLY_ACTION_DENIED, ERROR);
    }
}
# If resolving or closing, ensure that all dependant issues have been resolved.
if (($t_resolve_issue || $t_close_issue) && !relationship_can_resolve_bug($f_bug_id)) {
开发者ID:hamx0r,项目名称:mantisbt,代码行数:31,代码来源:bug_update.php

示例7: html_button_bug_close

/**
 * Print a button to close the given bug
 * Only if user can close bugs and workflow allows moving them to that status
 * @param BugData $p_bug A valid bug object.
 * @return void
 */
function html_button_bug_close(BugData $p_bug)
{
    $t_closed_status = config_get('bug_closed_status_threshold', null, null, $p_bug->project_id);
    if (access_can_close_bug($p_bug) && bug_check_workflow($p_bug->status, $t_closed_status)) {
        html_button('bug_change_status_page.php', lang_get('close_bug_button'), array('id' => $p_bug->id, 'new_status' => $t_closed_status, 'change_type' => BUG_UPDATE_TYPE_CLOSE));
    }
}
开发者ID:vipjaven,项目名称:mantisbt,代码行数:13,代码来源:html_api.php


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