diff --git a/controllers/app_controller.php b/controllers/app_controller.php new file mode 100644 index 00000000..399af31b --- /dev/null +++ b/controllers/app_controller.php @@ -0,0 +1,19 @@ +set('currentuser', $this->Auth->user()); + if($this->RequestHandler->isAjax()) { + Configure::write('debug', 0); + } + + } + +} +?> diff --git a/controllers/components/image.php b/controllers/components/image.php new file mode 100644 index 00000000..0f5276be --- /dev/null +++ b/controllers/components/image.php @@ -0,0 +1,242 @@ +create('FurnitureSet',array('type' => 'file')); ?> + * + * In view where you upload the image, make sure that you have a file input similar to the following + * = $form->file('Image/name1'); ?> + * + * In the controller, add the component to your components array + * var $components = array("Image"); + * + * In your controller action (the parameters are expained below) + * $image_path = $this->Image->upload_image_and_thumbnail($this->data,"name1",573,80,"sets",true); + * this returns the file name of the result image. You can store this file name in the database + * + * Note that your image will be stored in 2 locations: + * Image: /webroot/img/$folderName/big/$image_path + * Thumbnail: /webroot/img/$folderName/small/$image_path + * + * Finally in the view where you want to see the images + * = $html->image('sets/big/'.$furnitureSet['FurnitureSet']['image_path']); + * where "sets" is the folder name we saved our pictures in, and $furnitureSet['FurnitureSet']['image_path'] is the file name we stored in the database + + * Parameters: + * $data: CakePHP data array from the form + * $datakey: key in the $data array. If you used = $form->file('Image/name1'); ?> in your view, then $datakey = name1 + * $imgscale: the maximum width or height that you want your picture to be resized to + * $thumbscale: the maximum width or height that you want your thumbnail to be resized to + * $folderName: the name of the parent folder of the images. The images will be stored to /webroot/img/$folderName/big/ and /webroot/img/$folderName/small/ + * $square: a boolean flag indicating whether you want square and zoom cropped thumbnails, or thumbnails with the same aspect ratio of the source image + */ + function upload_image_and_thumbnail($data, $datakey, $imgscale, $thumbscale, $folderName, $square) { + if (strlen($data['Image'][$datakey]['name'])>4){ + $error = 0; + $tempuploaddir = "img/temp"; // the /temp/ directory, should delete the image after we upload + $biguploaddir = "img/".$folderName."/big"; // the /big/ directory + $smalluploaddir = "img/".$folderName."/small"; // the /small/ directory for thumbnails + + // Make sure the required directories exist, and create them if necessary + if(!is_dir($tempuploaddir)) mkdir($tempuploaddir,true); + if(!is_dir($biguploaddir)) mkdir($biguploaddir,true); + if(!is_dir($smalluploaddir)) mkdir($smalluploaddir,true); + + $filetype = $this->getFileExtension($data['Image'][$datakey]['name']); + $filetype = strtolower($filetype); + + if (($filetype != "jpeg") && ($filetype != "jpg") && ($filetype != "gif") && ($filetype != "png")) + { + // verify the extension + return; + } + else + { + // Get the image size + $imgsize = GetImageSize($data['Image'][$datakey]['tmp_name']); + } + + // Generate a unique name for the image (from the timestamp) + $id_unic = str_replace(".", "", strtotime ("now")); + $filename = $id_unic; + + settype($filename,"string"); + $filename.= "."; + $filename.=$filetype; + $tempfile = $tempuploaddir . "/$filename"; + $resizedfile = $biguploaddir . "/$filename"; + $croppedfile = $smalluploaddir . "/$filename"; + + + if (is_uploaded_file($data['Image'][$datakey]['tmp_name'])) + { + // Copy the image into the temporary directory + if (!copy($data['Image'][$datakey]['tmp_name'],"$tempfile")) + { + print "Error Uploading File!."; + exit(); + } + else { + /* + * Generate the big version of the image with max of $imgscale in either directions + */ + $this->resize_img($tempfile, $imgscale, $resizedfile); + + if($square) { + /* + * Generate the small square version of the image with scale of $thumbscale + */ + $this->crop_img($tempfile, $thumbscale, $croppedfile); + } + else { + /* + * Generate the big version of the image with max of $imgscale in either directions + */ + $this->resize_img($tempfile, $thumbscale, $croppedfile); + } + + // Delete the temporary image + unlink($tempfile); + } + } + + // Image uploaded, return the file name + return $filename; + } + } + + /* + * Deletes the image and its associated thumbnail + * Example in controller action: $this->Image->delete_image("1210632285.jpg","sets"); + * + * Parameters: + * $filename: The file name of the image + * $folderName: the name of the parent folder of the images. The images will be stored to /webroot/img/$folderName/big/ and /webroot/img/$folderName/small/ + */ + function delete_image($filename,$folderName) { + unlink("img/".$folderName."/big/".$filename); + unlink("img/".$folderName."/small/".$filename); + } + + function crop_img($imgname, $scale, $filename) { + $filetype = $this->getFileExtension($imgname); + $filetype = strtolower($filetype); + + switch($filetype){ + case "jpeg": + case "jpg": + $img_src = ImageCreateFromjpeg ($imgname); + break; + case "gif": + $img_src = imagecreatefromgif ($imgname); + break; + case "png": + $img_src = imagecreatefrompng ($imgname); + break; + } + + $width = imagesx($img_src); + $height = imagesy($img_src); + $ratiox = $width / $height * $scale; + $ratioy = $height / $width * $scale; + + //-- Calculate resampling + $newheight = ($width <= $height) ? $ratioy : $scale; + $newwidth = ($width <= $height) ? $scale : $ratiox; + + //-- Calculate cropping (division by zero) + $cropx = ($newwidth - $scale != 0) ? ($newwidth - $scale) / 2 : 0; + $cropy = ($newheight - $scale != 0) ? ($newheight - $scale) / 2 : 0; + + //-- Setup Resample & Crop buffers + $resampled = imagecreatetruecolor($newwidth, $newheight); + $cropped = imagecreatetruecolor($scale, $scale); + + //-- Resample + imagecopyresampled($resampled, $img_src, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); + //-- Crop + imagecopy($cropped, $resampled, 0, 0, $cropx, $cropy, $newwidth, $newheight); + + // Save the cropped image + switch($filetype) + { + case "jpeg": + case "jpg": + imagejpeg($cropped,$filename,80); + break; + case "gif": + imagegif($cropped,$filename,80); + break; + case "png": + imagepng($cropped,$filename,80); + break; + } + } + + function resize_img($imgname, $size, $filename) { + $filetype = $this->getFileExtension($imgname); + $filetype = strtolower($filetype); + + switch($filetype) { + case "jpeg": + case "jpg": + $img_src = ImageCreateFromjpeg ($imgname); + break; + case "gif": + $img_src = imagecreatefromgif ($imgname); + break; + case "png": + $img_src = imagecreatefrompng ($imgname); + break; + } + + $true_width = imagesx($img_src); + $true_height = imagesy($img_src); + + if ($true_width>=$true_height) + { + $width=$size; + $height = ($width/$true_width)*$true_height; + } + else + { + $width=$size; + $height = ($width/$true_width)*$true_height; + } + $img_des = ImageCreateTrueColor($width,$height); + imagecopyresampled ($img_des, $img_src, 0, 0, 0, 0, $width, $height, $true_width, $true_height); + + // Save the resized image + switch($filetype) + { + case "jpeg": + case "jpg": + imagejpeg($img_des,$filename,80); + break; + case "gif": + imagegif($img_des,$filename,80); + break; + case "png": + imagepng($img_des,$filename,80); + break; + } + } + + function getFileExtension($str) { + + $i = strrpos($str,"."); + if (!$i) { return ""; } + $l = strlen($str) - $i; + $ext = substr($str,$i+1,$l); + return $ext; + } +} ?> diff --git a/controllers/currencies_controller.php b/controllers/currencies_controller.php index cff4f706..e5461a49 100755 --- a/controllers/currencies_controller.php +++ b/controllers/currencies_controller.php @@ -2,7 +2,7 @@ class CurrenciesController extends AppController { var $name = 'Currencies'; - var $helpers = array('Html', 'Form'), 'Ajax'; + var $helpers = array('Html', 'Form', 'Ajax'); var $components = array('RequestHandler'); function index() { diff --git a/controllers/customers_controller.php b/controllers/customers_controller.php index 70cfd1e5..c936d062 100755 --- a/controllers/customers_controller.php +++ b/controllers/customers_controller.php @@ -83,7 +83,6 @@ class CustomersController extends AppController { $this->Session->setFlash(__('The Customer could not be saved. Please, try again.', true)); $this->set('customer_categories', $this->Customer->CustomerCategory->find('list')); - $this->set('industries', $this->Customer->Industry->find('list', array('fields'=>array('Industry.id', 'Industry.name', 'ParentIndustry.name'),'recursive' => 0, 'order'=>'ParentIndustry.name ASC, Industry.name ASC'))); } diff --git a/controllers/enquiries_controller.php b/controllers/enquiries_controller.php index 4df27fe5..68957813 100755 --- a/controllers/enquiries_controller.php +++ b/controllers/enquiries_controller.php @@ -108,7 +108,7 @@ class EnquiriesController extends AppController { $customer = $this->Enquiry->Customer->findById($this->data['Enquiry']['customer_id']); $principle = $this->Enquiry->Principle->findById($this->data['Enquiry']['principle_id']); $this->data['Enquiry']['principle_code'] = $principle['Principle']['code']; //Store which principle code this enquiry belongs to. - Sanitize::clean($this->data); + //Sanitize::clean($this->data); if(isset($this->data['Contact']['new'])) { if($this->data['Contact']['new']) { $this->Enquiry->Contact->save($this->data); @@ -410,7 +410,28 @@ class EnquiriesController extends AppController { } - } + } + + function mark_submitted($id = null) { + if($id == null) { + $this->Session->setFlash('Invalid Enquiry ID'); + $this->redirect(array('action'=>'index')); + } + else { + $this->Enquiry->id = $id; + $today = date("Y-m-d"); + $this->Enquiry->saveField('submitted', $today); + $this->Session->setFlash('The Enquiry has been marked as submitted today ('.date('j M Y').')'); + $this->redirect(array('action'=>'index')); + } + + + + } + + + + } ?> diff --git a/controllers/product_options_categories_controller.php b/controllers/product_options_categories_controller.php new file mode 100644 index 00000000..4676c734 --- /dev/null +++ b/controllers/product_options_categories_controller.php @@ -0,0 +1,78 @@ +ProductOptionsCategory->recursive = 0; + $this->set('productOptionsCategories', $this->paginate()); + } + + function view($id = null) { + if (!$id) { + $this->Session->setFlash(__('Invalid ProductOptionsCategory.', true)); + $this->redirect(array('action'=>'index')); + } + $this->set('productOptionsCategory', $this->ProductOptionsCategory->read(null, $id)); + } + + function add($id = null) { + + if (!$id && empty($this->data)) { + $this->Session->setFlash(__('Invalid ProductOptionsCategory', true)); + $this->redirect(array('action'=>'index')); + } + + + if (!empty($this->data)) { + $this->ProductOptionsCategory->create(); + if ($this->ProductOptionsCategory->save($this->data)) { + $productid = $this->data['ProductOptionsCategory']['product_id']; + $this->Session->setFlash(__('The ProductOptionsCategory has been saved', true)); + $this->redirect(array('controller'=>'products', 'action'=>'view', $productid)); + } else { + $this->Session->setFlash(__('The ProductOptionsCategory could not be saved. Please, try again.', true)); + } + } + $product = $this->ProductOptionsCategory->Product->find('first', array('conditions'=> array('Product.id' => $id), 'recursive' => false)); + + $this->set(compact('product')); + } + + function edit($id = null) { + + if (!$id && empty($this->data)) { + $this->Session->setFlash(__('Invalid ProductOptionsCategory', true)); + $this->redirect(array('action'=>'index')); + } + + + if (!empty($this->data)) { + if ($this->ProductOptionsCategory->save($this->data)) { + $this->Session->setFlash(__('The ProductOptionsCategory has been saved', true)); + $this->redirect(array('action'=>'index')); + } else { + $this->Session->setFlash(__('The ProductOptionsCategory could not be saved. Please, try again.', true)); + } + } + if (empty($this->data)) { + $this->data = $this->ProductOptionsCategory->read(null, $id); + } + $products = $this->ProductOptionsCategory->Product->find('list'); + $this->set(compact('products')); + } + + function delete($id = null) { + if (!$id) { + $this->Session->setFlash(__('Invalid id for ProductOptionsCategory', true)); + $this->redirect(array('action'=>'index')); + } + if ($this->ProductOptionsCategory->del($id)) { + $this->Session->setFlash(__('ProductOptionsCategory deleted', true)); + $this->redirect(array('action'=>'index')); + } + } + +} +?> diff --git a/controllers/product_options_controller.php b/controllers/product_options_controller.php index 07778e40..f80eee4c 100644 --- a/controllers/product_options_controller.php +++ b/controllers/product_options_controller.php @@ -17,18 +17,25 @@ class ProductOptionsController extends AppController { $this->set('productOption', $this->ProductOption->read(null, $id)); } - function add($productid = null) { + function add($catid = null) { + if (!$catid && empty($this->data)) { + $this->Session->setFlash(__('Invalid Product Options Category. Options can only be added to an existing Options Category.', true)); + $this->redirect(array('action'=>'index')); + } + + $optcat = $this->ProductOption->ProductOptionsCategory->read(null, $catid); if (!empty($this->data)) { $this->ProductOption->create(); + $productid = $this->data['ProductOption']['product_id']; if ($this->ProductOption->save($this->data)) { - $this->Session->setFlash(__('The ProductOption has been saved', true)); - $this->redirect(array('action'=>'index')); + $this->Session->setFlash(__('The Product Option has been saved', true)); + $this->redirect(array('controller' => 'products', 'action'=>'view', $productid)); } else { $this->Session->setFlash(__('The ProductOption could not be saved. Please, try again.', true)); } } - $products = $this->ProductOption->Product->find('list'); - $this->set(compact('products')); + $optcat = $this->ProductOption->ProductOptionsCategory->read(null, $catid); + $this->set('optcat', $optcat); } function edit($id = null) { @@ -37,18 +44,20 @@ class ProductOptionsController extends AppController { $this->redirect(array('action'=>'index')); } if (!empty($this->data)) { + $productid = $this->data['ProductOption']['product_id']; if ($this->ProductOption->save($this->data)) { - $this->Session->setFlash(__('The ProductOption has been saved', true)); - $this->redirect(array('action'=>'index')); + $this->Session->setFlash(__('The Product Option has been saved', true)); + $this->redirect(array('controller'=> 'products', 'action'=>'view', $productid)); } else { $this->Session->setFlash(__('The ProductOption could not be saved. Please, try again.', true)); } } if (empty($this->data)) { $this->data = $this->ProductOption->read(null, $id); + $product = $this->ProductOption->ProductOptionsCategory->Product->read(null, $this->data['ProductOption']['product_id']); } - $products = $this->ProductOption->Product->find('list'); - $this->set(compact('products')); + + $this->set('product', $product); } function delete($id = null) { diff --git a/controllers/products_controller.php b/controllers/products_controller.php index f69102bb..2b1a8ef1 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', 'Fck'); + var $helpers = array('Html', 'Form', 'Ajax', 'Number'); function index() { $this->Product->recursive = 0; @@ -16,6 +16,11 @@ class ProductsController extends AppController { $this->redirect(array('action'=>'index')); } $this->set('product', $this->Product->read(null, $id)); + + //$this->set('product', $this->Product->find('first', array('conditions' => array('Product.id'=>$id), 'recursive' => 1))); + + $this->set('options', $this->Product->ProductOptionsCategory->find('all', array('conditions' => array('ProductOptionsCategory.product_id'=>$id), 'order'=>'ProductOptionsCategory.location ASC'))); + $this->set('files', $this->Product->ProductAttachment->findAllByProductId($id)); $this->set('number_of_files', $this->Product->ProductAttachment->find('count', array('conditions' => array('ProductAttachment.product_id'=>$id)))); } @@ -56,6 +61,7 @@ class ProductsController extends AppController { } if (empty($this->data)) { $this->data = $this->Product->read(null, $id); + $this->set('description', $this->data['Product']['description']); } $principles = $this->Product->Principle->find('list'); $this->set(compact('principles')); diff --git a/controllers/quote_pages_controller.php b/controllers/quote_pages_controller.php new file mode 100644 index 00000000..2478faaf --- /dev/null +++ b/controllers/quote_pages_controller.php @@ -0,0 +1,106 @@ +QuotePage->recursive = 0; + $this->set('quotePages', $this->paginate()); + } + + function view($id = null) { + if (!$id) { + $this->Session->setFlash(__('Invalid QuotePage.', true)); + $this->redirect(array('action'=>'index')); + } + $this->set('quotePage', $this->QuotePage->read(null, $id)); + } + + function add($id = null) { + + if (!$id && empty($this->data)) { + $this->Session->setFlash(__('Invalid Quote ID', true)); + $this->redirect(array('controller' => 'quotes', 'action'=>'index')); + } + + + + if (!empty($this->data)) { + $this->QuotePage->create(); + if ($this->QuotePage->save($this->data)) { + $this->Session->setFlash(__('The Quote Page has been saved', true)); + $this->redirect(array('controller'=>'quotes', 'action'=>'view/'.$this->data['QuotePage']['quote_id'])); + } else { + $this->Session->setFlash(__('The Quote Page could not be saved. Please, try again.', true)); + } + } + $quotes = $this->QuotePage->Quote->find('list'); + $this->set(compact('quotes')); + $this->set('quoteid', $id); + $number_of_pages = $this->QuotePage->find('count', array('conditions' => array('QuotePage.quote_id'=>$id))); + $number_of_pages++; + $this->set('pagenumber', $number_of_pages); + } + + function edit($id = null) { + + if (!$id && empty($this->data)) { + $this->Session->setFlash(__('Invalid QuotePage', true)); + $this->redirect(array('action'=>'index')); + } + + if (!empty($this->data)) { + if ($this->QuotePage->save($this->data)) { + $this->Session->setFlash(__('The QuotePage has been saved', true)); + $id = $this->data['QuotePage']['quote_id']; + $this->redirect(array('controller' => 'quotes', 'action'=>'view/'.$id)); + } else { + $this->Session->setFlash(__('The QuotePage could not be saved. Please, try again.', true)); + } + } + if (empty($this->data)) { + $this->data = $this->QuotePage->read(null, $id); + $this->set('content', $this->data['QuotePage']['content']); + } + $quotes = $this->QuotePage->Quote->find('list'); + $this->set(compact('quotes')); + } + + function delete($id = null) { + if (!$id) { + $this->Session->setFlash(__('Invalid id for QuotePage', true)); + $this->redirect(array('action'=>'index')); + } + + $quotepage = $this->QuotePage->findById($id); + $quoteid = $quotepage['QuotePage']['quote_id']; + + if ($this->QuotePage->del($id)) { + + + $this->Session->setFlash(__('Quote Page deleted', true)); + $this->redirect(array('controller' => 'quotes' , 'action'=>'view', $quoteid)); + } + } + + + function show($id = null) { + $this->layout = 'ajax'; + $this->set('quotePage', $this->QuotePage->read(null, $id)); + + } + + function frame($id = null) { + $this->layout = 'ajax'; + $this->set('id', $id); + } + + + + + +} +?> diff --git a/controllers/quote_products_controller.php b/controllers/quote_products_controller.php index b35b73ce..e9435df1 100644 --- a/controllers/quote_products_controller.php +++ b/controllers/quote_products_controller.php @@ -17,7 +17,13 @@ class QuoteProductsController extends AppController { $this->set('quoteProduct', $this->QuoteProduct->read(null, $id)); } - function add() { + function add($quoteid = null) { + + if (!$quoteid && empty($this->data)) { + $this->Session->setFlash(__('Invalid Quote ID', true)); + $this->redirect(array('action'=>'index')); + } + if (!empty($this->data)) { $this->QuoteProduct->create(); if ($this->QuoteProduct->save($this->data)) { @@ -27,18 +33,53 @@ class QuoteProductsController extends AppController { $this->Session->setFlash(__('The QuoteProduct could not be saved. Please, try again.', true)); } } + + $principles = $this->QuoteProduct->Product->Principle->find('list'); $currencies = $this->QuoteProduct->Currency->find('list'); $quotes = $this->QuoteProduct->Quote->find('list'); - $products = $this->QuoteProduct->Product->find('list'); $this->set(compact('principles', 'currencies', 'quotes', 'products')); } + + /* Display a list of Products for a given principle. Used for the add() method */ + function principle_products() { + if (empty($this->data['QuoteProduct']['principle_id'])) { + } + else { + $this->set('products', $this->QuoteProduct->Product->find('list', array('conditions'=>array('Product.principle_id'=>$this->data['QuoteProduct']['principle_id'])))); + } + } + + + /* Display a list of Options (if any) for a given Product. Used for the add() method */ + function product_options() { + if (empty($this->data['QuoteProduct']['product_id'])) { + } + else { + // $this->set('options', $this->QuoteProduct->Product->ProductOptions->find('list', array('conditions'=>array('ProductOption.product_id'=>$this->data['QuoteProduct']['product_id'])))); + + + $this->set('options', $this->QuoteProduct->Product->ProductOptionsCategory->find('all', + array('conditions' => array('ProductOptionsCategory.product_id'=>$this->data['QuoteProduct']['product_id']), + 'order'=>'ProductOptionsCategory.location ASC'))); + } + } + + + + + + function edit($id = null) { + + if (!$id && empty($this->data)) { $this->Session->setFlash(__('Invalid QuoteProduct', true)); $this->redirect(array('action'=>'index')); } + + if (!empty($this->data)) { if ($this->QuoteProduct->save($this->data)) { $this->Session->setFlash(__('The QuoteProduct has been saved', true)); diff --git a/controllers/quotes_controller.php b/controllers/quotes_controller.php index 016731f4..46bd2433 100755 --- a/controllers/quotes_controller.php +++ b/controllers/quotes_controller.php @@ -16,7 +16,9 @@ class QuotesController extends AppController { $this->Session->setFlash(__('Invalid Quote.', true)); $this->redirect(array('action'=>'index')); } - $this->set('quote', $this->Quote->read(null, $id)); + $quote = $this->Quote->read(null, $id); + $this->set('quote', $quote); + $this->set('customer', $this->Quote->Enquiry->Customer->read(null, $quote['Enquiry']['customer_id'])); } function add() { @@ -79,4 +81,5 @@ class QuotesController extends AppController { } + ?> diff --git a/models/product.php b/models/product.php index 771d3948..f3abe54e 100755 --- a/models/product.php +++ b/models/product.php @@ -4,7 +4,7 @@ class Product extends AppModel { var $name = 'Product'; - var $hasMany = array('ProductOption', 'ProductAttachment'); + var $hasMany = array('ProductAttachment', 'ProductOptionsCategory'); //The Associations below have been created with all possible keys, those that are not needed can be removed var $belongsTo = array( diff --git a/models/product_option.php b/models/product_option.php index ddea7795..eae19722 100644 --- a/models/product_option.php +++ b/models/product_option.php @@ -4,6 +4,6 @@ class ProductOption extends AppModel { var $name = 'ProductOption'; - var $belongsTo = array('Product'); + var $belongsTo = array('ProductOptionsCategory'); } diff --git a/models/product_options_category.php b/models/product_options_category.php new file mode 100644 index 00000000..d7ed475e --- /dev/null +++ b/models/product_options_category.php @@ -0,0 +1,40 @@ + array('numeric'), + 'name' => array('notempty'), + 'location' => array('numeric'), + 'exclusive' => array('notempty') + ); + + //The Associations below have been created with all possible keys, those that are not needed can be removed + var $belongsTo = array( + 'Product' => array( + 'className' => 'Product', + 'foreignKey' => 'product_id', + 'conditions' => '', + 'fields' => '', + 'order' => '' + ) + ); + + var $hasMany = array( + 'ProductOption' => array( + 'className' => 'ProductOption', + 'foreignKey' => 'product_options_category_id', + 'dependent' => false, + 'conditions' => '', + 'fields' => '', + 'order' => '', + 'limit' => '', + 'offset' => '', + 'exclusive' => '', + 'finderQuery' => '', + 'counterQuery' => '' + ) + ); + +} +?> diff --git a/models/quote_page.php b/models/quote_page.php new file mode 100644 index 00000000..b360a8f3 --- /dev/null +++ b/models/quote_page.php @@ -0,0 +1,23 @@ + array('numeric'), + 'content' => array('notempty'), + 'quote_id' => array('numeric') + ); + + //The Associations below have been created with all possible keys, those that are not needed can be removed + var $belongsTo = array( + 'Quote' => array( + 'className' => 'Quote', + 'foreignKey' => 'quote_id', + 'conditions' => '', + 'fields' => '', + 'order' => '' + ) + ); + +} +?> diff --git a/views/elements/enquiry_table.ctp b/views/elements/enquiry_table.ctp index abb2f3ec..827a828c 100644 --- a/views/elements/enquiry_table.ctp +++ b/views/elements/enquiry_table.ctp @@ -10,6 +10,7 @@