From 0de6b5ec398e4f65c767688c19d03a6f5cbfe4ce Mon Sep 17 00:00:00 2001 From: Lillem4n Date: Sat, 12 Nov 2011 15:49:40 +0100 Subject: [PATCH] Upgraded to match Kohana 3.2 --- classes/controller/admin/bills.php | 4 +++- classes/controller/admin/customers.php | 4 +++- classes/controller/admin/wages.php | 2 -- classes/model/employee.php | 2 +- init.php | 2 +- xsl/admin/bills.xsl | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/classes/controller/admin/bills.php b/classes/controller/admin/bills.php index 0ea0498..68717c6 100644 --- a/classes/controller/admin/bills.php +++ b/classes/controller/admin/bills.php @@ -101,8 +101,10 @@ public function action_new_bill() xml::to_XML($_SESSION['bills'], $this->xml_content); } - public function action_mark_as_paid($details) + public function action_mark_as_paid() { + $details = $this->request->param('options'); + list($bill_id, $pay_date) = explode('/', $details); $bill = new bill($bill_id); diff --git a/classes/controller/admin/customers.php b/classes/controller/admin/customers.php index 1c03826..21051ec 100644 --- a/classes/controller/admin/customers.php +++ b/classes/controller/admin/customers.php @@ -36,8 +36,10 @@ public function action_add_customer() } } - public function action_edit_customer($customer_id) + public function action_edit_customer() { + $customer_id = $this->request->param('options'); + $customer_model = new Customer($customer_id); xml::to_XML(array('customer' => $customer_model->get_customer_data()), $this->xml_content, NULL, 'id'); diff --git a/classes/controller/admin/wages.php b/classes/controller/admin/wages.php index 907fcf4..1f235b9 100644 --- a/classes/controller/admin/wages.php +++ b/classes/controller/admin/wages.php @@ -216,8 +216,6 @@ public function action_payout() if (isset($errors['amount'])) $this->add_form_errors(array('amount'=>'Must be numbers ONLY')); } - - } } diff --git a/classes/model/employee.php b/classes/model/employee.php index d61da79..4f1b0a9 100644 --- a/classes/model/employee.php +++ b/classes/model/employee.php @@ -29,7 +29,7 @@ public function get($detail = FALSE) $age = $current_year - $born_year; $this->employee['soc_fee_level'] = 0; // Initial setting, will change if any matches are found further down - foreach (Kohana::config('larv.soc_fee_levels') as $level_data) + foreach (Kohana::$config->load('larv.soc_fee_levels') as $level_data) { if ($level_data['start_age'] <= $age && $level_data['end_age'] >= $age) $this->employee['soc_fee_level'] = $level_data['level']; } diff --git a/init.php b/init.php index 1e01e8b..5bd3018 100644 --- a/init.php +++ b/init.php @@ -2,7 +2,7 @@ if ( ! is_dir(APPPATH.'user_content/pdf')) mkdir(APPPATH.'user_content/pdf'); $pdo = Kohana_pdo::instance('default'); -$column_name = 'Tables_in_'.Kohana::config('pdo.default.database_name'); +$column_name = 'Tables_in_'.Kohana::$config->load('pdo.default.database_name'); $columns = $pdo->query(' SHOW TABLES WHERE diff --git a/xsl/admin/bills.xsl b/xsl/admin/bills.xsl index d917458..ff496b5 100644 --- a/xsl/admin/bills.xsl +++ b/xsl/admin/bills.xsl @@ -78,7 +78,7 @@ Link - [Details] + [Details] [Mark as paid]