Skip to content
Snippets Groups Projects
Commit c299fb8c authored by Peter Rotich's avatar Peter Rotich
Browse files

Retire ref_type

parent 6d4f26db
No related branches found
No related tags found
No related merge requests found
...@@ -118,8 +118,7 @@ class Thread { ...@@ -118,8 +118,7 @@ class Thread {
.' FROM '.TICKET_THREAD_TABLE.' thread ' .' FROM '.TICKET_THREAD_TABLE.' thread '
.' LEFT JOIN '.TICKET_ATTACHMENT_TABLE.' attach .' LEFT JOIN '.TICKET_ATTACHMENT_TABLE.' attach
ON (thread.ticket_id=attach.ticket_id ON (thread.ticket_id=attach.ticket_id
AND thread.id=attach.ref_id AND thread.id=attach.ref_id) '
AND thread.thread_type=attach.ref_type) '
.' WHERE thread.ticket_id='.db_input($this->getTicketId()); .' WHERE thread.ticket_id='.db_input($this->getTicketId());
if($type && is_array($type)) if($type && is_array($type))
...@@ -247,8 +246,7 @@ Class ThreadEntry { ...@@ -247,8 +246,7 @@ Class ThreadEntry {
ON (thread.id=info.thread_id) ' ON (thread.id=info.thread_id) '
.' LEFT JOIN '.TICKET_ATTACHMENT_TABLE.' attach .' LEFT JOIN '.TICKET_ATTACHMENT_TABLE.' attach
ON (thread.ticket_id=attach.ticket_id ON (thread.ticket_id=attach.ticket_id
AND thread.id=attach.ref_id AND thread.id=attach.ref_id) '
AND thread.thread_type=attach.ref_type) '
.' WHERE thread.id='.db_input($id); .' WHERE thread.id='.db_input($id);
if($type) if($type)
...@@ -466,8 +464,7 @@ Class ThreadEntry { ...@@ -466,8 +464,7 @@ Class ThreadEntry {
$sql ='INSERT IGNORE INTO '.TICKET_ATTACHMENT_TABLE.' SET created=NOW() ' $sql ='INSERT IGNORE INTO '.TICKET_ATTACHMENT_TABLE.' SET created=NOW() '
.' ,file_id='.db_input($fileId) .' ,file_id='.db_input($fileId)
.' ,ticket_id='.db_input($this->getTicketId()) .' ,ticket_id='.db_input($this->getTicketId())
.' ,ref_id='.db_input($this->getId()) .' ,ref_id='.db_input($this->getId());
.' ,ref_type='.db_input($this->getType());
return (db_query($sql) && ($id=db_insert_id()))?$id:0; return (db_query($sql) && ($id=db_insert_id()))?$id:0;
} }
...@@ -491,8 +488,7 @@ Class ThreadEntry { ...@@ -491,8 +488,7 @@ Class ThreadEntry {
.' FROM '.FILE_TABLE.' f ' .' FROM '.FILE_TABLE.' f '
.' INNER JOIN '.TICKET_ATTACHMENT_TABLE.' a ON(f.id=a.file_id) ' .' INNER JOIN '.TICKET_ATTACHMENT_TABLE.' a ON(f.id=a.file_id) '
.' WHERE a.ticket_id='.db_input($this->getTicketId()) .' WHERE a.ticket_id='.db_input($this->getTicketId())
.' AND a.ref_id='.db_input($this->getId()) .' AND a.ref_id='.db_input($this->getId());
.' AND a.ref_type='.db_input($this->getType());
$this->attachments = array(); $this->attachments = array();
if(($res=db_query($sql)) && db_num_rows($res)) { if(($res=db_query($sql)) && db_num_rows($res)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment