From ebfced738a9d625e771dfb2e97fab9b66ac835cd Mon Sep 17 00:00:00 2001 From: Karl Cordes Date: Mon, 23 Feb 2009 13:22:19 +1100 Subject: [PATCH] Enquiry Comment JS. Fixed user Enquiry view order. Enquiry In-Place-Select Looks prettier --- controllers/contacts_controller.php | 7 ++ controllers/customers_controller.php | 2 +- controllers/enquiries_controller.php | 1 + .../product_attachments_controller.php | 46 ++++++++++ controllers/products_controller.php | 5 +- models/product.php | 2 +- models/product_attachment.php | 17 ++++ vendors/shells/vault.php | 83 +++++++++++------- views/elements/enquiry_table.ctp | 6 +- views/elements/product_attachment_table.ctp | 59 +++++++++++++ views/emails/show.ctp | 8 +- views/enquiries/edit.ctp | 11 ++- views/pages/about.ctp | 20 ++++- views/product_attachments/add.ctp | 14 +++ views/product_options/add.ctp | 6 ++ views/product_options/edit.ctp | 6 ++ views/product_options/index.ctp | 24 +++++ views/product_options/view.ctp | 30 +++++++ views/products/add.ctp | 52 ++++++++--- views/products/edit.ctp | 7 +- views/products/index.ctp | 18 ++-- views/products/view.ctp | 61 +++++++------ views/users/view.ctp | 5 -- webroot/css/quotenik.css | 52 ++++++++++- webroot/img/ajax-loader.gif | Bin 0 -> 2545 bytes webroot/js/quotenik/add_datetime.js | 23 +++++ webroot/js/quotenik/product_buildup.js | 50 +++++++++++ 27 files changed, 514 insertions(+), 101 deletions(-) create mode 100644 controllers/product_attachments_controller.php create mode 100644 models/product_attachment.php create mode 100644 views/elements/product_attachment_table.ctp create mode 100644 views/product_attachments/add.ctp create mode 100644 webroot/img/ajax-loader.gif create mode 100644 webroot/js/quotenik/add_datetime.js create mode 100644 webroot/js/quotenik/product_buildup.js diff --git a/controllers/contacts_controller.php b/controllers/contacts_controller.php index 4be07d60..73fafd2c 100755 --- a/controllers/contacts_controller.php +++ b/controllers/contacts_controller.php @@ -23,6 +23,13 @@ class ContactsController extends AppController { //$enquiries = $this->Contact->Enquiry->findAllByContactId($id); $this->set('enquiries', $this->paginate('Enquiry', array('Enquiry.contact_id' => $id))); //$this->set('enquiries', $this->paginate($enquiries)); + $statuses = $this->Contact->Enquiry->Status->find('all'); + $status_list = array(); + foreach ($statuses as $status) { + $status_list[] = array($status['Status']['id'], $status['Status']['name']); + } + $this->set('status_list', $status_list); + } diff --git a/controllers/customers_controller.php b/controllers/customers_controller.php index 2e3f595e..4ca286c3 100755 --- a/controllers/customers_controller.php +++ b/controllers/customers_controller.php @@ -8,7 +8,7 @@ class CustomersController extends AppController { 'Customer' => array('order' => array('Customer.name' => 'asc'), 'limit' => 200 ), - 'Enquiry' => array('order' => array('Enquiry.id' => 'asc')) + 'Enquiry' => array('order' => array('Enquiry.id' => 'desc')) ); function index() { diff --git a/controllers/enquiries_controller.php b/controllers/enquiries_controller.php index 2afd9529..68ca275f 100755 --- a/controllers/enquiries_controller.php +++ b/controllers/enquiries_controller.php @@ -297,6 +297,7 @@ class EnquiriesController extends AppController { $this->redirect(array('action'=>'index')); } if (!empty($this->data)) { + if ($this->Enquiry->save($this->data)) { $this->Session->setFlash(__('The Enquiry has been saved', true)); $this->redirect(array('action'=>'index')); diff --git a/controllers/product_attachments_controller.php b/controllers/product_attachments_controller.php new file mode 100644 index 00000000..beb00128 --- /dev/null +++ b/controllers/product_attachments_controller.php @@ -0,0 +1,46 @@ +params['named']['productid'])) { + $productid = $this->params['named']['productid']; + $this->set('product', $this->ProductAttachment->Product->findById($productid)); + } + + if (!$productid && empty($this->data)) { + $this->Session->setFlash(__('Invalid Product ID', true)); + $this->redirect(array('controller'=>'Products', 'action'=>'index')); + } + + if (!empty($this->data) && + is_uploaded_file($this->data['ProductAttachment']['File']['tmp_name'])) { + $fileData = fread(fopen($this->data['ProductAttachment']['File']['tmp_name'], "r"), + $this->data['ProductAttachment']['File']['size']); + + $this->data['ProductAttachment']['name'] = $this->data['ProductAttachment']['File']['name']; + $this->data['ProductAttachment']['type'] = $this->data['ProductAttachment']['File']['type']; + $this->data['ProductAttachment']['size'] = $this->data['ProductAttachment']['File']['size']; + $this->data['ProductAttachment']['data'] = $fileData; + + $this->ProductAttachment->save($this->data); + + $this->redirect(array('controller' => 'products', 'action' => 'view/'.$productid)); + } + } + + + function download($id) { + Configure::write('debug', 0); + $file = $this->ProductAttachment->findById($id); + header('Content-type: ' . $file['ProductAttachment']['type']); + header('Content-length: ' . $file['ProductAttachment']['size']); + header('Content-Disposition: attachment; filename="'.$file['ProductAttachment']['name'].'"'); + echo $file['ProductAttachment']['data']; + exit(); + } + + +} diff --git a/controllers/products_controller.php b/controllers/products_controller.php index 8c459bda..ca1a7367 100755 --- a/controllers/products_controller.php +++ b/controllers/products_controller.php @@ -2,7 +2,8 @@ class ProductsController extends AppController { var $name = 'Products'; - var $helpers = array('Html', 'Form'); + var $components = array('RequestHandler'); + var $helpers = array('Html', 'Form', 'Ajax', 'Number'); function index() { $this->Product->recursive = 0; @@ -15,6 +16,8 @@ class ProductsController extends AppController { $this->redirect(array('action'=>'index')); } $this->set('product', $this->Product->read(null, $id)); + $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)))); } function add() { diff --git a/models/product.php b/models/product.php index 2ea42d28..5358cc14 100755 --- a/models/product.php +++ b/models/product.php @@ -4,7 +4,7 @@ class Product extends AppModel { var $name = 'Product'; - var $hasMany = array('ProductOption'); + var $hasMany = array('ProductOption', 'ProductAttachment'); //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_attachment.php b/models/product_attachment.php new file mode 100644 index 00000000..c94f51ec --- /dev/null +++ b/models/product_attachment.php @@ -0,0 +1,17 @@ + array('className' => 'Product', + 'foreignKey' => 'product_id', + 'conditions' => '', + 'fields' => '', + 'order' => '' + ) + ); + +} +?> \ No newline at end of file diff --git a/vendors/shells/vault.php b/vendors/shells/vault.php index 85660944..5d39d324 100644 --- a/vendors/shells/vault.php +++ b/vendors/shells/vault.php @@ -41,37 +41,44 @@ class VaultShell extends Shell { $this->data['Email']['body'] = ""; $this->data['Email']['plainbody'] = ""; $structure = imap_fetchstructure($mbox, $i); + $attachments = 1; if (empty($structure->parts)) { /* A single part message. No attachments and is plain text */ $this->data['Email']['body'] = imap_body($mbox, $i); } else { - $attachments = $this->fetchBodyAttachments($mbox, $i, $temp_filename, $email_dir); - foreach ($attachments as $attachment) { - if($attachment['type'] == 'text/html') { //Assuming All HTML attachments are the body of the email - - $filecontents = file_get_contents($email_dir.'/'.$attachment['name']); - $size = filesize($email_dir.'/'.$attachment['name']); - $this->data['Email']['body'] .= $filecontents; - - + $attachments = $this->fetchBodyAttachments($mbox, $i, $temp_filename, $email_dir); + if($attachments != 1) { + foreach ($attachments as $attachment) { + if($attachment['type'] == 'text/html') { //Assuming All HTML attachments are the body of the email + if(file_exists($email_dir.'/'.$attachment['name'])) { + $filecontents = file_get_contents($email_dir.'/'.$attachment['name']); + $size = filesize($email_dir.'/'.$attachment['name']); + $this->data['Email']['body'] .= $filecontents; + } + + } + if($attachment['type'] == 'text/plain') { //Found plain text + if(file_exists($email_dir.'/'.$attachment['name'])) { + $filecontents = file_get_contents($email_dir.'/'.$attachment['name']); + $size = filesize($email_dir.'/'.$attachment['name']); + $this->data['Email']['plainbody'] .= $filecontents; + } + + } + } + } - if($attachment['type'] == 'text/plain') { //Found plain text - $filecontents = file_get_contents($email_dir.'/'.$attachment['name']); - $size = filesize($email_dir.'/'.$attachment['name']); - $this->data['Email']['plainbody'] .= $filecontents; - - - } } - - } //Sanitize::clean($this->data); + if( ($this->data['Email']['body'] != "") || ($this->data['Email']['plainbody'] != "") ) { if($this->Email->save($this->data)) { $email_id = $this->Email->id; - if(isset($attachments)) { + if($attachments != 1) { foreach ($attachments as $attachment) { + if(file_exists($email_dir.'/'.$attachment['name']) != FALSE) { + if( ($attachment['type'] != 'text/html') && ($attachment['type'] != 'multipart/mixed') && ($attachment['type'] != 'multipart/alternative') ) { $this->EmailAttachment->create(); @@ -89,6 +96,7 @@ class VaultShell extends Shell { } } } + } echo "Email stored in the DB under enquiry ".$enquiry['Enquiry']['title']." Will be moved to the stored folder\n"; if($testing == 0) { //Testing Mode. Don't actually move these emails unless we're in production. @@ -97,19 +105,24 @@ class VaultShell extends Shell { - if(isset($attachments)) { + if($attachments != 1) { $this->clearEmailAttachmentDirs($email_dir, $temp_filename, $attachments); } } + else { echo 'Unable to save the Email\n'; } } else { + echo "Unable to find either HTML or Plaintext body to this email. Ignoring it"; + } + + } else { /* Can't find a valid-looking CMC Enquiry Number. Move the message to the discarded folder * I may change this to simply delete the emails. This will do for now, but it's doubling up on the storage for useless files. * */ @@ -142,22 +155,28 @@ function fetchBodyAttachments($mailbox, $msg_number, $filename, $email_dir) { $email_file = $email_dir.'/'.$filename; imap_savebody($mailbox, $email_file, $msg_number); - $command = "ripmime -i $email_file -d $email_dir -v --verbose-contenttype --paranoid --prefix $msg_number"; + $command = "/usr/local/bin/ripmime -i $email_file -d $email_dir -v --verbose-contenttype --paranoid --prefix $msg_number"; $output = array(); - exec($command, $output); + exec($command, $output, $status); /* Check the $output array and find the filenames of the attachments */ - $attachments = array(); - for($i=0, $j=0; $i< count($output); $i++, $j++) { - $words = explode(' ', $output[$i]); - $type = explode('=', $words[1]); - $name = explode('=', $words[2]); - $attachments[$j]['type'] = $type[1]; - $attachments[$j]['name'] = $name[1]; - echo "in message number $msg_number: found attachment ".$attachments[$j]['name'].' '.$attachments[$j]['type']."\n"; - } -return $attachments; + if($status == 0) { + $attachments = array(); + + for($i=0, $j=0; $i< count($output); $i++, $j++) { + $words = explode(' ', $output[$i]); + $type = explode('=', $words[1]); + $name = explode('=', $words[2]); + $attachments[$j]['type'] = $type[1]; + $attachments[$j]['name'] = $name[1]; + echo "in message number $msg_number: found attachment ".$attachments[$j]['name'].' '.$attachments[$j]['type']."\n"; + } + return $attachments; + } + else { + return 1; + } } diff --git a/views/elements/enquiry_table.ctp b/views/elements/enquiry_table.ctp index 68aa7501..785952d7 100644 --- a/views/elements/enquiry_table.ctp +++ b/views/elements/enquiry_table.ctp @@ -105,10 +105,10 @@ foreach ($enquiries as $enquiry): link($enquiry['Country']['name'], array('controller'=> 'countries', 'action'=>'view', $enquiry['Country']['id'])); ?> - -
+
editor("statusupdate_$i", array('controller'=>'Enquiries', 'action'=>'update_status', $enquiry['Enquiry']['id']), array('update' => "statusupdate_$i", 'collection' => $status_list, 'okText'=>'Change Status', 'savingText' => 'Saving..', 'formId' => 'EnquiryStatusId')); + echo $ajax->editor("statusupdate_$i", array('controller'=>'Enquiries', 'action'=>'update_status', $enquiry['Enquiry']['id']), array('update' => "statusupdate_$i", 'collection' => $status_list, 'okText'=>'Change Status', 'savingText' => 'Saving..', 'formId' => 'EnquiryStatusId', + 'formClassName' => 'MER-inplace-select')); ?> diff --git a/views/elements/product_attachment_table.ctp b/views/elements/product_attachment_table.ctp new file mode 100644 index 00000000..179b2b17 --- /dev/null +++ b/views/elements/product_attachment_table.ctp @@ -0,0 +1,59 @@ + + + + + + + + + + + + + > + + + + + + + + +
nice($file['ProductAttachment']['created']);?>link($file['ProductAttachment']['name'], array('controller'=>'product_attachments', 'action' => 'download/', $file['ProductAttachment']['id']));?>image('pdf_type.png'); + } + else if($file['ProductAttachment']['type'] == 'application/msword') { + echo $html->image('document_type.png'); + } + else if($file['ProductAttachment']['type'] == 'message/rfc822') { + echo $html->image('message_type.png'); + } + else if($file['ProductAttachment']['type'] == 'application/vnd.ms-excel') { + echo $html->image('spreadsheet_document_type.png'); + } + else if($file['EnquiryFile']['type'] == 'image/jpeg') { + echo $html->image('image_type.png'); + } + else { + echo $html->image('unknown_type.png'); + } + ?>toReadableSize($file['ProductAttachment']['size']);?> + link(__('View', true), array('controller'=> 'product_attachments', 'action'=>'download/', $file['ProductAttachment']['id'])); ?> +
+ + +
+ +
diff --git a/views/emails/show.ctp b/views/emails/show.ctp index 530f149f..f175a7d8 100644 --- a/views/emails/show.ctp +++ b/views/emails/show.ctp @@ -39,7 +39,13 @@ $cleanbody = str_replace(array('a:link', 'a:visited'), '', $email['Email']['body']); ?> - + '; + echo $email['Email']['plainbody']; + echo ''; + } + ?> diff --git a/views/enquiries/edit.ctp b/views/enquiries/edit.ctp index 64faedf6..3b2f8025 100755 --- a/views/enquiries/edit.ctp +++ b/views/enquiries/edit.ctp @@ -1,8 +1,11 @@
+ create('Enquiry');?>
input('id'); echo $form->input('user_id', array('label'=>'Assigned to User')); echo $form->input('principle_id'); @@ -15,8 +18,14 @@ 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'); + echo $form->input('comments', array('id'=>'comments')); + ?> + ');" value="Edit Comments" class="dateButton" id="datebutton"/> + link('quotenik/add_datetime.js', true); echo $form->input('posted', array('label' => 'This quote been sent hard copy via Post')); + + ?>
end('Submit');?> diff --git a/views/pages/about.ctp b/views/pages/about.ctp index 8a45aa45..2e87d893 100644 --- a/views/pages/about.ctp +++ b/views/pages/about.ctp @@ -1,2 +1,20 @@ -

About this Software

+

About this Software

+ +

Developed by Karl Cordes

+
+
Copyright (c) 2009 Karl Cordes
+CMC Technologies Pty Ltd (CMC), and any future CMC subsidiary companies, have a licence to use this software.
+Modifications are permitted for internal CMC use only.
+Redistribution of any part of the software is strictly prohibited.
+This software uses other software packages: CakePHP and mySQL. These software packages have their own licence and redistribution terms that are not affected by this licence.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+
diff --git a/views/product_attachments/add.ctp b/views/product_attachments/add.ctp new file mode 100644 index 00000000..6312e5e7 --- /dev/null +++ b/views/product_attachments/add.ctp @@ -0,0 +1,14 @@ +create('ProductAttachment', array('action' => 'add/productid:'.$product['Product']['id'], 'type' => 'file')); + echo '
'; + echo''; + __('Add File to '.$product['Principle']['name'].' '.$product['Product']['title']); + echo ''; + echo $form->file('File'); + echo $form->input('description'); + echo $form->input('product_id', array('type'=>'hidden', 'value' => $product['Product']['id'])); + //echo $form->submit('Upload'); + echo $form->end('Upload'); + echo '
'; +?> + diff --git a/views/product_options/add.ctp b/views/product_options/add.ctp index 64c9607f..9612f586 100644 --- a/views/product_options/add.ctp +++ b/views/product_options/add.ctp @@ -7,6 +7,12 @@ echo $form->input('title'); echo $form->input('description'); echo $form->input('cost_price'); + echo $form->input('our_discount'); + echo $form->input('packing_each'); + echo $form->input('shipping_weight_each'); + echo $form->input('shipping_cost_each'); + echo $form->input('duty'); + echo $form->input('sell_price_each'); ?> end('Submit');?> diff --git a/views/product_options/edit.ctp b/views/product_options/edit.ctp index d75c6b1c..e32b97d3 100644 --- a/views/product_options/edit.ctp +++ b/views/product_options/edit.ctp @@ -8,6 +8,12 @@ echo $form->input('title'); echo $form->input('description'); echo $form->input('cost_price'); + echo $form->input('our_discount'); + echo $form->input('packing_each'); + echo $form->input('shipping_weight_each'); + echo $form->input('shipping_cost_each'); + echo $form->input('duty'); + echo $form->input('sell_price_each'); ?> end('Submit');?> diff --git a/views/product_options/index.ctp b/views/product_options/index.ctp index 94415deb..3dbbfd4b 100644 --- a/views/product_options/index.ctp +++ b/views/product_options/index.ctp @@ -13,6 +13,12 @@ echo $paginator->counter(array( sort('title');?> sort('description');?> sort('cost_price');?> + sort('our_discount');?> + sort('packing_each');?> + sort('shipping_weight_each');?> + sort('shipping_cost_each');?> + sort('duty');?> + sort('sell_price_each');?> + + + + + + + + + + + + + + + + + + link(__('View', true), array('action'=>'view', $productOption['ProductOption']['id'])); ?> link(__('Edit', true), array('action'=>'edit', $productOption['ProductOption']['id'])); ?> diff --git a/views/product_options/view.ctp b/views/product_options/view.ctp index f9ef5a95..9b7da8a8 100644 --- a/views/product_options/view.ctp +++ b/views/product_options/view.ctp @@ -26,6 +26,36 @@   + > + > + +   + + > + > + +   + + > + > + +   + + > + > + +   + + > + > + +   + + > + > + +   +
diff --git a/views/products/add.ctp b/views/products/add.ctp index 0ca361c7..3411038c 100755 --- a/views/products/add.ctp +++ b/views/products/add.ctp @@ -1,21 +1,49 @@ -
-create('Product');?> +link('quotenik/product_buildup.js', false); ?> + +
+create('Product', array('id'=>'productaddform', 'class'=>'addproduct'));?>
input('principle_id'); echo $form->input('title'); echo $form->input('description'); - echo $form->input('principle_part_number'); - echo $form->input('cmc_part_number'); - echo $form->input('costprice_each'); - echo $form->input('our_discount'); - echo $form->input('packing_each'); - echo $form->input('shipping_weight_each'); - echo $form->input('shipping_cost_each'); - echo $form->input('duty'); - echo $form->input('target_gp'); - echo $form->input('sellprice_each'); + 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 '
'; + 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 '
'; + echo '
'; + echo $form->label('convert_to_aud', 'Convert to A$'); + echo $form->text('convert_to_aud', array('readonly'=>'readonly', 'id'=>'convert_to_aud')); + echo '
'; + + 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'=>'

