Initial Commit of AgileBill Open Source
This commit is contained in:
6
modules/ticket_attachment/auth.inc.php
Normal file
6
modules/ticket_attachment/auth.inc.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
$auth_methods = Array
|
||||
(
|
||||
Array ('module'=> 'ticket_attachment', 'method'=> 'download')
|
||||
);
|
||||
?>
|
56
modules/ticket_attachment/ticket_attachment.inc.php
Normal file
56
modules/ticket_attachment/ticket_attachment.inc.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* AgileBill - Open Billing Software
|
||||
*
|
||||
* This body of work is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the Open AgileBill License
|
||||
* License as published at http://www.agileco.com/agilebill/license1-4.txt
|
||||
*
|
||||
* For questions, help, comments, discussion, etc., please join the
|
||||
* Agileco community forums at http://forum.agileco.com/
|
||||
*
|
||||
* @link http://www.agileco.com/
|
||||
* @copyright 2004-2008 Agileco, LLC.
|
||||
* @license http://www.agileco.com/agilebill/license1-4.txt
|
||||
* @author Tony Landis <tony@agileco.com>
|
||||
* @package AgileBill
|
||||
* @version 1.4.93
|
||||
*/
|
||||
|
||||
class ticket_attachment
|
||||
{
|
||||
function download($VAR) {
|
||||
if(empty($VAR['id'])) return false;
|
||||
|
||||
$id=$VAR['id'];
|
||||
|
||||
// get ticket id
|
||||
$db=&DB();
|
||||
$rs=$db->Execute(sqlSelect($db, Array("ticket_attachment","ticket"), "A.ticket_id,B.department_id,B.account_id","A.id=::$id:: AND A.ticket_id=B.id"));
|
||||
if(!$rs || $rs->RecordCount()==0) return false;
|
||||
|
||||
// is this an admin?
|
||||
global $C_auth;
|
||||
if($C_auth->auth_method_by_name("ticket","view")) {
|
||||
|
||||
// get the data & type
|
||||
$rs=$db->Execute(sqlSelect($db, "ticket_attachment", "*", "id=::$id::"));
|
||||
|
||||
// set the header
|
||||
require_once(PATH_CORE.'file_extensions.inc.php');
|
||||
$ft = new file_extensions;
|
||||
$type = $ft->set_headers_ext($rs->fields['type'], $rs->fields['name']);
|
||||
|
||||
if (empty($type)) {
|
||||
echo imap_qprint($rs->fields['content']);
|
||||
} elseif(eregi("^text", $type)) {
|
||||
echo imap_base64($rs->fields['content']);
|
||||
} else {
|
||||
echo imap_base64($rs->fields['content']);
|
||||
}
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
43
modules/ticket_attachment/ticket_attachment_construct.xml
Normal file
43
modules/ticket_attachment/ticket_attachment_construct.xml
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<construct>
|
||||
<module>ticket_attachment</module>
|
||||
<table>ticket_attachment</table>
|
||||
<dependancy/>
|
||||
<cache>0</cache>
|
||||
<order_by>name</order_by>
|
||||
<limit>25</limit>
|
||||
<index>
|
||||
<tickets>site_id,ticket_id</tickets>
|
||||
<message>site_id,ticket_message_id</message>
|
||||
<fulltext_content>content</fulltext_content>
|
||||
</index>
|
||||
<field>
|
||||
<id>
|
||||
<type>I4</type>
|
||||
<unique>1</unique>
|
||||
</id>
|
||||
<site_id>
|
||||
<type>I4</type>
|
||||
</site_id>
|
||||
<ticket_id>
|
||||
<type>I4</type>
|
||||
</ticket_id>
|
||||
<ticket_message_id>
|
||||
<type>I8</type>
|
||||
</ticket_message_id>
|
||||
<name>
|
||||
<type>C(255)</type>
|
||||
</name>
|
||||
<size>
|
||||
<type>C(16)</type>
|
||||
</size>
|
||||
<type>
|
||||
<type>C(64)</type>
|
||||
</type>
|
||||
<content>
|
||||
<type>X2</type>
|
||||
</content>
|
||||
</field>
|
||||
<method></method>
|
||||
<trigger>0</trigger>
|
||||
</construct>
|
11
modules/ticket_attachment/ticket_attachment_install.xml
Normal file
11
modules/ticket_attachment/ticket_attachment_install.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<install>
|
||||
<module_properties>
|
||||
<name>ticket_attachment</name>
|
||||
<parent>ticket</parent>
|
||||
<notes><![CDATA[Contains files attached to tickets]]></notes>
|
||||
<menu_display></menu_display>
|
||||
</module_properties>
|
||||
<sql_inserts>
|
||||
<module_method></module_method>
|
||||
</sql_inserts>
|
||||
</install>
|
Reference in New Issue
Block a user