| |
|
Line 11
|
Parallel
|
Line 11
|
Parallel
|
| 11 |
URL. See the codestriker.conf file for more information. |
11 |
URL. See the codestriker.conf file for more information. |
| 12 |
Submitted by Edwin Fine <edwin.m.fine@verizon.com>. |
12 |
Submitted by Edwin Fine <edwin.m.fine@verizon.com>. |
| 13 |
|
13 |
|
|
|
14 |
* Creating a topic with an invalid bug ID is now shown as an error to |
|
|
15 |
the user on the create topic screen. |
|
|
16 |
|
| 14 |
* If there was an error creating a topic, the selected project name |
17 |
* If there was an error creating a topic, the selected project name |
| 15 |
was not retained when the create topic screen was redisplayed. This |
18 |
was not retained when the create topic screen was redisplayed. This |
| 16 |
has now been fixed. |
19 |
has now been fixed. |
| |
| |
|
Line 82
|
Parallel
|
Line 82
|
Parallel
|
| 82 |
$feedback .= "Topic text specified using tags and uploaded file.\n"; |
82 |
$feedback .= "Topic text specified using tags and uploaded file.\n"; |
| 83 |
$feedback .= "Please choose one topic text method, and try again.\n"; |
83 |
$feedback .= "Please choose one topic text method, and try again.\n"; |
| 84 |
} |
84 |
} |
| 85 |
|
85 |
|
| 86 |
$http_response->generate_header(topic_title=>"Create New Topic", |
86 |
$http_response->generate_header(topic_title=>"Create New Topic", |
| 87 |
email=>$email, reviewers=>$reviewers, |
87 |
email=>$email, reviewers=>$reviewers, |
| 88 |
cc=>$cc, repository=>$repository_name, |
88 |
cc=>$cc, repository=>$repository_name, |
| |
| |
|
Line 150
|
Parallel
|
Line 150
|
Parallel
|
| 150 |
$projectid = $projects[0]->{id}; |
150 |
$projectid = $projects[0]->{id}; |
| 151 |
} |
151 |
} |
| 152 |
|
152 |
|
|
|
153 |
# Make sure all the conditions from the topic listeners are satisified. |
|
|
154 |
$feedback .= Codestriker::TopicListeners::Manager::topic_pre_create |
|
|
155 |
($email, $topic_title, $topic_description, |
|
|
156 |
$bug_ids, $reviewers, $cc, |
|
|
157 |
$repository_url, $projectid); |
|
|
158 |
|
| 153 |
# If there is a problem with the input, redirect to the create screen |
159 |
# If there is a problem with the input, redirect to the create screen |
| 154 |
# with the message. |
160 |
# with the message. |
| 155 |
if ($feedback ne "") { |
161 |
if ($feedback ne "") { |
| |
| |
|
Line 34
|
Parallel
|
Line 34
|
Parallel
|
| 34 |
$self->{dbh}->disconnect; |
34 |
$self->{dbh}->disconnect; |
| 35 |
} |
35 |
} |
| 36 |
|
36 |
|
|
|
37 |
# Return true if the specified bugid exists in the bug database, |
|
|
38 |
# false otherwise. |
|
|
39 |
sub bugid_exists($$) { |
|
|
40 |
my ($self, $bugid) = @_; |
|
|
41 |
|
|
|
42 |
return $self->{dbh}->selectrow_array('SELECT COUNT(*) FROM bugs ' . |
|
|
43 |
'WHERE bug_id = ?', {}, $bugid) != 0; |
|
|
44 |
} |
|
|
45 |
|
| 37 |
# Method for updating the bug with information that a code review has been |
46 |
# Method for updating the bug with information that a code review has been |
| 38 |
# created/closed/committed against this bug. |
47 |
# created/closed/committed against this bug. |
| 39 |
sub update_bug($$$$) { |
48 |
sub update_bug($$$$) { |
| |
| |
|
Line 26
|
Parallel
|
Line 26
|
Parallel
|
| 26 |
return bless $self, $type; |
26 |
return bless $self, $type; |
| 27 |
} |
27 |
} |
| 28 |
|
28 |
|
|
|
29 |
# Check that the nominated bugids exist in the bug database. |
|
|
30 |
sub topic_pre_create($$) { |
|
|
31 |
my ($self, $user, $topic_title, $topic_description, $bug_ids, |
|
|
32 |
$reviewers, $cc, $repository_url, $projectid) = @_; |
|
|
33 |
|
|
|
34 |
my $feedback = ''; |
|
|
35 |
if ($bug_ids ne '') { |
|
|
36 |
my @bug_ids = split /, /, $bug_ids; |
|
|
37 |
my $bug_db_connection = |
|
|
38 |
Codestriker::BugDB::BugDBConnectionFactory->getBugDBConnection(); |
|
|
39 |
foreach my $bug_id (@bug_ids) { |
|
|
40 |
if (!$bug_db_connection->bugid_exists($bug_id)) { |
|
|
41 |
$feedback .= "Bug ID $bug_id does not exist.\n"; |
|
|
42 |
} |
|
|
43 |
} |
|
|
44 |
$bug_db_connection->release_connection(); |
|
|
45 |
} |
|
|
46 |
|
|
|
47 |
return $feedback; |
|
|
48 |
} |
|
|
49 |
|
| 29 |
sub topic_create($$) { |
50 |
sub topic_create($$) { |
| 30 |
my ($self, $topic) = @_; |
51 |
my ($self, $topic) = @_; |
| 31 |
|
52 |
|
| |
| |
|
Line 19
|
Parallel
|
Line 19
|
Parallel
|
| 19 |
return bless $self, $type; |
19 |
return bless $self, $type; |
| 20 |
} |
20 |
} |
| 21 |
|
21 |
|
|
|
22 |
sub topic_pre_create($$) { |
|
|
23 |
my ($self, $user, $topic_title, $topic_description, $bug_ids, |
|
|
24 |
$reviewers, $cc, $repository_url, $projectid) = @_; |
|
|
25 |
|
|
|
26 |
# Default version of function that does nothing, and allowed the |
|
|
27 |
# event to continue. |
|
|
28 |
|
|
|
29 |
return ''; |
|
|
30 |
} |
|
|
31 |
|
| 22 |
sub topic_create($$) { |
32 |
sub topic_create($$) { |
| 23 |
my ($self, $user, $topic) = @_; |
33 |
my ($self, $user, $topic) = @_; |
| 24 |
|
34 |
|
| |