')); + + echo '
'; + echo $form->label('total_landed_cost', 'Total Landed Cost'); + echo $form->text('total_landed_cost', array('readonly'=>'readonly', 'id'=>'total_landed_cost')); + echo '
'; + echo $form->input('sellprice_each', array('label' => 'Sell Price Each', 'id'=>'sellprice_each')); + echo '
'; + echo $form->label('gross_profit_dollars', 'Gross Profit $'); + echo $form->text('gross_profit_dollars', array('readonly'=>'readonly', 'id'=>'gross_profit_dollars')); + echo '
'; + echo '
'; + echo $form->label('gross_profit_percent', 'Gross Profit %'); + echo $form->text('gross_profit_prercent', array('readonly'=>'readonly', 'id'=>'gross_profit_percent')); + echo '
'; + echo $form->input('notes'); + echo $ajax->observeForm('productaddform', array('frequency' => 0.5, 'complete'=>'buildup()')); ?>
end('Submit');?> diff --git a/views/products/edit.ctp b/views/products/edit.ctp index b8ce29fd..60b06678 100755 --- a/views/products/edit.ctp +++ b/views/products/edit.ctp @@ -7,16 +7,15 @@ echo $form->input('principle_id'); echo $form->input('title'); echo $form->input('description'); - echo $form->input('principle_part_number'); - echo $form->input('cmc_part_number'); - echo $form->input('costprice_each'); + echo $form->input('part_number'); + echo $form->input('cost_price_each'); echo $form->input('our_discount'); echo $form->input('packing_each'); echo $form->input('shipping_weight_each'); echo $form->input('shipping_cost_each'); echo $form->input('duty'); - echo $form->input('target_gp'); echo $form->input('sellprice_each'); + echo $form->input('notes'); ?> end('Submit');?> diff --git a/views/products/index.ctp b/views/products/index.ctp index 6a94b877..31c44d8f 100755 --- a/views/products/index.ctp +++ b/views/products/index.ctp @@ -12,16 +12,15 @@ echo $paginator->counter(array( sort('principle_id');?> sort('title');?> sort('description');?> - sort('principle_part_number');?> - sort('cmc_part_number');?> - sort('costprice_each');?> + sort('part_number');?> + sort('cost_price_each');?> sort('our_discount');?> sort('packing_each');?> sort('shipping_weight_each');?> sort('shipping_cost_each');?> sort('duty');?> - sort('target_gp');?> sort('sellprice_each');?> + sort('notes');?> - + - - - - + @@ -70,10 +66,10 @@ foreach ($products as $product): - + - + link(__('View', true), array('action'=>'view', $product['Product']['id'])); ?> diff --git a/views/products/view.ctp b/views/products/view.ctp index 3bf1e3b0..48794357 100755 --- a/views/products/view.ctp +++ b/views/products/view.ctp @@ -1,11 +1,7 @@

- > - > - -   - + > > link($product['Principle']['name'], array('controller'=> 'principles', 'action'=>'view', $product['Principle']['id'])); ?> @@ -21,19 +17,14 @@   - > + > > - +   - > + > > - -   - - > - > - +   > @@ -61,40 +52,42 @@   - > - > - -   - > >   + > + > + +   +
  • link(__('Edit Product', true), array('action'=>'edit', $product['Product']['id'])); ?>
  • -
  • link(__('Delete Product', true), array('action'=>'delete', $product['Product']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $product['Product']['id'])); ?>
  • link(__('List Products', true), array('action'=>'index')); ?>
  • link(__('New Product', true), array('action'=>'add')); ?>
  • link(__('List Principles', true), array('controller'=> 'principles', 'action'=>'index')); ?>
  • link(__('New Principle', true), array('controller'=> 'principles', 'action'=>'add')); ?>
  • -
  • link(__('List Product Options', true), array('controller'=> 'product_options', 'action'=>'index')); ?>
  • link(__('New Product Option', true), array('controller'=> 'product_options', 'action'=>'add')); ?>