本文整理汇总了PHP中access_has_project_level函数的典型用法代码示例。如果您正苦于以下问题:PHP access_has_project_level函数的具体用法?PHP access_has_project_level怎么用?PHP access_has_project_level使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了access_has_project_level函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: export_issues_menu
/**
* Export Issues Menu
* @return array
*/
function export_issues_menu()
{
if (!access_has_project_level(plugin_config_get('export_threshold'))) {
return array();
}
return array('<a href="' . plugin_page('export') . '">' . plugin_lang_get('export') . '</a>');
}
示例2: action_add_note_print_fields
/**
* Prints the field within the custom action form. This has an entry for
* every field the user need to supply + the submit button. The fields are
* added as rows in a table that is already created by the calling code.
* A row has two columns.
*/
function action_add_note_print_fields()
{
echo '<tr class="row-1" valign="top"><td class="category">', lang_get('add_bugnote_title'), '</td><td><textarea name="bugnote_text" cols="80" rows="10"></textarea></td></tr>';
?>
<!-- View Status -->
<tr class="row-2">
<td class="category">
<?php
echo lang_get('view_status');
?>
</td>
<td>
<?php
$t_default_state = config_get('default_bugnote_view_status');
if (access_has_project_level(config_get('set_view_status_threshold'))) {
?>
<select name="view_state">
<?php
print_enum_string_option_list('view_state', $t_default_state);
?>
</select>
<?php
} else {
echo get_enum_element('view_state', $t_default_state);
echo '<input type="hidden" name="view_state" value="', $t_default_state, '" />';
}
?>
</td>
</tr>
<?php
echo '<tr><td colspan="2"><center><input type="submit" class="button" value="' . lang_get('add_bugnote_button') . ' " /></center></td></tr>';
}
示例3: mci_account_get_array_by_id
/**
* Get username, realname and email from for a given user id
* @param integer $p_user_id A valid user identifier.
* @return array
*/
function mci_account_get_array_by_id($p_user_id)
{
$t_result = array();
$t_result['id'] = $p_user_id;
if (user_exists($p_user_id)) {
$t_current_user_id = auth_get_current_user_id();
$t_access_level = user_get_field($t_current_user_id, 'access_level');
$t_can_manage = access_has_global_level(config_get('manage_user_threshold')) && access_has_global_level($t_access_level);
# this deviates from the behaviour of view_user_page.php, but it is more intuitive
$t_is_same_user = $t_current_user_id === $p_user_id;
$t_can_see_realname = access_has_project_level(config_get('show_user_realname_threshold'));
$t_can_see_email = access_has_project_level(config_get('show_user_email_threshold'));
$t_result['name'] = user_get_field($p_user_id, 'username');
if ($t_is_same_user || $t_can_manage || $t_can_see_realname) {
$t_realname = user_get_realname($p_user_id);
if (!empty($t_realname)) {
$t_result['real_name'] = $t_realname;
}
}
if ($t_is_same_user || $t_can_manage || $t_can_see_email) {
$t_email = user_get_email($p_user_id);
if (!empty($t_email)) {
$t_result['email'] = $t_email;
}
}
}
return $t_result;
}
示例4: menu_main
function menu_main()
{
$t_links = array();
if (plugin_config_get('show_gantt_roadmap_link') && access_has_project_level(config_get('view_summary_threshold'))) {
$t_page = plugin_page('summary_gantt_chart_page', false, 'GanttChart');
$t_lang = plugin_lang_get('menu', 'GanttChart');
$t_links[] = "<a href=\"{$t_page}\">{$t_lang}</a>";
}
return $t_links;
}
示例5: report_bug_form
/**
* When reporting a bug, show appropriate form elements to the user.
* @param string Event name
* @param int Project ID
*/
function report_bug_form($p_event, $p_project_id)
{
if (plugin_config_get('use_estimates') && access_has_project_level(plugin_config_get('estimate_threshold'), $p_project_id)) {
echo '<tr ', helper_alternate_class(), '><td class="category">', plugin_lang_get('estimate'), '<input type="hidden" name="plugin_timecard" value="1"/>', '</td><td><input name="plugin_timecard_estimate" size="8" maxlength="64"/>', plugin_lang_get('hours'), '</td></tr>';
}
if (plugin_config_get('use_timecard')) {
$t_project = TimecardProject::load($p_project_id);
echo '<tr ', helper_alternate_class(), '><td class="category">', plugin_lang_get('timecard'), '</td><td><input name="plugin_timecard_string" value="', $t_project->timecard, '" size="15" maxlength="64"/></td></tr>';
}
}
示例6: mc_project_attachment_delete
/**
* Delete a project attachment given its id.
*
* @param string $p_username The name of the user trying to add an attachment to an issue.
* @param string $p_password The password of the user.
* @param integer $p_project_attachment_id The id of the attachment to be deleted.
* @return true: success, false: failure
*/
function mc_project_attachment_delete( $p_username, $p_password, $p_project_attachment_id ) {
$t_user_id = mci_check_login( $p_username, $p_password );
if( $t_user_id === false ) {
return mci_soap_fault_login_failed();
}
$t_project_id = file_get_field( $p_project_attachment_id, 'project_id', 'project' );
if( !access_has_project_level( config_get( 'upload_project_file_threshold' ), $t_project_id, $t_user_id ) ) {
return mci_soap_fault_access_denied( $t_user_id );
}
return file_delete( $p_project_attachment_id, 'project' );
}
示例7: prepare_email_link
function prepare_email_link($p_email, $p_text)
{
if (!access_has_project_level(config_get('show_user_email_threshold'))) {
return $p_text;
}
# If we apply string_url() to the whole mailto: link then the @
# gets turned into a %40 and you can't right click in browsers to
# do Copy Email Address.
$t_mailto = string_attribute("mailto:{$p_email}");
$p_text = string_display($p_text);
return "<a href=\"{$t_mailto}\">{$p_text}</a>";
}
示例8: prepare_version_string
/**
* A function that prepares the version string for outputting to the user on view / print issue pages.
* This function would add the version date, if appropriate.
*
* @param integer $p_project_id The project id.
* @param integer $p_version_id The version id. If false then this method will return an empty string.
* @return The formatted version string.
*/
function prepare_version_string($p_project_id, $p_version_id)
{
if ($p_version_id === false) {
return '';
}
$t_version_text = version_full_name($p_version_id, null, $p_project_id);
if (access_has_project_level(config_get('show_version_dates_threshold'), $p_project_id)) {
$t_short_date_format = config_get('short_date_format');
$t_version = version_get($p_version_id);
$t_version_text .= ' (' . date($t_short_date_format, $t_version->date_order) . ')';
}
return $t_version_text;
}
示例9: get
/**
* Gets the avatar information for the user. The avatars are provided by
* plugins that can integrate with a variety of services like gravatar.com,
* LDAP, Social Identities, etc.
*
* If logged in user doesn't have access to view avatars or not avatar is found,
* then a default avatar will be used.
*
* Note that the provided user id may no longer has a corresponding user in the
* system, if the user was deleted.
*
* @param integer $p_user_id The user id.
* @param integer $p_size The desired width/height of the avatar.
*
* @return array The array with avatar information.
*/
public static function get($p_user_id, $p_size = 80)
{
$t_enabled = config_get('show_avatar') !== OFF;
$t_avatar = null;
if ($t_enabled) {
$t_user_exists = user_exists($p_user_id);
if ($t_user_exists && access_has_project_level(config_get('show_avatar_threshold'), null, $p_user_id)) {
$t_avatar = event_signal('EVENT_USER_AVATAR', array($p_user_id, $p_size));
}
if ($t_avatar === null) {
$t_avatar = new Avatar();
}
$t_avatar->normalize($p_user_id, $t_user_exists);
}
return $t_avatar;
}
示例10: display_bug
function display_bug($p_event, $p_bug_id)
{
require_once 'Source.ViewAPI.php';
$t_project_id = bug_get_field($p_bug_id, 'project_id');
$t_view_threshold = config_get('plugin_Source_view_threshold');
if (!access_has_project_level($t_view_threshold, $t_project_id)) {
return;
}
$t_changesets = $this->changesets;
if (count($t_changesets) < 1) {
return;
}
collapse_open('Source');
?>
<br/>
<a name="changesets"/>
<table class="width100" cellspacing="1">
<tr>
<td class="form-title"><?php
collapse_icon('Source');
echo plugin_lang_get('related_changesets', 'Source');
?>
</td>
</tr>
<?php
Source_View_Changesets($t_changesets);
?>
</table>
<?php
collapse_closed('Source');
?>
<br/>
<table class="width100" cellspacing="1">
<tr>
<td class="form-title"><?php
collapse_icon('Source');
echo plugin_lang_get('related_changesets', 'Source');
?>
</td>
</tr>
</table>
<?php
collapse_end('Source');
}
示例11: collapse_icon
collapse_icon('profile');
echo lang_get('or_fill_in');
?>
<?php
collapse_end('profile');
?>
<?php
}
?>
</td>
</tr>
<?php
}
if ($t_show_product_version) {
$t_product_version_released_mask = VERSION_RELEASED;
if (access_has_project_level(config_get('report_issues_for_unreleased_versions_threshold'))) {
$t_product_version_released_mask = VERSION_ALL;
}
?>
<tr>
<th class="category">
<label for="product_version"><?php
echo lang_get('product_version');
?>
</label>
</th>
<td>
<select <?php
echo helper_get_tab_index();
?>
id="product_version" name="product_version">
示例12: helper_get_columns_to_view
function helper_get_columns_to_view($p_columns_target = COLUMNS_TARGET_VIEW_PAGE)
{
$t_columns = helper_call_custom_function('get_columns_to_view', array($p_columns_target));
$t_enable_sponsorship = config_get('enable_sponsorship');
if (OFF == $t_enable_sponsorship) {
$t_keys = array_keys($t_columns, 'sponsorship_total');
foreach ($t_keys as $t_key) {
unset($t_columns[$t_key]);
}
}
$t_show_attachments = config_get('show_attachment_indicator');
if (OFF == $t_show_attachments) {
$t_keys = array_keys($t_columns, 'attachment');
foreach ($t_keys as $t_key) {
unset($t_columns[$t_key]);
}
}
if (OFF == config_get('enable_relationship')) {
$t_keys = array_keys($t_columns, 'duplicate_id');
foreach ($t_keys as $t_key) {
unset($t_columns[$t_key]);
}
}
$t_current_project_id = helper_get_current_project();
if ($t_current_project_id != ALL_PROJECTS && !access_has_project_level(config_get('roadmap_view_threshold'), $t_current_project_id)) {
$t_keys = array_keys($t_columns, 'target_version');
foreach ($t_keys as $t_key) {
unset($t_columns[$t_key]);
}
}
# get the array values to remove gaps in the array which causes issue
# if the array is accessed using an index.
return array_values($t_columns);
}
示例13: filter_db_get_available_queries
/**
* Note: any changes made in this function should be reflected in
* mci_filter_db_get_available_queries())
* @param integer $p_project_id A valid project identifier.
* @param integer $p_user_id A valid user identifier.
* @return mixed
*/
function filter_db_get_available_queries($p_project_id = null, $p_user_id = null)
{
$t_overall_query_arr = array();
if (null === $p_project_id) {
$t_project_id = helper_get_current_project();
} else {
$t_project_id = (int) $p_project_id;
}
if (null === $p_user_id) {
$t_user_id = auth_get_current_user_id();
} else {
$t_user_id = (int) $p_user_id;
}
# If the user doesn't have access rights to stored queries, just return
if (!access_has_project_level(config_get('stored_query_use_threshold'))) {
return $t_overall_query_arr;
}
# Get the list of available queries. By sorting such that public queries are
# first, we can override any query that has the same name as a private query
# with that private one
$t_query = 'SELECT * FROM {filters}
WHERE (project_id=' . db_param() . '
OR project_id=0)
AND name!=\'\'
AND (is_public = ' . db_param() . '
OR user_id = ' . db_param() . ')
ORDER BY is_public DESC, name ASC';
$t_result = db_query($t_query, array($t_project_id, true, $t_user_id));
while ($t_row = db_fetch_array($t_result)) {
$t_overall_query_arr[$t_row['id']] = $t_row['name'];
}
$t_overall_query_arr = array_unique($t_overall_query_arr);
asort($t_overall_query_arr);
return $t_overall_query_arr;
}
示例14: get_capability_enum
function get_capability_enum($p_caption, $p_threshold, $p_enum, $p_all_projects_only = false)
{
global $t_user, $t_project_id, $t_show_submit, $t_access_levels, $t_colour_project, $t_colour_global;
$t_file = config_get_global($p_threshold);
$t_global = config_get($p_threshold, null, null, ALL_PROJECTS);
$t_project = config_get($p_threshold);
$t_can_change = access_has_project_level(config_get_access($p_threshold), $t_project_id, $t_user) && (ALL_PROJECTS == $t_project_id || !$p_all_projects_only);
$t_colour = '';
if ($t_global != $t_file) {
$t_colour = ' bgcolor="' . $t_colour_global . '" ';
# all projects override
if ($t_can_change) {
set_overrides($p_threshold);
}
}
if ($t_project != $t_global) {
$t_colour = ' bgcolor="' . $t_colour_project . '" ';
# project overrides
if ($t_can_change) {
set_overrides($p_threshold);
}
}
echo '<tr ' . helper_alternate_class() . '><td>' . string_display($p_caption) . '</td>';
if ($t_can_change) {
echo '<td class="left" colspan="3"' . $t_colour . '><select name="flag_' . $p_threshold . '">';
print_enum_string_option_list($p_enum, config_get($p_threshold));
echo '</select></td><td colspan="' . (count($t_access_levels) - 3) . '"></td>';
$t_show_submit = true;
} else {
$t_value = MantisEnum::getLabel(lang_get($p_enum . '_enum_string'), config_get($p_threshold)) . ' ';
echo '<td class="left" colspan="3"' . $t_colour . '>' . $t_value . '</td><td colspan="' . (count($t_access_levels) - 3) . '"></td>';
}
if ($t_can_change) {
echo '<td><select name="access_' . $p_threshold . '">';
print_enum_string_option_list('access_levels', config_get_access($p_threshold));
echo '</select> </td>';
} else {
echo '<td>' . MantisEnum::getLabel(lang_get('access_levels_enum_string'), config_get_access($p_threshold)) . ' </td>';
}
echo '</tr>' . "\n";
}
示例15: helper_alternate_class
?>
<!-- View Status -->
<tr <?php
echo helper_alternate_class();
?>
>
<td class="category">
<?php
echo lang_get('view_status');
?>
</td>
<td>
<?php
if (access_has_project_level(config_get('set_view_status_threshold'))) {
?>
<input <?php
echo helper_get_tab_index();
?>
type="radio" name="view_state" value="<?php
echo VS_PUBLIC;
?>
" <?php
check_checked($f_view_state, VS_PUBLIC);
?>
/> <?php
echo lang_get('public');
?>
<input <?php
echo helper_get_tab_index();