• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP project_exists函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: project_ensure_exists

function project_ensure_exists($p_project_id)
{
    if (!project_exists($p_project_id)) {
        error_parameters($p_project_id);
        trigger_error(ERROR_PROJECT_NOT_FOUND, ERROR);
    }
}
开发者ID:Kirill,项目名称:mantisbt,代码行数:7,代码来源:project_api.php


示例2: config_get

}
# Manage filter's persistency through cookie
$t_cookie_name = config_get('manage_config_cookie');
if ($t_filter_save) {
    # Save user's filter to the cookie
    $t_cookie_string = implode(':', array($t_filter_user_value, $t_filter_project_value, $t_filter_config_value));
    gpc_set_cookie($t_cookie_name, $t_cookie_string, true);
} else {
    # Retrieve the filter from the cookie if it exists
    $t_cookie_string = gpc_get_cookie($t_cookie_name, null);
    if (null !== $t_cookie_string) {
        $t_cookie_contents = explode(':', $t_cookie_string);
        $t_filter_user_value = $t_cookie_contents[0];
        $t_filter_project_value = $t_cookie_contents[1];
        $t_filter_config_value = check_config_value($t_cookie_contents[2]);
        if ($t_filter_project_value != META_FILTER_NONE && !project_exists($t_filter_project_value)) {
            $t_filter_project_value = ALL_PROJECTS;
        }
    }
}
# Get config edit values
$t_edit_user_id = gpc_get_int('user_id', $t_filter_user_value == META_FILTER_NONE ? ALL_USERS : $t_filter_user_value);
$t_edit_project_id = gpc_get_int('project_id', $t_filter_project_value == META_FILTER_NONE ? ALL_PROJECTS : $t_filter_project_value);
$t_edit_option = gpc_get_string('config_option', $t_filter_config_value == META_FILTER_NONE ? '' : $t_filter_config_value);
$t_edit_type = gpc_get_string('type', CONFIG_TYPE_DEFAULT);
$t_edit_value = gpc_get_string('value', '');
# Apply filters
# Get users in db having specific configs
$t_query = 'SELECT DISTINCT user_id FROM {config} WHERE user_id <> ' . db_param();
$t_result = db_query($t_query, array(ALL_USERS));
if ($t_filter_user_value != META_FILTER_NONE && $t_filter_user_value != ALL_USERS) {
开发者ID:sfranks1124,项目名称:mantisbt,代码行数:31,代码来源:adm_config_report.php


示例3: helper_get_current_project_trace

/**
 * Return the current project id as stored in a cookie, in an Array
 * If no cookie exists, the user's default project is returned
 * If the current project is a subproject, the return value will include
 * any parent projects
 * @return array
 */
function helper_get_current_project_trace()
{
    $t_cookie_name = config_get('project_cookie');
    $t_project_id = gpc_get_cookie($t_cookie_name, null);
    if (null === $t_project_id) {
        $t_bottom = current_user_get_pref('default_project');
        $t_parent = $t_bottom;
        $t_project_id = array($t_bottom);
        while (true) {
            $t_parent = project_hierarchy_get_parent($t_parent);
            if (0 == $t_parent) {
                break;
            }
            array_unshift($t_project_id, $t_parent);
        }
    } else {
        $t_project_id = explode(';', $t_project_id);
        $t_bottom = $t_project_id[count($t_project_id) - 1];
    }
    if (!project_exists($t_bottom) || 0 == project_get_field($t_bottom, 'enabled') || !access_has_project_level(VIEWER, $t_bottom)) {
        $t_project_id = array(ALL_PROJECTS);
    }
    return $t_project_id;
}
开发者ID:nextgens,项目名称:mantisbt,代码行数:31,代码来源:helper_api.php


示例4: history_localize_item

/**
 * Localizes one raw history item specified by set the next parameters: $p_field_name, $p_type, $p_old_value, $p_new_value
 * Returns array with two elements indexed as 'note' and 'change'
 * @param string  $p_field_name The field name of the field being localized.
 * @param integer $p_type       The type of the history entry.
 * @param string  $p_old_value  The old value of the field.
 * @param string  $p_new_value  The new value of the field.
 * @param boolean $p_linkify    Whether to return a string containing hyperlinks.
 * @return array
 */
function history_localize_item($p_field_name, $p_type, $p_old_value, $p_new_value, $p_linkify = true)
{
    $t_note = '';
    $t_change = '';
    $t_field_localized = $p_field_name;
    $t_raw = true;
    if (PLUGIN_HISTORY == $p_type) {
        $t_note = lang_get_defaulted('plugin_' . $p_field_name, $p_field_name);
        $t_change = isset($p_new_value) ? $p_old_value . ' => ' . $p_new_value : $p_old_value;
        return array('note' => $t_note, 'change' => $t_change, 'raw' => true);
    }
    switch ($p_field_name) {
        case 'category':
            $t_field_localized = lang_get('category');
            break;
        case 'status':
            $p_old_value = get_enum_element('status', $p_old_value);
            $p_new_value = get_enum_element('status', $p_new_value);
            $t_field_localized = lang_get('status');
            break;
        case 'severity':
            $p_old_value = get_enum_element('severity', $p_old_value);
            $p_new_value = get_enum_element('severity', $p_new_value);
            $t_field_localized = lang_get('severity');
            break;
        case 'reproducibility':
            $p_old_value = get_enum_element('reproducibility', $p_old_value);
            $p_new_value = get_enum_element('reproducibility', $p_new_value);
            $t_field_localized = lang_get('reproducibility');
            break;
        case 'resolution':
            $p_old_value = get_enum_element('resolution', $p_old_value);
            $p_new_value = get_enum_element('resolution', $p_new_value);
            $t_field_localized = lang_get('resolution');
            break;
        case 'priority':
            $p_old_value = get_enum_element('priority', $p_old_value);
            $p_new_value = get_enum_element('priority', $p_new_value);
            $t_field_localized = lang_get('priority');
            break;
        case 'eta':
            $p_old_value = get_enum_element('eta', $p_old_value);
            $p_new_value = get_enum_element('eta', $p_new_value);
            $t_field_localized = lang_get('eta');
            break;
        case 'view_state':
            $p_old_value = get_enum_element('view_state', $p_old_value);
            $p_new_value = get_enum_element('view_state', $p_new_value);
            $t_field_localized = lang_get('view_status');
            break;
        case 'projection':
            $p_old_value = get_enum_element('projection', $p_old_value);
            $p_new_value = get_enum_element('projection', $p_new_value);
            $t_field_localized = lang_get('projection');
            break;
        case 'sticky':
            $p_old_value = gpc_string_to_bool($p_old_value) ? lang_get('yes') : lang_get('no');
            $p_new_value = gpc_string_to_bool($p_new_value) ? lang_get('yes') : lang_get('no');
            $t_field_localized = lang_get('sticky_issue');
            break;
        case 'project_id':
            if (project_exists($p_old_value)) {
                $p_old_value = project_get_field($p_old_value, 'name');
            } else {
                $p_old_value = '@' . $p_old_value . '@';
            }
            # Note that the new value maybe an intermediately project and not the
            # current one.
            if (project_exists($p_new_value)) {
                $p_new_value = project_get_field($p_new_value, 'name');
            } else {
                $p_new_value = '@' . $p_new_value . '@';
            }
            $t_field_localized = lang_get('email_project');
            break;
        case 'handler_id':
            $t_field_localized = lang_get('assigned_to');
        case 'reporter_id':
            if ('reporter_id' == $p_field_name) {
                $t_field_localized = lang_get('reporter');
            }
            if (0 == $p_old_value) {
                $p_old_value = '';
            } else {
                $p_old_value = user_get_name($p_old_value);
            }
            if (0 == $p_new_value) {
                $p_new_value = '';
            } else {
                $p_new_value = user_get_name($p_new_value);
//.........这里部分代码省略.........
开发者ID:gtn,项目名称:mantisbt,代码行数:101,代码来源:history_api.php


示例5: news_ensure_enabled

 */
/**
 * MantisBT Core API's
 */
require_once 'core.php';
require_once 'news_api.php';
require_once 'string_api.php';
news_ensure_enabled();
$f_news_id = gpc_get_int('news_id');
$f_action = gpc_get_string('action', '');
# If deleting item redirect to delete script
if ('delete' == $f_action) {
    form_security_validate('news_delete');
    $row = news_get_row($f_news_id);
    # This check is to allow deleting of news items that were left orphan due to bug #3723
    if (project_exists($row['project_id'])) {
        access_ensure_project_level(config_get('manage_news_threshold'), $row['project_id']);
    }
    helper_ensure_confirmed(lang_get('delete_news_sure_msg'), lang_get('delete_news_item_button'));
    news_delete($f_news_id);
    form_security_purge('news_delete');
    print_header_redirect('news_menu_page.php', true);
}
# Retrieve news item data and prefix with v_
$row = news_get_row($f_news_id);
if ($row) {
    extract($row, EXTR_PREFIX_ALL, 'v');
}
access_ensure_project_level(config_get('manage_news_threshold'), $v_project_id);
$v_headline = string_attribute($v_headline);
$v_body = string_textarea($v_body);
开发者ID:Tarendai,项目名称:spring-website,代码行数:31,代码来源:news_edit_page.php


示例6:

}
if (isset($_GET['cat'])) {
    echo '&cat=' . $_GET['cat'];
}
if (isset($_GET['pio'])) {
    echo '&pio=' . $_GET['pio'];
}
echo '\';">x</div>';
if (isset($_POST['submit'])) {
    if ($_POST['select'] == "uplpro" && $_POST['proname'] == "") {
        $error[] = 'Du hast keinen Projektnamen eingegeben!';
    }
    if ($_POST['select'] == "uplpro" && $_POST['procat'] == "") {
        $error[] = 'Du hast keine Projektkategorie ausgewählt!';
    }
    if ($_POST['select'] == "uplpro" && !project_exists($_POST['proname'])) {
        $error[] = 'Der Projektname ist bereits vorhanden!';
    }
    if ($_POST['select'] != "uplpro" && $_POST['title'] == "") {
        $error[] = 'Du hast keinen Titel eingetragen!';
    }
    if ($_POST['select'] == "uplsin" && $_POST['descr'] == "") {
        $error[] = 'Du hast keine Beschreibung eingegeben!';
    }
    if ($_POST['select'] == "uplsin" && $_POST['type'] == "") {
        $error[] = 'Du hast keinen Typ angegeben!';
    }
    if ($_POST['select'] == "uplscr" && $_POST['script'] == "") {
        $error[] = 'Du hast keinen Text eingegeben!';
    }
    if ($_POST['select'] == "uplav" && $_POST['mtype'] == "") {
开发者ID:Therealleft,项目名称:CMS-Project-2011,代码行数:31,代码来源:upload.php


示例7: process_mailbox

 public function process_mailbox($p_mailbox)
 {
     $this->_mailbox = $p_mailbox + ERP_get_default_mailbox();
     if ($this->_functionality_enabled) {
         if ($this->_mailbox['enabled']) {
             // Check whether EmailReporting supports the mailbox type. The check is based on available default ports
             if (isset($this->_default_ports[$this->_mailbox['mailbox_type']])) {
                 if (project_exists($this->_mailbox['project_id'])) {
                     if (category_exists($this->_mailbox['global_category_id'])) {
                         $t_upload_folder_passed = TRUE;
                         if ($this->_allow_file_upload && $this->_file_upload_method == DISK) {
                             $t_upload_folder_passed = FALSE;
                             $t_file_path = project_get_field($this->_mailbox['project_id'], 'file_path');
                             if ($t_file_path == '') {
                                 $t_file_path = config_get('absolute_path_default_upload_folder');
                             }
                             $t_file_path = ERP_prepare_directory_string($t_file_path, TRUE);
                             $t_real_file_path = ERP_prepare_directory_string($t_file_path);
                             if (!file_exists($t_file_path) || !is_dir($t_file_path) || !is_writable($t_file_path) || !is_readable($t_file_path)) {
                                 $this->custom_error('Upload folder is not writable: ' . $t_file_path . "\n");
                             } elseif (strcasecmp($t_real_file_path, $t_file_path) !== 0) {
                                 $this->custom_error('Upload folder is not an absolute path' . "\n" . 'Upload folder: ' . $t_file_path . "\n" . 'Absolute path: ' . $t_real_file_path . "\n");
                             } else {
                                 $t_upload_folder_passed = TRUE;
                             }
                         }
                         if ($t_upload_folder_passed) {
                             $this->prepare_mailbox_hostname();
                             if (!$this->_test_only && $this->_mail_debug) {
                                 var_dump($this->_mailbox);
                             }
                             $this->show_memory_usage('Start process mailbox');
                             $t_process_mailbox_function = 'process_' . strtolower($this->_mailbox['mailbox_type']) . '_mailbox';
                             $this->{$t_process_mailbox_function}();
                             $this->show_memory_usage('Finished process mailbox');
                         }
                     } else {
                         $this->custom_error('Category does not exist');
                     }
                 } else {
                     $this->custom_error('Project does not exist');
                 }
             } else {
                 $this->custom_error('Unknown mailbox type');
             }
         } else {
             $this->custom_error('Mailbox disabled');
         }
     }
     return $this->_result;
 }
开发者ID:JeromyK,项目名称:EmailReporting,代码行数:51,代码来源:mail_api.php


示例8: helper_get_current_project_trace

function helper_get_current_project_trace()
{
    $t_cookie_name = config_get('project_cookie');
    $t_project_id = gpc_get_cookie($t_cookie_name, null);
    if (null === $t_project_id) {
        $t_bottom = current_user_get_pref('default_project');
        $t_project_id = array($t_bottom);
    } else {
        $t_project_id = split(';', $t_project_id);
        $t_bottom = $t_project_id[count($t_project_id) - 1];
    }
    if (!project_exists($t_bottom) || 0 == project_get_field($t_bottom, 'enabled') || !access_has_project_level(VIEWER, $t_bottom)) {
        $t_project_id = array(ALL_PROJECTS);
    }
    return $t_project_id;
}
开发者ID:amjadtbssm,项目名称:website,代码行数:16,代码来源:helper_api.php


示例9: mc_issue_update

/**
 * Update Issue in database
 *
 * Created By KGB
 * @param string $p_username The name of the user trying to add the issue.
 * @param string $p_password The password of the user.
 * @param Array $p_issue A IssueData structure containing information about the new issue.
 * @return integer The id of the created issue.
 */
function mc_issue_update($p_username, $p_password, $p_issue_id, $p_issue)
{
    $t_user_id = mci_check_login($p_username, $p_password);
    if ($t_user_id === false) {
        return new soap_fault('Client', '', 'Access Denied');
    }
    if (!bug_exists($p_issue_id)) {
        return new soap_fault('Server', '', "Issue '{$p_issue_id}' does not exist.");
    }
    $t_project_id = bug_get_field($p_issue_id, 'project_id');
    if (!mci_has_readwrite_access($t_user_id, $t_project_id)) {
        return new soap_fault('Client', '', 'Access Denied');
    }
    extract($p_issue, EXTR_PREFIX_ALL, 'v');
    $t_project_id = mci_get_project_id($v_project);
    $t_handler_id = mci_get_user_id($v_handler);
    $t_priority_id = mci_get_priority_id($v_priority);
    $t_severity_id = mci_get_severity_id($v_severity);
    $t_status_id = mci_get_status_id($v_status);
    $t_reproducibility_id = mci_get_reproducibility_id($v_reproducibility);
    $t_resolution_id = mci_get_resolution_id($v_resolution);
    $t_projection_id = mci_get_projection_id($v_projection);
    $t_eta_id = mci_get_eta_id($v_eta);
    $t_view_state_id = mci_get_view_state_id($v_view_state);
    $t_reporter_id = mci_get_user_id($v_reporter);
    if ($t_reporter_id == 0) {
        $t_reporter_id = $t_user_id;
    }
    if ($t_project_id == 0 || !project_exists($t_project_id)) {
        if ($t_project_id == 0) {
            return new soap_fault('Client', '', "Project '" . $v_project['name'] . "' does not exist.");
        } else {
            return new soap_fault('Client', '', "Project '{$t_project_id}' does not exist.");
        }
    }
    if (!access_has_bug_level(config_get('update_bug_threshold'), $p_issue_id, $t_user_id)) {
        return new soap_fault('Client', '', "User '{$t_user_id}' does not have access right to report issues.");
    }
    if ($t_handler_id != 0 && !user_exists($t_handler_id)) {
        return new soap_fault('Client', '', "User '{$t_handler_id}' does not exist.");
    }
    if (!in_array($v_category, mci_category_get_all_rows($t_project_id, $t_user_id))) {
        $t_error_when_category_not_found = config_get('mc_error_when_category_not_found');
        if ($t_error_when_category_not_found == ON) {
            if (is_blank($v_category) && count(category_get_all_rows($t_project_id)) == 0) {
                $v_category = '';
                // it is ok to have category as empty if project has no categories
            } else {
                return new soap_fault('Client', '', "Category '{$v_category}' does not exist in project '{$t_project_id}'.");
            }
        } else {
            $t_category_when_not_found = config_get('mc_category_when_not_found');
            $v_category = $t_category_when_not_found;
        }
    }
    if (isset($v_version) && !is_blank($v_version) && !version_get_id($v_version, $t_project_id)) {
        $t_error_when_version_not_found = config_get('mc_error_when_version_not_found');
        if ($t_error_when_version_not_found == ON) {
            $t_project_name = project_get_name($t_project_id);
            return new soap_fault('Client', '', "Version '{$v_version}' does not exist in project '{$t_project_name}'.");
        } else {
            $t_version_when_not_found = config_get('mc_version_when_not_found');
            $v_version = $t_version_when_not_found;
        }
    }
    if (is_blank($v_summary)) {
        return new soap_fault('Client', '', "Mandatory field 'summary' is missing.");
    }
    if (is_blank($v_description)) {
        return new soap_fault('Client', '', "Mandatory field 'description' is missing.");
    }
    if ($v_priority == 0) {
        $v_priority = config_get('default_bug_priority');
    }
    if ($v_severity == 0) {
        $v_severity = config_get('default_bug_severity');
    }
    if ($v_view_state == 0) {
        $v_view_state = config_get('default_bug_view_status');
    }
    if ($v_reproducibility == 0) {
        $v_reproducibility = 10;
    }
    $t_bug_data = new BugData();
    $t_bug_data->project_id = $t_project_id;
    $t_bug_data->reporter_id = $t_reporter_id;
    $t_bug_data->handler_id = $t_handler_id;
    $t_bug_data->priority = $t_priority_id;
    $t_bug_data->severity = $t_severity_id;
    $t_bug_data->reproducibility = $t_reproducibility_id;
    $t_bug_data->status = $t_status_id;
//.........这里部分代码省略.........
开发者ID:jin255ff,项目名称:company_website,代码行数:101,代码来源:mc_issue_api.php


示例10: history_localize_item

function history_localize_item($p_field_name, $p_type, $p_old_value, $p_new_value)
{
    $t_note = '';
    $t_change = '';
    $t_field_localized = $p_field_name;
    switch ($p_field_name) {
        case 'category':
            $t_field_localized = lang_get('category');
            break;
        case 'status':
            $p_old_value = get_enum_element('status', $p_old_value);
            $p_new_value = get_enum_element('status', $p_new_value);
            $t_field_localized = lang_get('status');
            break;
        case 'severity':
            $p_old_value = get_enum_element('severity', $p_old_value);
            $p_new_value = get_enum_element('severity', $p_new_value);
            $t_field_localized = lang_get('severity');
            break;
        case 'reproducibility':
            $p_old_value = get_enum_element('reproducibility', $p_old_value);
            $p_new_value = get_enum_element('reproducibility', $p_new_value);
            $t_field_localized = lang_get('reproducibility');
            break;
        case 'resolution':
            $p_old_value = get_enum_element('resolution', $p_old_value);
            $p_new_value = get_enum_element('resolution', $p_new_value);
            $t_field_localized = lang_get('resolution');
            break;
        case 'priority':
            $p_old_value = get_enum_element('priority', $p_old_value);
            $p_new_value = get_enum_element('priority', $p_new_value);
            $t_field_localized = lang_get('priority');
            break;
        case 'eta':
            $p_old_value = get_enum_element('eta', $p_old_value);
            $p_new_value = get_enum_element('eta', $p_new_value);
            $t_field_localized = lang_get('eta');
            break;
        case 'view_state':
            $p_old_value = get_enum_element('view_state', $p_old_value);
            $p_new_value = get_enum_element('view_state', $p_new_value);
            $t_field_localized = lang_get('view_status');
            break;
        case 'projection':
            $p_old_value = get_enum_element('projection', $p_old_value);
            $p_new_value = get_enum_element('projection', $p_new_value);
            $t_field_localized = lang_get('projection');
            break;
        case 'sticky':
            $p_old_value = gpc_string_to_bool($p_old_value) ? lang_get('yes') : lang_get('no');
            $p_new_value = gpc_string_to_bool($p_new_value) ? lang_get('yes') : lang_get('no');
            $t_field_localized = lang_get('sticky_issue');
            break;
        case 'project_id':
            if (project_exists($p_old_value)) {
                $p_old_value = project_get_field($p_old_value, 'name');
            } else {
                $p_old_value = '@' . $p_old_value . '@';
            }
            # Note that the new value maybe an intermediately project and not the
            # current one.
            if (project_exists($p_new_value)) {
                $p_new_value = project_get_field($p_new_value, 'name');
            } else {
                $p_new_value = '@' . $p_new_value . '@';
            }
            $t_field_localized = lang_get('email_project');
            break;
        case 'handler_id':
            $t_field_localized = lang_get('assigned_to');
        case 'reporter_id':
            if ('reporter_id' == $p_field_name) {
                $t_field_localized = lang_get('reporter');
            }
            if (0 == $p_old_value) {
                $p_old_value = '';
            } else {
                $p_old_value = user_get_name($p_old_value);
            }
            if (0 == $p_new_value) {
                $p_new_value = '';
            } else {
                $p_new_value = user_get_name($p_new_value);
            }
            break;
        case 'fixed_in_version':
            $t_field_localized = lang_get('fixed_in_version');
            break;
        case 'date_submitted':
            $t_field_localized = lang_get('date_submitted');
            break;
        case 'last_updated':
            $t_field_localized = lang_get('last_update');
            break;
        case 'summary':
            $t_field_localized = lang_get('summary');
            break;
        case 'duplicate_id':
            $t_field_localized = lang_get('duplicate_id');
//.........这里部分代码省略.........
开发者ID:centaurustech,项目名称:BenFund,代码行数:101,代码来源:history_api.php


示例11: helper_get_current_project

    $f_description = $t_bug->description;
    $f_steps_to_reproduce = $t_bug->steps_to_reproduce;
    $f_additional_info = $t_bug->additional_information;
    $f_view_state = (int) $t_bug->view_state;
    $f_due_date = $t_bug->due_date;
    $t_project_id = $t_bug->project_id;
} else {
    # Get Project Id and set it as current
    $t_current_project = helper_get_current_project();
    $t_project_id = gpc_get_int('project_id', $t_current_project);
    # If all projects, use default project if set
    $t_default_project = user_pref_get_pref(auth_get_current_user_id(), 'default_project');
    if (ALL_PROJECTS == $t_project_id && ALL_PROJECTS != $t_default_project) {
        $t_project_id = $t_default_project;
    }
    if ((ALL_PROJECTS == $t_project_id || project_exists($t_project_id)) && $t_project_id != $t_current_project && project_enabled($t_project_id)) {
        helper_set_current_project($t_project_id);
        # Reloading the page is required so that the project browser
        # reflects the new current project
        print_header_redirect($_SERVER['REQUEST_URI'], true, false, true);
    }
    # New issues cannot be reported for the 'All Project' selection
    if (ALL_PROJECTS == $t_current_project) {
        print_header_redirect('login_select_proj_page.php?ref=bug_report_page.php');
    }
    access_ensure_project_level(config_get('report_bug_threshold'));
    $f_build = gpc_get_string('build', '');
    $f_platform = gpc_get_string('platform', '');
    $f_os = gpc_get_string('os', '');
    $f_os_build = gpc_get_string('os_build', '');
    $f_product_version = gpc_get_string('product_version', '');
开发者ID:spring,项目名称:spring-website,代码行数:31,代码来源:bug_report_page.php


示例12: helper_get_current_project

	$f_view_state			= (int)$t_bug->view_state;
	$f_due_date				= $t_bug->due_date;

	$t_project_id			= $t_bug->project_id;
} else {
	# Get Project Id and set it as current
	$t_current_project = helper_get_current_project();
	$t_project_id = gpc_get_int( 'project_id', $t_current_project );

	# If all projects, use default project if set
	$t_default_project = user_pref_get_pref( auth_get_current_user_id(), 'default_project' );
	if( ALL_PROJECTS == $t_project_id && ALL_PROJECTS != $t_default_project ) {
		$t_project_id = $t_default_project;
	}

	if( ( ALL_PROJECTS == $t_project_id || project_exists( $t_project_id ) )
	 && $t_project_id != $t_current_project
	) {
		helper_set_current_project( $t_project_id );
		# Reloading the page is required so that the project browser
		# reflects the new current project
		print_header_redirect( $_SERVER['REQUEST_URI'], true, false, true );
	}

	# New issues cannot be reported for the 'All Project' selection
	if( ALL_PROJECTS == $t_current_project ) {
		print_header_redirect( 'login_select_proj_page.php?ref=bug_report_page.php' );
	}

	access_ensure_project_level( config_get( 'report_bug_threshold' ) );
开发者ID:01-Scripts,项目名称:mantisbt,代码行数:30,代码来源:bug_report_page.php


示例13: display_document_header

    display_document_header();
    display_menu();
    display_no_auth();
    display_document_footer();
    exit;
}
if (!isset($_POST['project_name']) || !isset($_POST['ocp_id'])) {
    header('location: create_project_form.php');
    exit;
}
$_POST['project_name'] = trim($_POST['project_name']);
if (empty($_POST['project_name']) || empty($_POST['ocp_id'])) {
    display_warning('Wype³nij poprawnie formularz!');
    exit;
} else {
    if (project_exists($_POST['project_name'])) {
        display_warning('Projekt o nazwie ' . htmlspecialchars(stripslashes($_POST['project_name'])) . ' ju¿ istnieje!');
        exit;
    }
}
if (isset($_POST['confirmed'])) {
    if (!insert_project($_POST['project_name'], $_POST['ocp_id'])) {
        display_warning('Utworzenie projektu zakoñczone niepowodzeniem!');
        exit;
    }
    $orgs = str_replace("\r", '', $_POST['orgs']);
    $orgs = explode("\n", $orgs);
    $new_orgs = get_new_orgs($orgs);
    if (!insert_new_orgs($new_orgs)) {
        display_warning('Dodanie nowych organizacji zakoñczone niepowodzeniem!');
        exit;
开发者ID:exviva,项目名称:flip,代码行数:31,代码来源:create_project.php


示例14: mc_project_get_issue_headers

function mc_project_get_issue_headers($p_username, $p_password, $p_project_id, $p_page_number, $p_per_page)
{
    $t_user_id = mci_check_login($p_username, $p_password);
    if ($t_user_id === false) {
        return mci_soap_fault_login_failed();
    }
    if (!project_exists($p_project_id)) {
        return new soap_fault('Client', '', "Project '{$p_project_id}' does not exist.");
    }
    if (!mci_has_readonly_access($t_user_id, $p_project_id)) {
        return mci_soap_fault_access_denied($t_user_id);
    }
    $t_page_count = 0;
    $t_bug_count = 0;
    $t_rows = filter_get_bug_rows($p_page_number, $p_per_page, $t_page_count, $t_bug_count, null, $p_project_id);
    $t_result = array();
    foreach ($t_rows as $t_issue_data) {
        $t_id = $t_issue_data->id;
        $t_issue = array();
        $t_issue['id'] = $t_id;
        $t_issue['view_state'] = $t_issue_data->view_state;
        $t_issue['last_updated'] = timestamp_to_iso8601($t_issue_data->last_updated);
        $t_issue['project'] = $t_issue_data->project_id;
        $t_issue['category'] = mci_get_category($t_issue_data->category_id);
        $t_issue['priority'] = $t_issue_data->priority;
        $t_issue['severity'] = $t_issue_data->severity;
        $t_issue['status'] = $t_issue_data->status;
        $t_issue['reporter'] = $t_issue_data->reporter_id;
        $t_issue['summary'] = $t_issue_data->summary;
        if (!empty($t_issue_data->handler_id)) {
            $t_issue['handler'] = $t_issue_data->handler_id;
        }
        $t_issue['resolution'] = $t_issue_data->resolution;
        $t_issue['attachments_count'] = count(mci_issue_get_attachments($t_issue_data->id));
        $t_issue['notes_count'] = count(mci_issue_get_notes($t_issue_data->id));
        $t_result[] = $t_issue;
    }
    return $t_result;
}
开发者ID:kaos,项目名称:mantisbt,代码行数:39,代码来源:mc_project_api.php


示例15: mc_issue_update

/**
 * Update Issue in database
 *
 * Created By KGB
 * @param string $p_username The name of the user trying to add the issue.
 * @param string $p_password The password of the user.
 * @param Array $p_issue A IssueData structure containing information about the new issue.
 * @return integer The id of the created issue.
 */
function mc_issue_update( $p_username, $p_password, $p_issue_id, $p_issue ) {
	global $g_project_override;
	
	$t_user_id = mci_check_login( $p_username, $p_password );
	if( $t_user_id === false ) {
		return mci_soap_fault_login_failed();
	}

	if( !bug_exists( $p_issue_id ) ) {
		return new soap_fault( 'Client', '', "Issue '$p_issue_id' does not exist." );
	}

	$t_project_id = bug_get_field( $p_issue_id, 'project_id' );

	if( !mci_has_readwrite_access( $t_user_id, $t_project_id ) ) {
		return mci_soap_fault_access_denied( $t_user_id );
	}
	
	$g_project_override = $t_project_id; // ensure that helper_get_current_project() calls resolve to this project id

	$t_project_id = mci_get_project_id( $p_issue['project'] );
	$t_reporter_id = isset( $p_issue['reporter'] ) ? mci_get_user_id( $p_issue['reporter'] )  : $t_user_id ;
	$t_handler_id = isset( $p_issue['handler'] ) ? mci_get_user_id( $p_issue['handler'] ) : 0;
	$t_project = $p_issue['project'];
	$t_summary = isset( $p_issue['summary'] ) ? $p_issue['summary'] : '';
	$t_description = isset( $p_issue['description'] ) ? $p_issue['description'] : '';
	
	
	if(( $t_project_id == 0 ) || !project_exists( $t_project_id ) ) {
		if( $t_project_id == 0 ) {
			return new soap_fault( 'Client', '', "Project '" . $t_project['name'] . "' does not exist." );
		}
		return new soap_fault( 'Client', '', "Project '$t_project_id' does not exist." );
	}

	if( !access_has_bug_level( config_get( 'update_bug_threshold' ), $p_issue_id, $t_user_id ) ) {
		return mci_soap_fault_access_denied( $t_user_id,  "Not enough rights to update issues" );
	}

	if(( $t_handler_id != 0 ) && !user_exists( $t_handler_id ) ) {
		return new soap_fault( 'Client', '', "User '$t_handler_id' does not exist." );
	}

	$t_category = isset ( $p_issue['category'] ) ? $p_issue['category'] : null;

	$t_category_id = translate_category_name_to_id( $t_category, $t_project_id );
	if ( $t_category_id == 0 && !config_get( 'allow_no_category' ) ) {
		if ( isset( $p_issue['category'] ) && !is_blank( $p_issue['category'] ) ) {
			return new soap_fault( 'Client', '', "Category field must be supplied." );
		} else {
			return new soap_fault( 'Client', '', "Category '" . $p_issue['category'] . "' not found for project '$t_project_name'." );
		}
	}

	if ( isset( $p_issue['version'] ) && !is_blank( $p_issue['version'] ) && !version_get_id( $p_issue['version'], $t_project_id ) ) {
		$t_error_when_version_not_found = config_get( 'mc_error_when_version_not_found' );
		if( $t_error_when_version_not_found == ON ) {
			$t_project_name = project_get_name( $t_project_id );
			return new soap_fault( 'Client', '', "Version '" . $p_issue['version'] . "' does not exist in project '$t_project_name'." );
		} else {
			$t_version_when_not_found = config_get( 'mc_version_when_not_found' );
			$p_issue['version'] = $t_version_when_not_found;
		}
	}

	if ( is_blank( $t_summary ) ) {
		return new soap_fault( 'Client', '', "Mandatory field 'summary' is missing." );
	}

	if ( is_blank( $t_description ) ) {
		return new soap_fault( 'Client', '', "Mandatory field 'description' is missing." );
	}

	// fields which we expect to always be set
	$t_bug_data = bug_get( $p_issue_id, true );
	$t_bug_data->project_id = $t_project_id;
	$t_bug_data->reporter_id = $t_reporter_id;
	$t_bug_data->handler_id = $t_handler_id;
	$t_bug_data->category_id = $t_category_id;
	$t_bug_data->summary = $t_summary;
	$t_bug_data->description = $t_description;

	// fields which might not be set
	if ( isset ( $p_issue['steps_to_reproduce'] ) )
		$t_bug_data->steps_to_reproduce = $p_issue['steps_to_reproduce'];
	if ( isset ( $p_issue['additional_information'] ) )
		$t_bug_data->additional_information = $p_issue['additional_information'];
	if ( isset( $p_issue['priority'] ) )
		$t_bug_data->priority = mci_get_priority_id( $p_issue['priority'] );
	if ( isset( $p_issue['severity'] ) )
		$t_bug_data->severity = mci_get_severity_id( $p_issue['severity'] );
//.........这里部分代码省略.........
开发者ID:rombert,项目名称:mantisbt,代码行数:101,代码来源:mc_issue_api.php


示例16: gpc_get_int

    $f_category_id = $t_bug->category_id;
    $f_reproducibility = $t_bug->reproducibility;
    $f_eta = $t_bug->eta;
    $f_severity = $t_bug->severity;
    $f_priority = $t_bug->priority;
    $f_summary = $t_bug->summary;
    $f_description = $t_bug->description;
    $f_steps_to_reproduce = $t_bug->steps_to_reproduce;
    $f_additional_info = $t_bug->additional_information;
    $f_view_state = (int) $t_bug->view_state;
    $f_due_date = $t_bug->due_date;
    $t_project_id = $t_bug->project_id;
} else {
    # Get Project Id and set it as current
    $t_project_id = gpc_get_int('project_id', helper_get_current_project());
    if ((ALL_PROJECTS == $t_project_id || project_exists($t_project_id)) && $t_project_id != helper_get_current_project()) {
        helper_set_current_project($t_project_id);
        # Reloading the page is required so that the project browser
        # reflects the new current project
        print_header_redirect($_SERVER['REQUEST_URI'], true, false, true);
    }
    # New issues cannot be reported for the 'All Project' selection
    if (ALL_PROJECTS == helper_get_current_project()) {
        print_header_redirect('login_select_proj_page.php?ref=bug_report_page.php');
    }
    access_ensure_project_level(config_get('report_bug_threshold'));
    $f_build = gpc_get_string('build', '');
    $f_platform = gpc_get_string('platform', '');
    $f_os = gpc_get_string('os', '');
    $f_os_build = gpc_get_string('os_build', '');
    $f_product_version = gpc_get_string('product_version', '');
开发者ID:Kirill,项目名称:mantisbt,代码行数:31,代码来源:bug_report_page.php


示例17: mc_project_get_issue_headers

/**
 * Get Issue Headers
 * @param string  $p_username    The name of the user trying to access the versions.
 * @param string  $p_password    The password of the user.
 * @param integer $p_project_id  The id of the project to retrieve the attachments for.
 * @param integer $p_page_number Page number.
 * @param integer $p_per_page    Per page.
 * @return mixed
 */
function mc_project_get_issue_headers($p_username, $p_password, $p_project_id, $p_page_number, $p_per_page)
{
    global $g_project_override;
    $t_user_id = mci_check_login($p_username, $p_password);
    if ($t_user_id === false) {
        return mci_soap_fault_login_failed();
    }
    if ($p_project_id != ALL_PROJECTS && !project_exists($p_project_id)) {
        return SoapObjectsFactory::newSoapFault('Client', 'Project \'' . $p_project_id . '\' does not exist.');
    }
    $g_project_override = $p_project_id;
    if (!mci_has_readonly_access($t_user_id, $p_project_id)) {
        return mci_soap_fault_access_denied($t_user_id);
    }
    $t_orig_page_number = $p_page_number < 1 ? 1 : $p_page_number;
    $t_page_count = 0;
    $t_bug_count = 0;
    $t_rows = filter_get_bug_rows($p_page_number, $p_per_page, $t_page_count, $t_bug_count, null, $p_project_id);
    $t_result = array();
    # the page number was moved back, so we have exceeded the actual page number, see bug #12991
    if ($t_orig_page_number > $p_page_number) {
        return $t_result;
    }
    foreach ($t_rows as $t_issue_data) {
        $t_result[] = mci_issue_data_as_header_array($t_issue_data);
    }
    return $t_result;
}
开发者ID:derrickweaver,项目名称:mantisbt,代码行数:37,代码来源:mc_project_api.php


示例18: filter_get_bug_rows

/**
 * Get set of bug rows from given filter
 * @todo Had to make all these parameters required because we can't use call-time pass by reference anymore.
 * I really preferred not having to pass all the params in if you didn't want to, but I wanted to get
 * rid of the errors for now.  If we can think of a better way later (maybe return an object) that would be great.
 *
 * @param integer &$p_page_number  Page number of the page you want to see (set to the actual page on return).
 * @param integer &$p_per_page     The number of bugs to see per page (set to actual on return)
 *                                 -1   indicates you want to see all bugs
 *                                 null indicates you want to use the value specified in the filter.
 * @param integer &$p_page_count   You don't need to give a value here, the number of pages will be stored here on return.
 * @param integer &$p_bug_count    You don't need to give a value here, the number of bugs will be stored here on return.
 * @param mixed   $p_custom_filter Custom Filter to use.
 * @param integer $p_project_id    Project id to use in filtering.
 * @param integer $p_user_id       User id to use as current user when filtering.
 * @param boolean $p_show_sticky   True/false - get sticky issues only.
 * @return boolean|array
 */
function filter_get_bug_rows(&$p_page_number, &$p_per_page, &$p_page_count, &$p_bug_count, $p_custom_filter = null, $p_project_id = null, $p_user_id = null, $p_show_sticky = null)
{
    log_event(LOG_FILTERING, 'START NEW FILTER QUERY');
    $t_limit_reporters = config_get('limit_reporters');
    $t_report_bug_threshold = config_get('report_bug_threshold');
    $t_where_param_count = 0;
    $t_current_user_id = auth_get_current_user_id();
    if ($p_user_id === null || $p_user_id === 0) {
        $t_user_id = $t_current_user_id;
    } else {
        $t_user_id = $p_user_id;
    }
    $c_user_id = (int) $t_user_id;
    if (null === $p_project_id) {
        # @@@ If project_id is not specified, then use the project id(s) in the filter if set, otherwise, use current project.
        $t_project_id = helper_get_current_project();
    } else {
        $t_project_id = $p_project_id;
    }
    if ($p_custom_filter === null) {
        # Prefer current_user_get_bug_filter() over user_get_filter() when applicable since it supports
        # cookies set by previous version of the code.
        if ($t_user_id == $t_current_user_id) {
            $t_filter = current_user_get_bug_filter();
        } else {
  

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP project_get_all_rows函数代码示例发布时间:2022-05-15
下一篇:
PHP project_ensure_exists函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap