This commit is contained in:
Karl Cordes 2009-10-06 21:29:00 +11:00
parent 541c8ee0ff
commit 786ff25698
8 changed files with 33 additions and 100 deletions

View file

@ -40,7 +40,7 @@
* In production mode, flash messages redirect after a time interval. * In production mode, flash messages redirect after a time interval.
* In development mode, you need to click the flash message to continue. * In development mode, you need to click the flash message to continue.
*/ */
Configure::write('debug', 0); Configure::write('debug', 1);
/** /**
* Application wide charset encoding * Application wide charset encoding
*/ */

View file

@ -26,9 +26,13 @@ class QuoteProductsController extends AppController {
if (!empty($this->data)) { if (!empty($this->data)) {
$this->QuoteProduct->create(); $this->QuoteProduct->create();
if ($this->QuoteProduct->save($this->data)) { if ($this->QuoteProduct->save($this->data)) {
$quoteid = $this->data['QuoteProduct']['quote_id']; $quoteid = $this->data['QuoteProduct']['quote_id'];
$this->Session->setFlash(__('Product Added to Quote Successfully', true)); $this->Session->setFlash(__('Product Added to Quote Successfully', true));
$this->redirect(array('controller'=>'quotes', 'action'=>'view', $quoteid)); $this->redirect(array('controller'=>'quotes', 'action'=>'view', $quoteid));
} else { } else {

View file

@ -14,54 +14,14 @@
echo $html->css('quotenik'); echo $html->css('quotenik');
echo $scripts_for_layout; echo $scripts_for_layout;
echo $javascript->link('jquery'); //echo $javascript->link('jquery');
echo $javascript->link('jquery-ui'); //echo $javascript->link('jquery-ui');
echo $javascript->link('prototype'); echo $javascript->link('prototype');
echo $javascript->link('scriptaculous'); echo $javascript->link('scriptaculous');
echo $javascript->link('qtip'); echo $javascript->link('ckeditor/ckeditor');
echo $javascript->link('wymeditor/jquery.wymeditor.min');
echo $javascript->link('wymeditor/plugins/hovertools/jquery.wymeditor.hovertools.js');
echo $javascript->link('wymeditor/plugins/resizable/jquery.wymeditor.resizable.js');
?> ?>
<script type="text/javascript">
jQuery(function() {
jQuery(".wymeditor").wymeditor({
skin: 'silver',
postInit: function(wym) {
wym.hovertools();
wym.resizable();
}
});
});
</script>
<script type="text/javascript"><!--//--><![CDATA[//><!--
sfHover = function() {
var sfEls = document.getElementById("nav").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
//--><!]]></script>
</head> </head>
<body> <body>
@ -175,8 +135,6 @@ if ($mem_usage < 1024)
echo round($mem_usage/1048576,2)." megabytes"; echo round($mem_usage/1048576,2)." megabytes";
echo "<br/>"; echo "<br/>";
?>
?> ?>
<?php echo $cakeDebug; ?> <?php echo $cakeDebug; ?>

View file

@ -7,18 +7,20 @@
echo $form->input('principle_id'); echo $form->input('principle_id');
echo $form->input('title'); echo $form->input('title');
echo $form->input('description', array('class'=>'wymeditor')); echo $form->input('description', array('id' => 'description', 'class'=>'ckeditor'));
//echo $javascript->codeBlock("CKEDITOR.replace('description');");
echo $form->input('part_number'); echo $form->input('part_number');
echo $form->input('product_category_id'); echo $form->input('product_category_id');
echo $form->input('notes'); echo $form->input('notes');
echo $html->link('Show/Hide Costing Details', '#', array('onClick' => "Effect.toggle('costingdetails', 'appear'); return false;")); //echo $html->link('Show/Hide Costing Details', '#', array('onClick' => "Effect.toggle('costingdetails', 'appear'); return false;"));
echo $html->image('calculator.png'); echo $html->image('calculator.png');
echo $ajax->div('costingdetails'); //echo $ajax->div('costingdetails');
echo $this->element('product_costing', array('modelName' => 'Product')); //echo $this->element('product_costing', array('modelName' => 'Product'));
echo $ajax->divEnd('costingdetails'); //echo $ajax->divEnd('costingdetails');

View file

@ -15,8 +15,7 @@
echo $form->input('product_id', array('type' => 'select', 'id'=>'products')); echo $form->input('product_id', array('type' => 'select', 'id'=>'products'));
echo $ajax->observeField('products', array( echo $ajax->observeField('products', array(
'url' => 'product_options', 'url' => 'product_options',
'frequency' => 0.2, 'frequency' => 0.2,
'update' => 'productoptions' 'update' => 'productoptions'

View file

@ -2,7 +2,6 @@
$i = 0; $i = 0;
foreach ($options as $opt) { foreach ($options as $opt) {
$default_option = ''; $default_option = '';
foreach($opt['ProductOption'] as $prodopt) { foreach($opt['ProductOption'] as $prodopt) {

View file

@ -12,15 +12,8 @@ else {
__('Quote: '.$enquirynumber_link.' Revision '.$quote['Quote']['revision']); __('Quote: '.$enquirynumber_link.' Revision '.$quote['Quote']['revision']);
} }
?></h2> ?></h2>
</div> </div>
<div id="LoadingDiv" style="display: none;">
<?php echo $html->image('ajax-loader.gif'); ?>
</div>
<?php <?php
$i = 0; $i = 0;
foreach ($quote['QuotePage'] as $quotePage): foreach ($quote['QuotePage'] as $quotePage):
@ -28,29 +21,17 @@ else {
if ($i++ % 2 == 0) { if ($i++ % 2 == 0) {
$class = ' class="altrow"'; $class = ' class="altrow"';
} }
?> ?>
<div class="related"> <div class="related">
<h3>Cover Page <?php echo $i; ?> </h3> <h3>Cover Page <?php echo $i; ?> </h3>
<?php echo $ajax->link('View', array('controller'=> 'quote_pages', 'action'=>'show', $quotePage['id']), <div class="quotepageview">
array('update'=>'viewpage'.$i, 'indicator' => 'LoadingDiv','loading'=>'Effect.appear(\'viewpage\')')); <?php echo $quotePage['content']; ?>
</div>
<?php echo $html->link(__('Edit', true), array('controller'=>'quote_pages', 'action'=>'edit',$quotePage['id']));?>
// echo $ajax->link('View', array('controller'=> 'quote_pages', 'action'=>'show', $quotePage['id']),
//array('update'=>'viewpage', 'indicator' => 'LoadingDiv'));
?>
<?php // echo $html->link(__('Edit', true), array('controller'=> 'quote_pages', 'action'=>'edit', $quotePage['id']));
// echo $ajax->link('Edit', array('controller'=> 'quote_pages', 'action'=>'edit', $quotePage['id']),
// array('update'=>'viewpage'.$i, 'indicator' => 'LoadingDiv','loading'=>'Effect.toggle(\'viewpage\', \'blind\')'));
echo $html->link('Edit', array('controller'=>'quote_pages', 'action'=>'edit', $quotePage['id']));
?>
<?php echo $html->link(__('Delete', true), array('controller'=> 'quote_pages', 'action'=>'delete', $quotePage['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $quotePage['id'])); ?> <?php echo $html->link(__('Delete', true), array('controller'=> 'quote_pages', 'action'=>'delete', $quotePage['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $quotePage['id'])); ?>
@ -71,27 +52,16 @@ else {
</div>
<div class="related"> <div class="related">
<h3><?php __('Products in this Quote');?></h3> <h3><?php __('Products in this Quote');?></h3>
<?php if (!empty($quote['QuoteProduct'])):?> <?php if (!empty($quote['QuoteProduct'])):?>
<table cellpadding = "0" cellspacing = "0"> <table cellpadding = "0" cellspacing = "0">
<tr> <tr>
<th><?php __('Id'); ?></th> <th><?php __('Item Number'); ?></th>
<th><?php __('Itemnumber'); ?></th>
<th><?php __('Option'); ?></th> <th><?php __('Option'); ?></th>
<th><?php __('Principle Id'); ?></th>
<th><?php __('Quantity'); ?></th> <th><?php __('Quantity'); ?></th>
<th><?php __('Grosssellprice'); ?></th>
<th><?php __('Title'); ?></th> <th><?php __('Title'); ?></th>
<th><?php __('Description'); ?></th> <th><?php __('Description'); ?></th>
<th><?php __('Discount'); ?></th>
<th><?php __('Discountamount'); ?></th>
<th><?php __('Grosssellpriceeach'); ?></th>
<th><?php __('Netsellpriceeach'); ?></th>
<th><?php __('Netsellprice'); ?></th>
<th class="actions"><?php __('Actions');?></th> <th class="actions"><?php __('Actions');?></th>
</tr> </tr>
@ -106,19 +76,12 @@ else {
?> ?>
<tr<?php echo $class;?>> <tr<?php echo $class;?>>
<td><?php echo $quoteProduct['id'];?></td> <td><?php echo $quoteProduct['item_number'];?></td>
<td><?php echo $quoteProduct['itemnumber'];?></td>
<td><?php echo $quoteProduct['option'];?></td> <td><?php echo $quoteProduct['option'];?></td>
<td><?php echo $quoteProduct['principle_id'];?></td>
<td><?php echo $quoteProduct['quantity'];?></td> <td><?php echo $quoteProduct['quantity'];?></td>
<td><?php echo $quoteProduct['grosssellprice'];?></td>
<td><?php echo $quoteProduct['title'];?></td> <td><?php echo $quoteProduct['title'];?></td>
<td><?php echo $quoteProduct['description'];?></td> <td><?php echo $quoteProduct['description'];?></td>
<td><?php echo $quoteProduct['discount'];?></td>
<td><?php echo $quoteProduct['discountamount'];?></td>
<td><?php echo $quoteProduct['grosssellpriceeach'];?></td>
<td><?php echo $quoteProduct['netsellpriceeach'];?></td>
<td><?php echo $quoteProduct['netsellprice'];?></td>
<td class="actions"> <td class="actions">
<?php echo $html->link(__('View', true), array('controller'=> 'quote_products', 'action'=>'view', $quoteProduct['id'])); ?> <?php echo $html->link(__('View', true), array('controller'=> 'quote_products', 'action'=>'view', $quoteProduct['id'])); ?>
@ -140,3 +103,5 @@ else {
</div> </div>
<?php debug($quote); ?>

View file

@ -311,6 +311,7 @@ dl#showemail {
div.quotepageview { div.quotepageview {
overflow: scroll; overflow: scroll;
border: black 1px solid; border: black 1px solid;
width: auto;
} }
.addressradio label { .addressradio label {
@ -504,7 +505,12 @@ table.mer tr td.viewedit {
font-size: x-small; font-size: x-small;
white-space: nowrap; white-space: nowrap;
} }
table.quotetable {
width: auto;
}
table.quotetable tr.mostrecent td { table.quotetable tr.mostrecent td {
background: #ADD8E6; background: #ADD8E6;
} }