changing quotenik css color scheme

This commit is contained in:
Karl Cordes 2009-04-24 11:21:22 +10:00
parent 718ad07f97
commit 6fafd98b21
12 changed files with 107 additions and 16 deletions

View file

@ -22,6 +22,7 @@ class EnquiriesController extends AppController {
$status_list[] = array($status['Status']['id'], $status['Status']['name']);
}
$this->set('status_list', $status_list);
}
function view($id = null) {

View file

@ -0,0 +1,63 @@
<?php
class ProductCategoriesController extends AppController {
var $name = 'ProductCategories';
var $helpers = array('Html', 'Form');
function index() {
$this->ProductCategory->recursive = 0;
$this->set('productCategories', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid ProductCategory.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('productCategory', $this->ProductCategory->read(null, $id));
$this->set('products', $this->ProductCategory->Product->findAllByProductCategoryId($id));
}
function add() {
if (!empty($this->data)) {
$this->ProductCategory->create();
if ($this->ProductCategory->save($this->data)) {
$this->Session->setFlash(__('The ProductCategory has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The ProductCategory could not be saved. Please, try again.', true));
}
}
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid ProductCategory', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->ProductCategory->save($this->data)) {
$this->Session->setFlash(__('The ProductCategory has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The ProductCategory could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->ProductCategory->read(null, $id);
}
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for ProductCategory', true));
$this->redirect(array('action'=>'index'));
}
if ($this->ProductCategory->del($id)) {
$this->Session->setFlash(__('ProductCategory deleted', true));
$this->redirect(array('action'=>'index'));
}
}
}
?>

View file

@ -3,7 +3,7 @@ class ProductsController extends AppController {
var $name = 'Products';
var $components = array('RequestHandler');
var $helpers = array('Html', 'Form', 'Ajax', 'Number');
var $helpers = array('Html', 'Form', 'Ajax', 'Number', 'Fck');
function index() {
$this->Product->recursive = 0;

View file

@ -73,6 +73,7 @@ class Enquiry extends AppModel {
/*Custom Validation Rule to Check that Enquiries with Australian States are assigned to Australia.
* and that Overseas enquiries are NOT assigned to Australia.
* Not Portable at all. This code is only for CMC usage
* Should probably change this to use RegExes.
*/
function checkStates($data) {
@ -93,10 +94,8 @@ class Enquiry extends AppModel {
}
}
}
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $belongsTo = array(
'User' => array('className' => 'User',

View file

@ -82,7 +82,14 @@ foreach ($enquiries as $enquiry):
echo date('j M Y',$time->toUnix($enquiry['Enquiry']['created'])); ?>
</td>
<td class="principlename">
<?php echo $html->link($enquiry['Principle']['name'], array('controller'=> 'principles', 'action'=>'view', $enquiry['Principle']['id'])); ?>
<?php
if($enquiry['Principle']['short_name']) {
echo $html->link($enquiry['Principle']['short_name'], array('controller'=> 'principles', 'action'=>'view', $enquiry['Principle']['id']));
}
else {
echo $html->link($enquiry['Principle']['name'], array('controller'=> 'principles', 'action'=>'view', $enquiry['Principle']['id']));
}
?>
</td>
<td>
<?php echo $html->link($enquiry['Enquiry']['title'], array('controller'=>'enquiries', 'action'=>'view', $enquiry['Enquiry']['id'])); ?>
@ -98,7 +105,7 @@ foreach ($enquiries as $enquiry):
<? //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>
<td>
<td class="contactemail">
<?php echo $enquiry['Contact']['phone']; ?>
</td>
@ -109,6 +116,7 @@ foreach ($enquiries as $enquiry):
?>
</td>
<td class="comments">
<div id="comment_<?php echo $i; ?>">
<?php
$displayedComment = substr($enquiry['Enquiry']['comments'], 0, 60);
@ -117,6 +125,7 @@ foreach ($enquiries as $enquiry):
echo '.... '.$html->link('view all', array('controller'=>'enquiries', 'action'=>'view', $enquiry['Enquiry']['id']));
}
?>
</div>
</td>
<td class="viewedit">
<?php echo $html->link(__('View', true), array('controller'=>'enquiries','action'=>'view', $enquiry['Enquiry']['id'])); ?>

View file

@ -64,9 +64,8 @@ if (window.attachEvent) window.attachEvent("onload", sfHover);
<body>
<div id="container">
<div id="header">
<?php // echo $html->image("cmclogo.png");
<?php echo $html->image("cmclogosmall.png");
?>
<h1>CMC Technologies</h1>
</div>
<div id="username">
<?php

View file

@ -4,6 +4,7 @@
<legend><?php __('Add Principle');?></legend>
<?php
echo $form->input('name');
echo $form->input('short_name');
echo $form->input('code');
echo $form->input('address');
echo $form->input('city');

View file

@ -5,6 +5,7 @@
<?php
echo $form->input('id');
echo $form->input('name');
echo $form->input('short_name');
echo $form->input('code');
echo $form->input('address');
echo $form->input('city');

View file

@ -6,6 +6,11 @@
<?php echo $principle['Principle']['name']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Short Name'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $principle['Principle']['short_name']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Code'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $principle['Principle']['code']; ?>

View file

@ -1,6 +1,5 @@
<?php echo $javascript->link('quotenik/product_buildup.js', false); ?>
<?php echo $javascript->link('tiny_mce/tiny_mce', false); ?>
<?php echo $javascript->link('tiny_mce/tiny_init', false); ?>
<div class="addproduct">
<?php echo $form->create('Product', array('id'=>'productaddform', 'class'=>'addproduct'));?>
<fieldset>
@ -8,14 +7,15 @@
<?php
echo $form->input('principle_id');
echo $form->input('title');
echo $form->input('description');
echo $fck->fckeditor(array('Product', 'description'), '');
//echo $form->input('description');
echo $form->input('part_number');
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()'));
?>
</fieldset>
<?php echo $form->end('Submit');?>

View file

@ -64,6 +64,14 @@
</dd>
</dl>
</div>
<table>
<tr>
<th>Title</th>
<td>
</td>
</tr>
</table>
<div class="actions">
<ul>
<li><?php echo $html->link(__('Edit Product', true), array('action'=>'edit', $product['Product']['id'])); ?> </li>

View file

@ -70,6 +70,11 @@ h2 {
margin: 0.3em 0;
padding-top: 0.8em;
}
a.headerlinks {
color: #EE3322;
font-weight:normal;
}
h3 {
color: #2C5FD5;
font-family:'Gill Sans','lucida grande',helvetica, arial, sans-serif;
@ -97,8 +102,8 @@ ul.principle-emails {
text-align: left;
}
#header{
/* padding: 10px 20px; */
#header{
padding-bottom: 10px;
background: #366FA4;
}
#header h1 {
@ -652,7 +657,7 @@ div.addproduct {
form.addproduct {
margin-right: 20px;
padding: 0;
width: 30%;
width: 50%;
}