Improved view Enquiry. New Quotes now default to AUD and issue date is the day created
This commit is contained in:
parent
6d8c6915ae
commit
fb94915cde
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,28 +1,56 @@
|
|||
<div class="enquiries-view">
|
||||
<h2><?php __("Enquiry: " . $enquiry['Enquiry']['title']);?></h2>
|
||||
|
||||
<dl class="enquirySummary">
|
||||
<dt>Enquiry:</dt>
|
||||
<dd><?=$enquiry['Enquiry']['title']?></dd>
|
||||
<dt>Customer:</dt>
|
||||
<dd><?=$html->link($enquiry['Customer']['name'], array('controller'=>'customers','action'=>'view', $enquiry['Customer']['id']));?>
|
||||
</dd>
|
||||
|
||||
<dt>Contact:</dt>
|
||||
<dd><?=$html->link($enquiry['Contact']['first_name'].' '.$enquiry['Contact']['last_name'], array('controller'=> 'users', 'action'=>'view', $enquiry['Contact']['id'])); ?>
|
||||
<?=$html->link($enquiry['Contact']['email'], 'mailto:'.$enquiry['Contact']['email']);?>
|
||||
</dd>
|
||||
|
||||
<?
|
||||
|
||||
/* Copy+pasta. Should be a helper of an element or something. Aug_2011_Hackfest_for_victory_and_liberation_from_this_project! */
|
||||
if ($enquiry['Status']['id'] == 3) {
|
||||
$class = ' class="jobwon"';
|
||||
} else if ($enquiry['Status']['id'] == 4) {
|
||||
$class = ' class="joblost"';
|
||||
} else if ($enquiry['Status']['id'] == 8) {
|
||||
$class = ' class="joblost"';
|
||||
} else if ($enquiry['Status']['id'] == 9) {
|
||||
$class = ' class="joblost"';
|
||||
} else if ($enquiry['Status']['id'] == 10) {
|
||||
$class = ' class="joblost"';
|
||||
} else if ($enquiry['Status']['id'] == 6) {
|
||||
$class = ' class="information"';
|
||||
} else if ($enquiry['Status']['id'] == 11) {
|
||||
$class = ' class="informationsent"';
|
||||
} else if ($enquiry['Status']['id'] == 5) {
|
||||
$class = ' class="quoted"';
|
||||
} else if ($enquiry['Status']['id'] == 1) {
|
||||
$class = ' class="requestforquote"';
|
||||
}
|
||||
?>
|
||||
|
||||
<dt>Status:</dt>
|
||||
<dd <?=$class?>> <?php echo $html->link($enquiry['Status']['name'], array('controller'=> 'statuses', 'action'=>'view', $enquiry['Status']['id'])); ?></dd>
|
||||
</dl>
|
||||
|
||||
<h3>Details</h3>
|
||||
<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'])); ?>
|
||||
|
|
@ -114,13 +142,6 @@ $class = ' class="altrow"';?>
|
|||
</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 if($enquiry['Enquiry']['quote_count'] > 1) {
|
||||
echo $enquiry['Enquiry']['quote_count'].' Quotes for this Enquiry';
|
||||
|
|
@ -130,6 +151,7 @@ $class = ' class="altrow"';?>
|
|||
|
||||
}?>
|
||||
</h3>
|
||||
<button>New Quote</button>
|
||||
<?php echo $this->element('quote_table', $quotes); ?>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -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%;
|
||||
}
|
||||
|
|
@ -1565,3 +1608,5 @@ table.lineItems tr td.price {
|
|||
#userType {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue