本文整理汇总了PHP中version_get_id函数的典型用法代码示例。如果您正苦于以下问题:PHP version_get_id函数的具体用法?PHP version_get_id怎么用?PHP version_get_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了version_get_id函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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));
}
}
示例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);
}
}
示例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'])) {
//.........这里部分代码省略.........
示例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)) {
//.........这里部分代码省略.........
示例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) {
示例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 ) );
示例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;
}
}
示例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;
}
示例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'] );
//.........这里部分代码省略.........
示例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);
示例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);
示例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');
示例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;
//.........这里部分代码省略.........
示例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'];
}
示例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;