本文整理汇总了PHP中version_get_id函数的典型用法代码示例。如果您正苦于以下问题:PHP version_get_id函数的具体用法?PHP version_get_id怎么用?PHP version_get_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了version_get_id函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: addVersion
public function addVersion($projID, $version)
{
if (MANTIS_LOCAL) {
if (version_add($projID, $version, true, $version)) {
$t_version_id = version_get_id($version, $projID);
if (!is_blank($v_date_order)) {
$t_version = version_get($t_version_id);
$t_version->date_order = date("Y-m-d H:i:s", strtotime($v_date_order));
version_update($t_version);
}
}
} else {
$this->client->mc_project_version_add(MANTIS_USER, MANTIS_PWD, array('name' => $version, 'project_id' => $projID, 'description' => $version, 'released' => true));
}
}
开发者ID:brotherbard,项目名称:feedbackreporter,代码行数:15,代码来源:mantis.php
示例2: actiongroupUpdateData
/**
* Updates the version and associated type of the document if several issues
* are updated
*
* @param $event
* @param $event_type
* @param $bug_id
*/
function actiongroupUpdateData($event, $event_type, $bug_id)
{
require_once SPECMANAGEMENT_CORE_URI . 'specmanagement_database_api.php';
$specmanagement_database_api = new specmanagement_database_api();
if ($event_type == 'UP_TARGET_VERSION') {
$target_version = gpc_get_string('target_version', null);
$p_version_id = null;
if (!(is_null($target_version) || $target_version == '')) {
$version_id = version_get_id($target_version);
$version_obj = $specmanagement_database_api->get_plugin_version_row_by_version_id($version_id);
$p_version_id = $version_obj[0];
}
$specmanagement_database_api->update_source_version($bug_id, $p_version_id);
}
}
开发者ID:Cre-ator,项目名称:Whiteboard.SpecificationManagement-Plugin,代码行数:23,代码来源:SpecManagement.php
示例3: 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 integer $p_issue_id The issue id of the existing issue being updated.
* @param stdClass $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, stdClass $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 SoapObjectsFactory::newSoapFault('Client', 'Issue \'' . $p_issue_id . '\' does not exist.');
}
if (bug_is_readonly($p_issue_id)) {
return SoapObjectsFactory::newSoapFault('Client', 'Issue \'' . $p_issue_id . '\' is readonly');
}
$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
$p_issue = SoapObjectsFactory::unwrapObject($p_issue);
$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 SoapObjectsFactory::newSoapFault('Client', 'Project \'' . $t_project['name'] . '\' does not exist.');
}
return SoapObjectsFactory::newSoapFault('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');
}
$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 SoapObjectsFactory::newSoapFault('Client', 'Category field must be supplied.');
} else {
$t_project_name = project_get_name($t_project_id);
return SoapObjectsFactory::newSoapFault('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('webservice_error_when_version_not_found');
if ($t_error_when_version_not_found == ON) {
$t_project_name = project_get_name($t_project_id);
return SoapObjectsFactory::newSoapFault('Client', 'Version \'' . $p_issue['version'] . '\' does not exist in project \'' . $t_project_name . '\'.');
} else {
$t_version_when_not_found = config_get('webservice_version_when_not_found');
$p_issue['version'] = $t_version_when_not_found;
}
}
if (is_blank($t_summary)) {
return SoapObjectsFactory::newSoapFault('Client', 'Mandatory field \'summary\' is missing.');
}
if (is_blank($t_description)) {
return SoapObjectsFactory::newSoapFault('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_access_check_result = mci_issue_handler_access_check($t_user_id, $t_project_id, $t_bug_data->handler_id, $t_handler_id);
if ($t_access_check_result !== true) {
return $t_access_check_result;
}
$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']);
}
if (isset($p_issue['status'])) {
$t_bug_data->status = mci_get_status_id($p_issue['status']);
}
if (isset($p_issue['reproducibility'])) {
//.........这里部分代码省略.........
开发者ID:elmarculino,项目名称:mantisbt,代码行数:101,代码来源:mc_issue_api.php
示例4: save_acra_issue
function save_acra_issue($p_project_id, $packages)
{
$begin_ts = microtime(true);
set_time_limit(0);
$pid = "pid:" . getmypid() . "-" . substr(md5(microtime()), 8, 16) . " ";
error_log($pid . "save_acra_issue enter");
$t_app_version = gpc_get_string('APP_VERSION_NAME', '');
$t_project_id = $p_project_id;
$t_fingerprint = $this->build_acra_issue_fingerprint(gpc_get_string('STACK_TRACE'), $packages, $pid);
$t_bug_id = acra_get_bug_id_by_fingerprint($t_fingerprint, $t_app_version);
if ($t_bug_id != false && $t_bug_id != '0' && $t_bug_id != '-1') {
//the bug id is valid
if (bug_is_closed($t_bug_id)) {
error_log($pid . "the bug " . $t_bug_id . " is closed");
error_log($pid . "save_acra_issue quit2 " . (microtime(true) - $begin_ts) . 'ms');
return;
}
}
//save acra issue extionsion
$acra_ext = new BugDataAcraExt();
$acra_ext->project_id = $t_project_id;
$acra_ext->issue_id = 0;
$acra_ext->report_id = gpc_get_string('REPORT_ID', '');
$acra_ext->report_fingerprint = $t_fingerprint;
$acra_ext->file_path = gpc_get_string('FILE_PATH', '');
$acra_ext->phone_model = gpc_get_string('PHONE_MODEL', '');
$acra_ext->phone_build = gpc_get_string('BUILD', '');
$acra_ext->phone_brand = gpc_get_string('BRAND', '');
$acra_ext->product_name = gpc_get_string('PRODUCT', '');
$acra_ext->total_mem_size = gpc_get_string('TOTAL_MEM_SIZE', '');
$acra_ext->available_mem_size = gpc_get_string('AVAILABLE_MEM_SIZE', '');
$acra_ext->custom_data = gpc_get_string('CUSTOM_DATA', '');
$acra_ext->initial_configuration = gpc_get_string('INITIAL_CONFIGURATION', '');
$acra_ext->crash_configuration = gpc_get_string('CRASH_CONFIGURATION', '');
$acra_ext->display = gpc_get_string('DISPLAY', '');
$acra_ext->user_comment = gpc_get_string('USER_COMMENT', '');
$acra_ext->dumpsys_meminfo = gpc_get_string('DUMPSYS_MEMINFO', '');
$acra_ext->dropbox = gpc_get_string('DROPBOX', '');
//NOT EXITS, need check with acra, later
$acra_ext->eventslog = gpc_get_string('EVENTSLOG', '');
//NOT EXITS, need check with acra, later
$acra_ext->radiolog = gpc_get_string('RADIOLOG', '');
//NOT EXITS, need check with acra, later
$acra_ext->is_silent = gpc_get_string('IS_SILENT', '');
$acra_ext->device_id = gpc_get_string('INSTALLATION_ID', '');
//NOT EXITS, need check with acra, later
$acra_ext->installation_id = gpc_get_string('INSTALLATION_ID', '');
$acra_ext->user_email = gpc_get_string('USER_EMAIL', '');
$acra_ext->device_features = gpc_get_string('DEVICE_FEATURES', '');
$acra_ext->environment = gpc_get_string('ENVIRONMENT', '');
$acra_ext->settings_system = gpc_get_string('SETTINGS_SYSTEM', '');
$acra_ext->settings_secure = gpc_get_string('SETTINGS_SECURE', '');
$acra_ext->shared_preferences = gpc_get_string('SHARED_PREFERENCES', '');
$acra_ext->android_version = gpc_get_string('ANDROID_VERSION', '');
$acra_ext->app_version = $t_app_version;
$acra_ext->crash_date = $this->covertTimeString(gpc_get_string('USER_CRASH_DATE', ''));
$acra_ext->install_date = $this->covertTimeString(gpc_get_string('USER_APP_START_DATE', ''));
$t_result = $acra_ext->create();
if ($t_result === false) {
error_log($pid . "dumplicated report id");
return;
}
error_log($pid . "save fingerprint " . $acra_ext->report_fingerprint . " to acra issue:" . $acra_ext->id);
$t_duplicated_bug_id = '0';
$tries = 0;
while ($tries < 30) {
sleep(1);
//wait one second
$t_duplicated_bug_id = acra_get_bug_id_by_fingerprint($t_fingerprint, $t_app_version);
$tries = $tries + 1;
if ($t_duplicated_bug_id == "-1") {
$id = acra_get_first_issue_id_by_fingerprint($t_fingerprint, 0);
if ($id == $acra_ext->id) {
$t_duplicated_bug_id = '0';
break;
}
continue;
}
if ($t_duplicated_bug_id == '0') {
break;
}
break;
}
if (tries >= 30) {
$t_duplicated_bug_id = '0';
}
$t_user_id = $this->get_user_id();
if ($t_duplicated_bug_id == '0') {
//new crash report, save a bug record
$t_duplicated_bug_id = $this->save_bug($t_project_id, $t_user_id);
error_log($pid . "create bug " . $t_duplicated_bug_id . ' for acra issue:' . $acra_ext->id . ' fp:' . $t_fingerprint);
//create version if possible
$t_version_id = version_get_id($t_app_version, $t_project_id);
if ($t_version_id === false) {
version_add($t_project_id, $t_app_version, VERSION_RELEASED);
event_signal('EVENT_MANAGE_VERSION_CREATE', array($t_version_id));
}
} else {
error_log($pid . "exists bug " . $t_duplicated_bug_id);
if (!bug_is_closed($t_duplicated_bug_id)) {
//.........这里部分代码省略.........
开发者ID:since2014,项目名称:MantisAcra,代码行数:101,代码来源:MantisAcra.php
示例5: array
?>
</td>
</tr>
<?php
$t_bug_list = array();
$t_total_owing = 0;
$t_total_paid = 0;
for ($i = 0; $i < $t_sponsor_count; ++$i) {
$t_sponsor_row = $t_sponsors[$i];
$t_bug = bug_get($t_sponsor_row['bug']);
$t_sponsor = sponsorship_get($t_sponsor_row['sponsor']);
$t_buglist[] = $t_sponsor_row['bug'] . ':' . $t_sponsor_row['sponsor'];
# describe bug
$t_status = string_attribute(get_enum_element('status', $t_bug->status, auth_get_current_user_id(), $t_bug->project_id));
$t_resolution = string_attribute(get_enum_element('resolution', $t_bug->resolution, auth_get_current_user_id(), $t_bug->project_id));
$t_version_id = version_get_id($t_bug->fixed_in_version, $t_bug->project_id);
if (false !== $t_version_id && VERSION_RELEASED == version_get_field($t_version_id, 'released')) {
$t_released_label = '<a title="' . lang_get('released') . '">' . $t_bug->fixed_in_version . '</a>';
} else {
$t_released_label = $t_bug->fixed_in_version;
}
# choose color based on status
$t_status_label = html_get_status_css_class($t_bug->status, auth_get_current_user_id(), $t_bug->project_id);
echo '<tr class="' . $t_status_label . '">';
echo '<td><a href="' . string_get_bug_view_url($t_sponsor_row['bug']) . '">' . bug_format_id($t_sponsor_row['bug']) . '</a></td>';
echo '<td>' . string_display_line(project_get_field($t_bug->project_id, 'name')) . ' </td>';
echo '<td class="right">' . $t_released_label . ' </td>';
echo '<td><a title="' . $t_resolution . '"><span class="underline">' . $t_status . '</span> </a></td>';
# summary
echo '<td>' . string_display_line($t_bug->summary);
if (VS_PRIVATE == $t_bug->view_state) {
开发者ID:gtn,项目名称:mantisbt,代码行数:31,代码来源:account_sponsor_page.php
示例6: helper_call_custom_function
if ($f_fixed_in_version === '' || version_get_id($f_fixed_in_version, $t_bug->project_id) !== false) {
# @todo we need to issue a helper_call_custom_function( 'issue_update_validate', array( $t_bug_id, $t_bug_data, $f_bugnote_text ) );
bug_set_field($t_bug_id, 'fixed_in_version', $f_fixed_in_version);
email_bug_updated($t_bug_id);
helper_call_custom_function('issue_update_notify', array($t_bug_id));
} else {
$t_failed_ids[$t_bug_id] = lang_get('bug_actiongroup_version');
}
} else {
$t_failed_ids[$t_bug_id] = lang_get('bug_actiongroup_access');
}
break;
case 'UP_TARGET_VERSION':
$f_target_version = gpc_get_string('target_version');
if (access_has_bug_level(config_get('roadmap_update_threshold'), $t_bug_id)) {
if ($f_target_version === '' || version_get_id($f_target_version, $t_bug->project_id) !== false) {
# @todo we need to issue a helper_call_custom_function( 'issue_update_validate', array( $t_bug_id, $t_bug_data, $f_bugnote_text ) );
bug_set_field($t_bug_id, 'target_version', $f_target_version);
email_bug_updated($t_bug_id);
helper_call_custom_function('issue_update_notify', array($t_bug_id));
} else {
$t_failed_ids[$t_bug_id] = lang_get('bug_actiongroup_version');
}
} else {
$t_failed_ids[$t_bug_id] = lang_get('bug_actiongroup_access');
}
break;
case 'VIEW_STATUS':
if (access_has_bug_level(config_get('change_view_status_threshold'), $t_bug_id)) {
$f_view_status = gpc_get_int('view_status');
# @todo we need to issue a helper_call_custom_function( 'issue_update_validate', array( $t_bug_id, $t_bug_data, $f_bugnote_text ) );
开发者ID:gtn,项目名称:mantisbt,代码行数:31,代码来源:bug_actiongroup.php
示例7: mc_project_version_add
/**
* Submit the specified version details.
*
* @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_version A ProjectVersionData structure containing information about the new verison.
* @return integer The id of the created version.
*/
function mc_project_version_add($p_username, $p_password, $p_version)
{
$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)) {
return new soap_fault('Client', '', 'Access Denied', 'User does not have administrator access');
}
extract($p_version, EXTR_PREFIX_ALL, 'v');
if (is_blank($v_project_id)) {
return new soap_fault('Client', '', 'Mandatory field "project_id" was missing');
}
if (is_blank($v_name)) {
return new soap_fault('Client', '', 'Mandatory field "name" was missing');
}
if (!version_is_unique($v_name, $v_project_id)) {
return new soap_fault('Client', '', 'Version exists for project', 'The version you attempted to add already exists for this project');
}
if ($v_released === false) {
$v_released = VERSION_FUTURE;
} else {
$v_released = VERSION_RELEASED;
}
if (version_add($v_project_id, $v_name, $v_released, $v_description)) {
$t_version_id = version_get_id($v_name, $v_project_id);
if (!is_blank($v_date_order)) {
$t_version = version_get($t_version_id);
$t_version->date_order = date("Y-m-d H:i:s", strtotime($v_date_order));
version_update($t_version);
}
return $t_version_id;
} else {
return null;
}
}
开发者ID:amjadtbssm,项目名称:website,代码行数:44,代码来源:mc_project_api.php
示例8: getVersionInformation
function getVersionInformation($p_project_id, $p_version = "")
{
$t_version_id = version_get_id($p_version, $p_project_id);
$t_version_id = version_cache_row($t_version_id, false);
return $t_version_id;
}
开发者ID:CarlosPinedaT,项目名称:agileMantis,代码行数:6,代码来源:class_version.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 ) {
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
示例10: helper_call_custom_function
# @@@ we need to issue a helper_call_custom_function( 'issue_update_validate', array( $t_bug_id, $t_bug_data, $f_bugnote_text ) );
bug_set_field($t_bug_id, 'fixed_in_version', $f_fixed_in_version);
helper_call_custom_function('issue_update_notify', array($t_bug_id));
$t_success = true;
}
}
if (!$t_success) {
$t_failed_ids[$t_bug_id] = lang_get('bug_actiongroup_access');
}
break;
case 'UP_TARGET_VERSION':
$f_target_version = gpc_get_string('target_version');
$t_project_id = bug_get_field($t_bug_id, 'project_id');
$t_success = false;
if (access_has_bug_level(config_get('roadmap_update_threshold'), $t_bug_id)) {
if (version_get_id($f_target_version, $t_project_id) !== false) {
# @@@ we need to issue a helper_call_custom_function( 'issue_update_validate', array( $t_bug_id, $t_bug_data, $f_bugnote_text ) );
bug_set_field($t_bug_id, 'target_version', $f_target_version);
helper_call_custom_function('issue_update_notify', array($t_bug_id));
$t_success = true;
}
}
if (!$t_success) {
$t_failed_ids[$t_bug_id] = lang_get('bug_actiongroup_access');
}
break;
case 'VIEW_STATUS':
if (access_has_bug_level(config_get('change_view_status_threshold'), $t_bug_id)) {
$f_view_status = gpc_get_int('view_status');
# @@@ we need to issue a helper_call_custom_function( 'issue_update_validate', array( $t_bug_id, $t_bug_data, $f_bugnote_text ) );
bug_set_field($t_bug_id, 'view_state', $f_view_status);
开发者ID:renemilk,项目名称:spring-website,代码行数:31,代码来源:bug_actiongroup.php
示例11: count
foreach ( $statuses as $l_status )
{
if ( array_key_exists( $l_status, $bugs) )
{
$bug_count_for_column += count( $bugs[$l_status] );
}
}
$bug_percentage_by_column[$column] = ( $bug_count_for_column / $bug_count ) * 100;
}
if ($target_version)
{
foreach($project_ids as $project_id)
{
$version_id = version_get_id($target_version, $project_id, true);
if ($version_id !== false)
{
break;
}
}
$version = version_get($version_id);
$version_date = $version->date_order;
$now = time();
$time_diff = $version_date - $now;
$time_hours = floor($time_diff / 3600);
$time_days = floor($time_diff / 86400);
$time_weeks = floor($time_diff / 604800);
开发者ID:rombert,项目名称:scrum,代码行数:30,代码来源:board.php
示例12: access_ensure_project_level
access_ensure_project_level(config_get('manage_project_threshold'), $f_other_project_id);
if ($f_copy_from) {
$t_src_project_id = $f_other_project_id;
$t_dst_project_id = $f_project_id;
} else {
if ($f_copy_to) {
$t_src_project_id = $f_project_id;
$t_dst_project_id = $f_other_project_id;
} else {
trigger_error(ERROR_VERSION_NO_ACTION, ERROR);
}
}
# Get all active versions (i.e. exclude obsolete ones)
$t_rows = version_get_all_rows($t_src_project_id);
foreach ($t_rows as $t_row) {
$t_dst_version_id = version_get_id($t_row['version'], $t_dst_project_id);
if ($t_dst_version_id === false) {
# Version does not exist in target project
version_add($t_dst_project_id, $t_row['version'], $t_row['released'], $t_row['description'], $t_row['date_order']);
} else {
# Update existing version
# Since we're ignoring obsolete versions, those marked as such in the
# source project after an earlier copy operation will not be updated
# in the target project.
$t_version_data = new VersionData($t_row);
$t_version_data->id = $t_dst_version_id;
$t_version_data->project_id = $t_dst_project_id;
version_update($t_version_data);
}
}
form_security_purge('manage_proj_ver_copy');
开发者ID:spring,项目名称:spring-website,代码行数:31,代码来源:manage_proj_ver_copy.php
示例13: 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
示例14: get_restore_file_by_version_name
function get_restore_file_by_version_name($version)
{
$ver_id = version_get_id($version);
if ($ver_id === false) {
return false;
}
$t_acra_ver_table = plugin_table("version");
$query = "SELECT * FROM {$t_acra_ver_table} WHERE `version_id` = " . $ver_id;
$result = db_query_bound($query);
$row = db_fetch_array($result);
if ($row === false) {
return false;
}
return $row['map_file'];
}
开发者ID:since2014,项目名称:MantisAcra,代码行数:15,代码来源:VersionAcraExt.php
示例15: in_array
$t_show_product_build = $t_show_versions && in_array('product_build', $t_fields) && config_get('enable_product_build') == ON;
$t_product_build = $t_show_product_build ? string_display_line($t_bug->build) : '';
$t_show_target_version = $t_show_versions && in_array('target_version', $t_fields) && access_has_bug_level(config_get('roadmap_view_threshold'), $f_bug_id);
$t_product_version_string = '';
$t_target_version_string = '';
$t_fixed_in_version_string = '';
if ($t_show_product_version || $t_show_fixed_in_version || $t_show_target_version) {
$t_version_rows = version_get_all_rows($t_bug->project_id);
if ($t_show_product_version) {
$t_product_version_string = prepare_version_string($t_bug->project_id, version_get_id($t_bug->version, $t_bug->project_id));
}
if ($t_show_target_version) {
$t_target_version_string = prepare_version_string($t_bug->project_id, version_get_id($t_bug->target_version, $t_bug->project_id));
}
if ($t_show_fixed_in_version) {
$t_fixed_in_version_string = prepare_version_string($t_bug->project_id, version_get_id($t_bug->fixed_in_version, $t_bug->project_id));
}
}
$t_product_version_string = string_display_line($t_product_version_string);
$t_target_version_string = string_display_line($t_target_version_string);
$t_fixed_in_version_string = string_display_line($t_fixed_in_version_string);
$t_bug_id = $f_bug_id;
$t_form_title = lang_get('bug_view_title');
$t_wiki_link = config_get_global('wiki_enable') == ON ? 'wiki.php?id=' . $f_bug_id : '';
if (access_has_bug_level(config_get('view_history_threshold'), $f_bug_id)) {
$t_history_link = "view.php?id={$f_bug_id}&history=1#history";
} else {
$t_history_link = '';
}
$t_show_reminder_link = !current_user_is_anonymous() && !bug_is_readonly($f_bug_id) && access_has_bug_level(config_get('bug_reminder_threshold'), $f_bug_id);
$t_bug_reminder_link = 'bug_reminder_page.php?bug_id=' . $f_bug_id;
开发者ID:N0ctrnl,项目名称:mantisbt,代码行数:31,代码来源:bug_view_inc.php
示例16: string_display_line
$t_eta = string_display_line(get_enum_element('eta', $t_bug->eta));
$t_summary = string_display_line_links(bug_format_summary($f_bug_id, SUMMARY_FIELD));
$t_description = string_display_links($t_bug->description);
$t_steps_to_reproduce = string_display_links($t_bug->steps_to_reproduce);
$t_additional_information = string_display_links($t_bug->additional_information);
$t_view_state = $t_show_view_state ? get_enum_element('view_state', $t_bug->view_state) : '';
if ($t_show_due_date) {
if (!date_is_null($t_bug->due_date)) {
$t_due_date = date(config_get('normal_date_format'), $t_bug->due_date);
} else {
$t_due_date = '';
}
}
$t_product_version = $t_show_product_version ? string_display_line(prepare_version_string($t_bug->project_id, version_get_id($t_bug->version, $t_bug->project_id))) : '';
$t_target_version = $t_show_target_version ? string_display_line(prepare_version_string($t_bug->project_id, version_get_id($t_bug->target_version, $t_bug->project_id))) : '';
$t_fixed_in_version = $t_show_fixed_in_version ? string_display_line(prepare_version_string($t_bug->project_id, version_get_id($t_bug->fixed_in_version, $t_bug->project_id))) : '';
html_page_top1(bug_format_summary($f_bug_id, SUMMARY_CAPTION));
html_head_end();
html_body_begin();
echo '<br />';
echo '<table class="width100" cellspacing="1">';
echo '<tr>';
echo '<td class="form-title" colspan="6">';
echo '<div class="center">', $t_window_title;
if (!is_blank($t_project_name)) {
echo ' - ' . $t_project_name;
}
echo '</div></td>';
echo '</tr>';
echo '<tr>';
echo '<td class="form-title" colspan="6">', lang_get('bug_view_title'), '</td>';
开发者ID:derrickweaver,项目名称:mantisbt,代码行数:31,代码来源:print_bug_page.php
示例17: mc_project_version_add
/**
* Submit the specified version details.
*
* @param string $p_username The name of the user trying to add the issue.
* @param string $p_password The password of the user.
* @param stdClass $p_version A ProjectVersionData structure containing information about the new version.
* @return integer The id of the created version.
*/
function mc_project_version_add($p_username, $p_password, stdClass $p_version)
{
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();
}
$p_version = SoapObjectsFactory::unwrapObject($p_version);
$t_project_id = $p_version['project_id'];
$g_project_override = $t_project_id;
$t_name = $p_version['name'];
$t_released = $p_version['released'];
$t_description = $p_version['description'];
$t_date_order = $p_version['date_order'];
if (is_blank($t_date_order)) {
$t_date_order = null;
} else {
$t_date_order = SoapObjectsFactory::parseDateTimeString($t_date_order);
}
$t_obsolete = isset($p_version['obsolete']) ? $p_version['obsolete'] : false;
if (is_blank($t_project_id)) {
return SoapObjectsFactory::newSoapFault('Client', 'Mandatory field "project_id" was missing');
}
if (!project_exists($t_project_id)) {
return SoapObjectsFactory::newSoapFault('Client', 'Project \'' . $t_project_id . '\' does not exist.');
}
if (!mci_has_readwrite_access($t_user_id, $t_project_id)) {
return mci_soap_fault_access_denied($t_user_id);
}
if (!mci_has_access(config_get('manage_project_threshold'), $t_user_id, $t_project_id)) {
return mci_soap_fault_access_denied($t_user_id);
}
if (is_blank($t_name)) {
return SoapObjectsFactory::newSoapFault('Client', 'Mandatory field "name" was missing');
}
if (!version_is_unique($t_name, $t_project_id)) {
return SoapObjectsFactory::newSoapFault('Client', 'Version exists for project');
}
if ($t_released === false) {
$t_released = VERSION_FUTURE;
} else {
$t_released = VERSION_RELEASED;
}
if (version_add($t_project_id, $t_name, $t_released, $t_description, $t_date_order, $t_obsolete)) {
return version_get_id($t_name, $t_project_id);
}
return null;
}
开发者ID:derrickweaver,项目名称:mantisbt,代码行数:56,代码来源:mc_project_api.php
示例18: mc_project_version_add
/**
* Submit the specified version details.
*
* @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_version A ProjectVersionData structure containing information about the new verison.
* @return integer The id of the created version.
*/
function mc_project_version_add($p_username, $p_password, $p_version)
{
$t_user_id = mci_check_login($p_username, $p_password);
if ($t_user_id === false) {
return mci_soap_fault_login_failed();
}
$t_project_id = $p_version['project_id'];
$t_name = $p_version['name'];
$t_released = $p_version['released'];
$t_description = $p_version['description'];
$t_date_order = $p_version['date_order'];
if (is_blank($t_project_id)) {
return new soap_fault('Client', '', 'Mandatory field "project_id" was missing');
}
if (!project_exists($t_project_id)) {
return new soap_fault('Client', '', "Project '{$t_project_id}' does not exist.");
}
if (!mci_has_readwrite_access($t_user_id, $t_project_id)) {
return mci_soap_fault_access_denied($t_user_id);
}
if (!mci_has_access(config_get('manage_project_threshold'), $t_user_id, $t
|
请发表评论