Fixed download method enquiry attachments
This commit is contained in:
parent
abd7f453db
commit
9fbaca261f
|
|
@ -12,8 +12,6 @@ class EmailAttachmentsController extends AppController {
|
|||
$file = $this->EmailAttachment->findById($id);
|
||||
|
||||
$file_path = Configure::read('email_directory');
|
||||
echo $file_path."/".$file['EmailAttachment']['name'];
|
||||
die();
|
||||
if(file_exists($file_path."/".$file['EmailAttachment']['name'])) {
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ class Email extends AppModel {
|
|||
'EmailAttachment' => array('className' => 'EmailAttachment',
|
||||
'foreignKey' => 'email_id',
|
||||
'dependent' => true,
|
||||
'order' => 'EmailAttachment.size DESC',
|
||||
'counterCache'=>'email_attachment_count'),
|
||||
|
||||
'EmailRecipient' => array('className' => 'EmailRecipient',
|
||||
|
|
|
|||
|
|
@ -3,6 +3,10 @@ class EmailAttachment extends AppModel {
|
|||
|
||||
var $name = 'EmailAttachment';
|
||||
|
||||
|
||||
var $order = "EmailAttachment.size DESC";
|
||||
|
||||
|
||||
var $belongsTo = array(
|
||||
'Email' => array('className' => 'Email',
|
||||
'foreignKey' => 'email_id',
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ doesn't appear in the drop down list, click 'New Contact'")); ?>
|
|||
echo $form->input('Customer.name', array('readonly'=>'readonly', 'value'=>$customer['Customer']['name']));
|
||||
echo $form->input('user_id', array('label' =>'Assigned to User'), $users);
|
||||
echo '<div id="contact">';
|
||||
echo $form->input('contact_user_id', array('div' => false));
|
||||
echo $form->input('contact_user_id', array('type'=>'select', 'options'=>$contacts));
|
||||
echo '<br>';
|
||||
//echo $ajax->link('New Contact', array('controller' => 'contacts', 'action' => 'add_one',$customer['Customer']['id']), array('update'=>'contact'));
|
||||
//echo $html->image('contact-new.png');
|
||||
|
|
|
|||
|
|
@ -32,13 +32,15 @@ $(function() {
|
|||
autoOpen: false,
|
||||
width: 450,
|
||||
modal: true,
|
||||
title: 'Add a Contact'
|
||||
position: 'top',
|
||||
});
|
||||
|
||||
$("#addContactUser").click(function() { //Meh, we'll just repeat this for the 3 user types. Easiest way to handle this.'
|
||||
$("#addContactUser").click(function() { //Adding a Contact to a Customer.
|
||||
var userType = 'contact';
|
||||
var customer_id = $('.customer_id').attr('id');
|
||||
var thisAction = 'add'
|
||||
|
||||
$("#addUserDiv").dialog( "option", "title", 'Add Contact to Customer' );
|
||||
$("#addUserDiv").load('/users/add_edit/action:'+thisAction+'/type:'+userType+'/customer_id:'+customer_id);
|
||||
$("#addUserDiv").dialog('open');
|
||||
return false;
|
||||
|
|
@ -50,7 +52,7 @@ $(function() {
|
|||
var userType ='contact';
|
||||
var thisAction = 'edit';
|
||||
var user_id = $(this).attr('id');
|
||||
|
||||
$("#addUserDiv").dialog( "option", "title", 'Edit Customer Contact' );
|
||||
$("#addUserDiv").load('/users/add_edit/action:'+thisAction+'/type:'+userType+'/user_id:'+user_id);
|
||||
$("#addUserDiv").dialog('open');
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue