From fb94915cded71a2cead0898f780c0e1cc94207b8 Mon Sep 17 00:00:00 2001 From: Karl Cordes Date: Tue, 9 Aug 2011 14:41:46 +1000 Subject: [PATCH] Improved view Enquiry. New Quotes now default to AUD and issue date is the day created --- controllers/documents_controller.php | 7 +- views/enquiries/view.ctp | 294 ++++++++++++++------------- webroot/css/quotenik.css | 49 ++++- 3 files changed, 208 insertions(+), 142 deletions(-) diff --git a/controllers/documents_controller.php b/controllers/documents_controller.php index a4d049a7..f1f20a0a 100755 --- a/controllers/documents_controller.php +++ b/controllers/documents_controller.php @@ -71,15 +71,14 @@ class DocumentsController extends AppController { $this->data['Quote']['enquiry_id'] = $enquiryid; $number_of_revisions = $this->Document->Quote->findCount('Quote.enquiry_id ='. $enquiryid); $this->data['Quote']['revision'] = $number_of_revisions; + $this->data['Quote']['date_issued'] = date('Y-m-d'); + $this->data['Quote']['currency_id'] = 2; //All new Quotes default to AUD. + $this->data['Document']['user_id']= $enquiry['Enquiry']['user_id']; $this->data['Document']['enquiry_id'] = $enquiryid; $this->data['Document']['type'] = 'quote'; - - - - if ($this->Document->saveAll($this->data)) { $newid = $this->Document->id; diff --git a/views/enquiries/view.ctp b/views/enquiries/view.ctp index acce7c5b..d04efb2e 100755 --- a/views/enquiries/view.ctp +++ b/views/enquiries/view.ctp @@ -1,94 +1,122 @@
-

-
- > - > - -   - +
+
Enquiry:
+
+
Customer:
+
link($enquiry['Customer']['name'], array('controller'=>'customers','action'=>'view', $enquiry['Customer']['id']));?> +
+ +
Contact:
+
link($enquiry['Contact']['first_name'].' '.$enquiry['Contact']['last_name'], array('controller'=> 'users', 'action'=>'view', $enquiry['Contact']['id'])); ?> + link($enquiry['Contact']['email'], 'mailto:'.$enquiry['Contact']['email']);?> +
+ + + +
Status:
+
> link($enquiry['Status']['name'], array('controller'=> 'statuses', 'action'=>'view', $enquiry['Status']['id'])); ?>
+
+ +

Details

+
+ + > > -link($enquiry['User']['username'], array('controller'=> 'users', 'action'=>'view', $enquiry['User']['id'])); ?> -   - - > - > -link($enquiry['Customer']['name'], array('controller'=> 'customers', 'action'=>'view', $enquiry['Customer']['id'])); ?> -   - - > - > -link($enquiry['Contact']['first_name'].' '.$enquiry['Contact']['last_name'], array('controller'=> 'contacts', 'action'=>'view', $enquiry['Contact']['id'])); ?> + link($enquiry['User']['username'], array('controller'=> 'users', 'action'=>'view', $enquiry['User']['id'])); ?>   + > > -link($enquiry['State']['name'], array('controller'=> 'states', 'action'=>'view', $enquiry['State']['id'])); ?> + link($enquiry['State']['name'], array('controller'=> 'states', 'action'=>'view', $enquiry['State']['id'])); ?>   > > -link($enquiry['Country']['name'], array('controller'=> 'countries', 'action'=>'view', $enquiry['Country']['id'])); ?> + link($enquiry['Country']['name'], array('controller'=> 'countries', 'action'=>'view', $enquiry['Country']['id'])); ?>   > > - +   > > -link($enquiry['Principle']['name'], array('controller'=> 'principles', 'action'=>'view', $enquiry['Principle']['id'])); ?> + link($enquiry['Principle']['name'], array('controller'=> 'principles', 'action'=>'view', $enquiry['Principle']['id'])); ?>   > > -link($enquiry['Status']['name'], array('controller'=> 'statuses', 'action'=>'view', $enquiry['Status']['id'])); ?> + link($enquiry['Status']['name'], array('controller'=> 'statuses', 'action'=>'view', $enquiry['Status']['id'])); ?>   > > - +   > > - '; - echo $enquiry['BillingAddress']['city'].' '.$billingaddress['State']['name'].' '.$enquiry['BillingAddress']['postcode'].'
'; - echo ''.$billingaddress['Country']['name'].''; - } - else { - echo 'No Billing Address Assigned for this Enquiry'; - } -?> + '; + echo $enquiry['BillingAddress']['city'].' '.$billingaddress['State']['name'].' '.$enquiry['BillingAddress']['postcode'].'
'; + echo ''.$billingaddress['Country']['name'].''; + } + else { + echo 'No Billing Address Assigned for this Enquiry'; + } + ?>   > > - '; - echo $enquiry['ShippingAddress']['city'].' '.$shippingaddress['State']['name'].' '.$enquiry['ShippingAddress']['postcode'].'
'; - echo ''.$shippingaddress['Country']['name'].''; - } - else { - echo 'No Shipping Address Assigned for this Enquiry'; -} -?> + '; + echo $enquiry['ShippingAddress']['city'].' '.$shippingaddress['State']['name'].' '.$enquiry['ShippingAddress']['postcode'].'
'; + echo ''.$shippingaddress['Country']['name'].''; + } + else { + echo 'No Shipping Address Assigned for this Enquiry'; + } + ?>   @@ -107,41 +135,35 @@ $class = ' class="altrow"';?> $boxdata['enquirynumber'] = $enquiry['Enquiry']['title']; //$boxdata['principle_emails'] = $principle_emails; ?> -element('principle_contacts_email_box', array('enquirynumber' => $enquiry['Enquiry']['title'], -'principle_emails' => $principle_emails )); ?> + element('principle_contacts_email_box', array('enquirynumber' => $enquiry['Enquiry']['title'], + 'principle_emails' => $principle_emails )); ?>
- -

image('document.png'); ?>

- element('enquiry_file_table', $files); ?> - -*/?> -
- link('add_job');?> + link('add_job');?> @@ -228,9 +250,9 @@ $class = ' class="altrow"';?> @@ -313,10 +335,10 @@ $class = ' class="altrow"';?> diff --git a/webroot/css/quotenik.css b/webroot/css/quotenik.css index 8bbc9b7a..5a85c934 100755 --- a/webroot/css/quotenik.css +++ b/webroot/css/quotenik.css @@ -89,7 +89,7 @@ a.headerlinks { h3 { color: #2C5FD5; font-family:'Gill Sans','lucida grande',helvetica, arial, sans-serif; - font-size: 130%; + font-size: 150%; /* padding-top: 1.5em; */ } @@ -638,6 +638,9 @@ div.paging span.current { div.paging span a { } + + + /* Scaffold View */ dl { line-height: 2em; @@ -658,6 +661,46 @@ dt.altrow { background: #E6F0F0; } + +/** Enquiry Details Summary */ + +dl.enquirySummary { + font-size: 150%; + color: #045FB4; + +} + +dl.enquirySummary dt { + width: 5em; +} + +dl.enquirySummary dd { + margin-left: 8em; +} + + + +/* Colors for Enquiry Statuses */ + +.joblost { + background: #FFC0CB; +} +.jobwon { + background: #55E055; +} +.information { + background: #FFFFFF; +} +.informationsent { + background: #ADD8E6; +} +.requestforquote { + background: #FFFFFF; +} + + + + #emailHeaders { font-size: 80%; } @@ -1564,4 +1607,6 @@ table.lineItems tr td.price { #userType { display: none; -} \ No newline at end of file +} + +