From ef62312dbed1a4d3d76a364622ec0d90bde863c0 Mon Sep 17 00:00:00 2001 From: ethem Date: Mon, 13 Mar 2006 18:26:55 +0000 Subject: [PATCH] You can't do this action: $a->action --- enrol/authorize/index.php | 13 +++++++++---- lang/en_utf8/enrol_authorize.php | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/enrol/authorize/index.php b/enrol/authorize/index.php index c483defea8..1bc670093e 100644 --- a/enrol/authorize/index.php +++ b/enrol/authorize/index.php @@ -222,7 +222,8 @@ function authorize_order_details($orderno) { if (!empty($cmdcapture)) { // CAPTURE if (!in_array(ORDER_CAPTURE, $status->actions)) { - error("You can't do this action:" + ORDER_CAPTURE); + $a->action = ORDER_CAPTURE; + error(get_string('youcantdo', 'enrol_authorize', $a)); } if (empty($cmdconfirm)) { @@ -270,7 +271,8 @@ function authorize_order_details($orderno) { } elseif (!empty($cmdrefund)) { // REFUND if (!in_array(ORDER_REFUND, $status->actions)) { - error("You can't do this action:" + ORDER_REFUND); + $a->action = ORDER_REFUND; + error(get_string('youcantdo', 'enrol_authorize', $a)); } $extra = new stdClass(); @@ -328,7 +330,8 @@ function authorize_order_details($orderno) { } elseif (!empty($cmdvoid)) { // VOID if (!in_array(ORDER_VOID, $status->actions)) { - error("You can't do this action:" + ORDER_VOID); + $a->action = ORDER_VOID; + error(get_string('youcantdo', 'enrol_authorize', $a)); } $suborderno = optional_param('suborder', 0, PARAM_INT); @@ -408,7 +411,8 @@ function authorize_order_details($orderno) { } elseif (!empty($cmddelete)) { // DELETE if (!in_array(ORDER_DELETE, $status->actions)) { - error("You can't do this action:" + ORDER_DELETE); + $a->action = ORDER_DELETE; + error(get_string('youcantdo', 'enrol_authorize', $a)); } //if (!in_array(ORDER_DELETE, $status->actions)) { // error("Order $orderno cannot be deleted. Status must be expired."); @@ -489,6 +493,7 @@ function get_order_status_desc($order) global $CFG, $USER; $ret = new stdClass(); + $ret->actions = array(); if (intval($order->transid) == 0) { // test transaction if (isadmin() || (!empty($CFG->an_teachermanagepay) && isteacher($order->courseid))) { diff --git a/lang/en_utf8/enrol_authorize.php b/lang/en_utf8/enrol_authorize.php index 42a1fdcd99..f5caedb6f0 100644 --- a/lang/en_utf8/enrol_authorize.php +++ b/lang/en_utf8/enrol_authorize.php @@ -149,7 +149,7 @@ $string['transid'] = 'Transaction ID'; $string['unenrolstudent'] = 'Unenrol student?'; $string['void'] = 'Void'; $string['voidyes'] = 'Transaction will be cancelled. Are you sure?'; -$string['youcantdo'] = 'You can\'t this action: $a->action'; +$string['youcantdo'] = 'You can\'t do this action: $a->action'; $string['zipcode'] = 'Zip Code'; ?> -- 2.39.5