From 5154c9366e187ae9178db9546b75c1743422a863 Mon Sep 17 00:00:00 2001 From: Jan Koch Date: Wed, 8 Jul 2015 11:55:57 +0200 Subject: [PATCH] Released version 2.1.2 This version contains smaller changes when editing a Product Backlog / showing Links in agileMantis components and minor bugfixes regarding custom fields, plugin behavior and wrong group-by clauses. --- agileMantis.php | 232 +++++++++++++++--------- core/agile_mantis_custom_fields_inc.php | 10 +- core/chart/generate_velocity_data.php | 7 +- core/schnittstelle.php | 7 +- core/schnittstelle_load_userstory.php | 223 +++++++++++++---------- lang/strings_english.txt | 1 + lang/strings_german.txt | 1 + libs/class_commonlib.php | 16 +- libs/class_product_backlog.php | 3 +- libs/class_sprint.php | 7 +- pages/agileuser.php | 149 +++++---------- pages/assume_userstories.php | 2 +- pages/capacity.php | 4 +- pages/chose_product_backlog.php | 32 ++-- pages/chose_sprint.php | 50 ++--- pages/config.php | 9 - pages/divide_userstories.php | 8 +- pages/edit_product_backlog.php | 44 +++-- pages/edit_sprint.php | 2 +- pages/edit_task.php | 2 +- pages/info.php | 6 +- pages/product_backlog_actions.php | 4 +- pages/product_backlog_stories.php | 4 +- pages/product_backlogs.php | 16 +- pages/sprint_backlog.php | 28 +-- pages/sprint_backlog_actions.php | 29 ++- pages/sprint_backlog_functions.php | 2 +- pages/sprint_backlog_task_row.php | 66 +++---- pages/sprints.php | 10 +- pages/task_page.php | 42 ++--- pages/teams.php | 22 +-- 31 files changed, 545 insertions(+), 493 deletions(-) diff --git a/agileMantis.php b/agileMantis.php index e7ebaa4..b800021 100644 --- a/agileMantis.php +++ b/agileMantis.php @@ -28,6 +28,8 @@ # agileMantis plugin class class agileMantisPlugin extends MantisPlugin { + var $version; + /** * Plugin registration information, some will be shown on plugin overview. * @@ -37,7 +39,7 @@ function register() { $this->name = "agileMantis"; $this->description = "Enables Scrum on your MantisBT-Installation"; $this->page = "info"; - $this->version = "2.1.1"; + $this->version = "2.1.2"; $this->requires = array( "MantisCore" => "1.2.5" ); $this->author = "gadiv GmbH"; $this->contact = "agileMantis@gadiv.de"; @@ -561,6 +563,8 @@ function install() { // Install site key plugin_config_set('gadiv_sitekey', md5(uniqid(rand(), true))); + $this->installConfigurationParams(); + // Create custom fields $this->create_custom_field( 'ProductBacklog', array( 'possible_values' => '', 'type' => '6' ) ); // List @@ -641,7 +645,9 @@ function getDBVersion() { */ function upgrade() { - plugin_config_set( 'gadiv_agilemantis_version', $this->version = "2.1.0" ); + plugin_config_set( 'gadiv_agilemantis_version', $this->version = "2.1.2" ); + + $this->installConfigurationParams(); return ( TRUE ); } @@ -987,9 +993,15 @@ function event_report_bug( $p_bug_event, $p_bug_data ) { # add agileMantis plugin functions after sending bug data to database when a bug is updated # - adding custom field values to mantis and agilemantis tables function event_update_bug( $p_bug_event, $p_bug_data, $p_bug_id ) { - global $agilemantis_pb; + global $agilemantis_pb; global $agilemantis_commonlib; + $t_product_owner = ""; + $t_handler_id = 0; + $t_product_backlog_id = 0; + $t_team_id = 0; + $f_bug_id = 0; + // Only projects with agilMantis backlog if( !$agilemantis_commonlib->projectHasBacklogs( helper_get_current_project() ) ) { return; @@ -1005,33 +1017,27 @@ function event_update_bug( $p_bug_event, $p_bug_data, $p_bug_id ) { || isset( $_POST['technical'] ) || isset( $_POST['presentable'] ) || isset( $_POST['inReleaseDocu'] ) || isset( $_POST['sprint'] ) ) { - $f_bug_id = $_POST['bug_id']; + $f_bug_id = (int) $_POST['bug_id']; $agilemantis_pb->setCustomFieldValues( $f_bug_id ); # change Product Backlog - if( $_POST['old_product_backlog'] - != $_POST['backlog'] - && $_POST['backlog'] != "" ) { - + if( $_POST['old_product_backlog'] != $_POST['backlog'] && $_POST['backlog'] != "" ) { $p_bug_data->handler_id = $_SESSION['tracker_handler']; $p_bug_data->status = 50; } # change back to Team User if no Product Backlog is selected - if( $_POST['old_product_backlog'] - != $_POST['backlog'] - && $_POST['backlog'] == "" ) { - - $product_backlog_id = $agilemantis_pb->get_product_backlog_id( - $_POST['old_product_backlog'] ); - $handler_id = 0; - if( $agilemantis_pb->count_productbacklog_teams( $product_backlog_id ) > 0 ) { - $team_id = $agilemantis_pb->getTeamIdByBacklog( $product_backlog_id ); - $product_owner = $agilemantis_pb->getProductOwner( $team_id ); - $handler_id = $agilemantis_pb->getUserIdByName( $product_owner ); + if( $_POST['old_product_backlog'] != $_POST['backlog'] && $_POST['backlog'] == "" ) { + + $t_product_backlog_id = $agilemantis_pb->get_product_backlog_id( $_POST['old_product_backlog'] ); + + if( $agilemantis_pb->count_productbacklog_teams( $t_product_backlog_id ) > 0 ) { + $t_team_id = $agilemantis_pb->getTeamIdByBacklog( $t_product_backlog_id ); + $t_product_owner = $agilemantis_pb->getProductOwner( $t_team_id ); + $t_handler_id = user_get_id_by_name( $t_product_owner ); } - $p_bug_data->handler_id = $handler_id; + $p_bug_data->handler_id = $t_handler_id; } } } @@ -1110,87 +1116,85 @@ function event_bug_action ( $p_event, $p_action, $p_bug_id ) { $t_custom_field_id = $_SESSION['custom_field_id']; - # restore values from selected bug list if necessary - foreach( $_POST['bug_arr'] AS $num => $row ) { + $pb_id = $agilemantis_commonlib->getProductBacklogIDByBugId( $p_bug_id ); + $list_sprints = $agilemantis_commonlib->getSprintsByBacklogId( $pb_id ); + $current_sprint = $agilemantis_commonlib->getSprintByBugId( $p_bug_id ); - $pb_id = $agilemantis_commonlib->getProductBacklogIDByBugId( $row ); - $list_sprints = $agilemantis_commonlib->getSprintsByBacklogId( $pb_id ); - $current_sprint = $agilemantis_commonlib->getSprintByBugId( $row ); + $t_custom_field_value = $_SESSION['custom_field'][$p_bug_id]; + if( !$t_custom_field_value ) { + $t_custom_field_value = ''; + } - $t_custom_field_value = $_SESSION['custom_field'][$row]; - if( !$t_custom_field_value ) { - $t_custom_field_value = ''; - } + $t_status = bug_get_field( $p_bug_id, 'status' ); - # restore story points value - if( $t_custom_field_id == $agilemantis_commonlib->sp ) { - if( $current_sprint[0]['status'] > 0 || $pb_id == 0 ) { - $agilemantis_commonlib->restoreCustomFieldValue( - $row, $t_custom_field_id, $t_custom_field_value ); - } + # restore story points value + if( $t_custom_field_id == $agilemantis_commonlib->sp ) { + if( $current_sprint[0]['status'] > 1 || $pb_id == 0 || $t_status >= 80) { + $agilemantis_commonlib->restoreCustomFieldValue($p_bug_id, $t_custom_field_id, $t_custom_field_value ); } + } - # restore product backlog value - if( $t_custom_field_id == $agilemantis_commonlib->pb ) { - $pbl = $agilemantis_commonlib->getProjectProductBacklogs( - helper_get_current_project() ); - $do_not_reset = false; - if( !empty( $pbl ) ) { - foreach( $pbl AS $key => $value ) { - if( $value['pb_id'] == $pb_id ) { - $do_not_reset = true; - } + # restore product backlog value + if( $t_custom_field_id == $agilemantis_commonlib->pb ) { + $pbl = $agilemantis_commonlib->getProjectProductBacklogs( + helper_get_current_project() ); + $do_not_reset = false; + if( !empty( $pbl ) ) { + foreach( $pbl AS $key => $value ) { + if( $value['pb_id'] == $pb_id ) { + $do_not_reset = true; } } + } - $value_resettet = false; - if( $current_sprint[0]['name'] != '' - || $pb_id == 0 - || empty($pbl) - || $do_not_reset == false ) { - - $agilemantis_commonlib->restoreCustomFieldValue( - $row, - $t_custom_field_id, - $t_custom_field_value ); + $value_resettet = false; + if( $current_sprint[0]['name'] != '' + || $pb_id == 0 + || empty($pbl) + || $do_not_reset == false ) { - $value_resettet = true; - } + $agilemantis_commonlib->restoreCustomFieldValue( + $p_bug_id, + $t_custom_field_id, + $t_custom_field_value ); - if( empty( $t_custom_field_value ) && $value_resettet == false ) { - $agilemantis_commonlib->setTrackerStatus( $row, 50 ); - $agilemantis_commonlib->id = $pb_id; - $backlog = $agilemantis_commonlib->getSelectedProductBacklog(); - $agilemantis_commonlib->updateTrackerHandler( - $row , $backlog[0]['user_id'] , $pb_id ); - } + $value_resettet = true; + } + if( empty( $t_custom_field_value ) && $value_resettet == false ) { + $agilemantis_commonlib->setTrackerStatus( $p_bug_id, 50 ); + $agilemantis_commonlib->id = $pb_id; + $backlog = $agilemantis_commonlib->getSelectedProductBacklog(); + $agilemantis_commonlib->updateTrackerHandler( + $p_bug_id , $backlog[0]['user_id'] , $pb_id ); } - if( $t_custom_field_id == $agilemantis_commonlib->spr ) { - if( empty( $list_sprints ) ) { - $agilemantis_commonlib->restoreCustomFieldValue( - $row, $t_custom_field_id, $t_custom_field_value ); - } + } - # old sprint information - $agilemantis_commonlib->sprint_id = $t_custom_field_value; - $sprintInfo = $agilemantis_sprint->getSprintById(); + if( $t_custom_field_id == $agilemantis_commonlib->spr ) { + if( empty( $list_sprints ) ) { + $agilemantis_commonlib->restoreCustomFieldValue( + $p_bug_id, $t_custom_field_id, $t_custom_field_value ); + } - if( $current_sprint[0]['pb_id'] != $pb_id ) { - $agilemantis_commonlib->restoreCustomFieldValue( - $row, $t_custom_field_id, $t_custom_field_value ); - } + # old sprint information + $agilemantis_commonlib->sprint_id = $t_custom_field_value; + $sprintInfo = $agilemantis_sprint->getSprintById(); - if( $sprintInfo['status'] > 0 || $pb_id == 0 ) { - $agilemantis_commonlib->restoreCustomFieldValue( - $row, $t_custom_field_id, $t_custom_field_value ); - } + if( $current_sprint[0]['pb_id'] != $pb_id ) { + $agilemantis_commonlib->restoreCustomFieldValue( + $p_bug_id, $t_custom_field_id, $t_custom_field_value ); } - # update bug date - bug_update_date( $p_bug_id ); + if( $current_sprint[0]['status'] > 1 || $pb_id == 0 || $t_status >= 80 ) { + $agilemantis_commonlib->restoreCustomFieldValue( + $p_bug_id, $t_custom_field_id, $t_custom_field_value ); + } } + + # update bug date + bug_update_date( $p_bug_id ); + } # add menu items to mantis main menu between "Summary" and "Manage" @@ -1278,6 +1282,7 @@ function event_layout_content_end() { } function event_layout_resources() { + echo ''; echo ''; echo ''; @@ -1311,5 +1316,68 @@ function create_custom_field( $p_field_name, $p_def_array ) { } } + function installConfigurationParams(){ + + if( !config_is_set( 'plugin_agileMantis_gadiv_workday_in_hours' ) ) { + config_set( 'plugin_agileMantis_gadiv_workday_in_hours', 8 ); + } + + if( !config_is_set( 'plugin_agileMantis_gadiv_sprint_length' ) ) { + config_set( 'plugin_agileMantis_gadiv_sprint_length', 28 ); + } + + if( !config_is_set( 'plugin_agileMantis_gadiv_storypoint_mode' ) ) { + config_set( 'plugin_agileMantis_gadiv_storypoint_mode', 0 ); + } + + if( !config_is_set( 'plugin_agileMantis_gadiv_fibonacci_length' ) ) { + config_set( 'plugin_agileMantis_gadiv_fibonacci_length', 10 ); + } + + if( !config_is_set( 'plugin_agileMantis_gadiv_show_storypoints' ) ) { + config_set( 'plugin_agileMantis_gadiv_show_storypoints', 0 ); + } + + if( !config_is_set( 'plugin_agileMantis_gadiv_task_unit_mode' ) ) { + config_set( 'plugin_agileMantis_gadiv_task_unit_mode', 'h' ); + } + + if( !config_is_set( 'plugin_agileMantis_gadiv_userstory_unit_mode' ) ) { + config_set( 'plugin_agileMantis_gadiv_userstory_unit_mode', 'h' ); + } + + if( !config_is_set( 'plugin_agileMantis_gadiv_taskboard' ) ) { + config_set( 'plugin_agileMantis_gadiv_taskboard', 0 ); + } + + if( !config_is_set( 'plugin_agileMantis_gadiv_daily_scrum' ) ) { + config_set( 'plugin_agileMantis_gadiv_daily_scrum', 0 ); + } + + if( !config_is_set( 'plugin_agileMantis_gadiv_ranking_order' ) ) { + config_set( 'plugin_agileMantis_gadiv_ranking_order', 0 ); + } + + if( !config_is_set( 'plugin_agileMantis_gadiv_show_rankingorder' ) ) { + config_set( 'plugin_agileMantis_gadiv_show_rankingorder', 0 ); + } + + if( !config_is_set( 'plugin_agileMantis_gadiv_presentable' ) ) { + config_set( 'plugin_agileMantis_gadiv_presentable', 0 ); + } + + if( !config_is_set( 'plugin_agileMantis_gadiv_release_documentation' ) ) { + config_set( 'plugin_agileMantis_gadiv_release_documentation', 0 ); + } + + if( !config_is_set( 'plugin_agileMantis_gadiv_technical' ) ) { + config_set( 'plugin_agileMantis_gadiv_technical', 0 ); + } + + if( !config_is_set( 'plugin_agileMantis_gadiv_tracker_planned_costs' ) ) { + config_set( 'gadiv_tracker_planned_costs', 0 ); + } + } + } ?> \ No newline at end of file diff --git a/core/agile_mantis_custom_fields_inc.php b/core/agile_mantis_custom_fields_inc.php index 2a3d91a..1df23de 100644 --- a/core/agile_mantis_custom_fields_inc.php +++ b/core/agile_mantis_custom_fields_inc.php @@ -90,7 +90,7 @@ Story Points '; - if( plugin_config_get('gadiv_storypoint_mode') == 1 ) { + if( plugin_config_get( 'gadiv_storypoint_mode' ) == 1 ) { echo ''; } else { @@ -101,7 +101,7 @@ } echo ' '; -if( plugin_config_get('gadiv_tracker_planned_costs') == '1' +if( plugin_config_get( 'gadiv_tracker_planned_costs' ) == '1' && $agilemantis_sprint->customFieldIsInProject( "PlannedWork" ) == true ) { echo ' '. @@ -136,7 +136,7 @@ if( $row['name'] == $story['name'] ) { echo 'selected'; }?>> + echo string_display($row['name'])?> @@ -172,8 +172,8 @@ > + }?>> getUserStoryStatus( $p_project_id ) >= 80 && !empty( $story['sprint'] ) && $selected == false ) {?> diff --git a/core/chart/generate_velocity_data.php b/core/chart/generate_velocity_data.php index 8fb2772..db8a462 100644 --- a/core/chart/generate_velocity_data.php +++ b/core/chart/generate_velocity_data.php @@ -178,8 +178,8 @@ $SprintAvarageKid += $row['total_developer_capacity'] / $row['workday_length']; $SprintAvarageWes += $row['work_performed'] / $row['workday_length']; $SprintAvarageWorkPerformed += $row['work_performed'] / $row['workday_length']; - }else{ - echo $agilemantis_commonlib->createAgManWarning( plugin_lang_get('warning_1').'workday_lenght of Sprint'.plugin_lang_get('warning_2') ); + } else { + echo $agilemantis_commonlib->createAgManWarning( plugin_lang_get('warning_1', 'agileMantis').'workday_length of Sprint'.plugin_lang_get('warning_2', 'agileMantis') ); } } } @@ -202,9 +202,10 @@ if( $previous[0]['workday_length'] != 0 ){ $kidpre = $previous[0]['total_developer_capacity'] / $previous[0]['workday_length']; $wespre = ($previous[0]['work_performed'] / $previous[0]['workday_length']); -} else { +} else if( $previous != 0 ) { echo $agilemantis_commonlib->createAgManWarning('workday_lenght of previous Sprint'); } + #if(false){ if( $referenced[0]['workday_length'] != 0 ){ $kidref = $referenced[0]['total_developer_capacity'] / $referenced[0]['workday_length']; diff --git a/core/schnittstelle.php b/core/schnittstelle.php index 646159a..8642dd2 100644 --- a/core/schnittstelle.php +++ b/core/schnittstelle.php @@ -40,7 +40,7 @@ // Load agileMantis configuration require_once (AGILEMANTIS_CORE_URI . 'config_api.php'); -$_COOKIE['MANTIS_STRING_COOKIE'] = $_POST['cookie_string']; +$_COOKIE[ $g_cookie_prefix . '_STRING_COOKIE'] = $_POST['cookie_string']; // Zugriff auf die Mantis Funktionen //require_once ($mantisPath . 'core.php'); @@ -133,6 +133,7 @@ echo ''; echo '' . $sprintData['id'] . ''; echo '' . $agilemantis_commonlib->safeCData($sprintData['name']) . ''; + echo '' . $agilemantis_commonlib->safeCData(string_display_line_links(utf8_decode($sprintData['name']))) . ''; echo '' . $sprintData['status'] . ''; echo '' . $agilemantis_sprint->getTeamById( $sprintData['team_id'] ) . ''; echo '' . date( 'd.m.Y', $sprintData['start'] ) . ''; @@ -752,13 +753,13 @@ $team_sprint = $agilemantis_sprint->getLatestSprints( $sprintData['team_id'] ); echo ''; foreach( $team_sprint as $num => $row ) { - echo ''; + echo ''; } echo ''; break; case 'setCookie': $buglist = str_replace( '-', ',', $_POST['bugList'] ); - setcookie( 'MANTIS_BUG_LIST_COOKIE', $buglist, 0, '/' ); + setcookie( $g_cookie_prefix . 'BUG_LIST_COOKIE', $buglist, 0, '/' ); echo 1; break; case 'sendEmail': diff --git a/core/schnittstelle_load_userstory.php b/core/schnittstelle_load_userstory.php index 4f425c1..dbe24e5 100644 --- a/core/schnittstelle_load_userstory.php +++ b/core/schnittstelle_load_userstory.php @@ -27,162 +27,199 @@ $userstory = $agilemantis_sprint->getUserStoryById(); $project_id = $userstory[0]['project_id']; $target_version = $userstory[0]['target_version']; - $version_info = $agilemantis_version->getVersionInformation($project_id, $target_version); + $version_info = $agilemantis_version->getVersionInformation( $project_id, $target_version ); $versiondate = ""; - if(isset($version_info['date_order']) && $version_info['date_order'] != ""){ - $versiondate = date('d.m.Y',$version_info['date_order']); + if( isset( $version_info['date_order'] ) && $version_info['date_order'] != "" ){ + $versiondate = date( 'd.m.Y',$version_info['date_order'] ); } $versiondescription = ""; - if(isset($version_info['description']) && $version_info['description'] != ""){ + if( isset( $version_info['description'] ) && $version_info['description'] != "" ){ $versiondescription = $version_info['description']; } echo ''; - echo ''.$userstory[0]['id'].''; - echo ''.$agilemantis_commonlib->safeCData($userstory[0]['summary']).''; - echo ''.$userstory[0]['status'].''; - echo '' . $agilemantis_commonlib->safeCData($userstory[0]['description']) .''; + echo '' . $userstory[0]['id'] . ''; + echo '' . $agilemantis_commonlib->safeCData( string_display_line_links( $userstory[0]['summary'] ) ) . ''; + echo '' . $userstory[0]['status'] . ''; + echo '' . $agilemantis_commonlib->safeCData( string_display_links( $userstory[0]['description'] ) ) . + ''; + + echo 'getCategoryById( $userstory[0]['category_id'] ) . ']]>'; + echo 'getProjectName( $userstory[0]['project_id'] ) . + ' ' . $userstory[0]['target_version'].']]>'; + echo ''; + echo ''; - echo 'getCategoryById($userstory[0]['category_id']).']]>'; - echo 'getProjectName($userstory[0]['project_id']) . ' ' . $userstory[0]['target_version'].']]>'; - echo ''; - echo ''; echo ''; - echo ''.$agilemantis_commonlib->safeCData($agilemantis_project->getProjectName($userstory[0]['project_id'])).''; - echo ''.$agilemantis_commonlib->safeCData($agilemantis_project->getProjectDescription($userstory[0]['project_id'])).''; - echo ''; - echo ''.$versiondate.''; - echo ''.$agilemantis_version->getVersionTracker($userstory[0]['project_id'],$userstory[0]['target_version'], '10,20,30,40,50,60,70,80,90').''; - echo ''.$agilemantis_version->getVersionTracker($userstory[0]['project_id'],$userstory[0]['target_version'], '10,20,30,40,50,60,70').''; - echo ''.$agilemantis_version->getVersionUserStories($userstory[0]['project_id'],$userstory[0]['target_version']).''; - echo ''.$agilemantis_version->getNumberOfUserStories($userstory[0]['project_id'],$userstory[0]['target_version']).''; - echo ''.utf8_decode($versiondescription).''; + echo '' . + $agilemantis_commonlib->safeCData( $agilemantis_project->getProjectName( $userstory[0]['project_id'] ) ) . + ''; + echo '' . + $agilemantis_commonlib->safeCData( $agilemantis_project->getProjectDescription( $userstory[0]['project_id'] ) ) . + ''; + echo ''; + echo '' . $versiondate . ''; + echo '' . + $agilemantis_version->getVersionTracker( $userstory[0]['project_id'], $userstory[0]['target_version'], '10,20,30,40,50,60,70,80,90' ) . + ''; + echo '' . + $agilemantis_version->getVersionTracker( $userstory[0]['project_id'], $userstory[0]['target_version'], '10,20,30,40,50,60,70' ) . + ''; + echo '' . + $agilemantis_version->getVersionUserStories( $userstory[0]['project_id'], $userstory[0]['target_version'] ) . + ''; + echo '' . + $agilemantis_version->getNumberOfUserStories( $userstory[0]['project_id'], $userstory[0]['target_version'] ) . + ''; + echo '' . utf8_decode( $versiondescription ) . ''; echo ''; + $id = $agilemantis_sprint->us_id; - $addFields = $agilemantis_sprint->checkForUserStory($id); - if(!empty($addFields)){ + $addFields = $agilemantis_sprint->checkForUserStory( $id ); + if( !empty( $addFields ) ){ echo ''; echo ''; echo 'Product Backlog'; - echo ''.$agilemantis_commonlib->safeCData($addFields['name']).''; + echo '' . $agilemantis_commonlib->safeCData( string_display_line_links( $addFields['name'] ) ) . ''; echo 'String'; echo ''; echo ''; echo 'Story Points'; - echo ''.$addFields['storypoints'].''; + echo '' . $addFields['storypoints'] . ''; echo 'Double'; echo ''; echo ''; echo 'Business Value'; - echo ''; + echo ''; echo 'String'; echo ''; echo ''; echo 'Sprint'; - echo ''.$agilemantis_commonlib->safeCData($addFields['sprint']).''; + echo '' . $agilemantis_commonlib->safeCData( string_display_line_links( $addFields['sprint'] ) ) . ''; echo 'String'; echo ''; - if($agilemantis_tasks->getConfigValue('plugin_agileMantis_gadiv_tracker_planned_costs')=='1'){ + if( $agilemantis_tasks->getConfigValue( 'plugin_agileMantis_gadiv_tracker_planned_costs' ) == '1' ){ echo ''; - echo ''.$s_plugin_agileMantis_PlannedWork.' ('.$_POST['userstorycostunit'].')'; - echo ''.$addFields['plannedWork'].''; + echo '' . plugin_lang_get( 'PlannedWork', 'agileMantis' ) . ' ('.$_POST['userstorycostunit'].')'; + echo '' . $addFields['plannedWork'] . ''; echo 'Double'; echo ''; } - if($agilemantis_tasks->getConfigValue('plugin_agileMantis_gadiv_ranking_order')=='1'){ + if( $agilemantis_tasks->getConfigValue( 'plugin_agileMantis_gadiv_ranking_order' ) == '1' ){ echo ''; - echo ''.$s_plugin_agileMantis_RankingOrder.''; - echo ''.$addFields['rankingorder'].''; + echo '' . plugin_lang_get( 'RankingOrder', 'agileMantis' ) . ''; + echo '' . $addFields['rankingorder'] . ''; echo 'String'; echo ''; } - if($agilemantis_tasks->getConfigValue('plugin_agileMantis_gadiv_presentable')=='1'){ - if($addFields['presentable'] == 0){$string = $s_plugin_agileMantis_view_issue_non_presentable;} - if($addFields['presentable'] == 1){$string = $s_plugin_agileMantis_view_issue_technical_presentable;} - if($addFields['presentable'] == 2){$string = $s_plugin_agileMantis_view_issue_functional_presentable;} + if( $agilemantis_tasks->getConfigValue( 'plugin_agileMantis_gadiv_presentable' ) == '1' ){ + if( $addFields['presentable'] == 0 ){ + $string = plugin_lang_get( 'view_issue_non_presentable', 'agileMantis' ); + }else if( $addFields['presentable'] == 1 ){ + $string = plugin_lang_get( 'view_issue_technical_presentable', 'agileMantis' ); + }else if( $addFields['presentable'] == 2 ){ + $string = plugin_lang_get( 'view_issue_functional_presentable', 'agileMantis' ); + } echo ''; - echo ''.$s_plugin_agileMantis_Presentable.''; - echo ''.utf8_decode($string).''; + echo '' . plugin_lang_get( 'Presentable', 'agileMantis' ) . ''; + echo '' . utf8_decode($string) . ''; echo 'String'; echo ''; } - if($agilemantis_tasks->getConfigValue('plugin_agileMantis_gadiv_technical')=='1'){ - if($addFields['technical']==0){$string = 'false';}; - if($addFields['technical']==1){$string = 'true';}; + if( $agilemantis_tasks->getConfigValue( 'plugin_agileMantis_gadiv_technical' ) == '1' ){ + if( $addFields['technical'] == 0 ){ + $string = 'false'; + }else if( $addFields['technical'] == 1 ){ + $string = 'true'; + } echo ''; - echo ''.$s_plugin_agileMantis_Technical.''; - echo ''.$string.''; + echo '' . plugin_lang_get( 'Technical', 'agileMantis' ) . ''; + echo '' . $string . ''; echo 'Boolean'; echo ''; } - if($agilemantis_tasks->getConfigValue('plugin_agileMantis_gadiv_release_documentation')=='1'){ - if($addFields['inReleaseDocu']==0){$string = 'false';}; - if($addFields['inReleaseDocu']==1){$string = 'true';}; + if( $agilemantis_tasks->getConfigValue( 'plugin_agileMantis_gadiv_release_documentation' ) == '1' ){ + if( $addFields['inReleaseDocu'] == 0 ){ + $string = 'false'; + }else if( $addFields['inReleaseDocu'] == 1 ){ + $string = 'true'; + } echo ''; - echo ''.$s_plugin_agileMantis_InReleaseDocu.''; - echo ''.$string.''; + echo '' . plugin_lang_get( 'InReleaseDocu', 'agileMantis' ) . ''; + echo '' . $string . ''; echo 'Boolean'; echo ''; } echo ''; } - $temp_tasks = $agilemantis_sprint->getSprintTasks($id); - if(!empty($temp_tasks)){ + + $t_tasks = $agilemantis_sprint->getSprintTasks( $id ); + if( !empty( $t_tasks ) ){ echo ''; - foreach($temp_tasks AS $num => $row){ - $created = $agilemantis_tasks->getTaskEvent($row['id'],'created'); - $confirmed = $agilemantis_tasks->getTaskEvent($row['id'],'confirmed'); - $resolved = $agilemantis_tasks->getTaskEvent($row['id'],'resolved'); - $reopened = $agilemantis_tasks->getTaskEvent($row['id'],'reopened'); - $closed = $agilemantis_tasks->getTaskEvent($row['id'],'closed'); + foreach( $t_tasks AS $num => $row ){ + + $created = $agilemantis_tasks->getTaskEvent( $row['id'], 'created' ); + $confirmed = $agilemantis_tasks->getTaskEvent( $row['id'], 'confirmed' ); + $resolved = $agilemantis_tasks->getTaskEvent( $row['id'], 'resolved' ); + $reopened = $agilemantis_tasks->getTaskEvent( $row['id'], 'reopened' ); + $closed = $agilemantis_tasks->getTaskEvent( $row['id'], 'closed' ); + echo ''; - echo ''.$row['id'].''; - echo ''.$agilemantis_commonlib->safeCData($row['name']).''; - echo '' . $agilemantis_commonlib->safeCData($row['description']) .''; - echo ''.((int) $row['daily_scrum']).''; - if($row['developer_id'] > 0){ - echo ''; - echo ''.$row['developer_id'].''; - echo ''.$agilemantis_tasks->getUserName($row['developer_id']).''; - echo ''.$agilemantis_tasks->getUserRealName($row['developer_id']).''; - echo ''; + echo '' . $row['id'] . ''; + echo '' . $agilemantis_commonlib->safeCData( string_display_line_links( $row['name'] ) ) . ''; + echo '' . $agilemantis_commonlib->safeCData( $row['description'] ) .''; + echo '' . ( ( int ) $row['daily_scrum'] ) . ''; + if( $row['developer_id'] > 0 ){ + echo ''; + echo '' . $row['developer_id'] . ''; + echo '' . $agilemantis_tasks->getUserName( $row['developer_id'] ) . ''; + echo '' . $agilemantis_tasks->getUserRealName( $row['developer_id'] ) . ''; + echo ''; } - echo ''.$row['status'].''; - echo ''.$row['planned_capacity'].''; - echo ''.$row['performed_capacity'].''; - echo ''.$row['rest_capacity'].''; - $create_date = strtotime($created['date']); - $confirm_date = strtotime($confirmed['date']); - $resolve_date = strtotime($resolved['date']); - $close_date = strtotime($closed['date']); - $reopen_date = strtotime($reopened['date']); - if($created['user_id'] > 0){ - echo ''.$agilemantis_tasks->getUserName($created['user_id']).' / '.date('d.m.Y',$create_date).''; + echo '' . $row['status'] . ''; + echo '' . $row['planned_capacity'] . ''; + echo '' . $row['performed_capacity'] . ''; + echo '' . $row['rest_capacity'] . ''; + + + $create_date = strtotime( $created['date'] ); + $confirm_date = strtotime( $confirmed['date'] ); + $resolve_date = strtotime( $resolved['date'] ); + $close_date = strtotime( $closed['date'] ); + $reopen_date = strtotime( $reopened['date'] ); + if( $created['user_id'] > 0 ){ + echo '' . $agilemantis_tasks->getUserName( $created['user_id'] ); + echo ' / ' . date( 'd.m.Y', $create_date ) . ''; } - if($confirmed['user_id'] > 0){ - echo ''.$agilemantis_tasks->getUserName($confirmed['user_id']).' / '.date('d.m.Y',$confirm_date).''; + if( $confirmed['user_id'] > 0 ){ + echo '' . $agilemantis_tasks->getUserName( $confirmed['user_id'] ); + echo ' / ' . date( 'd.m.Y',$confirm_date ) . ''; } - if($resolved['user_id'] > 0){ - echo ''.$agilemantis_tasks->getUserName($resolved['user_id']).' / '.date('d.m.Y',$resolve_date).''; + if( $resolved['user_id'] > 0 ){ + echo '' . $agilemantis_tasks->getUserName( $resolved['user_id'] ); + echo ' / ' . date( 'd.m.Y', $resolve_date ) . ''; } - if($closed['user_id'] > 0){ - echo ''.$agilemantis_tasks->getUserName($closed['user_id']).' / '.date('d.m.Y',$close_date).''; + if( $closed['user_id'] > 0 ){ + echo '' . $agilemantis_tasks->getUserName( $closed['user_id'] ); + echo ' / ' . date( 'd.m.Y', $close_date ) . ''; } - if($reopened['user_id'] > 0){ - echo ''.$agilemantis_tasks->getUserName($reopened['user_id']).' / '.date('d.m.Y',$reopen_date).''; + if( $reopened['user_id'] > 0 ){ + echo '' . $agilemantis_tasks->getUserName( $reopened['user_id'] ); + echo ' / ' . date( 'd.m.Y', $reopen_date ) . ''; } echo ''; } echo ''; } - $notices = $agilemantis_tasks->getNotices($id); - if(!empty($notices)){ + + $notices = $agilemantis_tasks->getNotices( $id ); + if( !empty( $notices ) ){ echo ''; - foreach($notices AS $num => $row){ + foreach( $notices AS $num => $row ){ echo ''; - echo ''.$row['id'].''; - echo '' . $agilemantis_commonlib->safeCData($row['note']) .''; - echo 'getUserName($row['reporter_id']).']]>'; - echo ''.date('d.m.Y',$row['date_submitted']).''; + echo '' . $row['id'] . ''; + echo '' . $agilemantis_commonlib->safeCData( string_display_links( $row['note'] ) ) . ''; + echo 'getUserName( $row['reporter_id'] ) . ']]>'; + echo '' . date( 'd.m.Y', $row['date_submitted'] ) . ''; echo ''; } echo ''; diff --git a/lang/strings_english.txt b/lang/strings_english.txt index 08b2e29..48b8e2d 100644 --- a/lang/strings_english.txt +++ b/lang/strings_english.txt @@ -133,6 +133,7 @@ $s_plugin_agileMantis_edit_product_backlog_user_email = 'Email address of team user'; $s_plugin_agileMantis_edit_product_backlog_projects = 'Projects'; $s_plugin_agileMantis_edit_product_backlog_add_project = 'Add Project'; + $s_plugin_agileMantis_edit_product_backlog_team_user_info = 'The Team-User

