Fixing up Email View
This commit is contained in:
parent
0286ab30e4
commit
05c16e9f65
|
|
@ -4,6 +4,8 @@ class CountriesController extends AppController {
|
|||
var $name = 'Countries';
|
||||
var $helpers = array('Html', 'Form');
|
||||
|
||||
var $paginate = array('Enquiry' => array('order' => array('Enquiry.id' => 'asc')));
|
||||
|
||||
function index() {
|
||||
$this->Country->recursive = 0;
|
||||
$this->set('countries', $this->paginate());
|
||||
|
|
@ -15,6 +17,7 @@ class CountriesController extends AppController {
|
|||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
$this->set('country', $this->Country->read(null, $id));
|
||||
$this->set('enquiries', $this->paginate('Enquiry', array('Enquiry.country_id' => $id)));
|
||||
}
|
||||
|
||||
function add() {
|
||||
|
|
|
|||
18
controllers/email_attachments_controller.php
Normal file
18
controllers/email_attachments_controller.php
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
class EmailAttachmentsController extends AppController {
|
||||
|
||||
var $name = 'EmailAttachments';
|
||||
var $helpers = array('Html', 'Form');
|
||||
|
||||
|
||||
function download($id) {
|
||||
Configure::write('debug', 0);
|
||||
$file = $this->EmailAttachment->findById($id);
|
||||
header('Content-type: ' . $file['EmailAttachment']['type']);
|
||||
header('Content-length: ' . $file['EmailAttachment']['size']);
|
||||
header('Content-Disposition: attachment; filename="'.$file['EmailAttachment']['name'].'"');
|
||||
echo $file['EmailAttachment']['data'];
|
||||
exit();
|
||||
}
|
||||
|
||||
}
|
||||
66
controllers/emails_controller.php
Normal file
66
controllers/emails_controller.php
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
<?php
|
||||
class EmailsController extends AppController {
|
||||
|
||||
var $name = 'Emails';
|
||||
var $helpers = array('Html', 'Form');
|
||||
|
||||
function index() {
|
||||
$this->Email->recursive = 0;
|
||||
$this->set('emails', $this->paginate());
|
||||
}
|
||||
|
||||
function view($id = null) {
|
||||
if (!$id) {
|
||||
$this->Session->setFlash(__('Invalid Email.', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
$this->set('email', $this->Email->read(null, $id));
|
||||
}
|
||||
|
||||
function add() {
|
||||
if (!empty($this->data)) {
|
||||
$this->Email->create();
|
||||
if ($this->Email->save($this->data)) {
|
||||
$this->Session->setFlash(__('The Email has been saved', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
} else {
|
||||
$this->Session->setFlash(__('The Email could not be saved. Please, try again.', true));
|
||||
}
|
||||
}
|
||||
$enquiries = $this->Email->Enquiry->find('list');
|
||||
$this->set(compact('enquiries'));
|
||||
}
|
||||
|
||||
function edit($id = null) {
|
||||
if (!$id && empty($this->data)) {
|
||||
$this->Session->setFlash(__('Invalid Email', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
if (!empty($this->data)) {
|
||||
if ($this->Email->save($this->data)) {
|
||||
$this->Session->setFlash(__('The Email has been saved', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
} else {
|
||||
$this->Session->setFlash(__('The Email could not be saved. Please, try again.', true));
|
||||
}
|
||||
}
|
||||
if (empty($this->data)) {
|
||||
$this->data = $this->Email->read(null, $id);
|
||||
}
|
||||
$enquiries = $this->Email->Enquiry->find('list');
|
||||
$this->set(compact('enquiries'));
|
||||
}
|
||||
|
||||
function delete($id = null) {
|
||||
if (!$id) {
|
||||
$this->Session->setFlash(__('Invalid id for Email', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
if ($this->Email->del($id)) {
|
||||
$this->Session->setFlash(__('Email deleted', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -26,6 +26,8 @@ class EnquiriesController extends AppController {
|
|||
$this->set('enquiry', $enquiry);
|
||||
$this->set('quotes', $this->Enquiry->Quote->find('all', array('conditions'=>array('Quote.enquiry_id'=>$id), 'order'=>'Quote.revision DESC')));
|
||||
$this->set('files', $this->Enquiry->EnquiryFile->find('all', array('conditions' => array('EnquiryFile.enquiry_id'=>$id), 'order' => 'EnquiryFile.created ASC')));
|
||||
$this->set('emails', $this->Enquiry->Email->find('all', array('conditions' => array('Email.enquiry_id'=>$id), 'order' => 'Email.created DESC')));
|
||||
$this->set('number_of_emails', $this->Enquiry->Email->find('count', 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_files', $this->Enquiry->EnquiryFile->find('count', array('conditions' => array('EnquiryFile.enquiry_id'=>$id))));
|
||||
if($enquiry['Enquiry']['billing_address_id'] != 0) {
|
||||
|
|
@ -42,18 +44,26 @@ class EnquiriesController extends AppController {
|
|||
|
||||
function add() {
|
||||
|
||||
if(empty($this->data)) {
|
||||
/*
|
||||
* These were depreciated by the move to only add enquiries from the Customer View page.
|
||||
* if(empty($this->data)) {
|
||||
$this->set('step', 1);
|
||||
}
|
||||
|
||||
elseif( (!empty($this->data)) && ($this->data['Enquiry']['step'] == 1) ) {
|
||||
$customer = $this->Enquiry->Customer->findByName($this->data['Customer']['name']);
|
||||
}
|
||||
} */
|
||||
|
||||
if(isset($this->params['named']['customerid'])) {
|
||||
$customer = $this->Enquiry->Customer->findById($this->params['named']['customerid']);
|
||||
}
|
||||
if(empty($this->data)) {
|
||||
|
||||
if(isset($this->params['named']['customerid'])) {
|
||||
$customer = $this->Enquiry->Customer->findById($this->params['named']['customerid']);
|
||||
}
|
||||
else {
|
||||
$this->Session->setFlash(__('The customer must already exist in the database. Please add Enquiries to an existing Customer', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($customer)) {
|
||||
/* Check if the customer exists in the database - otherwise send the user back to step 1*/
|
||||
|
|
|
|||
|
|
@ -6,12 +6,13 @@ class PrinciplesController extends AppController {
|
|||
|
||||
var $paginate = array(
|
||||
'Principle' => array('order' => array('Principle.id' => 'asc')),
|
||||
'Enquiry' => array('order' => array('Enquiry.id' => 'desc'))
|
||||
'Enquiry' => array('limit' => 200, 'order' => array('Enquiry.id' => 'desc'))
|
||||
);
|
||||
|
||||
function index() {
|
||||
$this->Principle->recursive = 0;
|
||||
$this->set('principles', $this->paginate());
|
||||
$this->set('enquiries', $this->paginate());
|
||||
}
|
||||
|
||||
function view($id = null) {
|
||||
|
|
|
|||
17
models/email.php
Normal file
17
models/email.php
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
class Email extends AppModel {
|
||||
|
||||
var $name = 'Email';
|
||||
|
||||
var $belongsTo = array(
|
||||
'Enquiry' => array('className' => 'Enquiry',
|
||||
'foreignKey' => 'enquiry_id'));
|
||||
|
||||
var $hasMany = array(
|
||||
'EmailAttachment' => array('className' => 'EmailAttachment',
|
||||
'foreignKey' => 'email_id',
|
||||
'dependent' => false
|
||||
));
|
||||
|
||||
}
|
||||
?>
|
||||
15
models/email_attachment.php
Normal file
15
models/email_attachment.php
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
class EmailAttachment extends AppModel {
|
||||
|
||||
var $name = 'EmailAttachment';
|
||||
|
||||
var $belongsTo = array(
|
||||
'Email' => array('className' => 'Email',
|
||||
'foreignKey' => 'email_id',
|
||||
'conditions' => '',
|
||||
'fields' => '',
|
||||
'order' => ''
|
||||
));
|
||||
|
||||
}
|
||||
?>
|
||||
10
vendors/shells/vault.php
vendored
10
vendors/shells/vault.php
vendored
|
|
@ -157,7 +157,7 @@ function getMessage($mbox, $msgnumber, $headers) {
|
|||
$subject = $headers->subject;
|
||||
$date = $headers->date;
|
||||
$recipients = $this->getRecipients($headers);
|
||||
$message['subject'] = Sanitize::paranoid($subject, array(' ', '@'));
|
||||
$message['subject'] = $subject;
|
||||
$message['date'] = $date;
|
||||
$message['to'] = $recipients['to'];
|
||||
$message['from'] = $recipients['from'];
|
||||
|
|
@ -228,18 +228,18 @@ function getParts($parts, $mbox, $msgnumber) {
|
|||
|
||||
if ($part->subtype == 'HTML') { /* Find the HTML component of the body */
|
||||
$body = imap_fetchbody($mbox, $msgnumber, $i+1);
|
||||
return $body;
|
||||
break; //Found HTML (preferred) So end the loop.
|
||||
}
|
||||
elseif($part->subtype == 'PLAIN') {
|
||||
$body = imap_fetchbody($mbox, $msgnumber, $i+1);
|
||||
return $body;
|
||||
|
||||
}
|
||||
elseif(isset($part->parts)) {
|
||||
$body = $this->getParts($part->parts, $mbox, $msgnumber); /* Handle these goddamn Outlook messages */
|
||||
return $body;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return $body;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,120 +18,23 @@
|
|||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('Edit Country', true), array('action'=>'edit', $country['Country']['id'])); ?> </li>
|
||||
<li><?php echo $html->link(__('Delete Country', true), array('action'=>'delete', $country['Country']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $country['Country']['id'])); ?> </li>
|
||||
<li><?php echo $html->link(__('List Countries', true), array('action'=>'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Country', true), array('action'=>'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Currencies', true), array('controller'=> 'currencies', 'action'=>'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Currency', true), array('controller'=> 'currencies', 'action'=>'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Addresses', true), array('controller'=> 'addresses', 'action'=>'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Address', true), array('controller'=> 'addresses', 'action'=>'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Enquiries', true), array('controller'=> 'enquiries', 'action'=>'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Enquiry', true), array('controller'=> 'enquiries', 'action'=>'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Principles', true), array('controller'=> 'principles', 'action'=>'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Principle', true), array('controller'=> 'principles', 'action'=>'add')); ?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="related">
|
||||
<h3><?php __('Related Addresses');?></h3>
|
||||
<?php if (!empty($country['Address'])):?>
|
||||
<table cellpadding = "0" cellspacing = "0">
|
||||
<tr>
|
||||
<th><?php __('Id'); ?></th>
|
||||
<th><?php __('Address1'); ?></th>
|
||||
<th><?php __('City'); ?></th>
|
||||
<th><?php __('State Id'); ?></th>
|
||||
<th><?php __('Country Id'); ?></th>
|
||||
<th><?php __('Customer Id'); ?></th>
|
||||
<th><?php __('Type'); ?></th>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($country['Address'] as $address):
|
||||
$class = null;
|
||||
if ($i++ % 2 == 0) {
|
||||
$class = ' class="altrow"';
|
||||
}
|
||||
?>
|
||||
<tr<?php echo $class;?>>
|
||||
<td><?php echo $address['id'];?></td>
|
||||
<td><?php echo $address['address1'];?></td>
|
||||
<td><?php echo $address['city'];?></td>
|
||||
<td><?php echo $address['state_id'];?></td>
|
||||
<td><?php echo $address['country_id'];?></td>
|
||||
<td><?php echo $address['customer_id'];?></td>
|
||||
<td><?php echo $address['type'];?></td>
|
||||
<td class="actions">
|
||||
<?php echo $html->link(__('View', true), array('controller'=> 'addresses', 'action'=>'view', $address['id'])); ?>
|
||||
<?php echo $html->link(__('Edit', true), array('controller'=> 'addresses', 'action'=>'edit', $address['id'])); ?>
|
||||
<?php echo $html->link(__('Delete', true), array('controller'=> 'addresses', 'action'=>'delete', $address['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $address['id'])); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('New Address', true), array('controller'=> 'addresses', 'action'=>'add'));?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="related">
|
||||
<h3><?php __('Related Enquiries');?></h3>
|
||||
<?php if (!empty($country['Enquiry'])):?>
|
||||
<table cellpadding = "0" cellspacing = "0">
|
||||
<tr>
|
||||
<th><?php __('Id'); ?></th>
|
||||
<th><?php __('Title'); ?></th>
|
||||
<th><?php __('User Id'); ?></th>
|
||||
<th><?php __('Customer Id'); ?></th>
|
||||
<th><?php __('Contact Id'); ?></th>
|
||||
<th><?php __('State Id'); ?></th>
|
||||
<th><?php __('Country Id'); ?></th>
|
||||
<th><?php __('Principle Id'); ?></th>
|
||||
<th><?php __('Status Id'); ?></th>
|
||||
<th><?php __('Comments'); ?></th>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($country['Enquiry'] as $enquiry):
|
||||
$class = null;
|
||||
if ($i++ % 2 == 0) {
|
||||
$class = ' class="altrow"';
|
||||
}
|
||||
<?php if (!empty($country['Enquiry'])) {
|
||||
echo $this->element('enquiry_table', $enquiries);
|
||||
}
|
||||
else {
|
||||
echo "No Enquiries from this State";
|
||||
}
|
||||
?>
|
||||
<tr<?php echo $class;?>>
|
||||
<td><?php echo $enquiry['id'];?></td>
|
||||
<td><?php echo $enquiry['title'];?></td>
|
||||
<td><?php echo $enquiry['user_id'];?></td>
|
||||
<td><?php echo $enquiry['customer_id'];?></td>
|
||||
<td><?php echo $enquiry['contact_id'];?></td>
|
||||
<td><?php echo $enquiry['state_id'];?></td>
|
||||
<td><?php echo $enquiry['country_id'];?></td>
|
||||
<td><?php echo $enquiry['principle_id'];?></td>
|
||||
<td><?php echo $enquiry['status_id'];?></td>
|
||||
<td><?php echo $enquiry['comments'];?></td>
|
||||
<td class="actions">
|
||||
<?php echo $html->link(__('View', true), array('controller'=> 'enquiries', 'action'=>'view', $enquiry['id'])); ?>
|
||||
<?php echo $html->link(__('Edit', true), array('controller'=> 'enquiries', 'action'=>'edit', $enquiry['id'])); ?>
|
||||
<?php echo $html->link(__('Delete', true), array('controller'=> 'enquiries', 'action'=>'delete', $enquiry['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $enquiry['id'])); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('New Enquiry', true), array('controller'=> 'enquiries', 'action'=>'add'));?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="related">
|
||||
<h3><?php __('Related Principles');?></h3>
|
||||
<?php if (!empty($country['Principle'])):?>
|
||||
|
|
|
|||
|
|
@ -37,12 +37,17 @@
|
|||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('Edit Customer', true), array('action'=>'edit', $customer['Customer']['id'])); ?> </li>
|
||||
<li><?php echo $html->link(__('New Enquiry for this Customer', true), array('controller'=>'enquiries', 'action'=>'add/customerid:'.$customer['Customer']['id'])); ?></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="related">
|
||||
<h3><?php __('Contacts');?><?php echo $html->image('system-users.png'); ?></h3>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('New Contact for this Customer', true), array('controller'=> 'contacts', 'action'=>'add_to_customer/customerid:'.$customer['Customer']['id']));?><?php echo $html->link($html->image('contact-new.png'), array('controller'=> 'contacts', 'action'=>'add_to_customer/customerid:'.$customer['Customer']['id']), null, null, false); ?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php if (!empty($customer['Contact'])):?>
|
||||
<table cellpadding = "0" cellspacing = "0">
|
||||
<tr>
|
||||
|
|
@ -76,16 +81,18 @@
|
|||
</table>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('New Contact for this Customer', true), array('controller'=> 'contacts', 'action'=>'add_to_customer/customerid:'.$customer['Customer']['id']));?><?php echo $html->link($html->image('contact-new.png'), array('controller'=> 'contacts', 'action'=>'add_to_customer/customerid:'.$customer['Customer']['id']), null, null, false); ?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="related">
|
||||
<h3><?php __('Addresses');?><?php echo $html->image('x-office-address-book.png'); ?></h3>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('New Address for this Customer', true), array('controller'=> 'addresses', 'action'=>'add/customerid:'.$customer['Customer']['id']));?><?php echo $html->link($html->image('address-book-new.png'), array('controller'=> 'addresses', 'action'=>'add/customerid:'.$customer['Customer']['id']), null, null, false); ?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php if (!empty($customer['Address'])) {
|
||||
echo $this->element('address_table', $addresses);
|
||||
}
|
||||
|
|
@ -93,14 +100,15 @@
|
|||
echo 'No Addresses for this Customer Yet';
|
||||
}
|
||||
?>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('New Address for this Customer', true), array('controller'=> 'addresses', 'action'=>'add/customerid:'.$customer['Customer']['id']));?><?php echo $html->link($html->image('address-book-new.png'), array('controller'=> 'addresses', 'action'=>'add/customerid:'.$customer['Customer']['id']), null, null, false); ?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="related">
|
||||
<h3><?php __('Enquiries');?><?php echo $html->image('folder.png'); ?></h3>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('New Enquiry for this Customer', true), array('controller'=> 'enquiries', 'action'=>'add/customerid:'.$customer['Customer']['id']));?><?php echo $html->link($html->image('folder-new.png'), array('controller'=> 'enquiries', 'action'=>'add/customerid:'.$customer['Customer']['id']), null, null, false); ?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php if (!empty($customer['Enquiry'])) {
|
||||
echo $this->element('enquiry_table', $enquiries);
|
||||
}
|
||||
|
|
@ -110,10 +118,6 @@
|
|||
?>
|
||||
|
||||
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('New Enquiry for this Customer', true), array('controller'=> 'enquiries', 'action'=>'add/customerid:'.$customer['Customer']['id']));?><?php echo $html->link($html->image('folder-new.png'), array('controller'=> 'enquiries', 'action'=>'add/customerid:'.$customer['Customer']['id']), null, null, false); ?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,17 @@ Thank you for your enquiry. It has been entered in our system and will be action
|
|||
The reference number assigned to this enquiry is: <b><?php echo $enquiry['Enquiry']['title']; ?></b><br />
|
||||
<br />
|
||||
|
||||
Depending on the nature of your request, sometimes we may need input from our manufacturers overseas. This may take up to 24 or 48 hours. <br /><br />
|
||||
|
||||
Please see below for the contact details we have for this enquiry and advise if there are any mistakes.<br><br>
|
||||
|
||||
<b>Company Name:</b> <?php echo $enquiry['Customer']['name']; ?><br>
|
||||
<b>Contact Name:</b> <?php echo $enquiry['Contact']['first_name'].' '.$enquiry['Contact']['last_name']; ?><br>
|
||||
<b>Contact Email:</b> <?php echo $enquiry['Contact']['email']; ?><br>
|
||||
<b>Telephone:</b> <?php echo $enquiry['Contact']['phone']; ?><br>
|
||||
<b>Mobile:</b> <?php echo $enquiry['Contact']['mobile']; ?><br>
|
||||
<b>Fax:</b> <?php echo $enquiry['Contact']['fax']; ?><br>
|
||||
<br>
|
||||
Depending on the nature of your request, we may need input from our manufacturers overseas. This will usually take 24 to 48 hours, but if your application is more complex, it may take longer. <br /><br />
|
||||
|
||||
Sincerely, <br /><br />
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,22 @@ Dear <?php echo $enquiry['Contact']['first_name']; ?>,
|
|||
Thank you for your enquiry. It has been entered in our system and will be actioned for you by <?php echo $enquiry['User']['first_name'].' '.$enquiry['User']['last_name']; ?>. Email: <?php echo $enquiry['User']['email']; ?>
|
||||
The reference number assigned to this enquiry is: <?php echo $enquiry['Enquiry']['title']; ?>
|
||||
|
||||
Please see below for the contact details we have for this enquiry and advise if there are any mistakes.
|
||||
|
||||
Depending on the nature of your request, sometimes we may need input from our manufacturers overseas. This may take up to 24 or 48 hours.
|
||||
Company Name: <?php echo $enquiry['Customer']['name']; ?>
|
||||
|
||||
Contact Name: <?php echo $enquiry['Contact']['first_name'].' '.$enquiry['Contact']['last_name']; ?>
|
||||
|
||||
Contact Email: <?php echo $enquiry['Contact']['email']; ?>
|
||||
|
||||
Telephone: <?php echo $enquiry['Contact']['phone']; ?>
|
||||
|
||||
Mobile: <?php echo $enquiry['Contact']['mobile']; ?>
|
||||
|
||||
Fax: <?php echo $enquiry['Contact']['fax']; ?>
|
||||
|
||||
|
||||
Depending on the nature of your request, we may need input from our manufacturers overseas. This will usually take 24 to 48 hours, but if your application is more complex, it may take longer.
|
||||
|
||||
Sincerely,
|
||||
|
||||
|
|
|
|||
35
views/elements/email_table.ctp
Normal file
35
views/elements/email_table.ctp
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?php if (!empty($emails)):?>
|
||||
<table cellpadding = "0" cellspacing = "0" class="filetable">
|
||||
<tr>
|
||||
<th><?php __('Email Date'); ?></th>
|
||||
<th><?php __('To'); ?></th>
|
||||
<th><?php __('CC'); ?></th>
|
||||
<th><?php __('From'); ?></th>
|
||||
<th><?php __('Subject'); ?></th>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($emails as $email):
|
||||
$class = null;
|
||||
|
||||
if ($i % 2 == 0) {
|
||||
$class = ' class="altrow"';
|
||||
}
|
||||
$i++;
|
||||
?>
|
||||
|
||||
<tr<?php echo $class;?>>
|
||||
|
||||
<td><?php echo $email['Email']['date'];?></td>
|
||||
<td><?php echo $email['Email']['to']; ?></td>
|
||||
<td><?php echo $email['Email']['cc']; ?></td>
|
||||
<td><?php echo $email['Email']['from']; ?></td>
|
||||
<td><?php echo $html->link($email['Email']['subject'], array('controller'=> 'emails', 'action'=>'view/', $email['Email']['id'])); ?></td>
|
||||
<td class="actions">
|
||||
<?php echo $html->link(__('View', true), array('controller'=> 'emails', 'action'=>'view/', $email['Email']['id'])); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
|
|
@ -128,6 +128,7 @@ foreach ($enquiries as $enquiry):
|
|||
</table>
|
||||
</div>
|
||||
<div class="paging">
|
||||
<?php echo $paginator->options(array('url'=>$this->passedArgs)); ?>
|
||||
<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
|
||||
| <?php echo $paginator->numbers();?>
|
||||
<?php echo $paginator->next(__('next', true).' >>', array(), null, array('class'=>'disabled'));?>
|
||||
|
|
|
|||
26
views/emails/add.ctp
Normal file
26
views/emails/add.ctp
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<div class="emails form">
|
||||
<?php echo $form->create('Email');?>
|
||||
<fieldset>
|
||||
<legend><?php __('Add Email');?></legend>
|
||||
<?php
|
||||
echo $form->input('enquiry_id');
|
||||
echo $form->input('to');
|
||||
echo $form->input('from');
|
||||
echo $form->input('cc');
|
||||
echo $form->input('body');
|
||||
echo $form->input('date');
|
||||
echo $form->input('subject');
|
||||
echo $form->input('content-type');
|
||||
?>
|
||||
</fieldset>
|
||||
<?php echo $form->end('Submit');?>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('List Emails', true), array('action'=>'index'));?></li>
|
||||
<li><?php echo $html->link(__('List Enquiries', true), array('controller'=> 'enquiries', 'action'=>'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Enquiry', true), array('controller'=> 'enquiries', 'action'=>'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Email Attachments', true), array('controller'=> 'email_attachments', 'action'=>'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Email Attachment', true), array('controller'=> 'email_attachments', 'action'=>'add')); ?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
28
views/emails/edit.ctp
Normal file
28
views/emails/edit.ctp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<div class="emails form">
|
||||
<?php echo $form->create('Email');?>
|
||||
<fieldset>
|
||||
<legend><?php __('Edit Email');?></legend>
|
||||
<?php
|
||||
echo $form->input('enquiry_id');
|
||||
echo $form->input('id');
|
||||
echo $form->input('to');
|
||||
echo $form->input('from');
|
||||
echo $form->input('cc');
|
||||
echo $form->input('body');
|
||||
echo $form->input('date');
|
||||
echo $form->input('subject');
|
||||
echo $form->input('content-type');
|
||||
?>
|
||||
</fieldset>
|
||||
<?php echo $form->end('Submit');?>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('Delete', true), array('action'=>'delete', $form->value('Email.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $form->value('Email.id'))); ?></li>
|
||||
<li><?php echo $html->link(__('List Emails', true), array('action'=>'index'));?></li>
|
||||
<li><?php echo $html->link(__('List Enquiries', true), array('controller'=> 'enquiries', 'action'=>'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Enquiry', true), array('controller'=> 'enquiries', 'action'=>'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Email Attachments', true), array('controller'=> 'email_attachments', 'action'=>'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Email Attachment', true), array('controller'=> 'email_attachments', 'action'=>'add')); ?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
82
views/emails/index.ctp
Normal file
82
views/emails/index.ctp
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
<div class="emails index">
|
||||
<h2><?php __('Emails');?></h2>
|
||||
<p>
|
||||
<?php
|
||||
echo $paginator->counter(array(
|
||||
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
|
||||
));
|
||||
?></p>
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<th><?php echo $paginator->sort('enquiry_id');?></th>
|
||||
<th><?php echo $paginator->sort('id');?></th>
|
||||
<th><?php echo $paginator->sort('to');?></th>
|
||||
<th><?php echo $paginator->sort('from');?></th>
|
||||
<th><?php echo $paginator->sort('cc');?></th>
|
||||
|
||||
<th><?php echo $paginator->sort('created');?></th>
|
||||
<th><?php echo $paginator->sort('date');?></th>
|
||||
<th><?php echo $paginator->sort('subject');?></th>
|
||||
<th><?php echo $paginator->sort('content-type');?></th>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($emails as $email):
|
||||
$class = null;
|
||||
if ($i++ % 2 == 0) {
|
||||
$class = ' class="altrow"';
|
||||
}
|
||||
?>
|
||||
<tr<?php echo $class;?>>
|
||||
<td>
|
||||
<?php echo $html->link($email['Enquiry']['title'], array('controller'=> 'enquiries', 'action'=>'view', $email['Enquiry']['id'])); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $email['Email']['id']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $email['Email']['to']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $email['Email']['from']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $email['Email']['cc']; ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php echo $email['Email']['created']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $email['Email']['date']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $email['Email']['subject']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $email['Email']['content-type']; ?>
|
||||
</td>
|
||||
<td class="actions">
|
||||
<?php echo $html->link(__('View', true), array('action'=>'view', $email['Email']['id'])); ?>
|
||||
<?php echo $html->link(__('Edit', true), array('action'=>'edit', $email['Email']['id'])); ?>
|
||||
<?php echo $html->link(__('Delete', true), array('action'=>'delete', $email['Email']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $email['Email']['id'])); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
<div class="paging">
|
||||
<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
|
||||
| <?php echo $paginator->numbers();?>
|
||||
<?php echo $paginator->next(__('next', true).' >>', array(), null, array('class'=>'disabled'));?>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('New Email', true), array('action'=>'add')); ?></li>
|
||||
<li><?php echo $html->link(__('List Enquiries', true), array('controller'=> 'enquiries', 'action'=>'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Enquiry', true), array('controller'=> 'enquiries', 'action'=>'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Email Attachments', true), array('controller'=> 'email_attachments', 'action'=>'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Email Attachment', true), array('controller'=> 'email_attachments', 'action'=>'add')); ?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
95
views/emails/view.ctp
Normal file
95
views/emails/view.ctp
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
<div class="emails view">
|
||||
<h2><?php __('Email');?></h2>
|
||||
<dl><?php $i = 0; $class = ' class="altrow"';?>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Enquiry'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $html->link($email['Enquiry']['title'], array('controller'=> 'enquiries', 'action'=>'view', $email['Enquiry']['id'])); ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $email['Email']['id']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('To'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $email['Email']['to']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('From'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $email['Email']['from']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Cc'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $email['Email']['cc']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Body'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $email['Email']['body']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Created'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $email['Email']['created']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Date'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $email['Email']['date']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Subject'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $email['Email']['subject']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Content-type'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $email['Email']['content-type']; ?>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div class="related">
|
||||
<h3><?php __('Related Email Attachments');?></h3>
|
||||
<?php if (!empty($email['EmailAttachment'])):?>
|
||||
<table cellpadding = "0" cellspacing = "0">
|
||||
<tr>
|
||||
|
||||
<th><?php __('Name'); ?></th>
|
||||
<th><?php __('Type'); ?></th>
|
||||
<th><?php __('Size'); ?></th>
|
||||
<th><?php __('Description'); ?></th>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($email['EmailAttachment'] as $emailAttachment):
|
||||
$class = null;
|
||||
if ($i++ % 2 == 0) {
|
||||
$class = ' class="altrow"';
|
||||
}
|
||||
?>
|
||||
<tr<?php echo $class;?>>
|
||||
|
||||
<td><?php echo $emailAttachment['name'];?></td>
|
||||
<td><?php echo $emailAttachment['type'];?></td>
|
||||
<td><?php echo $emailAttachment['size'];?></td>
|
||||
|
||||
|
||||
<td><?php echo $emailAttachment['description'];?></td>
|
||||
<td class="actions">
|
||||
<?php echo $html->link(__('View', true), array('controller'=> 'email_attachments', 'action'=>'view', $emailAttachment['id'])); ?>
|
||||
<?php echo $html->link(__('Edit', true), array('controller'=> 'email_attachments', 'action'=>'edit', $emailAttachment['id'])); ?>
|
||||
<?php echo $html->link(__('Delete', true), array('controller'=> 'email_attachments', 'action'=>'delete', $emailAttachment['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $emailAttachment['id'])); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
|
@ -98,6 +98,11 @@
|
|||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="related">
|
||||
<h3><?php __($number_of_emails.' Emails for this Enquiry');?></h3>
|
||||
<?php echo $this->element('email_table', $emails); ?>
|
||||
</div>
|
||||
|
||||
<div class="related">
|
||||
<h3><?php __($number_of_quotes.' Quotes in this Enquiry');?></h3>
|
||||
<?php echo $this->element('quote_table', $quotes); ?>
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ if (window.attachEvent) window.attachEvent("onload", sfHover);
|
|||
<li><h3><?php echo $html->link('Enquiries', '/enquiries/index'); ?></h3>
|
||||
<ul>
|
||||
<li><?php echo $html->link('Enquiry Register', '/enquiries/index'); ?></li>
|
||||
<li><?php echo $html->link('Add Enquiry', '/enquiries/add'); ?></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
|
|
|||
|
|
@ -62,59 +62,7 @@
|
|||
<div class="related">
|
||||
<h3><?php __('Related Enquiries');?></h3>
|
||||
<?php if (!empty($principle['Enquiry'])):?>
|
||||
<table cellpadding = "0" cellspacing = "0">
|
||||
<tr>
|
||||
<th><?php __('Id'); ?></th>
|
||||
<th><?php __('Created'); ?></th>
|
||||
<th><?php __('Title'); ?></th>
|
||||
<th><?php __('User Id'); ?></th>
|
||||
<th><?php __('Customer Id'); ?></th>
|
||||
<th><?php __('Contact Id'); ?></th>
|
||||
<th><?php __('State Id'); ?></th>
|
||||
<th><?php __('Country Id'); ?></th>
|
||||
<th><?php __('Principle Id'); ?></th>
|
||||
<th><?php __('Status Id'); ?></th>
|
||||
<th><?php __('Comments'); ?></th>
|
||||
<th><?php __('Principle Code'); ?></th>
|
||||
<th><?php __('Gst'); ?></th>
|
||||
<th><?php __('Billing Address Id'); ?></th>
|
||||
<th><?php __('Shipping Address Id'); ?></th>
|
||||
<th><?php __('Posted'); ?></th>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($principle['Enquiry'] as $enquiry):
|
||||
$class = null;
|
||||
if ($i++ % 2 == 0) {
|
||||
$class = ' class="altrow"';
|
||||
}
|
||||
?>
|
||||
<tr<?php echo $class;?>>
|
||||
<td><?php echo $enquiry['id'];?></td>
|
||||
<td><?php echo $enquiry['created'];?></td>
|
||||
<td><?php echo $enquiry['title'];?></td>
|
||||
<td><?php echo $enquiry['user_id'];?></td>
|
||||
<td><?php echo $enquiry['customer_id'];?></td>
|
||||
<td><?php echo $enquiry['contact_id'];?></td>
|
||||
<td><?php echo $enquiry['state_id'];?></td>
|
||||
<td><?php echo $enquiry['country_id'];?></td>
|
||||
<td><?php echo $enquiry['principle_id'];?></td>
|
||||
<td><?php echo $enquiry['status_id'];?></td>
|
||||
<td><?php echo $enquiry['comments'];?></td>
|
||||
<td><?php echo $enquiry['principle_code'];?></td>
|
||||
<td><?php echo $enquiry['gst'];?></td>
|
||||
<td><?php echo $enquiry['billing_address_id'];?></td>
|
||||
<td><?php echo $enquiry['shipping_address_id'];?></td>
|
||||
<td><?php echo $enquiry['posted'];?></td>
|
||||
<td class="actions">
|
||||
<?php echo $html->link(__('View', true), array('controller'=> 'enquiries', 'action'=>'view', $enquiry['id'])); ?>
|
||||
<?php echo $html->link(__('Edit', true), array('controller'=> 'enquiries', 'action'=>'edit', $enquiry['id'])); ?>
|
||||
<?php echo $html->link(__('Delete', true), array('controller'=> 'enquiries', 'action'=>'delete', $enquiry['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $enquiry['id'])); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<? echo $this->element('enquiry_table', $enquiries); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="actions">
|
||||
|
|
|
|||
|
|
@ -35,52 +35,7 @@
|
|||
<li><?php echo $html->link(__('New Enquiry', true), array('controller'=> 'enquiries', 'action'=>'add')); ?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="related">
|
||||
<h3><?php __('Related Addresses');?></h3>
|
||||
<?php if (!empty($state['Address'])):?>
|
||||
<table cellpadding = "0" cellspacing = "0">
|
||||
<tr>
|
||||
<th><?php __('Id'); ?></th>
|
||||
<th><?php __('Address1'); ?></th>
|
||||
<th><?php __('City'); ?></th>
|
||||
<th><?php __('State Id'); ?></th>
|
||||
<th><?php __('Country Id'); ?></th>
|
||||
<th><?php __('Customer Id'); ?></th>
|
||||
<th><?php __('Type'); ?></th>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($state['Address'] as $address):
|
||||
$class = null;
|
||||
if ($i++ % 2 == 0) {
|
||||
$class = ' class="altrow"';
|
||||
}
|
||||
?>
|
||||
<tr<?php echo $class;?>>
|
||||
<td><?php echo $address['id'];?></td>
|
||||
<td><?php echo $address['address1'];?></td>
|
||||
<td><?php echo $address['city'];?></td>
|
||||
<td><?php echo $address['state_id'];?></td>
|
||||
<td><?php echo $address['country_id'];?></td>
|
||||
<td><?php echo $address['customer_id'];?></td>
|
||||
<td><?php echo $address['type'];?></td>
|
||||
<td class="actions">
|
||||
<?php echo $html->link(__('View', true), array('controller'=> 'addresses', 'action'=>'view', $address['id'])); ?>
|
||||
<?php echo $html->link(__('Edit', true), array('controller'=> 'addresses', 'action'=>'edit', $address['id'])); ?>
|
||||
<?php echo $html->link(__('Delete', true), array('controller'=> 'addresses', 'action'=>'delete', $address['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $address['id'])); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('New Address', true), array('controller'=> 'addresses', 'action'=>'add'));?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="related">
|
||||
<h3><?php __('Related Enquiries');?></h3>
|
||||
<?php if (!empty($state['Enquiry'])) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue