Email vault coming along. Implementing jQuery powered view for next commit
This commit is contained in:
parent
5622d8b94c
commit
d1792506d2
|
|
@ -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']));
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
class Email extends AppModel {
|
class Email extends AppModel {
|
||||||
|
|
||||||
var $name = 'Email';
|
var $name = 'Email';
|
||||||
|
|
||||||
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(
|
|
||||||
'EmailAttachment' => array('className' => 'EmailAttachment',
|
var $hasMany = array(
|
||||||
'foreignKey' => 'email_id',
|
'EmailAttachment' => array('className' => 'EmailAttachment',
|
||||||
'dependent' => false
|
'foreignKey' => 'email_id',
|
||||||
));
|
'dependent' => false
|
||||||
|
));
|
||||||
}
|
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,8 @@ class EmailAttachment extends AppModel {
|
||||||
var $belongsTo = array(
|
var $belongsTo = array(
|
||||||
'Email' => array('className' => 'Email',
|
'Email' => array('className' => 'Email',
|
||||||
'foreignKey' => 'email_id',
|
'foreignKey' => 'email_id',
|
||||||
'conditions' => '',
|
'counterCache' => true,
|
||||||
|
'conditions' => '',
|
||||||
'fields' => '',
|
'fields' => '',
|
||||||
'order' => ''
|
'order' => ''
|
||||||
));
|
));
|
||||||
|
|
|
||||||
|
|
@ -1,188 +1,191 @@
|
||||||
<?php
|
<?php
|
||||||
class Enquiry extends AppModel {
|
class Enquiry extends AppModel {
|
||||||
|
|
||||||
var $name = 'Enquiry';
|
var $name = 'Enquiry';
|
||||||
|
|
||||||
var $validate = array(
|
var $validate = array(
|
||||||
'user_id' => array(
|
'user_id' => array(
|
||||||
'rule' => 'numeric',
|
'rule' => 'numeric',
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'message' => 'User ID must be selected',
|
'message' => 'User ID must be selected',
|
||||||
'on' => 'create'
|
'on' => 'create'
|
||||||
),
|
),
|
||||||
'customer_id' => array(
|
'customer_id' => array(
|
||||||
'rule' => 'numeric',
|
'rule' => 'numeric',
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'message' => 'Must choose a Customer for this Enquiry',
|
'message' => 'Must choose a Customer for this Enquiry',
|
||||||
'on' => 'create'
|
'on' => 'create'
|
||||||
),
|
),
|
||||||
|
|
||||||
'contact_id' => array(
|
|
||||||
'rule' => 'numeric',
|
|
||||||
'required' => true,
|
|
||||||
'message' => 'Must choose a Contact for this Enquiry',
|
|
||||||
//'on' => 'create'
|
|
||||||
),
|
|
||||||
|
|
||||||
'customer_id' => array(
|
|
||||||
'rule' => 'numeric',
|
|
||||||
'required' => true,
|
|
||||||
'message' => 'Must choose a Customer for this Enquiry',
|
|
||||||
'on' => 'create'
|
|
||||||
),
|
|
||||||
|
|
||||||
'state_id' => array(
|
'contact_id' => array(
|
||||||
'rule' => 'numeric',
|
'rule' => 'numeric',
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'message' => 'Must choose a State for this Enquiry',
|
'message' => 'Must choose a Contact for this Enquiry',
|
||||||
'on' => 'create'
|
//'on' => 'create'
|
||||||
),
|
),
|
||||||
|
|
||||||
'country_id' => array(
|
|
||||||
'numeric' => array(
|
|
||||||
'rule' => 'numeric',
|
|
||||||
'required' => true,
|
|
||||||
'message' => 'Must choose a Country for this Enquiry',
|
|
||||||
'on' => 'create'
|
|
||||||
),
|
|
||||||
'checkStates' => array(
|
|
||||||
'rule' => array('checkStates'),
|
|
||||||
'message' => 'Australian Enquiries must be assigned to Australian States. Overseas Enquiries must be assigned to other Countries',
|
|
||||||
'on' => 'create')),
|
|
||||||
|
|
||||||
'principle_id' => array(
|
|
||||||
'rule' => 'numeric',
|
|
||||||
'required' => true,
|
|
||||||
'message' => 'Must choose a Principle for this Enquiry',
|
|
||||||
'on' => 'create'
|
|
||||||
),
|
|
||||||
|
|
||||||
'status_id' => array(
|
|
||||||
'rule' => 'numeric',
|
|
||||||
'required' => true,
|
|
||||||
'message' => 'Must choose a Status for this Enquiry'
|
|
||||||
),
|
|
||||||
'gst' => array(
|
|
||||||
'rule' => 'numeric',
|
|
||||||
'required' => true,
|
|
||||||
'message' => 'Must select whether GST is applicable for this Enquiry',
|
|
||||||
'on' => 'create'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
/*Custom Validation Rule to Check that Enquiries with Australian States are assigned to Australia.
|
'customer_id' => array(
|
||||||
|
'rule' => 'numeric',
|
||||||
|
'required' => true,
|
||||||
|
'message' => 'Must choose a Customer for this Enquiry',
|
||||||
|
'on' => 'create'
|
||||||
|
),
|
||||||
|
|
||||||
|
'state_id' => array(
|
||||||
|
'rule' => 'numeric',
|
||||||
|
'required' => true,
|
||||||
|
'message' => 'Must choose a State for this Enquiry',
|
||||||
|
'on' => 'create'
|
||||||
|
),
|
||||||
|
|
||||||
|
'country_id' => array(
|
||||||
|
'numeric' => array(
|
||||||
|
'rule' => 'numeric',
|
||||||
|
'required' => true,
|
||||||
|
'message' => 'Must choose a Country for this Enquiry',
|
||||||
|
'on' => 'create'
|
||||||
|
),
|
||||||
|
'checkStates' => array(
|
||||||
|
'rule' => array('checkStates'),
|
||||||
|
'message' => 'Australian Enquiries must be assigned to Australian States. Overseas Enquiries must be assigned to other Countries',
|
||||||
|
'on' => 'create')),
|
||||||
|
|
||||||
|
'principle_id' => array(
|
||||||
|
'rule' => 'numeric',
|
||||||
|
'required' => true,
|
||||||
|
'message' => 'Must choose a Principle for this Enquiry',
|
||||||
|
'on' => 'create'
|
||||||
|
),
|
||||||
|
|
||||||
|
'status_id' => array(
|
||||||
|
'rule' => 'numeric',
|
||||||
|
'required' => true,
|
||||||
|
'message' => 'Must choose a Status for this Enquiry'
|
||||||
|
),
|
||||||
|
'gst' => array(
|
||||||
|
'rule' => 'numeric',
|
||||||
|
'required' => true,
|
||||||
|
'message' => 'Must select whether GST is applicable for this Enquiry',
|
||||||
|
'on' => 'create'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
/*Custom Validation Rule to Check that Enquiries with Australian States are assigned to Australia.
|
||||||
* and that Overseas enquiries are NOT assigned to Australia.
|
* and that Overseas enquiries are NOT assigned to Australia.
|
||||||
* Not Portable at all. This code is only for CMC usage
|
* Not Portable at all. This code is only for CMC usage
|
||||||
* Should probably change this to use RegExes.
|
* Should probably change this to use RegExes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function checkStates($data) {
|
|
||||||
if($this->data['Enquiry']['country_id'] != 1) { //This Enquiry is not for Australia. State must be set to overseas.
|
|
||||||
if($this->data['Enquiry']['state_id'] != 9) { //The State isn't set to Overseas. Return false
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($this->data['Enquiry']['country_id'] == 1) { //This enquiry is for Australia. State must be for an Australian State
|
|
||||||
if($this->data['Enquiry']['state_id'] == 9) {
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//The Associations below have been created with all possible keys, those that are not needed can be removed
|
|
||||||
var $belongsTo = array(
|
|
||||||
'User' => array('className' => 'User',
|
|
||||||
'foreignKey' => 'user_id',
|
|
||||||
'conditions' => '',
|
|
||||||
'fields' => '',
|
|
||||||
'order' => ''
|
|
||||||
),
|
|
||||||
'Customer' => array('className' => 'Customer',
|
|
||||||
'foreignKey' => 'customer_id',
|
|
||||||
'conditions' => '',
|
|
||||||
'fields' => '',
|
|
||||||
'order' => ''
|
|
||||||
),
|
|
||||||
'Contact' => array('className' => 'Contact',
|
|
||||||
'foreignKey' => 'contact_id',
|
|
||||||
'conditions' => '',
|
|
||||||
'fields' => '',
|
|
||||||
'order' => ''
|
|
||||||
),
|
|
||||||
'State' => array('className' => 'State',
|
|
||||||
'foreignKey' => 'state_id',
|
|
||||||
'conditions' => '',
|
|
||||||
'fields' => '',
|
|
||||||
'order' => ''
|
|
||||||
),
|
|
||||||
'Country' => array('className' => 'Country',
|
|
||||||
'foreignKey' => 'country_id',
|
|
||||||
'conditions' => '',
|
|
||||||
'fields' => '',
|
|
||||||
'order' => ''
|
|
||||||
),
|
|
||||||
'Principle' => array('className' => 'Principle',
|
|
||||||
'foreignKey' => 'principle_id',
|
|
||||||
'conditions' => '',
|
|
||||||
'fields' => '',
|
|
||||||
'order' => ''
|
|
||||||
),
|
|
||||||
'Status' => array('className' => 'Status',
|
|
||||||
'foreignKey' => 'status_id',
|
|
||||||
'conditions' => '',
|
|
||||||
'fields' => '',
|
|
||||||
'order' => ''
|
|
||||||
),
|
|
||||||
'BillingAddress' => array('className' => 'Address',
|
|
||||||
'foreignKey' => 'billing_address_id',
|
|
||||||
'conditions' => '',
|
|
||||||
'fields' => '',
|
|
||||||
'order' => ''
|
|
||||||
),
|
|
||||||
'ShippingAddress' => array('className' => 'Address',
|
|
||||||
'foreignKey' => 'shipping_address_id',
|
|
||||||
'conditions' => '',
|
|
||||||
'fields' => '',
|
|
||||||
'order' => ''
|
|
||||||
),
|
|
||||||
|
|
||||||
|
|
||||||
);
|
|
||||||
|
|
||||||
var $hasMany = array(
|
function checkStates($data) {
|
||||||
'Quote' => array('className' => 'Quote',
|
if($this->data['Enquiry']['country_id'] != 1) { //This Enquiry is not for Australia. State must be set to overseas.
|
||||||
'foreignKey' => 'enquiry_id',
|
if($this->data['Enquiry']['state_id'] != 9) { //The State isn't set to Overseas. Return false
|
||||||
'dependent' => false,
|
return FALSE;
|
||||||
'conditions' => '',
|
}
|
||||||
'fields' => '',
|
else {
|
||||||
'order' => '',
|
return TRUE;
|
||||||
'limit' => '',
|
}
|
||||||
'offset' => '',
|
}
|
||||||
'exclusive' => '',
|
if($this->data['Enquiry']['country_id'] == 1) { //This enquiry is for Australia. State must be for an Australian State
|
||||||
'finderQuery' => '',
|
if($this->data['Enquiry']['state_id'] == 9) {
|
||||||
'counterQuery' => ''
|
return FALSE;
|
||||||
),
|
}
|
||||||
|
else {
|
||||||
/* 'EnquiryFile' => array('className' => 'EnquiryFile',
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//The Associations below have been created with all possible keys, those that are not needed can be removed
|
||||||
|
var $belongsTo = array(
|
||||||
|
'User' => array('className' => 'User',
|
||||||
|
'foreignKey' => 'user_id',
|
||||||
|
'conditions' => '',
|
||||||
|
'fields' => '',
|
||||||
|
'order' => ''
|
||||||
|
),
|
||||||
|
'Customer' => array('className' => 'Customer',
|
||||||
|
'foreignKey' => 'customer_id',
|
||||||
|
'conditions' => '',
|
||||||
|
'fields' => '',
|
||||||
|
'order' => ''
|
||||||
|
),
|
||||||
|
'Contact' => array('className' => 'Contact',
|
||||||
|
'foreignKey' => 'contact_id',
|
||||||
|
'conditions' => '',
|
||||||
|
'fields' => '',
|
||||||
|
'order' => ''
|
||||||
|
),
|
||||||
|
'State' => array('className' => 'State',
|
||||||
|
'foreignKey' => 'state_id',
|
||||||
|
'conditions' => '',
|
||||||
|
'fields' => '',
|
||||||
|
'order' => ''
|
||||||
|
),
|
||||||
|
'Country' => array('className' => 'Country',
|
||||||
|
'foreignKey' => 'country_id',
|
||||||
|
'conditions' => '',
|
||||||
|
'fields' => '',
|
||||||
|
'order' => ''
|
||||||
|
),
|
||||||
|
'Principle' => array('className' => 'Principle',
|
||||||
|
'foreignKey' => 'principle_id',
|
||||||
|
'conditions' => '',
|
||||||
|
'fields' => '',
|
||||||
|
'order' => ''
|
||||||
|
),
|
||||||
|
'Status' => array('className' => 'Status',
|
||||||
|
'foreignKey' => 'status_id',
|
||||||
|
'conditions' => '',
|
||||||
|
'fields' => '',
|
||||||
|
'order' => ''
|
||||||
|
),
|
||||||
|
'BillingAddress' => array('className' => 'Address',
|
||||||
|
'foreignKey' => 'billing_address_id',
|
||||||
|
'conditions' => '',
|
||||||
|
'fields' => '',
|
||||||
|
'order' => ''
|
||||||
|
),
|
||||||
|
'ShippingAddress' => array('className' => 'Address',
|
||||||
|
'foreignKey' => 'shipping_address_id',
|
||||||
|
'conditions' => '',
|
||||||
|
'fields' => '',
|
||||||
|
'order' => ''
|
||||||
|
),
|
||||||
|
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
var $hasMany = array(
|
||||||
|
'Quote' => array('className' => 'Quote',
|
||||||
|
'foreignKey' => 'enquiry_id',
|
||||||
|
'dependent' => false,
|
||||||
|
'conditions' => '',
|
||||||
|
'fields' => '',
|
||||||
|
'order' => '',
|
||||||
|
'limit' => '',
|
||||||
|
'offset' => '',
|
||||||
|
'exclusive' => '',
|
||||||
|
'finderQuery' => '',
|
||||||
|
'counterQuery' => ''
|
||||||
|
),
|
||||||
|
|
||||||
|
|
||||||
|
'Email' => array('className' => 'Email',
|
||||||
|
'foreignKey' => 'enquiry_id',
|
||||||
|
'dependent' => false
|
||||||
|
),
|
||||||
|
|
||||||
|
|
||||||
|
/* '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');
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
74
vendors/shells/vault.php
vendored
74
vendors/shells/vault.php
vendored
|
|
@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -1,51 +1,53 @@
|
||||||
|
|
||||||
|
|
||||||
<?php if (!empty($emails)):?>
|
<?php if (!empty($emails)):?>
|
||||||
<table cellpadding = "0" cellspacing = "0" class="emailtable">
|
<table cellpadding = "0" cellspacing = "0" class="emailtable">
|
||||||
<tr>
|
<tr>
|
||||||
<th><?php __('Email Date'); ?></th>
|
<th><?php __('Email Date'); ?></th>
|
||||||
<th><?php echo $html->image('attach.png'); ?></th>
|
<th><?php echo $html->image('attach.png'); ?></th>
|
||||||
<th><?php __('Subject'); ?></th>
|
<th><?php __('Subject'); ?></th>
|
||||||
<th><?php __('To'); ?></th>
|
<th><?php __('To'); ?></th>
|
||||||
<th><?php __('CC'); ?></th>
|
<th><?php __('CC'); ?></th>
|
||||||
<th><?php __('From'); ?></th>
|
<th><?php __('From'); ?></th>
|
||||||
|
|
||||||
<th class="actions"><?php __('Actions');?></th>
|
<th class="actions"><?php __('Actions');?></th>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($emails as $email):
|
foreach ($emails as $email):
|
||||||
$class = null;
|
$class = null;
|
||||||
|
|
||||||
if ($i % 2 == 0) {
|
if ($i % 2 == 0) {
|
||||||
$class = ' class="altrow"';
|
$class = ' class="altrow"';
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<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');
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td><?php echo $text->highlight($ajax->link($email['Email']['subject'], array('controller'=> 'emails', 'action'=>'frame/', $email['Email']['id']), array('update'=>'showemail')), 'Quotation'); ?></td>
|
<td><?php echo $text->highlight($ajax->link($email['Email']['subject'], array('controller'=> 'emails', 'action'=>'frame/', $email['Email']['id']), array('update'=>'showemail')), 'Quotation'); ?></td>
|
||||||
<td><?php echo $email['Email']['to']; ?></td>
|
<td><?php echo $email['Email']['to']; ?></td>
|
||||||
<td><?php echo $email['Email']['cc']; ?></td>
|
<td><?php echo $email['Email']['cc']; ?></td>
|
||||||
<td><?php echo $email['Email']['from']; ?></td>
|
<td><?php echo $email['Email']['from']; ?></td>
|
||||||
|
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
<?php //echo $html->link(__('View', true), array('controller'=> 'emails', 'action'=>'view/', $email['Email']['id']));
|
<?php //echo $html->link(__('View', true), array('controller'=> 'emails', 'action'=>'view/', $email['Email']['id']));
|
||||||
echo $ajax->link('View', array('controller'=>'emails', 'action'=>'frame/', $email['Email']['id']), array('update' => 'showemail'));
|
echo $ajax->link('View', array('controller'=>'emails', 'action'=>'frame/', $email['Email']['id']), array('update' => 'showemail'));
|
||||||
echo $html->link('Print', array('controller' => 'emails', 'action'=>'printview/', $email['Email']['id']));
|
echo $html->link('Print', array('controller' => 'emails', 'action'=>'printview/', $email['Email']['id']));
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</table>
|
</table>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
|
||||||
|
|
@ -1,141 +1,145 @@
|
||||||
<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>
|
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
|
||||||
<?php echo $enquiry['Enquiry']['title']; ?>
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Assigned to User'); ?></dt>
|
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
|
||||||
<?php echo $html->link($enquiry['User']['username'], array('controller'=> 'users', 'action'=>'view', $enquiry['User']['id'])); ?>
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Customer'); ?></dt>
|
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
|
||||||
<?php echo $html->link($enquiry['Customer']['name'], array('controller'=> 'customers', 'action'=>'view', $enquiry['Customer']['id'])); ?>
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Contact'); ?></dt>
|
|
||||||
<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'])); ?>
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('State'); ?></dt>
|
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
|
||||||
<?php echo $html->link($enquiry['State']['name'], array('controller'=> 'states', 'action'=>'view', $enquiry['State']['id'])); ?>
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Country'); ?></dt>
|
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
|
||||||
<?php echo $html->link($enquiry['Country']['name'], array('controller'=> 'countries', 'action'=>'view', $enquiry['Country']['id'])); ?>
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('GST Applicable'); ?></dt>
|
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
|
||||||
<?php
|
|
||||||
if($enquiry['Enquiry']['gst'] == 0) {
|
|
||||||
echo "No - GST Not Applicable";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
echo "Yes - GST Applicable";
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Principle'); ?></dt>
|
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
|
||||||
<?php echo $html->link($enquiry['Principle']['name'], array('controller'=> 'principles', 'action'=>'view', $enquiry['Principle']['id'])); ?>
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Status'); ?></dt>
|
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
|
||||||
<?php echo $html->link($enquiry['Status']['name'], array('controller'=> 'statuses', 'action'=>'view', $enquiry['Status']['id'])); ?>
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Comments'); ?></dt>
|
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
|
||||||
<span class="enquiry-view-comments">
|
|
||||||
<?php echo $enquiry['Enquiry']['comments']; ?>
|
|
||||||
</span>
|
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Billing Address'); ?></dt>
|
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
|
||||||
<?php
|
|
||||||
if($enquiry['BillingAddress']['customer_id'] != NULL) {
|
|
||||||
echo $enquiry['BillingAddress']['address'].'<br>';
|
|
||||||
echo $enquiry['BillingAddress']['city'].' '.$billingaddress['State']['name'].' '.$enquiry['BillingAddress']['postcode'].'<br>';
|
|
||||||
echo '<b>'.$billingaddress['Country']['name'].'</b>';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
echo 'No Billing Address Assigned for this Enquiry';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Shipping Address'); ?></dt>
|
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
|
||||||
<?php
|
|
||||||
if($enquiry['ShippingAddress']['customer_id'] != NULL) {
|
|
||||||
echo $enquiry['ShippingAddress']['address'].'<br>';
|
|
||||||
echo $enquiry['ShippingAddress']['city'].' '.$shippingaddress['State']['name'].' '.$enquiry['ShippingAddress']['postcode'].'<br>';
|
|
||||||
echo '<b>'.$shippingaddress['Country']['name'].'</b>';
|
|
||||||
}
|
|
||||||
else { echo 'No Shipping Address Assigned for this Enquiry';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
|
|
||||||
</dl>
|
|
||||||
|
|
||||||
<div class="enquiry-actions">
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Enquiry Number'); ?></dt>
|
||||||
<ul>
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
<li><?php echo $html->link(__('Edit Enquiry', true), array('action'=>'edit', $enquiry['Enquiry']['id'])); ?> </li>
|
<?php echo $enquiry['Enquiry']['title']; ?>
|
||||||
</ul>
|
|
||||||
</div>
|
</dd>
|
||||||
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Assigned to User'); ?></dt>
|
||||||
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
|
<?php echo $html->link($enquiry['User']['username'], array('controller'=> 'users', 'action'=>'view', $enquiry['User']['id'])); ?>
|
||||||
|
|
||||||
|
</dd>
|
||||||
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Customer'); ?></dt>
|
||||||
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
|
<?php echo $html->link($enquiry['Customer']['name'], array('controller'=> 'customers', 'action'=>'view', $enquiry['Customer']['id'])); ?>
|
||||||
|
|
||||||
|
</dd>
|
||||||
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Contact'); ?></dt>
|
||||||
|
<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'])); ?>
|
||||||
|
|
||||||
|
</dd>
|
||||||
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('State'); ?></dt>
|
||||||
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
|
<?php echo $html->link($enquiry['State']['name'], array('controller'=> 'states', 'action'=>'view', $enquiry['State']['id'])); ?>
|
||||||
|
|
||||||
|
</dd>
|
||||||
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Country'); ?></dt>
|
||||||
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
|
<?php echo $html->link($enquiry['Country']['name'], array('controller'=> 'countries', 'action'=>'view', $enquiry['Country']['id'])); ?>
|
||||||
|
|
||||||
|
</dd>
|
||||||
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('GST Applicable'); ?></dt>
|
||||||
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
|
<?php
|
||||||
|
if($enquiry['Enquiry']['gst'] == 0) {
|
||||||
|
echo "No - GST Not Applicable";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo "Yes - GST Applicable";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
</dd>
|
||||||
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Principle'); ?></dt>
|
||||||
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
|
<?php echo $html->link($enquiry['Principle']['name'], array('controller'=> 'principles', 'action'=>'view', $enquiry['Principle']['id'])); ?>
|
||||||
|
|
||||||
|
</dd>
|
||||||
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Status'); ?></dt>
|
||||||
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
|
<?php echo $html->link($enquiry['Status']['name'], array('controller'=> 'statuses', 'action'=>'view', $enquiry['Status']['id'])); ?>
|
||||||
|
|
||||||
|
</dd>
|
||||||
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Comments'); ?></dt>
|
||||||
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
|
<span class="enquiry-view-comments">
|
||||||
|
<?php echo $enquiry['Enquiry']['comments']; ?>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
|
||||||
|
</dd>
|
||||||
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Billing Address'); ?></dt>
|
||||||
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
|
<?php
|
||||||
|
if($enquiry['BillingAddress']['customer_id'] != NULL) {
|
||||||
|
echo $enquiry['BillingAddress']['address'].'<br>';
|
||||||
|
echo $enquiry['BillingAddress']['city'].' '.$billingaddress['State']['name'].' '.$enquiry['BillingAddress']['postcode'].'<br>';
|
||||||
|
echo '<b>'.$billingaddress['Country']['name'].'</b>';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo 'No Billing Address Assigned for this Enquiry';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
</dd>
|
||||||
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Shipping Address'); ?></dt>
|
||||||
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
|
<?php
|
||||||
|
if($enquiry['ShippingAddress']['customer_id'] != NULL) {
|
||||||
|
echo $enquiry['ShippingAddress']['address'].'<br>';
|
||||||
|
echo $enquiry['ShippingAddress']['city'].' '.$shippingaddress['State']['name'].' '.$enquiry['ShippingAddress']['postcode'].'<br>';
|
||||||
|
echo '<b>'.$shippingaddress['Country']['name'].'</b>';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo 'No Shipping Address Assigned for this Enquiry';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
<div class="enquiry-actions">
|
||||||
|
<ul>
|
||||||
|
<li><?php echo $html->link(__('Edit Enquiry', true), array('action'=>'edit', $enquiry['Enquiry']['id'])); ?> </li>
|
||||||
|
</ul>
|
||||||
|
</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">
|
|
||||||
<h3>
|
|
||||||
<?php __($number_of_emails.' 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, 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">
|
<div class="related">
|
||||||
<h3><?php __($number_of_quotes.' Quotes in this Enquiry');?></h3>
|
<h3>
|
||||||
<?php echo $this->element('quote_table', $quotes); ?>
|
<?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, array('cache'=>'+1 day')); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<?php debug($quotes); ?>
|
|
||||||
|
<?php //debug($emails); ?>
|
||||||
Loading…
Reference in a new issue