MTrackWeb/TicketEdit.php
authorAlan Knowles <alan@akbkhome.com>
Thu, 24 Mar 2011 06:39:23 +0000 (14:39 +0800)
committerAlan Knowles <alan@akbkhome.com>
Thu, 24 Mar 2011 06:39:23 +0000 (14:39 +0800)
MTrackWeb/TicketEdit.php

index 74eede7..802f563 100644 (file)
@@ -364,9 +364,9 @@ class MTrackWeb_TicketEdit extends MTrackWeb
             
         }
         
-        if ($this->issue->project_id) {
+        if ($this->currentProject()) {
             $d = DB_DataObject::factory('mtrack_project_component');
-            $d->project_id = $this->issue->project_id;
+            $d->project_id = $this->currentProject();
             $d->orderBy('name');
             $d->whereAdd('deleted != 1');
             $this->elements['component[]'] = new HTML_Template_Flexy_Element('select');
@@ -374,10 +374,9 @@ class MTrackWeb_TicketEdit extends MTrackWeb
             $ar = $this->issue->components();
             $this->elements['component[]']->setValue(array_keys($ar));
         
-        }
-        if ($this->issue->project_id) {
+        
             $d = DB_DataObject::factory('mtrack_milestone');
-            $d->project_id = $this->issue->project_id;
+            $d->project_id = $this->currentProject();
             $d->orderBy('(case when duedate is null then 1 else 0 end), duedate, name');
             $d->whereAdd('completed != 1');
             $d->whereAdd('deleted != 1');