diff --git a/codepot/src/codepot/controllers/issue.php b/codepot/src/codepot/controllers/issue.php index 7448fbc2..b66357eb 100644 --- a/codepot/src/codepot/controllers/issue.php +++ b/codepot/src/codepot/controllers/issue.php @@ -273,7 +273,13 @@ class Issue extends Controller $issue->type = $this->input->post('issue_new_type'); $issue->status = $this->issuehelper->STATUS_NEW; $issue->priority = $this->issuehelper->PRIORITY_OTHER; - if ($this->projects->projectHasMember($project->id, $login['id'])) + + $owner_candidate = $this->input->post('issue_new_owner'); + if ($this->projects->projectHasMember($project->id, $owner_candidate)) + { + $issue->owner = $owner_candidate; + } + else if ($this->projects->projectHasMember($project->id, $login['id'])) { // let the current user be the issue owner if he/she is a // project memeber. diff --git a/codepot/src/codepot/views/issue_home.php b/codepot/src/codepot/views/issue_home.php index eb8957ca..212275a0 100644 --- a/codepot/src/codepot/views/issue_home.php +++ b/codepot/src/codepot/views/issue_home.php @@ -173,6 +173,7 @@ $(function () { form_data.append ('issue_new_file_count', f_no); form_data.append ('issue_new_type', $('#issue_home_new_type').val()); + form_data.append ('issue_new_owner', $('#issue_home_new_owner').val()); form_data.append ('issue_new_summary', $('#issue_home_new_summary').val()); form_data.append ('issue_new_description', $('#issue_home_new_description').val()); @@ -399,6 +400,16 @@ else set_value('issue_home_new_type', ''), 'id="issue_home_new_type"' ); + print ' '; + + $tmpmemb = array(); + foreach ($project->members as $m) $tmpmemb[$m] = $m; + print form_dropdown ( + 'issue_home_new_owner', + $tmpmemb, + set_value('issue_home_new_owner', (in_array($login['id'], $project->members)? $login['id']: '')), + 'id="issue_home_new_owner"' + ); ?> '/>