Email vault coming along. Implementing jQuery powered view for next commit

This commit is contained in:
Karl Cordes 2010-03-23 10:03:03 +11:00
parent 5622d8b94c
commit d1792506d2
7 changed files with 422 additions and 375 deletions

View file

@ -65,6 +65,8 @@ class EnquiriesController extends AppController {
* Fix up Email Attachment icon on email box. Currently broken -KC 6/8/09 * Fix up Email Attachment icon on email box. Currently broken -KC 6/8/09
$this->set('number_of_emails', $this->Enquiry->Email->find('count', array('conditions'=>array('Email.enquiry_id'=>$id)))); $this->set('number_of_emails', $this->Enquiry->Email->find('count', array('conditions'=>array('Email.enquiry_id'=>$id))));
*/ */
$this->set('emails', $this->Enquiry->Email->find('all', array('conditions'=>array('Email.enquiry_id' => $id))));
$this->set('number_of_quotes', $this->Enquiry->Quote->find('count', array('conditions'=>array('Quote.enquiry_id'=>$id)))); $this->set('number_of_quotes', $this->Enquiry->Quote->find('count', array('conditions'=>array('Quote.enquiry_id'=>$id))));
//$this->set('number_of_files', $this->Enquiry->EnquiryFile->find('count', array('conditions' => array('EnquiryFile.enquiry_id'=>$id)))); //$this->set('number_of_files', $this->Enquiry->EnquiryFile->find('count', array('conditions' => array('EnquiryFile.enquiry_id'=>$id))));
$this->set('principle_emails', $this->Enquiry->Principle->PrincipleContact->findAllByPrincipleId($enquiry['Enquiry']['principle_id'])); $this->set('principle_emails', $this->Enquiry->Principle->PrincipleContact->findAllByPrincipleId($enquiry['Enquiry']['principle_id']));

View file

@ -5,7 +5,8 @@ class Email extends AppModel {
var $belongsTo = array( var $belongsTo = array(
'Enquiry' => array('className' => 'Enquiry', 'Enquiry' => array('className' => 'Enquiry',
'foreignKey' => 'enquiry_id')); 'foreignKey' => 'enquiry_id',
'counterCache' => true));
var $hasMany = array( var $hasMany = array(
'EmailAttachment' => array('className' => 'EmailAttachment', 'EmailAttachment' => array('className' => 'EmailAttachment',
@ -13,5 +14,5 @@ class Email extends AppModel {
'dependent' => false 'dependent' => false
)); ));
} }
?> ?>

View file

@ -6,6 +6,7 @@ class EmailAttachment extends AppModel {
var $belongsTo = array( var $belongsTo = array(
'Email' => array('className' => 'Email', 'Email' => array('className' => 'Email',
'foreignKey' => 'email_id', 'foreignKey' => 'email_id',
'counterCache' => true,
'conditions' => '', 'conditions' => '',
'fields' => '', 'fields' => '',
'order' => '' 'order' => ''

View file

@ -170,16 +170,19 @@ class Enquiry extends AppModel {
'counterQuery' => '' 'counterQuery' => ''
), ),
'Email' => array('className' => 'Email',
'foreignKey' => 'enquiry_id',
'dependent' => false
),
/* 'EnquiryFile' => array('className' => 'EnquiryFile', /* 'EnquiryFile' => array('className' => 'EnquiryFile',
'foreignKey' => 'enquiry_id', 'foreignKey' => 'enquiry_id',
'dependent' => false 'dependent' => false
),*/ ),*/
/*'Email' => array('className' => 'Email',
'foreignKey' => 'enquiry_id',
'dependent' => false
),
*/
); );
var $hasOne = array('EnquiryEmailQueue'); var $hasOne = array('EnquiryEmailQueue');

View file

@ -17,11 +17,17 @@ class VaultShell extends Shell {
/* Setup Connection to the IMAP server */ /* Setup Connection to the IMAP server */
$username = 'vault'; $username = 'vault';
$password = 'xjdYOsmJWc37'; /* The password for the account to be checked */ $password = 'xjdYOsmJWc37'; /* The password for the account to be checked */
$email_dir = '/var/www/cakephp/app/emails/working'; $email_dir = '/var/www/cakephp/app/emails';
$temp_filename = 'temp.eml'; $temp_filename = 'temp.eml';
$ripmime_path = '/usr/local/bin/ripmime';
if($testing == 1) { if($testing == 1) {
$email_dir = '/Users/karlcordes/Sites/app/emails/working'; $email_dir = '/Users/karlcordes/Sites/quotenik/app/emails';
$ripmime_path = '/opt/local/bin/ripmime';
} }
$mbox = imap_open("{mail.cmctechnologies.com.au:143}INBOX", $username, $password) or die("can't connect: " . imap_last_error()); $mbox = imap_open("{mail.cmctechnologies.com.au:143}INBOX", $username, $password) or die("can't connect: " . imap_last_error());
@ -33,19 +39,24 @@ class VaultShell extends Shell {
if($number_of_messages == 0) { if($number_of_messages == 0) {
exit(0); exit(0);
} }
exit(0);
/* Loop through the messages and sort them into ones to be processed or discarded */ /* Loop through the messages and sort them into ones to be processed or discarded */
for ($i=1; $i <= $number_of_messages; $i++) { for ($i=30000; $i <= $number_of_messages; $i++) {
$this_header = imap_headerinfo($mbox, $i); $this_header = imap_headerinfo($mbox, $i);
$message = $this->getMessage($mbox, $i, $this_header); $message = $this->getMessage($mbox, $i, $this_header);
echo "Checking msg number: $i \tSubject: ".$message['subject']."\n"; //echo "Checking msg number: $i \tSubject: ".$message['subject']."\n";
$enquiry = $this->checkIfValidEnquiry($message['subject'], $testing); $enquiry = $this->checkIfValidEnquiry($message['subject'], $testing);
if($enquiry) { if($enquiry) {
echo "Found Enquiry number: ".$enquiry['Enquiry']['title']." Processing.\n";
//Process it and store the message and its attachments. //Process it and store the message and its attachments.
//Generate a Uniqid for this email.
$uniqid = $this->getUniqId($email_dir);
$this->Email->create(); $this->Email->create();
$this->data['Email']['enquiry_id'] = $enquiry['Enquiry']['id']; $this->data['Email']['enquiry_id'] = $enquiry['Enquiry']['id'];
$this->data['Email']['to'] = $message['to']; $this->data['Email']['to'] = $message['to'];
@ -55,27 +66,28 @@ class VaultShell extends Shell {
$this->data['Email']['subject'] = $message['subject']; $this->data['Email']['subject'] = $message['subject'];
$this->data['Email']['body'] = ""; $this->data['Email']['body'] = "";
$this->data['Email']['plainbody'] = ""; $this->data['Email']['plainbody'] = "";
$this->data['Email']['uniqid'] = $uniqid;
$structure = imap_fetchstructure($mbox, $i); $structure = imap_fetchstructure($mbox, $i);
$attachments = 1; $attachments = 1;
if (empty($structure->parts)) { /* A single part message. No attachments and is plain text */ if (empty($structure->parts)) { /* A single part message. No attachments and is plain text */
$this->data['Email']['body'] = imap_body($mbox, $i); $this->data['Email']['body'] = imap_body($mbox, $i);
} }
else { else {
$attachments = $this->fetchBodyAttachments($mbox, $i, $temp_filename, $email_dir); $attachments = $this->fetchBodyAttachments($mbox, $i, $temp_filename, $email_dir, $uniqid, $ripmime_path);
if($attachments != 1) { if($attachments != 1) {
foreach ($attachments as $attachment) { foreach ($attachments as $attachment) {
if($attachment['type'] == 'text/html') { //Assuming All HTML attachments are the body of the email if($attachment['type'] == 'text/html') { //Assuming All HTML attachments are the body of the email
if(file_exists($email_dir.'/'.$attachment['name'])) { if(file_exists($email_dir.'/'.$uniqid.'/'.$attachment['name'])) {
$filecontents = file_get_contents($email_dir.'/'.$attachment['name']); $filecontents = file_get_contents($email_dir.'/'.$uniqid.'/'.$attachment['name']);
$size = filesize($email_dir.'/'.$attachment['name']); $size = filesize($email_dir.'/'.$uniqid.'/'.$attachment['name']);
$this->data['Email']['body'] .= $filecontents; $this->data['Email']['body'] .= $filecontents;
} }
} }
if($attachment['type'] == 'text/plain') { //Found plain text if($attachment['type'] == 'text/plain') { //Found plain text
if(file_exists($email_dir.'/'.$attachment['name'])) { if(file_exists($email_dir.'/'.$attachment['name'])) {
$filecontents = file_get_contents($email_dir.'/'.$attachment['name']); $filecontents = file_get_contents($email_dir.'/'.$uniqid.'/'.$attachment['name']);
$size = filesize($email_dir.'/'.$attachment['name']); $size = filesize($email_dir.'/'.$uniqid.'/'.$attachment['name']);
$this->data['Email']['plainbody'] .= $filecontents; $this->data['Email']['plainbody'] .= $filecontents;
} }
@ -92,7 +104,7 @@ class VaultShell extends Shell {
$email_id = $this->Email->id; $email_id = $this->Email->id;
if($attachments != 1) { if($attachments != 1) {
foreach ($attachments as $attachment) { foreach ($attachments as $attachment) {
if(file_exists($email_dir.'/'.$attachment['name']) != FALSE) { if(file_exists($email_dir.'/'.$uniqid.'/'.$attachment['name']) != FALSE) {
if( ($attachment['type'] != 'text/html') && ($attachment['type'] != 'multipart/mixed') && if( ($attachment['type'] != 'text/html') && ($attachment['type'] != 'multipart/mixed') &&
($attachment['type'] != 'multipart/alternative') ) { ($attachment['type'] != 'multipart/alternative') ) {
@ -101,7 +113,7 @@ class VaultShell extends Shell {
$this->data['EmailAttachment']['name'] = $attachment['name']; $this->data['EmailAttachment']['name'] = $attachment['name'];
$this->data['EmailAttachment']['type'] = $attachment['type']; $this->data['EmailAttachment']['type'] = $attachment['type'];
$this->data['EmailAttachment']['size'] = filesize($email_dir.'/'.$attachment['name']); $this->data['EmailAttachment']['size'] = filesize($email_dir.'/'.$attachment['name']);
$this->data['EmailAttachment']['data'] = file_get_contents($email_dir.'/'.$attachment['name']); $this->data['EmailAttachment']['filename'] = $email_dir.'/'.$uniqid.'/'.$attachment['name'];
if ($this->EmailAttachment->save($this->data)) { if ($this->EmailAttachment->save($this->data)) {
echo "Saved file successfully to database\n"; echo "Saved file successfully to database\n";
} }
@ -150,7 +162,7 @@ class VaultShell extends Shell {
} }
$this->rmdirr($email_dir); //delete all attachments from the working directory. Easiest way to stop random files persisting // $this->rmdirr($email_dir); //delete all attachments from the working directory. Easiest way to stop random files persisting
@ -191,11 +203,17 @@ class VaultShell extends Shell {
* *
*/ */
function fetchBodyAttachments($mailbox, $msg_number, $filename, $email_dir) { function fetchBodyAttachments($mailbox, $msg_number, $filename, $email_dir, $uniqid, $ripmime_path) {
$email_file = $email_dir.'/'.$filename; $mkdirresult = mkdir ($email_dir.'/'.$uniqid);
if($mkdirresult == FALSE) {
echo "ERROR: Failed to make ".$email_dir.'/'.$uniqid;
return 1;
}
$email_file = $email_dir.'/'.$uniqid.'/'.$filename;
imap_savebody($mailbox, $email_file, $msg_number); imap_savebody($mailbox, $email_file, $msg_number);
$command = "/usr/local/bin/ripmime -i $email_file -d $email_dir -v --verbose-contenttype --paranoid --prefix $msg_number"; $command = "$ripmime_path -i $email_file -d $email_dir/$uniqid -v --verbose-contenttype --paranoid --prefix $msg_number";
$output = array(); $output = array();
exec($command, $output, $status); exec($command, $output, $status);
@ -237,7 +255,7 @@ class VaultShell extends Shell {
function getMessage($mbox, $msgnumber, $headers) { function getMessage($mbox, $msgnumber, $headers) {
$subject = $headers->subject; $subject = $headers->subject;
$subject = iconv_mime_decode($subject, 0, "ISO-8859-1"); $subject = iconv_mime_decode($subject, 0, "ISO-8859-1//IGNORE");
$date = $headers->date; $date = $headers->date;
$recipients = $this->getRecipients($headers); $recipients = $this->getRecipients($headers);
$message['subject'] = $subject; $message['subject'] = $subject;
@ -309,7 +327,7 @@ class VaultShell extends Shell {
if(isset($output[0])) { //Found a valid-looking Enquiry Number if(isset($output[0])) { //Found a valid-looking Enquiry Number
$fetched_enquirynumber = $output[0]; $fetched_enquirynumber = $output[0];
echo $fetched_enquirynumber."\n"; // echo $fetched_enquirynumber."\n";
$enquiry = $this->Enquiry->findByTitle($fetched_enquirynumber); $enquiry = $this->Enquiry->findByTitle($fetched_enquirynumber);
if($enquiry) { if($enquiry) {
return $enquiry; return $enquiry;
@ -359,5 +377,21 @@ class VaultShell extends Shell {
//rmdir($dirname); //rmdir($dirname);
} }
/**
* Generate a uniq id.
* @todo Ensure the sub-directory doesn't exist to avoid collisions
*
*/
function getUniqId($email_dir) {
$uniqid = uniqid(null,TRUE);
//while(is_dir($email_dir."/".$uniqid) == TRUE) {
//
// }
return $uniqid;
}
} }
?> ?>

View file

@ -1,3 +1,5 @@
<?php if (!empty($emails)):?> <?php if (!empty($emails)):?>
<table cellpadding = "0" cellspacing = "0" class="emailtable"> <table cellpadding = "0" cellspacing = "0" class="emailtable">
<tr> <tr>
@ -27,7 +29,7 @@
<tr<?php echo $class;?>> <tr<?php echo $class;?>>
<td><?php echo $email['Email']['date'];?></td> <td><?php echo $email['Email']['date'];?></td>
<td><?php if(count($email['EmailAttachment']) > 0) { <td><?php if($email['email_attachment_count'] > 0) {
echo $html->image('attach.png'); echo $html->image('attach.png');
} }
?> ?>
@ -47,5 +49,5 @@
</td> </td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</table> </table>
<?php endif; ?> <?php endif; ?>

View file

@ -1,35 +1,36 @@
<div class="enquiries-view"> <div class="enquiries-view">
<h2><?php __("Enquiry: " . $enquiry['Enquiry']['title']);?></h2> <h2><?php __("Enquiry: " . $enquiry['Enquiry']['title']);?></h2>
<dl><?php $i = 0; $class = ' class="altrow"';?> <dl><?php $i = 0;
$class = ' class="altrow"';?>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Enquiry Number'); ?></dt> <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Enquiry Number'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>> <dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $enquiry['Enquiry']['title']; ?> <?php echo $enquiry['Enquiry']['title']; ?>
&nbsp; &nbsp;
</dd> </dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Assigned to User'); ?></dt> <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Assigned to User'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>> <dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $html->link($enquiry['User']['username'], array('controller'=> 'users', 'action'=>'view', $enquiry['User']['id'])); ?> <?php echo $html->link($enquiry['User']['username'], array('controller'=> 'users', 'action'=>'view', $enquiry['User']['id'])); ?>
&nbsp; &nbsp;
</dd> </dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Customer'); ?></dt> <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Customer'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>> <dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $html->link($enquiry['Customer']['name'], array('controller'=> 'customers', 'action'=>'view', $enquiry['Customer']['id'])); ?> <?php echo $html->link($enquiry['Customer']['name'], array('controller'=> 'customers', 'action'=>'view', $enquiry['Customer']['id'])); ?>
&nbsp; &nbsp;
</dd> </dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Contact'); ?></dt> <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Contact'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>> <dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $html->link($enquiry['Contact']['first_name'].' '.$enquiry['Contact']['last_name'], array('controller'=> 'contacts', 'action'=>'view', $enquiry['Contact']['id'])); ?> <?php echo $html->link($enquiry['Contact']['first_name'].' '.$enquiry['Contact']['last_name'], array('controller'=> 'contacts', 'action'=>'view', $enquiry['Contact']['id'])); ?>
&nbsp; &nbsp;
</dd> </dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('State'); ?></dt> <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('State'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>> <dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $html->link($enquiry['State']['name'], array('controller'=> 'states', 'action'=>'view', $enquiry['State']['id'])); ?> <?php echo $html->link($enquiry['State']['name'], array('controller'=> 'states', 'action'=>'view', $enquiry['State']['id'])); ?>
&nbsp; &nbsp;
</dd> </dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Country'); ?></dt> <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Country'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>> <dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $html->link($enquiry['Country']['name'], array('controller'=> 'countries', 'action'=>'view', $enquiry['Country']['id'])); ?> <?php echo $html->link($enquiry['Country']['name'], array('controller'=> 'countries', 'action'=>'view', $enquiry['Country']['id'])); ?>
&nbsp; &nbsp;
</dd> </dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('GST Applicable'); ?></dt> <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('GST Applicable'); ?></dt>
@ -41,23 +42,23 @@
else { else {
echo "Yes - GST Applicable"; echo "Yes - GST Applicable";
} }
?> ?>
&nbsp; &nbsp;
</dd> </dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Principle'); ?></dt> <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Principle'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>> <dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $html->link($enquiry['Principle']['name'], array('controller'=> 'principles', 'action'=>'view', $enquiry['Principle']['id'])); ?> <?php echo $html->link($enquiry['Principle']['name'], array('controller'=> 'principles', 'action'=>'view', $enquiry['Principle']['id'])); ?>
&nbsp; &nbsp;
</dd> </dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Status'); ?></dt> <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Status'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>> <dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $html->link($enquiry['Status']['name'], array('controller'=> 'statuses', 'action'=>'view', $enquiry['Status']['id'])); ?> <?php echo $html->link($enquiry['Status']['name'], array('controller'=> 'statuses', 'action'=>'view', $enquiry['Status']['id'])); ?>
&nbsp; &nbsp;
</dd> </dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Comments'); ?></dt> <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Comments'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>> <dd<?php if ($i++ % 2 == 0) echo $class;?>>
<span class="enquiry-view-comments"> <span class="enquiry-view-comments">
<?php echo $enquiry['Enquiry']['comments']; ?> <?php echo $enquiry['Enquiry']['comments']; ?>
</span> </span>
&nbsp; &nbsp;
@ -73,7 +74,7 @@
else { else {
echo 'No Billing Address Assigned for this Enquiry'; echo 'No Billing Address Assigned for this Enquiry';
} }
?> ?>
&nbsp; &nbsp;
</dd> </dd>
@ -85,57 +86,60 @@
echo $enquiry['ShippingAddress']['city'].' '.$shippingaddress['State']['name'].' '.$enquiry['ShippingAddress']['postcode'].'<br>'; echo $enquiry['ShippingAddress']['city'].' '.$shippingaddress['State']['name'].' '.$enquiry['ShippingAddress']['postcode'].'<br>';
echo '<b>'.$shippingaddress['Country']['name'].'</b>'; echo '<b>'.$shippingaddress['Country']['name'].'</b>';
} }
else { echo 'No Shipping Address Assigned for this Enquiry'; else {
} echo 'No Shipping Address Assigned for this Enquiry';
?> }
?>
&nbsp; &nbsp;
</dd> </dd>
</dl> </dl>
<div class="enquiry-actions"> <div class="enquiry-actions">
<ul> <ul>
<li><?php echo $html->link(__('Edit Enquiry', true), array('action'=>'edit', $enquiry['Enquiry']['id'])); ?> </li> <li><?php echo $html->link(__('Edit Enquiry', true), array('action'=>'edit', $enquiry['Enquiry']['id'])); ?> </li>
</ul> </ul>
</div> </div>
</div> </div>
<div class="principle-emails"> <div class="principle-emails">
<?php <?php
$boxdata = array(); $boxdata = array();
$boxdata['enquirynumber'] = $enquiry['Enquiry']['title']; $boxdata['enquirynumber'] = $enquiry['Enquiry']['title'];
//$boxdata['principle_emails'] = $principle_emails; //$boxdata['principle_emails'] = $principle_emails;
?> ?>
<?php echo $this->element('principle_contacts_email_box', array('enquirynumber' => $enquiry['Enquiry']['title'], <?php echo $this->element('principle_contacts_email_box', array('enquirynumber' => $enquiry['Enquiry']['title'],
'principle_emails' => $principle_emails )); ?> 'principle_emails' => $principle_emails )); ?>
</div> </div>
<? /*
<div class="related">
<h3><?php __($number_of_files.' Files in this Enquiry');?><?php echo $html->image('document.png'); ?></h3>
<?php echo $this->element('enquiry_file_table', $files); ?>
</div>
*/?>
<div class="related">
<h3><?php __($number_of_quotes.' Quotes in this Enquiry');?></h3>
<?php echo $this->element('quote_table', $quotes); ?>
</div>
<div id="showemail"> <div id="showemail">
</div> </div>
<? /*
<div class="related"> <div class="related">
<h3> <h3>
<?php __($number_of_emails.' Emails for this Enquiry');?><?php echo $html->image('internet-mail.png'); ?></h3> <?php __($enquiry['Enquiry']['email_count'].' Emails for this Enquiry');?><?php echo $html->image('internet-mail.png'); ?></h3>
<?php //echo $this->element('email_table_ajax', $enquiry); ?> <?php //echo $this->element('email_table_ajax', $enquiry); ?>
<?php echo $this->element('email_table_ajax', $enquiry, array('cache'=>'+1 day')); ?> <?php echo $this->element('email_table_ajax', $enquiry, array('cache'=>'+1 day')); ?>
</div>
<div class="related">
<h3><?php __($number_of_files.' Files in this Enquiry');?><?php echo $html->image('document.png'); ?></h3>
<?php echo $this->element('enquiry_file_table', $files); ?>
</div>
*
*/
?>
<div class="related">
<h3><?php __($number_of_quotes.' Quotes in this Enquiry');?></h3>
<?php echo $this->element('quote_table', $quotes); ?>
</div> </div>
<?php debug($quotes); ?>
<?php //debug($emails); ?>