]> git.mjollnir.org Git - moodle.git/commitdiff
Updated Authorize.net for Ethem
authorpatrickslee <patrickslee>
Mon, 13 Mar 2006 21:19:04 +0000 (21:19 +0000)
committerpatrickslee <patrickslee>
Mon, 13 Mar 2006 21:19:04 +0000 (21:19 +0000)
blocks/admin/block_admin.php
lang/en_utf8/moodle.php
user/view.php

index cc9e66b3350111420aec308b5db2ff7966b5b4d2..14951d8c2c535c69d1588c439f5c9b82bdc818d2 100644 (file)
@@ -71,9 +71,9 @@ class block_admin extends block_list {
 
             if ($CFG->enrol == 'authorize') {
                 require_once $CFG->dirroot.'/enrol/authorize/const.php';
-                $paymenturl = '<a href="'.$CFG->wwwroot.'/enrol/authorize/index.php">'.get_string('payments').'</a>';
+                $paymenturl = '<a href="'.$CFG->wwwroot.'/enrol/authorize/index.php">'.get_string('payments').'</a> ';
                 if ($cnt = count_records('enrol_authorize', 'status', AN_STATUS_AUTH)) {
-                    $paymenturl .= '<a href="'.$CFG->wwwroot.'/enrol/authorize/index.php?status='.AN_STATUS_AUTH.'">(<b>'.$cnt.'</b> '.get_string('pending').')</a>';
+                    $paymenturl .= '<a href="'.$CFG->wwwroot.'/enrol/authorize/index.php?status='.AN_STATUS_AUTH.'">'.get_string('paymentpending', 'moodle', $cnt).'</a>';
                 }
                 $this->content->items[] = $paymenturl;
                 $this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/payment.gif" height="16" width="16" alt="" />';
@@ -175,11 +175,11 @@ class block_admin extends block_list {
                 $this->content->icons[]='<img src="'.$CFG->pixpath.'/i/files.gif" height="16" width="16" alt="" />';
             }
 
-            if ($CFG->enrol == 'authorize') {
+            if ($course->enrol == 'authorize' || (empty($course->enrol) && $CFG->enrol == 'authorize')) {
                 require_once $CFG->dirroot.'/enrol/authorize/const.php';
-                $paymenturl = '<a href="'.$CFG->wwwroot.'/enrol/authorize/index.php?course='.$course->id.'">'.get_string('payments').'</a>';
+                $paymenturl = '<a href="'.$CFG->wwwroot.'/enrol/authorize/index.php?course='.$course->id.'">'.get_string('payments').'</a> ';
                 if ($cnt = count_records('enrol_authorize', 'status', AN_STATUS_AUTH, 'courseid', $course->id)) {
-                    $paymenturl .= '<a href="'.$CFG->wwwroot.'/enrol/authorize/index.php?status='.AN_STATUS_AUTH.'&amp;course='.$course->id.'">(<b>'.$cnt.'</b> '.get_string('pending').')</a>';
+                    $paymenturl .= '<a href="'.$CFG->wwwroot.'/enrol/authorize/index.php?status='.AN_STATUS_AUTH.'&amp;course='.$course->id.'">'.get_string('paymentpending', 'moodle', $cnt).'</a>';
                 }
                 $this->content->items[] = $paymenturl;
                 $this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/payment.gif" height="16" width="16" alt="" />';
index b2961547aabb1c00a9a2a219d08016a6a810bbb4..f43192ace490f7bc035190f619a5f4b6607dba45 100644 (file)
@@ -981,6 +981,8 @@ $string['pathnotexists'] = 'Path doesn\'t exist in your server!';
 $string['pathslasherror'] = 'Path can\'t end with a slash!!';
 $string['paymentinstant'] = 'Use the button below to pay and be enrolled within minutes!';
 $string['paymentrequired'] = 'This course requires a payment for entry.';
+$string['payments'] = 'Payments';
+$string['paymentpending'] = '(<small><b><u>$a</u></b> pending</small>)';
 $string['paymentsorry'] = 'Thank you for your payment!  Unfortunately your payment has not yet been fully processed, and you are not yet registered to enter the course \"$a->fullname\".  Please try continuing to the course in a few seconds, but if you continue to have trouble then please alert the $a->teacher or the site administrator';
 $string['paymentthanks'] = 'Thank you for your payment!  You are now enrolled in your course:<br />\"$a\"';
 $string['people'] = 'People';
index 847e4b4a03663be84825469317cf9e058488360d..3d095ff4e3d467938456fd6d07033897264bace1 100644 (file)
             echo "</form></td>";
         }
     }
+    if ($course->enrol == 'authorize' || (empty($course->enrol) && $CFG->enrol == 'authorize')) {
+        echo "<td nowrap=\"nowrap\"><form action=\"../enrol/authorize/index.php\" method=\"get\">";
+        echo "<input type=\"hidden\" name=\"id\" value=\"$course->id\" />";
+        echo "<input type=\"hidden\" name=\"user\" value=\"$user->id\" />";
+        echo "<input type=\"submit\" value=\"".get_string('payments')."\" />";
+        echo "</form></td>";
+    }
     echo "<td></td>";
     echo "</tr></table></div>\n";