本文整理汇总了PHP中project_get_field函数的典型用法代码示例。如果您正苦于以下问题:PHP project_get_field函数的具体用法?PHP project_get_field怎么用?PHP project_get_field使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了project_get_field函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: print_version_header
/**
* Print header for the specified project version.
* @param int $p_version_id a valid version id
* @return null
*/
function print_version_header( $p_version_id ) {
$t_project_id = version_get_field( $p_version_id, 'project_id' );
$t_version_name = version_get_field( $p_version_id, 'version' );
$t_project_name = project_get_field( $t_project_id, 'name' );
$t_release_title = '<a href="changelog_page.php?project_id=' . $t_project_id . '">' . string_display_line( $t_project_name ) . '</a> - <a href="changelog_page.php?version_id=' . $p_version_id . '">' . string_display_line( $t_version_name ) . '</a>';
if ( config_get( 'show_changelog_dates' ) ) {
$t_version_released = version_get_field( $p_version_id, 'released' );
$t_release_timestamp = version_get_field( $p_version_id, 'date_order' );
if ( (bool) $t_version_released ) {
$t_release_date = ' (' . lang_get('released') . ' ' . string_display_line( date( config_get( 'short_date_format' ), $t_release_timestamp ) ) . ')';
} else {
$t_release_date = ' (' . lang_get( 'not_released' ) . ')';
}
} else {
$t_release_date = '';
}
echo '<br />', $t_release_title, $t_release_date, lang_get( 'word_separator' ), print_bracket_link( 'view_all_set.php?type=1&temporary=y&' . FILTER_PROPERTY_PROJECT_ID . '=' . $t_project_id . '&' . filter_encode_field_and_value( FILTER_PROPERTY_FIXED_IN_VERSION, $t_version_name ), lang_get( 'view_bugs_link' ) ), '<br />';
$t_release_title_without_hyperlinks = $t_project_name . ' - ' . $t_version_name . $t_release_date;
echo utf8_str_pad( '', utf8_strlen( $t_release_title_without_hyperlinks ), '=' ), '<br />';
}
示例2: print_version_header
function print_version_header($p_version_id)
{
$t_project_id = version_get_field($p_version_id, 'project_id');
$t_version_name = version_get_field($p_version_id, 'version');
$t_project_name = project_get_field($t_project_id, 'name');
$t_release_title = string_display($t_project_name) . ' - ' . string_display($t_version_name);
echo '<tt>';
echo '<br />', $t_release_title, '<br />';
echo str_pad('', strlen($t_release_title), '='), '<br />';
}
示例3: 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';
}
示例4: print_version_header
function print_version_header($p_version_id)
{
$t_project_id = version_get_field($p_version_id, 'project_id');
$t_version_name = version_get_field($p_version_id, 'version');
$t_project_name = project_get_field($t_project_id, 'name');
$t_release_title = string_display($t_project_name) . ' - ' . string_display($t_version_name);
echo $t_release_title, '<br />';
echo str_pad('', strlen($t_release_title), '='), '<br />';
$t_description = version_get_field($p_version_id, 'description');
if ($t_description !== false && !is_blank($t_description)) {
echo string_display("<br />{$t_description}<br /><br />");
}
}
示例5: print_version_header
function print_version_header($p_version_row)
{
$t_project_id = $p_version_row['project_id'];
$t_version_id = $p_version_row['id'];
$t_version_name = $p_version_row['version'];
$t_project_name = project_get_field($t_project_id, 'name');
$t_release_title = '<a href="roadmap_page.php?project_id=' . $t_project_id . '">' . string_display_line($t_project_name) . '</a> - <a href="roadmap_page.php?version_id=' . $t_version_id . '">' . string_display_line($t_version_name) . '</a>';
if (config_get('show_roadmap_dates')) {
$t_version_timestamp = $p_version_row['date_order'];
$t_scheduled_release_date = ' (' . lang_get('scheduled_release') . ' ' . string_display_line(date(config_get('short_date_format'), $t_version_timestamp)) . ')';
} else {
$t_scheduled_release_date = '';
}
echo '<tt>';
echo '<br />', $t_release_title, $t_scheduled_release_date, lang_get('word_separator'), print_bracket_link('view_all_set.php?type=1&temporary=y&' . FILTER_PROPERTY_PROJECT_ID . '=' . $t_project_id . '&' . filter_encode_field_and_value(FILTER_PROPERTY_TARGET_VERSION, $t_version_name), lang_get('view_bugs_link')), '<br />';
$t_release_title_without_hyperlinks = $t_project_name . ' - ' . $t_version_name . $t_scheduled_release_date;
echo utf8_str_pad('', utf8_strlen($t_release_title_without_hyperlinks), '='), '<br />';
}
示例6: twitter_news
function twitter_news($p_news_id)
{
if (!twitter_enabled()) {
return true;
}
$t_news_view_state = news_get_field($p_news_id, 'view_state');
if (VS_PUBLIC != $t_news_view_state) {
return true;
}
$t_news_project_id = news_get_field($p_news_id, 'project_id');
if ($t_news_project_id != ALL_PROJECTS) {
$t_project_view_state = project_get_field($t_news_project_id, 'view_state');
if (VS_PUBLIC != $t_project_view_state) {
return true;
}
}
$t_news_headline = news_get_field($p_news_id, 'headline');
return twitter_update($t_news_headline);
}
示例7: project_get_all_user_rows
function project_get_all_user_rows($p_project_id = ALL_PROJECTS, $p_access_level = ANYBODY, $p_include_global_users = true)
{
$c_project_id = db_prepare_int($p_project_id);
# Optimization when access_level is NOBODY
if (NOBODY == $p_access_level) {
return array();
}
$t_user_table = db_get_table('mantis_user_table');
$t_project_user_list_table = db_get_table('mantis_project_user_list_table');
$t_project_table = db_get_table('mantis_project_table');
$t_on = ON;
$t_users = array();
$t_global_access_level = $p_access_level;
if ($c_project_id != ALL_PROJECTS && $p_include_global_users) {
# looking for specific project
if (VS_PRIVATE == project_get_field($p_project_id, 'view_state')) {
/** @todo (thraxisp) this is probably more complex than it needs to be
* When a new project is created, those who meet 'private_project_threshold' are added
* automatically, but don't have an entry in project_user_list_table.
* if they did, you would not have to add global levels.
*/
$t_private_project_threshold = config_get('private_project_threshold');
if (is_array($t_private_project_threshold)) {
if (is_array($p_access_level)) {
# both private threshold and request are arrays, use intersection
$t_global_access_level = array_intersect($p_access_level, $t_private_project_threshold);
} else {
# private threshold is an array, but request is a number, use values in threshold higher than request
$t_global_access_level = array();
foreach ($t_private_project_threshold as $t_threshold) {
if ($p_access_level <= $t_threshold) {
$t_global_access_level[] = $t_threshold;
}
}
}
} else {
if (is_array($p_access_level)) {
// private threshold is a number, but request is an array, use values in request higher than threshold
$t_global_access_level = array();
foreach ($p_access_level as $t_threshold) {
if ($t_threshold >= $t_private_project_threshold) {
$t_global_access_level[] = $t_threshold;
}
}
} else {
// both private threshold and request are numbers, use maximum
$t_global_access_level = max($p_access_level, $t_private_project_threshold);
}
}
}
}
if (is_array($t_global_access_level)) {
if (0 == count($t_global_access_level)) {
$t_global_access_clause = '>= ' . NOBODY . ' ';
} else {
if (1 == count($t_global_access_level)) {
$t_global_access_clause = '= ' . array_shift($t_global_access_level) . ' ';
} else {
$t_global_access_clause = 'IN (' . implode(',', $t_global_access_level) . ')';
}
}
} else {
$t_global_access_clause = ">= {$t_global_access_level} ";
}
if ($p_include_global_users) {
$query = "SELECT id, username, realname, access_level\n\t\t\t\tFROM {$t_user_table}\n\t\t\t\tWHERE enabled = " . db_param() . "\n\t\t\t\t\tAND access_level {$t_global_access_clause}";
$result = db_query_bound($query, array($t_on));
$t_row_count = db_num_rows($result);
for ($i = 0; $i < $t_row_count; $i++) {
$row = db_fetch_array($result);
$t_users[$row['id']] = $row;
}
}
if ($c_project_id != ALL_PROJECTS) {
// Get the project overrides
$query = "SELECT u.id, u.username, u.realname, l.access_level\n\t\t\t\tFROM {$t_project_user_list_table} l, {$t_user_table} u\n\t\t\t\tWHERE l.user_id = u.id\n\t\t\t\tAND u.enabled = " . db_param() . "\n\t\t\t\tAND l.project_id = " . db_param();
$result = db_query_bound($query, array($t_on, $c_project_id));
$t_row_count = db_num_rows($result);
for ($i = 0; $i < $t_row_count; $i++) {
$row = db_fetch_array($result);
if (is_array($p_access_level)) {
$t_keep = in_array($row['access_level'], $p_access_level);
} else {
$t_keep = $row['access_level'] >= $p_access_level;
}
if ($t_keep) {
$t_users[$row['id']] = $row;
} else {
# If user's overridden level is lower than required, so remove
# them from the list if they were previously there
unset($t_users[$row['id']]);
}
}
}
user_cache_array_rows(array_keys($t_users));
return array_values($t_users);
}
示例8: helper_alternate_class
<tr <?php
echo helper_alternate_class();
?>
>
<!-- Bug ID -->
<td>
<?php
echo bug_format_id($f_bug_id);
?>
</td>
<!-- Category -->
<td>
<?php
$t_project_name = string_display(project_get_field($t_bug->project_id, 'name'));
echo "[{$t_project_name}] {$t_bug->category}";
?>
</td>
<!-- Severity -->
<td>
<?php
echo get_enum_element('severity', $t_bug->severity);
?>
</td>
<!-- Reproducibility -->
<td>
<?php
echo get_enum_element('reproducibility', $t_bug->reproducibility);
示例9: mc_project_update
/**
* Update a project
*
* @param string $p_username The name of the user
* @param string $p_password The password of the user
* @param integer $p_project_id A project's id
* @param Array $p_project A new ProjectData structure
* @return bool returns true or false depending on the success of the update action
*/
function mc_project_update($p_username, $p_password, $p_project_id, $p_project)
{
$t_user_id = mci_check_login($p_username, $p_password);
if ($t_user_id === false) {
return new soap_fault('Client', '', 'Access Denied', 'Username/password combination was incorrect');
}
if (!mci_has_administrator_access($t_user_id, $p_project_id)) {
return new soap_fault('Client', '', 'Access Denied', 'User does not have administrator access');
}
if (!project_exists($p_project_id)) {
return new soap_fault('Client', '', "Project '{$p_project_id}' does not exist.");
}
if (!isset($p_project['name'])) {
return new soap_fault('Client', '', 'Missing Field', 'Required Field Missing');
} else {
$t_name = $p_project['name'];
}
// check to make sure project doesn't already exist
if ($t_name != project_get_name($p_project_id)) {
if (!project_is_name_unique($t_name)) {
return new soap_fault('Client', '', 'Project name exists', 'The project name you attempted to add exists already');
}
}
if (!isset($p_project['description'])) {
$t_description = project_get_field($p_project_id, 'description');
} else {
$t_description = $p_project['description'];
}
if (!isset($p_project['status'])) {
$t_status = project_get_field($p_project_id, 'status');
} else {
$t_status = $p_project['status'];
}
if (!isset($p_project['view_state'])) {
$t_view_state = project_get_field($p_project_id, 'view_state');
} else {
$t_view_state = $p_project['view_state'];
}
if (!isset($p_project['file_path'])) {
$t_file_path = project_get_field($p_project_id, 'file_path');
} else {
$t_file_path = $p_project['file_path'];
}
if (!isset($p_project['enabled'])) {
$t_enabled = project_get_field($p_project_id, 'enabled');
} else {
$t_enabled = $p_project['enabled'];
}
if (!isset($p_project['inherit_global'])) {
$t_inherit_global = project_get_field($p_project_id, 'inherit_global');
} else {
$t_inherit_global = $p_project['inherit_global'];
}
$t_project_status = mci_get_project_status_id($t_status);
$t_project_view_state = mci_get_project_view_state_id($t_view_state);
return project_update($p_project_id, $t_name, $t_description, $t_project_status, $t_project_view_state, $t_file_path, $t_enabled, $t_inherit_global);
}
示例10: mc_project_update
/**
* Update a project
*
* @param string $p_username The name of the user.
* @param string $p_password The password of the user.
* @param integer $p_project_id A project's identifier.
* @param stdClass $p_project A new ProjectData structure.
* @return boolean returns true or false depending on the success of the update action
*/
function mc_project_update($p_username, $p_password, $p_project_id, stdClass $p_project)
{
global $g_project_override;
$t_user_id = mci_check_login($p_username, $p_password);
if ($t_user_id === false) {
return mci_soap_fault_access_denied();
}
if (!mci_has_administrator_access($t_user_id, $p_project_id)) {
return mci_soap_fault_access_denied($t_user_id);
}
if (!project_exists($p_project_id)) {
return SoapObjectsFactory::newSoapFault('Client', 'Project \'' . $p_project_id . '\' does not exist.');
}
$g_project_override = $p_project_id;
$p_project = SoapObjectsFactory::unwrapObject($p_project);
if (!isset($p_project['name'])) {
return SoapObjectsFactory::newSoapFault('Client', 'Missing required field \'name\'.');
} else {
$t_name = $p_project['name'];
}
# check to make sure project doesn't already exist
if ($t_name != project_get_name($p_project_id)) {
if (!project_is_name_unique($t_name)) {
return SoapObjectsFactory::newSoapFault('Client', 'Project name exists');
}
}
if (!isset($p_project['description'])) {
$t_description = project_get_field($p_project_id, 'description');
} else {
$t_description = $p_project['description'];
}
if (!isset($p_project['status'])) {
$t_status = project_get_field($p_project_id, 'status');
} else {
$t_status = $p_project['status'];
}
if (!isset($p_project['view_state'])) {
$t_view_state = project_get_field($p_project_id, 'view_state');
} else {
$t_view_state = $p_project['view_state'];
}
if (!isset($p_project['file_path'])) {
$t_file_path = project_get_field($p_project_id, 'file_path');
} else {
$t_file_path = $p_project['file_path'];
}
if (!isset($p_project['enabled'])) {
$t_enabled = project_get_field($p_project_id, 'enabled');
} else {
$t_enabled = $p_project['enabled'];
}
if (!isset($p_project['inherit_global'])) {
$t_inherit_global = project_get_field($p_project_id, 'inherit_global');
} else {
$t_inherit_global = $p_project['inherit_global'];
}
$t_project_status = mci_get_project_status_id($t_status);
$t_project_view_state = mci_get_project_view_state_id($t_view_state);
project_update($p_project_id, $t_name, $t_description, $t_project_status, $t_project_view_state, $t_file_path, $t_enabled, $t_inherit_global);
return true;
}
示例11: UNIX_TIMESTAMP
# Select the faq posts
$query = "SELECT *, UNIX_TIMESTAMP(date_posted) as date_posted\n\t\t\tFROM {$g_mantis_worklog_table}\n\t\t\tWHERE id='{$f_id}'";
$result = db_query_bound($query);
$worklog_count = db_num_rows($result);
# Loop through results
for ($i = 0; $i < $worklog_count; $i++) {
$row = db_fetch_array($result);
extract($row, EXTR_PREFIX_ALL, "v");
$v_headline = string_display($v_headline);
$v_content = string_display_links($v_content);
$v_date_posted = date($g_normal_date_format, $v_date_posted);
$t_poster_name = user_get_name($v_poster_id);
$t_poster_email = user_get_email($v_poster_id);
$t_project_name = " ";
if ($v_project_id != 0) {
$t_project_name = project_get_field($v_project_id, "name");
}
?>
<p>
<div align="center">
<table class="width75" cellspacing="0">
<tr>
<td class="worklog-heading">
<span class="worklog-subject"><?php
echo '[' . worklog_type_display($v_log_type) . ']' . $v_subject;
?>
</span> -
<span class="worklog-date"><?php
echo $v_date_posted;
?>
</span> -
示例12: event_signal
event_signal('EVENT_REPORT_BUG_FORM_TOP', array($t_project_id));
if ($t_show_category) {
?>
<tr>
<th class="category" width="30%">
<?php
echo config_get('allow_no_category') ? '' : '<span class="required">*</span>';
echo '<label for="category_id">';
print_documentation_link('category');
echo '</label>';
?>
</th>
<td width="70%">
<?php
if ($t_changed_project) {
echo '[' . project_get_field($t_bug->project_id, 'name') . '] ';
}
?>
<select <?php
echo helper_get_tab_index();
?>
id="category_id" name="category_id" class="autofocus">
<?php
print_category_option_list($f_category_id);
?>
</select>
</td>
</tr>
<?php
}
if ($t_show_reproducibility) {
示例13: print_custom_field_projects_list
function print_custom_field_projects_list($p_field_id)
{
$c_field_id = (int) $p_field_id;
$t_project_ids = custom_field_get_project_ids($p_field_id);
$t_security_token = form_security_param('manage_proj_custom_field_remove');
foreach ($t_project_ids as $t_project_id) {
$t_project_name = project_get_field($t_project_id, 'name');
$t_sequence = custom_field_get_sequence($p_field_id, $t_project_id);
echo '<strong>', string_display_line($t_project_name), '</strong>: ';
print_bracket_link("manage_proj_custom_field_remove.php?field_id={$c_field_id}&project_id={$t_project_id}&return=custom_field{$t_security_token}", lang_get('remove_link'));
echo '<br />- ';
$t_linked_field_ids = custom_field_get_linked_ids($t_project_id);
$t_current_project_fields = array();
$t_first = true;
foreach ($t_linked_field_ids as $t_current_field_id) {
if ($t_first) {
$t_first = false;
} else {
echo ', ';
}
if ($t_current_field_id == $p_field_id) {
echo '<em>';
}
echo string_display_line(custom_field_get_field($t_current_field_id, 'name'));
echo ' (', custom_field_get_sequence($t_current_field_id, $t_project_id), ')';
if ($t_current_field_id == $p_field_id) {
echo '</em>';
}
}
echo '<br /><br />';
}
}
示例14: print_column_category
function print_column_category($p_row, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE)
{
global $t_sort, $t_dir;
# grab the project name
$t_project_name = project_get_field($p_row['project_id'], 'name');
echo '<td class="center">';
# type project name if viewing 'all projects' or if issue is in a subproject
if (ON == config_get('show_bug_project_links') && helper_get_current_project() != $p_row['project_id']) {
echo '<small>[';
print_view_bug_sort_link($t_project_name, 'project_id', $t_sort, $t_dir, $p_columns_target);
echo ']</small><br />';
}
echo string_display($p_row['category']);
echo '</td>';
}
示例15: helper_get_default_export_filename
function helper_get_default_export_filename($p_extension_with_dot, $p_prefix = '', $p_suffix = '')
{
$t_filename = $p_prefix;
$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 . $p_suffix . $p_extension_with_dot;
}