Added Customer Find

This commit is contained in:
Karl Cordes 2009-03-20 16:37:24 +11:00
parent 5021f77c69
commit 0aaace94f3
5 changed files with 52 additions and 6 deletions

View file

@ -90,6 +90,19 @@ class CustomersController extends AppController {
}
function find() {
if(!empty($this->data)) {
$customer = $this->Customer->findByName($this->data['Customer']['name']);
if(!$customer) {
$this->Session->setFlash(__('Could not find the Requested Customer. Please select one from the drop down box as you type.', true));
}
else {
$this->redirect(array('action'=>'view/'.$customer['Customer']['id']));
}
}
}
}
?>

View file

@ -54,6 +54,9 @@ foreach ($enquiries as $enquiry):
else if($enquiry['Status']['id'] == 5) {
$class = ' class="quoted"';
}
else if($enquiry['Status']['id'] == 1) {
$class = ' class="requestforquote"';
}
?>
@ -73,12 +76,12 @@ foreach ($enquiries as $enquiry):
$lastname = $enquiry['User']['last_name']; ?>
<?php echo $html->link($firstname[0].$lastname[0], array('controller'=> 'users', 'action'=>'view', $enquiry['User']['id'])); ?>
</td>
<td>
<td class="enqdate">
<?php
/* Change the date from MySQL DATETIME to a D M Y format */
echo date('j M Y',$time->toUnix($enquiry['Enquiry']['created'])); ?>
</td>
<td>
<td class="principlename">
<?php echo $html->link($enquiry['Principle']['name'], array('controller'=> 'principles', 'action'=>'view', $enquiry['Principle']['id'])); ?>
</td>
<td>
@ -88,10 +91,10 @@ foreach ($enquiries as $enquiry):
<td>
<?php echo $html->link($enquiry['Customer']['name'], array('controller'=> 'customers', 'action'=>'view', $enquiry['Customer']['id'])); ?>
</td>
<td>
<td class="contactname">
<?php echo $html->link($enquiry['Contact']['first_name'].' '.$enquiry['Contact']['last_name'], array('controller'=> 'contacts', 'action'=>'view', $enquiry['Contact']['id'])); ?>
</td>
<td>
<td class="contactemail">
<? //BCC address to Con is hardcoded in here. ?>
<?php echo $html->link($enquiry['Contact']['email'], 'mailto:'.$enquiry['Contact']['email'].'?subject='.$enquiry['Enquiry']['title'].'&bcc=carpis@cmctechnologies.com.au'); ?>
</td>

View file

@ -91,6 +91,7 @@ if (window.attachEvent) window.attachEvent("onload", sfHover);
<li><h3><?php echo $html->link('Customers', '/customers/index'); ?></h3>
<ul>
<li><?php echo $html->link('Customer Index', '/customers/index'); ?></li>
<li><?php echo $html->link('Find Customer', '/customers/find'); ?></li>
<li><?php echo $html->link('Add Customer', '/customers/add'); ?></li>
</ul>
</li>

View file

@ -21,6 +21,11 @@
<?php echo $html->link($user['User']['email'], 'mailto:'.$user['User']['email']); ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Group'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $html->link($user['Group']['name'], array('controller'=>'groups', 'action' => 'view/'.$user['Group']['id'])); ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Job Title'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $user['User']['job_title']; ?>

View file

@ -385,27 +385,51 @@ table.mer tr.information td {
table.mer tr.informationsent td {
background: #ADD8E6;
}
table.mer tr.requestforquote td {
background: #FFFFFF;
}
table.mer tr.quoted td {
background: #FFEC35;
}
table.mer tr td.posted {
padding: 0;
background: #55E055;
}
table.mer tr td.notposted {
padding: 0;
background: #FFFFFF;
}
table.mer tr td.enqdate {
padding: 0;
font-size: x-small;
}
table.mer tr td.principlename {
padding: 0;
font-size: x-small;
}
table.mer tr td.comments {
font-size: small;
font-size: x-small;
text-align: left;
}
table.mer tr td.status {
padding-right: 0;
padding: 0;
font-size: x-small;
}
table.mer tr td.contactemail {
padding: 0;
font-size: x-small;
}
table.mer tr td.contactname {
padding: 0;
font-size: small;
}
table.quotetable tr.mostrecent td {
background: #ADD8E6;
}