From 0fd1eb74bd51889ce48a6ab5369e66a86cbe7da2 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Sat, 13 Nov 2010 09:18:47 +0000 Subject: [PATCH] Old hooks superseded by new hooks API. --- gl/includes/db/gl_db_rates.inc | 10 ++++------ includes/ui/ui_view.inc | 9 ++++----- reporting/rep709.php | 7 ++----- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/gl/includes/db/gl_db_rates.inc b/gl/includes/db/gl_db_rates.inc index ceaddcc7..a6dc58e7 100644 --- a/gl/includes/db/gl_db_rates.inc +++ b/gl/includes/db/gl_db_rates.inc @@ -76,12 +76,10 @@ function delete_exchange_rate($rate_id) // function retrieve_exrate($curr_b, $date) { - global $Hooks; - - if (method_exists($Hooks, 'retrieve_exrate')) - return $Hooks->retrieve_exrate($curr_b, $date); - else - return get_extern_rate($curr_b, 'ECB', $date); + return $rate = hook_retrieve_exrate($curr_b, $date); + if (is_numeric($rate)) + return $rate; + return get_extern_rate($curr_b, 'ECB', $date); } //----------------------------------------------------------------------------- diff --git a/includes/ui/ui_view.inc b/includes/ui/ui_view.inc index 9306aa5d..69810222 100644 --- a/includes/ui/ui_view.inc +++ b/includes/ui/ui_view.inc @@ -734,12 +734,11 @@ function _number_to_words($number) function price_in_words($amount, $document=0) { - global $Hooks; // use local price_in_words() if the hook is defined - if (method_exists($Hooks, 'price_in_words')) - { - return $Hooks->price_in_words($amount, $document); - } + $price = hook_price_in_words($amount, $document); + if ($price) + return $price; + // Only usefor Remittance and Receipts as default if (!($document == ST_SUPPAYMENT || $document == ST_CUSTPAYMENT || $document == ST_CHEQUE)) return ""; diff --git a/reporting/rep709.php b/reporting/rep709.php index 3e7b9d79..e52f2933 100644 --- a/reporting/rep709.php +++ b/reporting/rep709.php @@ -71,7 +71,7 @@ function getTaxInfo($id) function print_tax_report() { - global $path_to_root, $trans_dir, $Hooks, $systypes_array; + global $path_to_root, $trans_dir, $systypes_array; $from = $_POST['PARAM_0']; $to = $_POST['PARAM_1']; @@ -202,10 +202,7 @@ function print_tax_report() $rep->Font(); $rep->NewLine(); - if (method_exists($Hooks, 'tax_report_done')) - { - $Hooks->tax_report_done(); - } + hook_tax_report_done(); $rep->End(); } -- 2.30.2