diff --git a/controllers/enquiries_controller.php b/controllers/enquiries_controller.php index 218bd734..a5136848 100755 --- a/controllers/enquiries_controller.php +++ b/controllers/enquiries_controller.php @@ -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) { diff --git a/controllers/product_categories_controller.php b/controllers/product_categories_controller.php new file mode 100644 index 00000000..ed484830 --- /dev/null +++ b/controllers/product_categories_controller.php @@ -0,0 +1,63 @@ +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')); + } + } + +} +?> diff --git a/controllers/products_controller.php b/controllers/products_controller.php index 9d7643a1..f69102bb 100755 --- a/controllers/products_controller.php +++ b/controllers/products_controller.php @@ -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; diff --git a/models/enquiry.php b/models/enquiry.php index 538401b8..518f3182 100755 --- a/models/enquiry.php +++ b/models/enquiry.php @@ -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', diff --git a/views/elements/enquiry_table.ctp b/views/elements/enquiry_table.ctp index 039cf7ed..ce4aaeeb 100644 --- a/views/elements/enquiry_table.ctp +++ b/views/elements/enquiry_table.ctp @@ -82,7 +82,14 @@ foreach ($enquiries as $enquiry): echo date('j M Y',$time->toUnix($enquiry['Enquiry']['created'])); ?> - link($enquiry['Principle']['name'], array('controller'=> 'principles', 'action'=>'view', $enquiry['Principle']['id'])); ?> + 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'])); + } + ?> link($enquiry['Enquiry']['title'], array('controller'=>'enquiries', 'action'=>'view', $enquiry['Enquiry']['id'])); ?> @@ -98,7 +105,7 @@ foreach ($enquiries as $enquiry): link($enquiry['Contact']['email'], 'mailto:'.$enquiry['Contact']['email'].'?subject='.$enquiry['Enquiry']['title'].'&bcc=carpis@cmctechnologies.com.au'); ?> - + @@ -109,6 +116,7 @@ foreach ($enquiries as $enquiry): ?> +
link('view all', array('controller'=>'enquiries', 'action'=>'view', $enquiry['Enquiry']['id'])); } ?> +
link(__('View', true), array('controller'=>'enquiries','action'=>'view', $enquiry['Enquiry']['id'])); ?> diff --git a/views/layouts/default.ctp b/views/layouts/default.ctp index 541c383b..e549c318 100755 --- a/views/layouts/default.ctp +++ b/views/layouts/default.ctp @@ -64,9 +64,8 @@ if (window.attachEvent) window.attachEvent("onload", sfHover);
input('name'); + echo $form->input('short_name'); echo $form->input('code'); echo $form->input('address'); echo $form->input('city'); diff --git a/views/principles/edit.ctp b/views/principles/edit.ctp index 43b4c732..6462d139 100755 --- a/views/principles/edit.ctp +++ b/views/principles/edit.ctp @@ -5,6 +5,7 @@ input('id'); echo $form->input('name'); + echo $form->input('short_name'); echo $form->input('code'); echo $form->input('address'); echo $form->input('city'); diff --git a/views/principles/view.ctp b/views/principles/view.ctp index 58feacb1..296c619b 100755 --- a/views/principles/view.ctp +++ b/views/principles/view.ctp @@ -6,6 +6,11 @@   + > + > + +   + > > diff --git a/views/products/add.ctp b/views/products/add.ctp index c6368905..f69c532c 100755 --- a/views/products/add.ctp +++ b/views/products/add.ctp @@ -1,6 +1,5 @@ link('quotenik/product_buildup.js', false); ?> -link('tiny_mce/tiny_mce', false); ?> -link('tiny_mce/tiny_init', false); ?> +
create('Product', array('id'=>'productaddform', 'class'=>'addproduct'));?>
@@ -8,14 +7,15 @@ 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 '
'; echo '
'; echo $form->input('notes'); - echo $ajax->observeForm('productaddform', array('frequency' => 0.5, 'complete'=>'buildup()')); + ?>
end('Submit');?> diff --git a/views/products/view.ctp b/views/products/view.ctp index 48794357..0558fed6 100755 --- a/views/products/view.ctp +++ b/views/products/view.ctp @@ -64,6 +64,14 @@
+ + + + + +
Title +
+
  • link(__('Edit Product', true), array('action'=>'edit', $product['Product']['id'])); ?>
  • diff --git a/webroot/css/quotenik.css b/webroot/css/quotenik.css index 92a4b867..b2c94e54 100755 --- a/webroot/css/quotenik.css +++ b/webroot/css/quotenik.css @@ -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%; }