Hi,
I have osticket collecting mail from our external mail server and automatically creating a ticket. This is working a treat, but if I add this to class.ticket.php to view the thumbnails in the ticket and open the attachment in a new tab (which works) The IMAP fetch stops working?
function getAttachmentStr($refid,$type){
global $cfg;
$helpdesk_url=$cfg->getUrl();
$dir=$cfg->getUploadDir();
$dir = preg_replace("/\\\\/","/",$dir);
$dir = explode('/', $dir);
$arrDir = array_reverse($dir);
$dir = $arrDir;
$sql ='SELECT attach_id,file_size,file_name,file_key FROM '.TICKET_ATTACHMENT_TABLE.
' WHERE deleted=0 AND ticket_id='.db_input($this->getId()).' AND ref_id='.db_input($refid).' AND ref_type='.db_input($type);
$res=db_query($sql);
if($res && db_num_rows($res)){
while(list($id,$size,$name,$key)=db_fetch_row($res)){
$month=date('my',strtotime($this->getCreateDate()));
$hash=MD5($this->getId()*$refid.session_id());
$size=Format:($size);
$ext = strtolower(substr(strrchr($name, '.'), 1));
$fullfilename = $helpdesk_url.$dir.'/'.$month.'/'.$key.'_'.$name;
if (in_array($ext,array('jpg', 'png', 'gif', 'bmp'))) {
list($width, $height, $type, $attr) = getimagesize($fullfilename);
}
$attachstr.= "<a class='Icon file' href='$fullfilename' target='_new'><img src='attachment.php?id=$id&ref=$hash' width=125 ><br><b>$name</b></a> (<i>$size</i>) ";
}
}
return ($attachstr);
}
Does anyone have any ideas, because this is driving me mad now, at the moment I can have 1 or the other?
Cheers
Simon