diff --git a/14_11_2011_add_myob_fields_to_products.sql b/14_11_2011_add_myob_fields_to_products.sql new file mode 100644 index 00000000..6185b817 --- /dev/null +++ b/14_11_2011_add_myob_fields_to_products.sql @@ -0,0 +1,2 @@ +ALTER TABLE `products` ADD `item_code` VARCHAR( 255 ) NOT NULL , +ADD `item_description` VARCHAR( 255 ) NOT NULL; diff --git a/controllers/products_controller.php b/controllers/products_controller.php index 30480218..6a85856f 100755 --- a/controllers/products_controller.php +++ b/controllers/products_controller.php @@ -99,7 +99,8 @@ class ProductsController extends AppController { if (!empty($this->data)) { if ($this->Product->save($this->data)) { $this->Session->setFlash(__('The Product has been saved', true)); - $this->redirect(array('action'=>'index')); + $id = $this->Product->id; + $this->redirect(array('action'=>'view/'.$id)); } else { $this->Session->setFlash(__('The Product could not be saved. Please, try again.', true)); } diff --git a/controllers/users_controller.php b/controllers/users_controller.php index cbde9c6c..5e0bb9b4 100755 --- a/controllers/users_controller.php +++ b/controllers/users_controller.php @@ -57,9 +57,12 @@ class UsersController extends AppController { $this->redirect($this->Auth->logout()); } - function index() { + function index($type = 'user') { $this->User->recursive = 0; - $this->set('users', $this->paginate()); + + $users = $this->paginate(array('User.type'=> $type)); + + $this->set('users', $users); } /** diff --git a/models/costing.php b/models/costing.php index 8e86bb87..d35078fa 100755 --- a/models/costing.php +++ b/models/costing.php @@ -16,8 +16,8 @@ class Costing extends AppModel { 'LineItem' => array('className'=>'LineItem','foreignKey' => 'line_item_id' ), - 'PurchaseCurrency' => array('className' => 'Currency', 'foreignKey' => 'purchase_currency_id'), - 'SaleCurrency' => array('className' => 'Currency', 'foreignKey' => 'sale_currency_id') + 'PurchaseCurrency' => array('className' => 'Currency', 'foreignKey' => 'purchase_currency_id', 'order'=>'PurchaseCurrency.name ASC'), + 'SaleCurrency' => array('className' => 'Currency', 'foreignKey' => 'sale_currency_id', 'order'=>'SaleCurrency.name ASC') diff --git a/views/pages/admin.ctp b/views/pages/admin.ctp index 11bac44c..195fafb3 100644 --- a/views/pages/admin.ctp +++ b/views/pages/admin.ctp @@ -1,11 +1,11 @@

WARNING: Deleting any records from these tables can have serious implications for data integrity.

-

Records in other tables could potentially end up referencing non-existing records.

-

eg. If currency id 2 were deleted, all other records referencing AUD would lose that reference.

-

Be careful!

+

ie.Records in other tables could potentially end up referencing non-existing records. if currency id 2 were deleted, all records referencing AUD will be break.

+

Tread carefully.