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


PHP custom_field_has_write_access_to_project函数代码示例

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


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

示例1: helper_get_tab_index

			<textarea <?php 
    echo helper_get_tab_index();
    ?>
 id="additional_info" name="additional_info" cols="80" rows="10"><?php 
    echo string_textarea($f_additional_info);
    ?>
</textarea>
		</td>
	</tr>
<?php 
}
$t_custom_fields_found = false;
$t_related_custom_field_ids = custom_field_get_linked_ids($t_project_id);
foreach ($t_related_custom_field_ids as $t_id) {
    $t_def = custom_field_get_definition($t_id);
    if (($t_def['display_report'] || $t_def['require_report']) && custom_field_has_write_access_to_project($t_id, $t_project_id)) {
        $t_custom_fields_found = true;
        ?>
	<tr>
		<th class="category">
			<?php 
        if ($t_def['require_report']) {
            ?>
				<span class="required">*</span>
			<?php 
        }
        ?>
			<?php 
        if ($t_def['type'] != CUSTOM_FIELD_TYPE_RADIO && $t_def['type'] != CUSTOM_FIELD_TYPE_CHECKBOX) {
            ?>
				<label for="custom_field_<?php 
开发者ID:derrickweaver,项目名称:mantisbt,代码行数:31,代码来源:bug_report_page.php

示例2: bug_group_action_get_commands

/**
 * Get a list of bug group actions available to the current user for one or
 * more projects.
 * @param array $p_project_ids An array containing one or more project IDs.
 * @return array
 */
function bug_group_action_get_commands(array $p_project_ids = null)
{
    if ($p_project_ids === null || count($p_project_ids) == 0) {
        $p_project_ids = array(ALL_PROJECTS);
    }
    $t_commands = array();
    foreach ($p_project_ids as $t_project_id) {
        if (!isset($t_commands['MOVE']) && access_has_project_level(config_get('move_bug_threshold', null, null, $t_project_id), $t_project_id)) {
            $t_commands['MOVE'] = lang_get('actiongroup_menu_move');
        }
        if (!isset($t_commands['COPY']) && access_has_any_project(config_get('report_bug_threshold', null, null, $t_project_id))) {
            $t_commands['COPY'] = lang_get('actiongroup_menu_copy');
        }
        if (!isset($t_commands['ASSIGN']) && access_has_project_level(config_get('update_bug_assign_threshold', null, null, $t_project_id), $t_project_id)) {
            if (ON == config_get('auto_set_status_to_assigned', null, null, $t_project_id) && access_has_project_level(access_get_status_threshold(config_get('bug_assigned_status', null, null, $t_project_id), $t_project_id), $t_project_id)) {
                $t_commands['ASSIGN'] = lang_get('actiongroup_menu_assign');
            } else {
                $t_commands['ASSIGN'] = lang_get('actiongroup_menu_assign');
            }
        }
        if (!isset($t_commands['CLOSE']) && access_has_project_level(config_get('update_bug_status_threshold', null, null, $t_project_id), $t_project_id) && (access_has_project_level(access_get_status_threshold(config_get('bug_closed_status_threshold', null, null, $t_project_id), $t_project_id), $t_project_id) || access_has_project_level(config_get('allow_reporter_close', null, null, $t_project_id), $t_project_id))) {
            $t_commands['CLOSE'] = lang_get('actiongroup_menu_close');
        }
        if (!isset($t_commands['DELETE']) && access_has_project_level(config_get('delete_bug_threshold', null, null, $t_project_id), $t_project_id)) {
            $t_commands['DELETE'] = lang_get('actiongroup_menu_delete');
        }
        if (!isset($t_commands['RESOLVE']) && access_has_project_level(config_get('update_bug_status_threshold', null, null, $t_project_id), $t_project_id) && access_has_project_level(access_get_status_threshold(config_get('bug_resolved_status_threshold', null, null, $t_project_id), $t_project_id), $t_project_id)) {
            $t_commands['RESOLVE'] = lang_get('actiongroup_menu_resolve');
        }
        if (!isset($t_commands['SET_STICKY']) && access_has_project_level(config_get('set_bug_sticky_threshold', null, null, $t_project_id), $t_project_id)) {
            $t_commands['SET_STICKY'] = lang_get('actiongroup_menu_set_sticky');
        }
        if (!isset($t_commands['UP_PRIOR']) && access_has_project_level(config_get('update_bug_threshold', null, null, $t_project_id), $t_project_id)) {
            $t_commands['UP_PRIOR'] = lang_get('actiongroup_menu_update_priority');
        }
        if (!isset($t_commands['EXT_UPDATE_SEVERITY']) && access_has_project_level(config_get('update_bug_threshold', null, null, $t_project_id), $t_project_id)) {
            $t_commands['EXT_UPDATE_SEVERITY'] = lang_get('actiongroup_menu_update_severity');
        }
        if (!isset($t_commands['UP_STATUS']) && access_has_project_level(config_get('update_bug_status_threshold', null, null, $t_project_id), $t_project_id)) {
            $t_commands['UP_STATUS'] = lang_get('actiongroup_menu_update_status');
        }
        if (!isset($t_commands['UP_CATEGORY']) && access_has_project_level(config_get('update_bug_threshold', null, null, $t_project_id), $t_project_id)) {
            $t_commands['UP_CATEGORY'] = lang_get('actiongroup_menu_update_category');
        }
        if (!isset($t_commands['VIEW_STATUS']) && access_has_project_level(config_get('change_view_status_threshold', null, null, $t_project_id), $t_project_id)) {
            $t_commands['VIEW_STATUS'] = lang_get('actiongroup_menu_update_view_status');
        }
        if (!isset($t_commands['EXT_UPDATE_PRODUCT_BUILD']) && config_get('enable_product_build', null, null, $t_project_id) == ON && access_has_project_level(config_get('update_bug_threshold', null, null, $t_project_id), $t_project_id)) {
            $t_commands['EXT_UPDATE_PRODUCT_BUILD'] = lang_get('actiongroup_menu_update_product_build');
        }
        if (!isset($t_commands['EXT_ADD_NOTE']) && access_has_project_level(config_get('add_bugnote_threshold', null, null, $t_project_id), $t_project_id)) {
            $t_commands['EXT_ADD_NOTE'] = lang_get('actiongroup_menu_add_note');
        }
        if (!isset($t_commands['EXT_ATTACH_TAGS']) && access_has_project_level(config_get('tag_attach_threshold', null, null, $t_project_id), $t_project_id)) {
            $t_commands['EXT_ATTACH_TAGS'] = lang_get('actiongroup_menu_attach_tags');
        }
        if (!isset($t_commands['UP_FIXED_IN_VERSION']) && version_should_show_product_version($t_project_id) && access_has_project_level(config_get('update_bug_threshold', null, null, $t_project_id), $t_project_id)) {
            $t_commands['UP_FIXED_IN_VERSION'] = lang_get('actiongroup_menu_update_fixed_in_version');
        }
        if (!isset($t_commands['UP_TARGET_VERSION']) && version_should_show_product_version($t_project_id) && access_has_project_level(config_get('roadmap_update_threshold', null, null, $t_project_id), $t_project_id)) {
            $t_commands['UP_TARGET_VERSION'] = lang_get('actiongroup_menu_update_target_version');
        }
        $t_custom_field_ids = custom_field_get_linked_ids($t_project_id);
        foreach ($t_custom_field_ids as $t_custom_field_id) {
            if (!custom_field_has_write_access_to_project($t_custom_field_id, $t_project_id)) {
                continue;
            }
            $t_custom_field_def = custom_field_get_definition($t_custom_field_id);
            $t_command_id = 'custom_field_' . $t_custom_field_id;
            $t_command_caption = sprintf(lang_get('actiongroup_menu_update_field'), lang_get_defaulted($t_custom_field_def['name']));
            $t_commands[$t_command_id] = string_display($t_command_caption);
        }
    }
    $t_custom_group_actions = config_get('custom_group_actions');
    foreach ($t_custom_group_actions as $t_custom_group_action) {
        # use label if provided to get the localized text, otherwise fallback to action name.
        if (isset($t_custom_group_action['label'])) {
            $t_commands[$t_custom_group_action['action']] = lang_get_defaulted($t_custom_group_action['label']);
        } else {
            $t_commands[$t_custom_group_action['action']] = lang_get_defaulted($t_custom_group_action['action']);
        }
    }
    return $t_commands;
}
开发者ID:derrickweaver,项目名称:mantisbt,代码行数:90,代码来源:bug_group_action_api.php

示例3: print_all_bug_action_option_list

function print_all_bug_action_option_list()
{
    $commands = array('MOVE' => lang_get('actiongroup_menu_move'), 'COPY' => lang_get('actiongroup_menu_copy'), 'ASSIGN' => lang_get('actiongroup_menu_assign'), 'CLOSE' => lang_get('actiongroup_menu_close'), 'DELETE' => lang_get('actiongroup_menu_delete'), 'RESOLVE' => lang_get('actiongroup_menu_resolve'), 'SET_STICKY' => lang_get('actiongroup_menu_set_sticky'), 'UP_PRIOR' => lang_get('actiongroup_menu_update_priority'), 'UP_STATUS' => lang_get('actiongroup_menu_update_status'), 'UP_CATEGORY' => lang_get('actiongroup_menu_update_category'), 'VIEW_STATUS' => lang_get('actiongroup_menu_update_view_status'), 'EXT_ADD_NOTE' => lang_get('actiongroup_menu_add_note'), 'EXT_ATTACH_TAGS' => lang_get('actiongroup_menu_attach_tags'));
    $t_project_id = helper_get_current_project();
    if (ALL_PROJECTS != $t_project_id) {
        $t_user_id = auth_get_current_user_id();
        if (access_has_project_level(config_get('update_bug_threshold'), $t_project_id)) {
            $commands['UP_FIXED_IN_VERSION'] = lang_get('actiongroup_menu_update_fixed_in_version');
        }
        if (access_has_project_level(config_get('roadmap_update_threshold'), $t_project_id)) {
            $commands['UP_TARGET_VERSION'] = lang_get('actiongroup_menu_update_target_version');
        }
        $t_custom_field_ids = custom_field_get_linked_ids($t_project_id);
        foreach ($t_custom_field_ids as $t_custom_field_id) {
            # if user has not access right to modify the field, then there is no
            # point in showing it.
            if (!custom_field_has_write_access_to_project($t_custom_field_id, $t_project_id, $t_user_id)) {
                continue;
            }
            $t_custom_field_def = custom_field_get_definition($t_custom_field_id);
            $t_command_id = 'custom_field_' . $t_custom_field_id;
            $t_command_caption = sprintf(lang_get('actiongroup_menu_update_field'), lang_get_defaulted($t_custom_field_def['name']));
            $commands[$t_command_id] = string_display($t_command_caption);
        }
    }
    $t_custom_group_actions = config_get('custom_group_actions');
    foreach ($t_custom_group_actions as $t_custom_group_action) {
        # use label if provided to get the localized text, otherwise fallback to action name.
        if (isset($t_custom_group_action['label'])) {
            $commands[$t_custom_group_action['action']] = lang_get_defaulted($t_custom_group_action['label']);
        } else {
            $commands[$t_custom_group_action['action']] = lang_get_defaulted($t_custom_group_action['action']);
        }
    }
    while (list($key, $val) = each($commands)) {
        print "<option value=\"" . $key . "\">" . $val . "</option>";
    }
}
开发者ID:jin255ff,项目名称:company_website,代码行数:38,代码来源:print_api.php

示例4: custom_field_has_write_access

/**
 * Return true if the user can modify the value of the field for the given bug,
 * false otherwise.
 * @param integer $p_field_id Custom field identifier.
 * @param integer $p_bug_id   A bug identifier.
 * @param integer $p_user_id  A user identifier.
 * @return boolean
 * @access public
 */
function custom_field_has_write_access($p_field_id, $p_bug_id, $p_user_id = null)
{
    $t_project_id = bug_get_field($p_bug_id, 'project_id');
    return custom_field_has_write_access_to_project($p_field_id, $t_project_id, $p_user_id);
}
开发者ID:hamx0r,项目名称:mantisbt,代码行数:14,代码来源:custom_field_api.php

示例5: print_all_bug_action_option_list

function print_all_bug_action_option_list()
{
    $commands = array('MOVE' => lang_get('actiongroup_menu_move'), 'COPY' => lang_get('actiongroup_menu_copy'), 'ASSIGN' => lang_get('actiongroup_menu_assign'), 'CLOSE' => lang_get('actiongroup_menu_close'), 'DELETE' => lang_get('actiongroup_menu_delete'), 'RESOLVE' => lang_get('actiongroup_menu_resolve'), 'SET_STICKY' => lang_get('actiongroup_menu_set_sticky'), 'UP_PRIOR' => lang_get('actiongroup_menu_update_priority'), 'UP_STATUS' => lang_get('actiongroup_menu_update_status'), 'UP_CATEGORY' => lang_get('actiongroup_menu_update_category'), 'VIEW_STATUS' => lang_get('actiongroup_menu_update_view_status'));
    $t_project_id = helper_get_current_project();
    if (ALL_PROJECTS != $t_project_id) {
        $t_user_id = auth_get_current_user_id();
        $t_custom_field_ids = custom_field_get_linked_ids($t_project_id);
        foreach ($t_custom_field_ids as $t_custom_field_id) {
            # if user has not access right to modify the field, then there is no
            # point in showing it.
            if (!custom_field_has_write_access_to_project($t_custom_field_id, $t_project_id, $t_user_id)) {
                continue;
            }
            $t_custom_field_def = custom_field_get_definition($t_custom_field_id);
            $t_command_id = 'custom_field_' . $t_custom_field_id;
            $t_command_caption = sprintf(lang_get('actiongroup_menu_update_field'), lang_get_defaulted($t_custom_field_def['name']));
            $commands[$t_command_id] = string_display($t_command_caption);
        }
    }
    $t_custom_group_actions = config_get('custom_group_actions');
    foreach ($t_custom_group_actions as $t_custom_group_action) {
        $commands[$t_custom_group_action['action']] = lang_get_defaulted($t_custom_group_action['action']);
    }
    while (list($key, $val) = each($commands)) {
        print "<option value=\"" . $key . "\">" . $val . "</option>";
    }
}
开发者ID:centaurustech,项目名称:BenFund,代码行数:27,代码来源:print_api.php


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