本文整理汇总了PHP中helper_get_current_project函数的典型用法代码示例。如果您正苦于以下问题:PHP helper_get_current_project函数的具体用法?PHP helper_get_current_project怎么用?PHP helper_get_current_project使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了helper_get_current_project函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: print_versions
/**
* @param $edit_page
* @param $obsolete_flag
*/
function print_versions($edit_page, $obsolete_flag)
{
$specmanagement_database_api = new specmanagement_database_api();
$specmanagement_print_api = new specmanagement_print_api();
$obsolote = false;
if ($obsolete_flag) {
$obsolote = null;
}
if ($edit_page) {
$versions = version_get_all_rows_with_subs(helper_get_current_project(), null, null);
} else {
$versions = version_get_all_rows_with_subs(helper_get_current_project(), null, $obsolote);
}
for ($version_index = 0; $version_index < count($versions); $version_index++) {
$version = $versions[$version_index];
$current_type = $specmanagement_database_api->get_type_string($specmanagement_database_api->get_type_by_version($version['id']));
$specmanagement_print_api->printRow();
echo '<input type="hidden" name="version_ids[]" value="' . $version['id'] . '"/>';
print_name($edit_page, $version);
print_released($edit_page, $version_index, $version);
print_obsolete($edit_page, $version_index, $version);
print_date($edit_page, $version);
print_type($edit_page, $current_type, $version);
print_description($edit_page, $version);
print_action($edit_page, $version);
echo '</tr>';
}
}
示例2: renderIssues
function renderIssues($status)
{
$content = array();
$t_project_id = helper_get_current_project();
$t_bug_table = db_get_table('mantis_bug_table');
$t_user_id = auth_get_current_user_id();
$specific_where = helper_project_specific_where($t_project_id, $t_user_id);
if ($this->severity) {
$severityCond = '= ' . $this->severity;
} else {
$severityCond = '> -1';
}
$query = "SELECT *\n\t\t\tFROM {$t_bug_table}\n\t\t\tWHERE {$specific_where}\n\t\t\tAND status = {$status}\n\t\t\tAND severity {$severityCond}\n\t\t\tORDER BY last_updated DESC\n\t\t\tLIMIT 20";
$result = db_query_bound($query);
$category_count = db_num_rows($result);
for ($i = 0; $i < $category_count; $i++) {
$row = db_fetch_array($result);
//pre_var_dump($row);
$content[] = '<div class="portlet ui-helper-clearfix" id="' . $row['id'] . '">
<div class="portlet-header">' . string_get_bug_view_link($row['id']) . ': ' . $row['summary'] . '</div>
<div class="portlet-content">' . ($row['reporter_id'] ? 'Reporter: ' . user_get_name($row['reporter_id']) . BR : '') . ($row['handler_id'] ? 'Assigned: ' . user_get_name($row['handler_id']) . BR : '') . '</div></div>';
}
if ($row) {
//pre_var_dump(array_keys($row));
}
return $content;
}
示例3: get_closed_count_by_date
function get_closed_count_by_date($p_date)
{
$t_project_id = helper_get_current_project();
$d_arr = explode('/', $p_date);
$p_date = $d_arr[2] . '-' . $d_arr[0] . '-' . $d_arr[1];
$query = "SELECT COUNT(*)\r\n\t\t\t\tFROM mantis_bug_table\r\n\t\t\t\tWHERE last_updated<='{$p_date}' AND\r\n\t\t\t\t\tstatus='90' AND\r\n\t\t\t\t\tproject_id='{$t_project_id}'";
$result = db_query($query);
return db_result($result, 0, 0);
}
示例4: footer
function footer()
{
$t_project_id = helper_get_current_project();
$t_user_id = auth_get_current_user_id();
$t_user_has_level = user_get_access_level($t_user_id, $t_project_id) >= plugin_config_get('BackgroundImageAccessLevel', PLUGINS_BACKGROUNDIMAGEVIEW_THRESHOLD_LEVEL_DEFAULT);
if (plugin_config_get('ShowInFooter') == 1 && $t_user_has_level) {
return '<address>' . $this->name . ' ' . $this->version . ' Copyright © 2015 by <a href="mailto://' . $this->contact . '">' . $this->author . '</a></address>';
}
return null;
}
示例5: csv_get_default_filename
/**
* if all projects selected, default to <username>.csv, otherwise default to
* <projectname>.csv.
* @return string filename
* @access public
*/
function csv_get_default_filename()
{
$t_current_project_id = helper_get_current_project();
if (ALL_PROJECTS == $t_current_project_id) {
$t_filename = user_get_name(auth_get_current_user_id());
} else {
$t_filename = project_get_field($t_current_project_id, 'name');
}
return $t_filename . '.csv';
}
示例6: set_overrides
/**
* Set overrides
* @param string $p_config Configuration value.
* @param bool $p_can_change True if user has access level to change config
* @param string $p_color CSS class name
* @return void
*/
function set_overrides($p_config, $p_can_change, $p_color)
{
global $g_overrides;
if (!$p_can_change) {
return;
}
$t_project = helper_get_current_project();
if ($t_project == ALL_PROJECTS && $p_color == COLOR_GLOBAL || $t_project != ALL_PROJECTS && $p_color == COLOR_PROJECT) {
$g_overrides[$p_config] = $p_config;
}
}
示例7: add_columns
function add_columns()
{
$t_project_id = helper_get_current_project();
$t_user_id = auth_get_current_user_id();
$t_user_has_level = user_get_access_level($t_user_id, $t_project_id) >= plugin_config_get('RelationshipColumnAccessLevel', PLUGINS_RELATIONSHIPCOLUMNVIEW_THRESHOLD_LEVEL_DEFAULT);
$t_result = array();
if (plugin_config_get('ShowRelationshipColumn') == gpc_get_int('ShowRelationshipColumn', ON) && $t_user_has_level) {
if ('1.2.' == substr(MANTIS_VERSION, 0, 4)) {
require_once 'classes' . DIRECTORY_SEPARATOR . 'RelationshipColumn.class.1.2.0.php';
} else {
require_once 'classes' . DIRECTORY_SEPARATOR . 'RelationshipColumn.class.1.3.0.php';
}
$t_result[] = 'RelationshipColumn';
}
return $t_result;
}
示例8: print_document_selection
/**
* @param $types
*/
function print_document_selection($types)
{
$project_id = gpc_get_int('project_id', helper_get_current_project());
$specmanagement_database_api = new specmanagement_database_api();
echo '<select name="version_id">';
foreach ($types as $type) {
$type_string = string_html_specialchars($type);
$type_id = $specmanagement_database_api->get_type_id($type);
$version_id_array = get_version_ids($type_id, $project_id);
foreach ($version_id_array as $version_id) {
$version_spec_project_id = version_get_field($version_id, 'project_id');
if (project_includes_user($version_spec_project_id, auth_get_current_user_id()) || user_is_administrator(auth_get_current_user_id())) {
$version_string = version_full_name($version_id);
echo '<option value="' . $version_id . '">';
echo $type_string . " - " . $version_string;
echo '</option>';
}
}
}
echo '</select>';
}
示例9: menu
function menu()
{
if (plugin_config_get('show_menu')) {
require_once __DIR__ . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'wmApi.php';
$projectId = helper_get_current_project();
$userId = auth_get_current_user_id();
$userAccessLevel = user_get_access_level($userId, $projectId);
$whiteboardPlugins = wmApi::getWhiteboardPlugins();
$showMenu = false;
foreach ($whiteboardPlugins as $whiteboardPlugin) {
$pluginAccessLevel = $whiteboardPlugin[2];
if (user_is_administrator($userId) || $userAccessLevel >= $pluginAccessLevel) {
$showMenu = true;
break;
}
}
if ($showMenu) {
return '<a href="' . plugin_page('whiteboard_menu') . '">' . plugin_lang_get('menu_title') . '</a>';
}
}
return null;
}
示例10: __construct
function __construct()
{
$this->project_id = helper_get_current_project();
if (isset($_REQUEST['severity'])) {
// isset to allow empty
$this->severity = intval($_REQUEST['severity']);
$_SESSION[__CLASS__]['severity'] = $this->severity;
} else {
$this->severity = $_SESSION[__CLASS__]['severity'];
}
$versions = version_get_all_rows($this->project_id, null, null);
$this->versions = [];
foreach ($versions as $version) {
if ($_REQUEST['versions'] === $version['version']) {
// isset to allow empty
$this->versions[$version['version']] = [$version['version'], "true"];
$this->version = $version['version'];
} else {
$this->versions[$version['version']] = [$version['version'], "false"];
}
}
}
示例11: print_tbody
/**
* Print table body
* @param $status_cols
*/
function print_tbody($status_cols)
{
$storyboard_db_api = new storyboard_db_api();
$project_spec_bug_ids = $storyboard_db_api->get_bugarray_by_project(helper_get_current_project());
$types = $storyboard_db_api->select_all_types();
echo '<tbody>';
foreach ($types as $type) {
echo '<tr>';
echo '<td class="category">' . $type[1] . '</td>';
foreach ($status_cols as $status_col) {
echo '<td class="story_baord">';
foreach ($project_spec_bug_ids as $project_spec_bug_id) {
$card = $storyboard_db_api->select_story_card($project_spec_bug_id);
if ($card[2] == $type[0]) {
$bug_status = bug_get_field($project_spec_bug_id, 'status');
if ($bug_status == $status_col) {
echo '<a href="' . string_get_bug_view_url($project_spec_bug_id) . '" class="rcv_tooltip">';
echo '<div class="story_card">';
echo string_display_line(bug_format_id($project_spec_bug_id));
echo '<span>';
print_story_card_title($project_spec_bug_id);
print_story_card_info('summary', bug_get_field($project_spec_bug_id, 'summary'), false);
print_story_card_info('description', bug_get_text_field($project_spec_bug_id, 'description'), false);
print_story_card_info('card_risk', $card[3], true);
print_story_card_info('card_story_pt', $card[4], true);
print_story_card_info('card_story_pt_post', $card[5], true);
print_story_card_info('card_acc_crit', $card[6], true);
echo '</span>';
echo '</div>';
echo '</a><br/><br/><br/>';
}
}
}
echo '</td>';
}
echo '</tr>';
}
echo '</tbody>';
}
示例12: timeline_get_affected_issues
/**
* Get list of affected issues between a given time period
* @param integer $p_start_time Timestamp representing start time of the period.
* @param integer $p_end_time Timestamp representing end time of the period.
* @return array
*/
function timeline_get_affected_issues($p_start_time, $p_end_time)
{
$t_query = 'SELECT DISTINCT(bug_id) from {bug_history} WHERE date_modified >= ' . db_param() . ' AND date_modified < ' . db_param();
$t_result = db_query($t_query, array($p_start_time, $p_end_time));
$t_current_project = helper_get_current_project();
$t_all_issue_ids = array();
while (($t_row = db_fetch_array($t_result)) !== false) {
$t_all_issue_ids[] = $t_row['bug_id'];
}
bug_cache_array_rows($t_all_issue_ids);
$t_issue_ids = array();
foreach ($t_all_issue_ids as $t_issue_id) {
if ($t_current_project != ALL_PROJECTS && $t_current_project != bug_get_field($t_issue_id, 'project_id')) {
continue;
}
if (!access_has_bug_level(config_get('view_bug_threshold'), $t_issue_id)) {
continue;
}
$t_issue_ids[] = $t_issue_id;
}
return $t_issue_ids;
}
示例13: printWhiteboardMenu
/**
* print menu entrys for each plugin
*/
public static function printWhiteboardMenu()
{
$projectId = helper_get_current_project();
$userId = auth_get_current_user_id();
$userAccessLevel = user_get_access_level($userId, $projectId);
$whiteboardPlugins = self::getWhiteboardPlugins();
$whiteboardPluginCount = count($whiteboardPlugins);
echo '<div class="table">';
for ($index = 0; $index < $whiteboardPluginCount; $index++) {
$whiteboardPlugin = $whiteboardPlugins[$index];
$plugin = $whiteboardPlugin[1];
$pluginAccessLevel = $whiteboardPlugin[2];
$pluginShowMenu = $whiteboardPlugin[3];
if ((user_is_administrator($userId) || $userAccessLevel >= $pluginAccessLevel) && $pluginShowMenu == 1) {
if ($index > 0) {
echo '<div class="item"> | </div>';
}
$pluginLink = $whiteboardPlugin[4];
echo '<div class="item"><a href="' . $pluginLink . '">' . plugin_lang_get('menu_title', $plugin) . '</a></div>';
}
}
echo '</div>';
}
示例14: print_project_user_list_option_list
function print_project_user_list_option_list($p_project_id = null)
{
$t_mantis_project_user_list_table = db_get_table('mantis_project_user_list_table');
$t_mantis_user_table = db_get_table('mantis_user_table');
if (null === $p_project_id) {
$p_project_id = helper_get_current_project();
}
$c_project_id = (int) $p_project_id;
$t_adm = config_get_global('admin_site_threshold');
$query = "SELECT DISTINCT u.id, u.username, u.realname\n\t\t\t\tFROM {$t_mantis_user_table} u\n\t\t\t\tLEFT JOIN {$t_mantis_project_user_list_table} p\n\t\t\t\tON p.user_id=u.id AND p.project_id=" . db_param() . "\n\t\t\t\tWHERE u.access_level<" . db_param() . " AND\n\t\t\t\t\tu.enabled = " . db_param() . " AND\n\t\t\t\t\tp.user_id IS NULL\n\t\t\t\tORDER BY u.realname, u.username";
$result = db_query_bound($query, array($c_project_id, $t_adm, true));
$t_display = array();
$t_sort = array();
$t_users = array();
$t_show_realname = ON == config_get('show_realname');
$t_sort_by_last_name = ON == config_get('sort_by_last_name');
$category_count = db_num_rows($result);
for ($i = 0; $i < $category_count; $i++) {
$row = db_fetch_array($result);
$t_users[] = $row['id'];
$t_user_name = string_attribute($row['username']);
$t_sort_name = $t_user_name;
if (isset($row['realname']) && $row['realname'] != '' && $t_show_realname) {
$t_user_name = string_attribute($row['realname']);
if ($t_sort_by_last_name) {
$t_sort_name_bits = explode(' ', utf8_strtolower($t_user_name), 2);
$t_sort_name = (isset($t_sort_name_bits[1]) ? $t_sort_name_bits[1] . ', ' : '') . $t_sort_name_bits[0];
} else {
$t_sort_name = utf8_strtolower($t_user_name);
}
}
$t_display[] = $t_user_name;
$t_sort[] = $t_sort_name;
}
array_multisort($t_sort, SORT_ASC, SORT_STRING, $t_users, $t_display);
$t_count = count($t_sort);
for ($i = 0; $i < $t_count; $i++) {
echo '<option value="' . $t_users[$i] . '">' . $t_display[$i] . '</option>';
}
}
示例15: 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;
}