Skip to content

Commit

Permalink
$this->data['TimeEntry']を存在確認してからmergeするようにした
Browse files Browse the repository at this point in the history
  • Loading branch information
ha1t committed Mar 29, 2011
1 parent a3b4c8a commit c672431
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/controllers/issues_controller.php
Expand Up @@ -347,12 +347,19 @@ function edit() {
}
if(($this->RequestHandler->isPost() || $this->RequestHandler->isPut()) && !empty($this->data)) {
$this->Issue->TimeEntry->create();
$this->Issue->TimeEntry->set(array_merge(array(
$time_entry = array(
'project_id'=>$this->_project['Project']['id'],
'issue_id' =>$issue['Issue']['id'],
'user_id' =>$this->current_user['id'],
'spent_on' =>date('Y-m-d')
), $this->data['TimeEntry']));
);

if (isset($this->data['TimeEntry'])) {
$time_entry = array_merge($time_entry, $this->data['TimeEntry']);
}

$this->Issue->TimeEntry->set($time_entry);

if(!empty($this->data['custom_field_values'])) {
$this->Issue->TimeEntry->data['TimeEntry']['custom_field_values'] = $this->Issue->TimeEntry->filterCustomFieldValue($this->data['custom_field_values']);
}
Expand Down

0 comments on commit c672431

Please sign in to comment.