r74383 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74382‎ | r74383 | r74384 >
Date:19:50, 6 October 2010
Author:kaldari
Status:deferred
Tags:
Comment:
changing how amount is handled
Modified paths:
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/validate_input.js (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/validate_input.js
@@ -31,9 +31,9 @@
3232 }
3333
3434 function validate_form( form ) {
35 - var msg = [ 'EmailAdd', 'Fname', 'Lname', 'Street', 'City', 'State', 'Zip', 'CardNum', 'Cvv', 'Amount' ];
 35+ var msg = [ 'EmailAdd', 'Fname', 'Lname', 'Street', 'City', 'State', 'Zip', 'CardNum', 'Cvv' ];
3636
37 - var fields = ["emailAdd","fname","lname","street","city","state","zip","card_num","cvv", "amount" ],
 37+ var fields = ["emailAdd","fname","lname","street","city","state","zip","card_num","cvv" ],
3838 numFields = fields.length,
3939 i,
4040 output = '',
Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php
@@ -852,6 +852,7 @@
853853
854854 $data = array(
855855 'amount' => ( $amount != "0.00" ) ? $amount : "30.00",
 856+ 'amountOther' => '',
856857 'email' => 'test@example.com',
857858 'fname' => 'Tester',
858859 'mname' => 'T.',
@@ -886,6 +887,7 @@
887888 } else {
888889 $data = array(
889890 'amount' => $amount,
 891+ 'amountOther' => $wgRequest->getText( 'amountOther' ),
890892 'email' => $wgRequest->getText( 'emailAdd' ),
891893 'fname' => $wgRequest->getText( 'fname' ),
892894 'mname' => $wgRequest->getText( 'mname' ),
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter.php
@@ -115,14 +115,14 @@
116116 Xml::radio( 'amount', 100 ) . '100 ' .
117117 Xml::radio( 'amount', 75 ) . '75 ' .
118118 Xml::radio( 'amount', 35 ) . '35 ' .
119 - Xml::radio( 'amount', -1, null, array( 'id' => 'otherRadio' ) ) . Xml::input( 'amountOther', '7', $this->form_data['amount'], array( 'type' => 'text', 'onfocus' => 'clearField( this, "0.00" )', 'onblur' => 'document.getElementById("otherRadio").value = this.value', 'maxlength' => '10', 'id' => 'amount' ) ) .
120119 '<span class="creditcard-error-msg">' . ' ' . $this->form_errors['invalidamount'] . '</span></td>';
121120 $form .= '</tr>';
122121
123122 // currency
124123 $form .= '<tr>';
125 - $form .= '<td class="label">' . Xml::label(wfMsg( 'payflowpro_gateway-donor-currency-label' ), 'currency' ) . '</td>';
126 - $form .= '<td>' . $this->generateCurrencyDropdown() . '</td>';
 124+ $form .= '<td class="label"></td>';
 125+ $form .= '<td>' . Xml::radio( 'amount', -1, null, array( 'id' => 'otherRadio' ) ) . Xml::input( 'amountOther', '7', $this->form_data['amountOther'], array( 'type' => 'text', 'onfocus' => 'clearField( this, "Other" )', 'onblur' => 'document.getElementById("otherRadio").value = this.value', 'maxlength' => '10', 'id' => 'amountOther' ) ) .
 126+ ' ' . $this->generateCurrencyDropdown() . '</td>';
127127 $form .= '</tr>';
128128
129129 // card logos
@@ -221,6 +221,7 @@
222222 <script type="text/javascript">
223223 var fname = document.getElementById('fname');
224224 var lname = document.getElementById('lname');
 225+var amountOther = document.getElementById('amountOther');
225226 if (fname.value == '') {
226227 fname.style.color = '#999999';
227228 fname.value = 'First';
@@ -229,6 +230,10 @@
230231 lname.style.color = '#999999';
231232 lname.value = 'Last';
232233 }
 234+if (amountOther.value == '') {
 235+ amountOther.style.color = '#999999';
 236+ amountOther.value = 'Other';
 237+}
233238 </script>
234239 EOT;
235240 //$form .= $this->generateDonationFooter();

Status & tagging log