With the creation of a new Product Backlog an additional MantisBT user is created. Its name is derived from the name of the Product Backlog plus prefixed „Team-User“. His MantisBT user role is „developer“, his agileMantis permission is „agileMantis-participant“. This user is referred as „Team-User“ of the created Product Backlog.

If the Product Owner assigns a Product Backlog to an issue which becomes a User Story, then the assignment should be transferred to a user who is responsible for the further processing. Finally, from this point on the Product Owner is no longer responsible for the issue.

According to the philosophy of Scrum, the Product Owner does not assign a User Story to a specific user, but to the team who is responsible for the Product Backlog. During the Sprint Planning the Team will decide which tasks for editing the User Story are necassary and which developer from the team should perform one of these.

Thus, at the moment of creating a User Story there is no specific user which could be assigned to this User Story. That is why the Team-User from the chosen Product Backlog will be assigned. Thereby the User Story is symbolically linked to the team which is responsible for the Product Backlog.'; # Manage Team $s_plugin_agileMantis_manage_teams_title = 'Manage Teams'; diff --git a/lang/strings_german.txt b/lang/strings_german.txt index fce377c..19541d3 100644 --- a/lang/strings_german.txt +++ b/lang/strings_german.txt @@ -134,6 +134,7 @@ $s_plugin_agileMantis_edit_product_backlog_user_email = 'Email-Adresse des Team-Users'; $s_plugin_agileMantis_edit_product_backlog_projects = 'Projekte'; $s_plugin_agileMantis_edit_product_backlog_add_project = 'Projekt hinzufügen'; + $s_plugin_agileMantis_edit_product_backlog_team_user_info = 'Der Team-User

