diff --git a/RedmineMobile/RedmineMobile/ViewControllers/OZLIssueCreateViewController.m b/RedmineMobile/RedmineMobile/ViewControllers/OZLIssueCreateViewController.m index 6088eb3..dafed77 100644 --- a/RedmineMobile/RedmineMobile/ViewControllers/OZLIssueCreateViewController.m +++ b/RedmineMobile/RedmineMobile/ViewControllers/OZLIssueCreateViewController.m @@ -172,10 +172,11 @@ issueData.status = _currentStatus; issueData.priority = _currentPriority; issueData.assignedTo = _currentUser; - issueData.projectId = _parentProject.index; - if (_parentIssue) { issueData.parentIssueId = _parentIssue.index; + issueData.projectId = _parentIssue.projectId; + }else { + issueData.projectId = _parentProject.index; } issueData.description = _descriptionTextview.text; issueData.startDate = _startDateLabel.text; @@ -315,6 +316,20 @@ [self.tableView reloadData]; } +-(NSString*)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section +{ + if (section == 0) { + NSString* tip ; + if (_parentIssue) { + tip = [NSString stringWithFormat:@"Add sub issue to #%d",_parentIssue.index]; + }else { + tip = [NSString stringWithFormat:@"Add issue to project:%@",_parentProject.name]; + } + return tip; + } + return @""; +} + #pragma mark - #pragma mark delegate of textfield inputview diff --git a/RedmineMobile/RedmineMobile/ViewControllers/OZLIssueDetailViewController.m b/RedmineMobile/RedmineMobile/ViewControllers/OZLIssueDetailViewController.m index c29be83..3f57049 100644 --- a/RedmineMobile/RedmineMobile/ViewControllers/OZLIssueDetailViewController.m +++ b/RedmineMobile/RedmineMobile/ViewControllers/OZLIssueDetailViewController.m @@ -30,6 +30,7 @@ #import "OZLIssueHistoryViewController.h" #import "OZLIssueLogtimeViewController.h" #import "OZLSingleton.h" +#import "OZLIssueCreateViewController.h" @interface OZLIssueDetailViewController () @@ -92,7 +93,11 @@ [self.navigationController pushViewController:history animated:YES]; }break; case 1:{// add sub task - + UIStoryboard *tableViewStoryboard = [UIStoryboard storyboardWithName:@"OZLIssueCreateViewController" bundle:nil]; + OZLIssueCreateViewController* creator = [tableViewStoryboard instantiateViewControllerWithIdentifier:@"OZLIssueCreateViewController"]; + [creator setParentIssue:_issueData]; + //[self.navigationController presentModalViewController:creator animated:YES]; + [self.navigationController pushViewController:creator animated:YES]; }break; case 2:{//logtime UIStoryboard *tableViewStoryboard = [UIStoryboard storyboardWithName:@"OZLIssueLogtimeViewController" bundle:nil];