MTrackWeb/Ticket.php
authorAlan Knowles <alan@akbkhome.com>
Fri, 8 Apr 2011 09:52:01 +0000 (17:52 +0800)
committerAlan Knowles <alan@akbkhome.com>
Fri, 8 Apr 2011 09:52:01 +0000 (17:52 +0800)
MTrackWeb/Ticket.php

index be4a56b..74527a8 100644 (file)
@@ -180,6 +180,31 @@ class MTrackWeb_Ticket extends MTrackWeb
         $this->issue->updated = $CS->id;
         $this->issue->update($old);
         
+        
+        
+        
+        if (!empty($_FILES['attachments'])) {
+            foreach ($_FILES['attachments']['name'] as $fileid => $name) {
+                $i = DB_DataObject::factory('Images');      
+                    MTrackAttachment::add("ticket:{$this->issue->tid}",
+                        $_FILES['attachments']['tmp_name'][$fileid],
+                        $_FILES['attachments']['name'][$fileid],
+                        $CS
+                    );
+                }
+            }
+        }
+        /*
+        if (!count($this->error) && $this->id != 'new') {
+            require_once 'MTrack/Attachment.php';
+            MTrackAttachment::process_delete("ticket:{$this->issue->tid}", $CS);
+        } 
+        */
+        
+        
+        
+        
+        
         $notify_query = "
                 (ontable='mtrack_ticket' and onid = {$this->issue->id})
                  OR
@@ -217,25 +242,7 @@ class MTrackWeb_Ticket extends MTrackWeb
         // if the owner has changed.. then we should add them to the watch list...
  
         // MTrackWatch::watch_object('ticket', $this->issue->tid,  $this->issue->owner);
-        /*         
-        if (!count($this->error)) {
-            if (!empty($_FILES['attachments'])) {
-                require_once 'MTrack/Attachment.php';
-                foreach ($_FILES['attachments']['name'] as $fileid => $name) {
-                      
-                    MTrackAttachment::add("ticket:{$this->issue->tid}",
-                        $_FILES['attachments']['tmp_name'][$fileid],
-                        $_FILES['attachments']['name'][$fileid],
-                        $CS
-                    );
-                }
-            }
-        }
-        if (!count($this->error) && $this->id != 'new') {
-            require_once 'MTrack/Attachment.php';
-            MTrackAttachment::process_delete("ticket:{$this->issue->tid}", $CS);
-        } 
-        */
+        
         $this->jok("OK");
         
     }