Mit der Neuanlage eines Product Backlogs wird ein zusätzlicher Mantis-Benutzer angelegt. Dessen Name setzt sich zusammen aus dem Namen des Product Backlogs plus vorangestelltem „Team-User-“. Seine Mantis-Rolle ist „Entwickler“,seine agileMantis-Berechtigung ist „agileMantis-Teilnehmer“. Er wird im Weiteren „Team-User“ des speziellen Product Backlog genannt.

Wenn der Product Owner aus einem ihm zugeordneten Issue eine User Story macht,dann sollte die Zuordnung auf einen Benutzer übergehen,der die weitere Bearbeitung übernimmt;schließlich ist von diesem Zeitpunkt an nicht mehr der Product Owner zuständig.

Gemäß der Philosophie von Scrum übergibt jedoch der Product Owner die User Story keineswegs an einen konkreten Bearbeiter,sondern an das für die Bearbeitung des Product Backlog zuständige Team. Dieses Team wird erst im Rahmen eines späteren Sprint Planning festlegen,welche Aufgaben / Tasks zur Bearbeitung der User Story notwendig sind und welcher Entwickler aus dem Team welchen Task durchführen soll.

Somit gibt es zum Zeitpunkt der Schaffung einer User Story keinen konkreten Benutzer,dem die User Story zugewiesen werden könnte. Aus diesem Grund wird hierfür als Ersatz der zum Product Backlog gehörige Team-User herangezogen. Hierdurch wird die User Story symbolisch dem Team zugewiesen,welches das Product Backlog bearbeitet.'; # Teams verwalten $s_plugin_agileMantis_manage_teams_title = 'Teams verwalten'; diff --git a/libs/class_commonlib.php b/libs/class_commonlib.php index 774873a..74899e2 100644 --- a/libs/class_commonlib.php +++ b/libs/class_commonlib.php @@ -26,7 +26,6 @@ class gadiv_commonlib { - var $agileMantisVersion = '2.1.0'; var $id; var $pbid; var $us_id; @@ -162,7 +161,9 @@ function forwardReturnToPage( $page_name ) { } function getConfigValueNoCache( $p_config_id ) { - $t_sql = "SELECT * FROM mantis_config_table WHERE config_id=" . db_param( 0 ); + $t_mantis_config_table = db_get_table( 'mantis_config_table' ); + + $t_sql = "SELECT * FROM $t_mantis_config_table WHERE config_id=" . db_param( 0 ); $t_params = array( $p_config_id ); $t_config = $this->executeQuery( $t_sql, $t_params ); return $t_config[0]['value']; @@ -625,7 +626,10 @@ function getSelectedTeam() { # get product owner username function getProductOwner( $p_id ) { - $t_sql = "SELECT * FROM gadiv_rel_team_user AS tu LEFT JOIN mantis_user_table AS ut " . + + $t_mantis_user_table = db_get_table( 'mantis_user_table' ); + + $t_sql = "SELECT * FROM gadiv_rel_team_user AS tu LEFT JOIN $t_mantis_user_table AS ut " . "ON tu.user_id=ut.id WHERE role LIKE '%1%' AND team_id=" . db_param( 0 ); $t_params = array( $p_id ); $t_name = $this->executeQuery( $t_sql, $t_params ); @@ -634,7 +638,10 @@ function getProductOwner( $p_id ) { # get scrum master username function getScrumMaster( $p_id ) { - $t_sql = "SELECT * FROM gadiv_rel_team_user AS tu LEFT JOIN mantis_user_table AS ut " . + + $t_mantis_user_table = db_get_table( 'mantis_user_table' ); + + $t_sql = "SELECT * FROM gadiv_rel_team_user AS tu LEFT JOIN $t_mantis_user_table AS ut " . "ON tu.user_id=ut.id WHERE role LIKE '%2%' AND team_id=" . db_param( 0 ); $t_params = array( $p_id ); $t_name = $this->executeQuery( $t_sql, $t_params ); @@ -1105,7 +1112,6 @@ function customFieldIsInProject( $p_field_name ) { # restores agileMantis custom field value if user tries to enter wrong value function restoreCustomFieldValue( $p_bug_id, $p_field_id, $p_value ) { custom_field_set_value( $p_field_id, $p_bug_id, $p_value ); - history_delete( $p_bug_id ); } # get product backlog id by product backlog name diff --git a/libs/class_product_backlog.php b/libs/class_product_backlog.php index 4cb801b..bcdd78f 100644 --- a/libs/class_product_backlog.php +++ b/libs/class_product_backlog.php @@ -56,6 +56,7 @@ function newProductBacklog() { $p_email = trim( $p_email ); $t_seed = $p_email . $p_username; $t_password = auth_generate_random_password( $t_seed ); + if( user_is_name_unique( $p_username ) === true ) { user_create( $p_username, $t_password, $p_email, 55, false, true, 'Team-User-' . $_POST['pbl_name'] ); @@ -578,7 +579,7 @@ function setCustomFieldValues( $bug_id ) { # get the latest mantis user function getLatestUser() { $t_mantis_user_table = db_get_table( 'mantis_user_table' ); - $team = $this->executeQuery( "SELECT max(id) AS id FROM $t_mantis_user_table GROUP BY enabled" ); + $team = $this->executeQuery( "SELECT max(id) AS id FROM $t_mantis_user_table" ); return $team[0]['id']; } diff --git a/libs/class_sprint.php b/libs/class_sprint.php index 0a65138..edb0e60 100644 --- a/libs/class_sprint.php +++ b/libs/class_sprint.php @@ -220,14 +220,14 @@ function getSprintStories( $name, $show_only_open_userstories = false ) { $user_stories[] = $row; } - $sort_by = $this->getConfigValue( 'current_user_sprint_backlog_filter' ); + $sort_by = config_get( 'current_user_sprint_backlog_filter', null, auth_get_current_user_id() ); if( !empty( $_GET['sort_by'] ) && isset( $_GET['sort_by'] ) ) { config_set( 'current_user_sprint_backlog_filter', $_GET['sort_by'], auth_get_current_user_id() ); $sort_by = $_GET['sort_by']; } - - $direction = $this->getConfigValue( 'current_user_sprint_backlog_filter_direction' ); + + $direction = config_get( 'current_user_sprint_backlog_filter_direction', null, auth_get_current_user_id() ); if( !empty( $_GET['direction'] ) && isset( $_GET['direction'] ) ) { config_set( 'current_user_sprint_backlog_filter_direction', $_GET['direction'], auth_get_current_user_id() ); @@ -604,6 +604,7 @@ function previousSprintIsClosed( $team_id, $sprint_id ) { GROUP BY team_id"; $t_params = array( $team_id, $sprint_id ); $result = $this->executeQuery( $t_sql, $t_params ); + if( $result[0]['amount'] > 0 ) { return false; } else { diff --git a/pages/agileuser.php b/pages/agileuser.php index 2df2c81..79cc0c4 100644 --- a/pages/agileuser.php +++ b/pages/agileuser.php @@ -1,7 +1,7 @@ . - html_page_top(plugin_lang_get( 'manage_user_title' )); - + html_page_top(plugin_lang_get( 'manage_user_title' )); + # check if user has enough rights $t_user_right = $agilemantis_au->authUser(); if( $t_user_right == 2 || $t_user_right == 3 || current_user_is_administrator() ) { ?> @@ -40,92 +40,29 @@ $rsUser = $agilemantis_au->getAllUser(); foreach( $rsUser as $num => $usr ) { $i = $usr[id]; - + if( $_SESSION['participant'][$i] == 1 || $_SESSION['developer'][$i] == 1 ) { $particpant = 1; } else { $particpant = 0; $agilemantis_team->deleteStakeholderFromTeams( $i ); } - + if( $_SESSION['developer'][$i] == 1 ) { $developer = 1; } else { $developer = 0; $agilemantis_team->deleteScrumDeveloperFromTeams( $i ); } - + if( $_SESSION['administrator'][$i] == 1 ) { $administrator = 1; } else { $administrator = 0; } - - /* - $agilemantis_au->getUserRights($i, $isParticipant, $isDeveloper, $isAdmin); - - //send mail if rights change - if ($isParticipant != $particpant || - $isDeveloper != $developer || - $isAdmin != $administrator) { - //No DIRECTORY_SEPARATOR it is an URI - $uri = explode('/',$_SERVER['REQUEST_URI']); - if(!empty($uri[1])){ - $subdir = '/'.$uri[1].'/'; - } - - include_once($_SERVER['DOCUMENT_ROOT'].$subdir.'config_defaults_inc.php'); - include_once($_SERVER['DOCUMENT_ROOT'].$subdir.'library'.DIRECTORY_SEPARATOR.'phpmailer'.DIRECTORY_SEPARATOR.'class.phpmailer.php'); - $adr_language = user_pref_get_language( $i ); - if($adr_language == 'german'){ - include( $path . 'plugins' . DIRECTORY_SEPARATOR . 'agileMantis' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR . 'strings_german.txt' ); - $datum = date("d.m.Y"); - } else { - include( $path . 'plugins' . DIRECTORY_SEPARATOR . 'agileMantis' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR . 'strings_english.txt' ); - $datum = date("Y/m/d"); - } - - try { - $login_username = current_user_get_field( 'username' ); - $login_realname = current_user_get_field( 'realname' ); - $login_email = current_user_get_field( 'email' ); - - if (!empty($usr[0]['email']) && !empty($login_email) && !empty($g_smtp_host)) { - - $yes = $s_plugin_agileMantis_mail_yes; - $no = $s_plugin_agileMantis_mail_no; - - $mail = new PHPMailer(); - $mail->IsSMTP(); - $mail->Host = $g_smtp_host; - - $mail->From = $login_email; - $mail->FromName = $login_realname; - $mail->Sender = $login_email; - $mail->AddAddress($usr[0]['email']); - $mail->Subject = $s_plugin_agileMantis_mail_subject; - $mail->Body = $s_plugin_agileMantis_mail_body_1. "\n\n"; - $mail->Body .= $s_plugin_agileMantis_mail_body_2 . $datum . "\n"; - $mail->Body .= $s_plugin_agileMantis_mail_body_3 . $login_username . "\n" ; - $mail->Body .= $s_plugin_agileMantis_mail_body_4 . "\n"; - $mail->Body .= " Participant : " . (($isParticipant == 1) ? $yes : $no) . " -> " . (($particpant == 1) ? $yes : $no) . "\n"; - $mail->Body .= " Developer : " . (($isDeveloper == 1) ? $yes : $no) . " -> " . (($developer == 1) ? $yes : $no) . "\n"; - $mail->Body .= " Administrator : " . (($isAdmin == 1) ? $yes : $no) . " -> " . (($administrator == 1) ? $yes : $no) . "\n"; - - if(!$mail->Send()) { - echo 'Message was not sent.'; - echo 'Mailer error: ' . $mail->ErrorInfo; - } - } - } catch (phpmailerException $e) { - echo $e->errorMessage(); - } - } - */ - - $agilemantis_au->setAgileMantisUserRights( $i, $particpant, $developer, - $administrator ); + $agilemantis_au->setAgileMantisUserRights( $i, $particpant, $developer,$administrator ); + } } else { $userArray = array_keys( $_SESSION['expert'] ); @@ -135,9 +72,9 @@ plugin_lang_get( 'manage_user_successful_saved' ) . '
'; } $user = $agilemantis_au->getAllUser(); - + # create a filtered table view with all necassary information - function createTableView( $id, $username, $realname, $email, $participant, $developer, + function createTableView( $id, $username, $realname, $email, $participant, $developer, $administrator, $expert ) { if( $participant == 1 ) { $participant_check = 'checked'; @@ -167,7 +104,7 @@ function createTableView( $id, $username, $realname, $email, $participant, $deve $participant_disable = ''; $additional = ''; } - + return ' ' . $username . ' ' . $realname . ' @@ -244,11 +181,11 @@ function createTableView( $id, $username, $realname, $email, $participant, $deve @@ -274,21 +211,21 @@ function createTableView( $id, $username, $realname, $email, $participant, $deve - getAdditionalUserFields( $row['id'] ); ?> - - - - - > - - - - + + + + @@ -138,15 +138,15 @@ } } elseif( $show_all_teams === true ) { ?> - " + " method="post"> + value=""> > - - - - + + + + diff --git a/pages/chose_sprint.php b/pages/chose_sprint.php index c54146c..29e241c 100644 --- a/pages/chose_sprint.php +++ b/pages/chose_sprint.php @@ -154,18 +154,18 @@ foreach( $userTeams as $key => $value ) { if( $row['team_id'] == $value['team_id'] ) { ?> - - + + - + - - - + + + - - + + @@ -176,12 +176,12 @@ - + - - + + @@ -192,18 +192,18 @@ } } elseif( $show_all_teams === true ) { ?> - - + + - + - - - + + + - - + + @@ -211,15 +211,15 @@ - + - - - + + + - - + + diff --git a/pages/config.php b/pages/config.php index d730519..4ced15d 100644 --- a/pages/config.php +++ b/pages/config.php @@ -25,15 +25,6 @@ # along with agileMantis. If not, see . global $agilemantis_tasks; - - # initial plugin config settings - if( !config_is_set( 'plugin_agileMantis_gadiv_show_storypoints' ) ) { - config_set( 'plugin_agileMantis_gadiv_show_storypoints', 0 ); - } - - if( !config_is_set( 'plugin_agileMantis_gadiv_show_rankingorder' ) ) { - config_set( 'plugin_agileMantis_gadiv_show_rankingorder', 0 ); - } // Workaround to prevent error messages if custom_strings_inc.php is missing function lang_get_failsave_custom_field( $p_custom_field_name ) { diff --git a/pages/divide_userstories.php b/pages/divide_userstories.php index 49acd7e..2b36c07 100644 --- a/pages/divide_userstories.php +++ b/pages/divide_userstories.php @@ -36,10 +36,7 @@ function copyUserStory( $us_id, $status, $sprintname ) { global $agilemantis_tasks; global $agilemantis_sprint; - $new_bug_id = bug_copy( $us_id, $p_target_project_id = null, $p_copy_custom_fields = true, - $p_copy_relationships = true, $p_copy_history = false, $p_copy_attachments = true, - $p_copy_bugnotes = true, $p_copy_monitoring_users = true ); - + $new_bug_id = bug_copy( $us_id, null, true, true, false, true, true, true ); $agilemantis_pb->doUserStoryToSprint( $new_bug_id, $sprintname ); relationship_add( $new_bug_id, $us_id, 0 ); $task = $agilemantis_sprint->getSprintTasks( $us_id ); @@ -54,6 +51,7 @@ function copyUserStory( $us_id, $status, $sprintname ) { $agilemantis_pb->addPresentable( $new_bug_id, $old_userstory['presentable'] ); $agilemantis_pb->AddInReleaseDocu( $new_bug_id, $old_userstory['inReleaseDocu'] ); $agilemantis_pb->AddPlannedWork( $new_bug_id, $old_userstory['plannedWork'] ); + history_delete($new_bug_id); $bugnote_text_new = plugin_lang_get( 'divide_userstories_from' ) . $agilemantis_pb->getUserName( auth_get_current_user_id() ) . @@ -225,7 +223,7 @@ function copyUserStory( $us_id, $status, $sprintname ) { $row ) { ?> - + diff --git a/pages/edit_product_backlog.php b/pages/edit_product_backlog.php index d1bffcb..9cd65ad 100644 --- a/pages/edit_product_backlog.php +++ b/pages/edit_product_backlog.php @@ -105,8 +105,8 @@ } // warning message if there are users without access rights - $result = $agilemantis_project->get_user_with_no_accessrights( - $agilemantis_pb->id, $t_project_id ); + $result = $agilemantis_project->get_user_with_no_accessrights( $agilemantis_pb->id, $t_project_id ); + if( count( $result ) > 0 ) { $names = $result[0]["realname"]; for( $i = 1; $i < count( $result ); $i++ ) { @@ -144,10 +144,16 @@ || ( $agilemantis_pb->name == $pb_name_old ) ); // PB name didn't change, Ok! - if( $isNewPBOk || $isExistingPbOk ) { + if( $isNewPBOk || $isExistingPbOk ) { if ( ! $agilemantis_pb->editProductBacklog() ) { $system = plugin_lang_get( 'edit_product_backlog_error_982601' ); } else { + + if( $_POST['pbl_email'] != $_POST['pbl_email_old'] ){ + $t_team_user_id = $agilemantis_pb->getTeamUserId( $agilemantis_pb->id ); + user_set_field( $t_team_user_id, 'email', $_POST['pbl_email'] ); + } + $agilemantis_pb->updatePBCustomFieldStrings( $pb_name_old, $agilemantis_pb->name ); @@ -261,20 +267,26 @@ > - + diff --git a/pages/edit_task.php b/pages/edit_task.php index afa4da3..4168bcd 100644 --- a/pages/edit_task.php +++ b/pages/edit_task.php @@ -725,7 +725,7 @@ > diff --git a/pages/info.php b/pages/info.php index c5862e6..1d1b618 100644 --- a/pages/info.php +++ b/pages/info.php @@ -26,9 +26,7 @@ html_page_top(plugin_lang_get( 'info_title' )); - - $current_version = $agilemantis_au->agileMantisVersion; - + if(!config_is_set('plugin_agileMantis_gadiv_agilemantis_version')){ config_set('plugin_agileMantis_gadiv_agilemantis_version', 0); } @@ -51,7 +49,7 @@ > > diff --git a/pages/product_backlog_actions.php b/pages/product_backlog_actions.php index ac76bcc..448645f 100644 --- a/pages/product_backlog_actions.php +++ b/pages/product_backlog_actions.php @@ -109,8 +109,8 @@ > - - + + checkProductBacklogMoreOneTeam( $product_backlog ) ) { ?> diff --git a/pages/product_backlog_stories.php b/pages/product_backlog_stories.php index 5d86f24..6b16416 100644 --- a/pages/product_backlog_stories.php +++ b/pages/product_backlog_stories.php @@ -224,8 +224,8 @@ onclick="(, '');" height="16" width="16"> - - + + - - + @@ -64,22 +64,22 @@ $agilemantis_pb->productBacklogHasStoriesLeft( $row['name'] ); ?> > - - + + @@ -207,14 +207,14 @@ - + diff --git a/pages/sprint_backlog_actions.php b/pages/sprint_backlog_actions.php index d4280e9..8d75e7d 100644 --- a/pages/sprint_backlog_actions.php +++ b/pages/sprint_backlog_actions.php @@ -147,7 +147,7 @@ disabled > &sprintName="> + href="&sprintName="> " @@ -199,8 +199,8 @@ $tomorrow = time() + 86400; $sprint_start = $s['start']; $is_begin_date_tomorrow_or_earlier = ( $sprint_start <= $tomorrow ); - $prev_sprint_closed = $agilemantis_sprint->previousSprintIsClosed( - $s['team_id'], $s['id'] ); + $prev_sprint_closed = $agilemantis_sprint->previousSprintIsClosed( $s['team_id'], $s['id'] ); + if( $is_begin_date_tomorrow_or_earlier && $has_userstories && $status_open && @@ -237,19 +237,18 @@ $disable_close = 'disabled'; if( $s['status'] != 0 && $s['status'] != 2 && $agilemantis_sprint->allTasksAndStoriesAreClosed( $s['name'] ) == false && - (time() >= $s['end'] || $s['start'] + 86400 > $s['end']) ) { + ( time() >= $s['end'] || $s['start'] + 86400 > $s['end'] ) ) { $disable_copy = ''; } elseif( $s['status'] != 0 && $s['status'] != 2 && $agilemantis_sprint->allTasksAndStoriesAreClosed( $s['name'] ) == true && - (time() >= $s['end'] || $s['start'] + 86400 > $s['end']) ) { + ( time() >= $s['end'] || $s['start'] + 86400 > $s['end'] ) ) { $disable_close = ''; } ?> > - + @@ -311,26 +310,26 @@ $productBacklog = $agilemantis_sprint->getSelectedProductBacklog(); ?> - - - + + + - - + + - + diff --git a/pages/sprint_backlog_functions.php b/pages/sprint_backlog_functions.php index a900a06..f34224f 100644 --- a/pages/sprint_backlog_functions.php +++ b/pages/sprint_backlog_functions.php @@ -84,7 +84,7 @@ } # confirm sprint -if( $_POST['confirmSprint'] == 1 ) { +if( $_POST['confirmSprint'] == 1 ) { $agilemantis_sprint->sprint_id = $_POST['id']; $sprintInfo = $agilemantis_sprint->getSprintByName(); $agilemantis_sprint->setSprintStatus( 1, $sprintInfo['id'] ); diff --git a/pages/sprint_backlog_task_row.php b/pages/sprint_backlog_task_row.php index 3c934d1..7d0ae39 100644 --- a/pages/sprint_backlog_task_row.php +++ b/pages/sprint_backlog_task_row.php @@ -51,7 +51,7 @@ @@ -70,7 +70,7 @@ ?> - + - + - + - + @@ -358,10 +358,10 @@ ?> > - + - + @@ -373,27 +373,27 @@ - + - + - + - + @@ -402,7 +402,7 @@ - + @@ -411,7 +411,7 @@ - + @@ -421,7 +421,7 @@ - + @@ -430,7 +430,7 @@ > @@ -438,7 +438,7 @@ > @@ -446,7 +446,7 @@ > @@ -454,7 +454,7 @@
"> @@ -262,10 +199,10 @@ function createTableView( $id, $username, $realname, $email, $participant, $deve
&sort_by=username">&sort_by=username"> &sort_by=realname">&sort_by=realname"> &sort_by=email">Email
- - - + + +
">
@@ -348,7 +285,7 @@ function createTableView( $id, $username, $realname, $email, $participant, $deve ?>
-
- +
getTeamById($row['team_id']);?>getProductBacklogByTeam($row['team_id']));?>getTeamById( $row['team_id'] ) );?>getProductBacklogByTeam( $row['team_id'] ) );?>
getTeamById($row['team_id']);?>getProductBacklogByTeam($row['team_id']));?>getTeamById( $row['team_id'] ) );?>getProductBacklogByTeam( $row['team_id'] ) );?>
getTeamById($row['team_id']);?>getProductBacklogByTeam($row['team_id']));?>getTeamById( $row['team_id'] ) );?>getProductBacklogByTeam( $row['team_id'] ) );?>
getTeamById($row['team_id']);?>getProductBacklogByTeam($row['team_id']));?>getTeamById( $row['team_id'] ) );?>getProductBacklogByTeam( $row['team_id'] ) );?>
* + + + + + + + getUserEmail($pbData[0]['user_id']); - } - $t_readonly = ""; - if($pbData[0]['id']>0){ - $t_readonly = "readonly"; - } - ?>> + getUserEmail($pbData[0]['user_id']); + } + ?> + + +
* diff --git a/pages/edit_sprint.php b/pages/edit_sprint.php index b732e83..886638a 100644 --- a/pages/edit_sprint.php +++ b/pages/edit_sprint.php @@ -450,7 +450,7 @@ - + + style="height: 200px; width: 400px;">
Version - + version;?>
getUserName( $agilemantis_team->getTeamProductOwner() )?>
-
" method="post"> + " method="post">
&sort_by=name">Name&sort_by=description"> + &sort_by=name">Name&sort_by=description">
-
+
-
+ checkProductBacklogTeam( $row['id'] ) == true - || $agilemantis_pb->productBacklogHasStoriesLeft($row['name'] ) == false ) { + || $agilemantis_pb->productBacklogHasStoriesLeft( $row['name'] ) == false ) { ?> disabled > diff --git a/pages/sprint_backlog.php b/pages/sprint_backlog.php index f9933bd..8f198ba 100644 --- a/pages/sprint_backlog.php +++ b/pages/sprint_backlog.php @@ -159,25 +159,25 @@ " method="post" style="float: right; margin: 0; padding: 0;"> + null, auth_get_current_user_id() ) == 1 ) { ?> checked value="1" onClick="this.form.submit();"> + null, auth_get_current_user_id() ) == 1 ) {?> checked value="1" onClick="this.form.submit();"> + checked value="1" onClick="this.form.submit();">
&sprintName=&sort_by=id&direction=&sprintName=&sort_by=id&direction=">ID &sprintName=&sort_by=summary&direction=&sprintName=&sort_by=summary&direction="> Rest &sprintName=&sort_by=storypoints&direction=&sprintName=&sort_by=storypoints&direction=">SP &sprintName=&sort_by=rankingOrder&direction=&sprintName=&sort_by=rankingOrder&direction=">R
getTeamById($s['team_id']);?>getTeamById( $s['team_id'] ) );?>
- +
- +
-
&us_id=&us_id=" method="post"> @@ -79,25 +79,25 @@ echo plugin_lang_get( 'sprint_backlog_add_task' )?>" >
- -
" method="post"> + + " method="post"> = 80){?>disabled = 80 ){?>disabled >
-
" method="post"> + " method="post"> = 80){?>disabled = 80 ){?>disabled >
@@ -116,22 +116,22 @@
0 ) { - echo $agilemantis_team->getUserName( $value['developer_id']); + echo $agilemantis_team->getUserName( $value['developer_id'] ); }?> -
" method="post"> - + " method="post"> + - + @@ -139,26 +139,26 @@ 3 || $value['status'] == 1 || $s['status'] == 0 - || $value['rest_capacity'] == 0.00){?>disabled> + || $value['rest_capacity'] == 0.00 ){?>disabled> 3 || $value['status'] == 1 || $s['status'] == 0 - || $value['rest_capacity'] == 0.00){?>disabled 3 || $value['status'] == 1 || $s['status'] == 0 + || $value['rest_capacity'] == 0.00 ){?>disabled >
-
" method="post"> + " method="post"> @@ -169,13 +169,13 @@ echo $disable_button?> >
-
" method="post"> - + " method="post"> + - - + + @@ -185,10 +185,10 @@ if( $value['status'] != 3 || $value['performed_capacity'] <= 0 || $s['status'] != 1 ) {?>disabled>
- -
" method="post"> - + " method="post"> + " method="post"> + " method="post"> + echo md5( uniqid( microtime(), 1 ) ) ?>"/> - - + + @@ -224,14 +224,14 @@ echo $sprint_end_disable?>>
-
" method="post"> + " method="post"> - - + + diff --git a/pages/sprints.php b/pages/sprints.php index 31e0bea..c578e44 100644 --- a/pages/sprints.php +++ b/pages/sprints.php @@ -154,19 +154,19 @@ ?>
- + - + - + - getTeamById( $row['team_id'] )?> + getTeamById( $row['team_id'] ))?>
+ action="">
User Story - "" + style="font-weight: bold; color: grey;">""
Produkt Backlog Sprint Sprint Sprint value="1" disabled> Sprint value="1" disabled> Sprint Sprint Sprint value="1" disabled> Sprint
- +
- +
- +
- +
@@ -464,7 +464,7 @@ - - - + + +
Tasks - "" + style="font-weight: bold; color: grey;">""
getUserName($row['developer_id'])?>getUserName( $row['developer_id'] )?> -
diff --git a/pages/teams.php b/pages/teams.php index b609bf5..04a90ba 100644 --- a/pages/teams.php +++ b/pages/teams.php @@ -47,7 +47,7 @@
+ href="&sort_by=name">Name @@ -76,20 +76,20 @@ foreach( $teams AS $num => $row ) { ?> > - - - + + +
- " + " method="post"> @@ -56,18 +56,18 @@
&sort_by=name">Name &sort_by=description"> + href="&sort_by=description"> &sort_by=product_backlog">Product + href="&sort_by=product_backlog">Product Backlog &sort_by=product_owner">Product + href="&sort_by=product_owner">Product Owner &sort_by=scrum_master">Scrum + href="&sort_by=scrum_master">Scrum Master
getTeamBacklog( $row['product_backlog']) ) ?>getTeamBacklog( $row['product_backlog'] ) ) ?> getProductOwner( $row['id'] ) ?> getScrumMaster( $row['id'] ) ?> + action="">
+ action="">