Reverted from Email Queue to just sending the email straight away. May fix this later

This commit is contained in:
Karl Cordes 2009-03-27 12:26:36 +11:00
parent c6edf2d79f
commit b57b353c40
8 changed files with 22 additions and 41 deletions

View file

@ -94,7 +94,7 @@ class EnquiriesController extends AppController {
if ($this->Enquiry->save($this->data)) {
$id = $this->Enquiry->id;
if($this->data['Enquiry']['send_enquiry_email'] == 1) {
$this->__addToQueue($id);
$this->__sendNewEnquiryEmail($id); //Will change this to be the queue at some point.
}
else {
$this->Session->setFlash(__('The Enquiry has been saved but the Contact has NOT been emailed, as you requested.', true));

View file

@ -26,13 +26,19 @@ class ProductsController extends AppController {
if ($this->Product->save($this->data)) {
$this->Session->setFlash(__('The Product has been saved', true));
$this->redirect(array('action'=>'index'));
$id = $this->Product->id;
$this->redirect(array('action'=>'view/'.$id));
} else {
$this->Session->setFlash(__('The Product could not be saved. Please, try again.', true));
}
}
$principles = $this->Product->Principle->find('list');
$this->set(compact('principles'));
$product_categories = $this->Product->ProductCategory->find('list');
$this->set(compact('principles', 'product_categories'));
}
function add_costing() {
}
function edit($id = null) {

View file

@ -118,7 +118,7 @@ foreach ($enquiries as $enquiry):
}
?>
</td>
<td class="actions">
<td class="viewedit">
<?php echo $html->link(__('View', true), array('controller'=>'enquiries','action'=>'view', $enquiry['Enquiry']['id'])); ?>
<?php echo $html->link(__('Edit', true), array('controller'=>'enquiries','action'=>'edit', $enquiry['Enquiry']['id'])); ?>

View file

@ -17,7 +17,7 @@
echo $form->input('billing_address_id', array('div' => 'addressradio', 'legend' => 'Billing Address', 'options' => $billing_addresses_list, 'type' => 'radio'));
echo $form->input('shipping_address_id', array('div' => 'addressradio','legend' => 'Shipping Address', 'options' => $shipping_addresses_list, 'type' => 'radio'));
echo $form->input('status_id');
echo $form->input('comments', array('id'=>'comments'));
echo $form->input('comments', array('id'=>'comments', 'wrap'=>'hard'));
?>
<input type="BUTTON" onClick="datetime('<?php echo "$initials"; ?>');" value="Edit Comments" class="dateButton" id="datebutton"/>
<?

View file

@ -68,7 +68,7 @@ if (window.attachEvent) window.attachEvent("onload", sfHover);
?>
<h1>CMC Technologies</h1>
</div>
<div id = "username">
<div id="username">
<?php
if(isset($currentuser) == FALSE) {
echo $html->link('Login', '/users/login');
@ -102,9 +102,9 @@ if (window.attachEvent) window.attachEvent("onload", sfHover);
</ul>
</li>
<li><h3><?php echo $html->link('Products', '/products/index'); ?></h3>
<li><h3><?php echo $html->link('Products', '/product_categories/index'); ?></h3>
<ul>
<li><?php echo $html->link('Product Index', '/products/index'); ?></li>
<li><?php echo $html->link('Product Index', '/product_categories/index'); ?></li>
<li><?php echo $html->link('Add Product', '/products/add'); ?></li>
</ul>
</li>

View file

@ -10,38 +10,9 @@
echo $form->input('title');
echo $form->input('description');
echo $form->input('part_number');
echo $form->input('exchange_rate', array('id'=>'exchange_rate'));
echo $form->input('cost_price_each', array('id'=>'costprice'));
echo $form->input('our_discount', array('label'=>'Our Discount %', 'id' => 'ourdiscount'));
echo $form->input('packing_each', array('id'=>'packing'));
echo '<div class="input text">';
echo $form->label('fob_country_of_export', 'F.O.B Country of Export');
echo $form->text('fob_country_of_export', array('readonly'=>'readonly', 'id'=>'fob_country_of_export'));
echo '</div>';
echo '<div class="input text">';
echo $form->label('convert_to_aud', 'Convert to A$');
echo $form->text('convert_to_aud', array('readonly'=>'readonly', 'id'=>'convert_to_aud'));
echo '</div>';
echo $form->input('duty', array('label' => 'Duty %', 'id'=>'duty'));
echo $form->input('shipping_weight_each', array('id'=>'shippingweight_each'));
echo $form->input('shipping_cost_each', array('id'=>'shippingcost_each'));
echo $form->input('customs', array('id'=>'customs'));
echo $form->input('misc_cost', array('label' => 'Misc. Costs', 'id'=>'misc_cost'));
echo $form->input('finance', array('label' => 'Finance %', 'id'=>'finance', 'after'=>'<p id="financeamount"> </p>'));
echo '<div class="input text">';
echo $form->label('total_landed_cost', 'Total Landed Cost');
echo $form->text('total_landed_cost', array('readonly'=>'readonly', 'id'=>'total_landed_cost'));
echo '</div>';
echo $form->input('sellprice_each', array('label' => 'Sell Price Each', 'id'=>'sellprice_each'));
echo '<div class="input text">';
echo $form->label('gross_profit_dollars', 'Gross Profit $');
echo $form->text('gross_profit_dollars', array('readonly'=>'readonly', 'id'=>'gross_profit_dollars'));
echo '</div>';
echo '<div class="input text">';
echo $form->label('gross_profit_percent', 'Gross Profit %');
echo $form->text('gross_profit_prercent', array('readonly'=>'readonly', 'id'=>'gross_profit_percent'));
echo $form->input('product_category_id');
echo $ajax->link('Enter Costing Info', array('controller'=> 'products', 'action' => 'add_costing'), array( 'update' => 'costingdetails'));
echo '<div id="costingdetails">';
echo '</div>';
echo $form->input('notes');
echo $ajax->observeForm('productaddform', array('frequency' => 0.5, 'complete'=>'buildup()'));

View file

@ -428,8 +428,12 @@ table.mer tr td.contactname {
padding: 0;
font-size: small;
}
table.mer tr td.viewedit {
padding: 0;
font-size: x-small;
white-space: nowrap;
}
table.quotetable tr.mostrecent td {
background: #ADD8E6;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB