$this->showEditBar = true;
}
-
+ $this->issue->images = $this->issue->images();
}
$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');
+ $i->object($this->issue);
+ $i->ontable = $this->issue->tableName();
+ $i->onid = $this->issue->id;
+ $i->created_by = $this->authUser->id;
+ $i->mimetype = $_FILES['attachments']["type"][$fileid];
+ $i->createFrom($_FILES['attachments']['tmp_name'][$fileid],$_FILES['attachments']['name'][$fileid]);
+
+ // 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
- (ontable='mtrack_project' and onid = {$this->issue->project_id})
- ) ";
-
+ (ontable='Projects' and onid = {$this->issue->project_id})
+ ";
+ $w = DB_DataObject::factory('core_watch');
$w->ensureNotify( 'mtrack_ticket' ,
$this->issue->id,
$this->authUser->id,
);
//DB_DataObject::debugLevel(1);
// who to notify..
- $w = DB_DataObject::factory('core_watch');
+ // who to notify.. -- originall did not send to issuer..
+ // we should probably make this configurable..
$w->notify( 'mtrack_ticket' , $this->issue->id,
- " $notify_query
+ $notify_query
+ /* " ( $notify_query )
AND
- (person_id != {$this->authUser->id}) "
+ (person_id != {$this->authUser->id}) " */
);
// 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");
}
$pd = DB_DataObject::factory('ProjectDirectory');
$pd->project_id = $this->currentProject();
$pd->whereAdd("ProjectDirectory.role != ''");
- $pd->joinAdd(DB_DataObject::factory('Person'), 'LEFT');
+ $pd->joinAdd(DB_DataObject::factory('core_person'), 'LEFT');
$pd->selectAdd();
$pd->selectAdd("distinct(Person.id) as id , CONCAT(Person.name , '<', Person.email , '>') as name");
$pd->groupBy('Person.id, Person.name');