Changeset 6067
- Timestamp:
- 11/01/2017 04:33:47 PM (7 years ago)
- Location:
- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/budget-tool.php
r4967 r6067 172 172 unset( $currencies[ $key ] ); 173 173 174 ksort( $currencies );175 176 174 require( dirname( __DIR__ ) . '/views/budget-tool/main.php' ); 177 175 } -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/payment-request.php
r4967 r6067 865 865 case 'payment_amount': 866 866 $currency = get_post_meta( $post_id, '_camppayments_currency', true ); 867 if ( false === strpos( $currency, 'null' ) ) {867 if ( $currency && false === strpos( $currency, 'null' ) ) { 868 868 echo esc_html( $currency ) . ' '; 869 869 } … … 996 996 } 997 997 998 if ( 'null-select-one' === $currency) {998 if ( false !== strpos( $currency, 'null' ) ) { 999 999 $currency = ''; 1000 1000 } -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/reimbursement-request.php
r4967 r6067 895 895 $categories = array(); 896 896 897 if ( strpos( $currency, 'null' ) === 0) {897 if ( false !== strpos( $currency, 'null' ) ) { 898 898 $currency = ''; 899 899 } -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/sponsor-invoice.php
r4967 r6067 460 460 case 'payment_amount': 461 461 $currency = get_post_meta( $post_id, '_wcbsi_currency', true ); 462 if ( false === strpos( $currency, 'null' ) ) {462 if ( $currency && false === strpos( $currency, 'null' ) ) { 463 463 echo esc_html( $currency ) . ' '; 464 464 } -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/sponsor-payment-stripe.php
r5842 r6067 11 11 const STEP_PAYMENT_DETAILS = 2; 12 12 const STEP_PAYMENT_SUCCESS = 3; 13 14 13 const CSS_VERSION = 1; 15 14 … … 110 109 111 110 $currency = $_POST['currency']; 112 if ( ! array_key_exists( $currency, $data['currencies'] ) or strpos( $currency, 'null' ) === 0) {111 if ( ! array_key_exists( $currency, $data['currencies'] ) || false !== strpos( $currency, 'null' ) ) { 113 112 $data['errors'][] = 'Invalid currency.'; 114 113 return; -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/wordcamp-budgets.php
r4967 r6067 602 602 603 603 /** 604 * Get a list of all world currencies, with the most frequently used at the top.605 * 606 * @todo Bring this in line with ISO 4217604 * Get a list of ISO 4217 currencies, sorted by name. 605 * 606 * @todo Move this to helper-functions.php so it can be more cleanly reused, and update calls to it. 607 607 * 608 608 * @return array … … 610 610 public static function get_currencies() { 611 611 $currencies = array ( 612 ' null-most-frequently-used' => 'Most Frequently Used:',612 'EUR' => 'European Zone Euro', 613 613 'USD' => 'United States Dollar', 614 'EUR' => 'Euro Member Countries', 615 616 'null-separator2' => '', 617 618 'null-all' => 'All:', 619 'ALL' => 'Albania Lek', 620 'AFN' => 'Afghanistan Afghani', 621 'ARS' => 'Argentina Peso', 622 'AWG' => 'Aruba Guilder', 623 'AUD' => 'Australia Dollar', 624 'AZN' => 'Azerbaijan New Manat', 625 'BSD' => 'Bahamas Dollar', 614 615 '' => '', 616 617 'AFN' => 'Afghan Afghani', 618 'ALL' => 'Albanian Lek', 619 'DZD' => 'Algerian Dinar', 620 'AOA' => 'Angolan Kwanza', 621 'ARS' => 'Argentine Peso', 622 'AMD' => 'Armenian Dram', 623 'AWG' => 'Aruban Florin', 624 'AUD' => 'Australian Dollar', 625 'AZN' => 'Azerbaijan Manat', 626 'BSD' => 'Bahamian Dollar', 627 'BHD' => 'Bahraini Dinar', 628 'BDT' => 'Bangladeshi Taka', 626 629 'BBD' => 'Barbados Dollar', 627 'BDT' => 'Bangladeshi taka', 628 'BYR' => 'Belarus Ruble', 630 'BYN' => 'Belarusian Ruble', 629 631 'BZD' => 'Belize Dollar', 630 'BMD' => 'Bermuda Dollar', 631 'BOB' => 'Bolivia Boliviano', 632 'BAM' => 'Bosnia and Herzegovina Convertible Marka', 632 'BMD' => 'Bermudian Dollar', 633 'BTN' => 'Bhutanese Ngultrum', 634 'BOB' => 'Bolivian Boliviano', 635 'BOV' => 'Bolivian Mvdol', 636 'BAM' => 'Bosnia and Herzegovina Convertible Mark', 633 637 'BWP' => 'Botswana Pula', 634 'BGN' => 'Bulgaria Lev', 635 'BRL' => 'Brazil Real', 636 'BND' => 'Brunei Darussalam Dollar', 637 'KHR' => 'Cambodia Riel', 638 'CAD' => 'Canada Dollar', 638 'BRL' => 'Brazilian Real', 639 'BND' => 'Bruneian Dollar', 640 'BGN' => 'Bulgarian Lev', 641 'MMK' => 'Burmese (Myanmar) Kyat', 642 'BIF' => 'Burundian Franc', 643 'CVE' => 'Cabo Verde Escudo', 644 'KHR' => 'Cambodian Riel', 645 'CAD' => 'Canadian Dollar', 639 646 'KYD' => 'Cayman Islands Dollar', 640 'XAF' => 'Central African CFA Franc', 641 'CLP' => 'Chile Peso', 642 'CNY' => 'China Yuan Renminbi', 643 'COP' => 'Colombia Peso', 644 'CRC' => 'Costa Rica Colon', 645 'HRK' => 'Croatia Kuna', 646 'CUP' => 'Cuba Peso', 647 'CZK' => 'Czech Republic Koruna', 648 'DKK' => 'Denmark Krone', 649 'DOP' => 'Dominican Republic Peso', 647 'XAF' => 'Central African CFA Franc BEAC', 648 'XPF' => 'Change Franc Pacifique (CFP) Franc', 649 'CLP' => 'Chilean Peso', 650 'CNY' => 'Chinese Yuan Renminbi', 651 'COP' => 'Colombian Peso', 652 'KMF' => 'Comorian Franc ', 653 'CDF' => 'Congolese Franc', 654 'NIO' => 'Cordoba Oro', 655 'CRC' => 'Costa Rican Colon', 656 'HRK' => 'Croatian Kuna', 657 'CUC' => 'Cuban Convertible Peso', 658 'CUP' => 'Cuban Peso', 659 'CZK' => 'Czech Koruna', 660 'DKK' => 'Danish Krone', 661 'DJF' => 'Djibouti Franc', 662 'DOP' => 'Dominican Peso', 650 663 'XCD' => 'East Caribbean Dollar', 651 'EGP' => 'Egypt Pound', 664 'XSU' => 'Ecuadorian Sucre', 665 'EGP' => 'Egyptian Pound', 652 666 'SVC' => 'El Salvador Colon', 653 'EEK' => 'Estonia Kroon', 654 'FKP' => 'Falkland Islands (Malvinas) Pound', 667 'ERN' => 'Eritrean Nakfa', 668 'ETB' => 'Ethiopian Birr', 669 'FKP' => 'Falkland Islands Pound', 655 670 'FJD' => 'Fiji Dollar', 656 'GHC' => 'Ghana Cedis', 671 'GMD' => 'Gambian Dalasi', 672 'GEL' => 'Georgian Lari', 673 'GHS' => 'Ghana Cedi', 657 674 'GIP' => 'Gibraltar Pound', 658 'GTQ' => 'Guatemala Quetzal',659 'G GP' => 'Guernsey Pound',675 'GTQ' => 'Guatemalan Quetzal', 676 'GNF' => 'Guinean Franc', 660 677 'GYD' => 'Guyana Dollar', 661 'HNL' => 'Honduras Lempira', 678 'HTG' => 'Haitian Gourde', 679 'HNL' => 'Honduran Lempira', 662 680 'HKD' => 'Hong Kong Dollar', 663 'HUF' => 'Hungar yForint',681 'HUF' => 'Hungarian Forint', 664 682 'ISK' => 'Iceland Krona', 665 'INR' => 'India Rupee',666 'IDR' => 'Indonesia Rupiah',667 'IRR' => 'Iran Rial',668 'I MP' => 'Isle of Man Pound',669 ' ILS' => 'Israel Shekel',670 'J MD' => 'Jamaica Dollar',671 'J PY' => 'Japan Yen',672 ' JEP' => 'Jersey Pound',683 'INR' => 'Indian Rupee', 684 'IDR' => 'Indonesian Rupiah', 685 'IRR' => 'Iranian Rial', 686 'IQD' => 'Iraqi Dinar', 687 'JMD' => 'Jamaican Dollar', 688 'JPY' => 'Japanese Yen', 689 'JOD' => 'Jordanian Dinar', 690 'KZT' => 'Kazakhstani Tenge', 673 691 'KES' => 'Kenyan Shilling', 674 'KZT' => 'Kazakhstan Tenge', 675 'KPW' => 'Korea (North) Won', 676 'KRW' => 'Korea (South) Won', 677 'KGS' => 'Kyrgyzstan Som', 678 'LAK' => 'Laos Kip', 679 'LVL' => 'Latvia Lat', 680 'LBP' => 'Lebanon Pound', 681 'LRD' => 'Liberia Dollar', 682 'LTL' => 'Lithuania Litas', 683 'MKD' => 'Macedonia Denar', 684 'MYR' => 'Malaysia Ringgit', 692 'KWD' => 'Kuwaiti Dinar', 693 'KGS' => 'Kyrgystani Som', 694 'LAK' => 'Lao Kip', 695 'LBP' => 'Lebanese Pound', 696 'LSL' => 'Lesotho Loti', 697 'LRD' => 'Liberian Dollar', 698 'LYD' => 'Libyan Dinar', 699 'MOP' => 'Macanese Pataca', 700 'MKD' => 'Macedonian Denar', 701 'MGA' => 'Malagasy Ariary', 702 'MWK' => 'Malawi Kwacha', 703 'MYR' => 'Malaysian Ringgit', 704 'MVR' => 'Maldivian Rufiyaa', 705 'MRO' => 'Mauritanian Ouguiya', 685 706 'MUR' => 'Mauritius Rupee', 686 'MXN' => 'Mexico Peso', 687 'MNT' => 'Mongolia Tughrik', 707 'MXN' => 'Mexican Peso', 708 'MXV' => 'Mexican Unidad de Inversion (UDI)', 709 'MDL' => 'Moldovan Leu', 710 'MNT' => 'Mongolian Tugrik', 711 'MAD' => 'Moroccan Dirham', 688 712 'MZN' => 'Mozambique Metical', 689 713 'NAD' => 'Namibia Dollar', 690 'NPR' => 'Nepal Rupee', 691 'ANG' => 'Netherlands Antilles Guilder', 714 'NPR' => 'Nepalese Rupee', 715 'ANG' => 'Netherlands Antillean Guilder', 716 'ILS' => 'New Israeli Sheqel', 717 'TWD' => 'New Taiwan Dollar', 692 718 'NZD' => 'New Zealand Dollar', 693 'NIO' => 'Nicaragua Cordoba', 694 'NGN' => 'Nigeria Naira', 695 'NOK' => 'Norway Krone', 696 'OMR' => 'Oman Rial', 719 'NGN' => 'Nigerian Naira', 720 'KPW' => 'North Korean Won', 721 'NOK' => 'Norwegian Krone', 697 722 'PKR' => 'Pakistan Rupee', 698 'PAB' => 'Panama Balboa', 699 'PYG' => 'Paraguay Guarani', 700 'PEN' => 'Peru Nuevo Sol', 701 'PHP' => 'Philippines Peso', 702 'PLN' => 'Poland Zloty', 703 'QAR' => 'Qatar Riyal', 704 'RON' => 'Romania New Leu', 705 'RUB' => 'Russia Ruble', 723 'PAB' => 'Panamanian Balboa', 724 'PGK' => 'Papua New Guinean Kina', 725 'PYG' => 'Paraguayan Guarani', 726 'PEN' => 'Peruvian Sol', 727 'UYU' => 'Peso Uruguayo', 728 'PHP' => 'Philippine Piso', 729 'PLN' => 'Polish Zloty', 730 'QAR' => 'Qatari Rial', 731 'OMR' => 'Rial Omani', 732 'RON' => 'Romanian Leu', 733 'RUB' => 'Russian Ruble', 734 'RWF' => 'Rwanda Franc', 706 735 'SHP' => 'Saint Helena Pound', 707 'SAR' => 'Saudi Arabia Riyal', 708 'RSD' => 'Serbia Dinar', 736 'WST' => 'Samoan Tala', 737 'SAR' => 'Saudi Riyal', 738 'RSD' => 'Serbian Dinar', 709 739 'SCR' => 'Seychelles Rupee', 740 'SLL' => 'Sierra Leonean Leone', 710 741 'SGD' => 'Singapore Dollar', 711 742 'SBD' => 'Solomon Islands Dollar', 712 'SOS' => 'Somalia Shilling', 713 'ZAR' => 'South Africa Rand', 743 'SOS' => 'Somali Shilling', 744 'ZAR' => 'South African Rand', 745 'KRW' => 'South Korean Won', 746 'SSP' => 'South Sudanese Pound', 714 747 'LKR' => 'Sri Lanka Rupee', 715 'SEK' => 'Sweden Krona', 716 'CHF' => 'Switzerland Franc', 717 'SRD' => 'Suriname Dollar', 718 'SYP' => 'Syria Pound', 719 'TWD' => 'Taiwan New Dollar', 720 'THB' => 'Thailand Baht', 748 'SDG' => 'Sudanese Pound', 749 'SRD' => 'Surinam Dollar', 750 'SZL' => 'Swazi Lilangeni', 751 'SEK' => 'Swedish Krona', 752 'CHF' => 'Swiss Franc', 753 'SYP' => 'Syrian Pound', 754 'STD' => 'São Tomé & Príncipe Dobra', 755 'TJS' => 'Tajikistani Somoni', 756 'TZS' => 'Tanzanian Shilling', 757 'THB' => 'Thai Baht', 758 'TOP' => 'Tongan Paʻanga', 721 759 'TTD' => 'Trinidad and Tobago Dollar', 722 'TRY' => 'Turkey Lira', 723 'TRL' => 'Turkey Lira', 724 'TVD' => 'Tuvalu Dollar', 725 'UAH' => 'Ukraine Hryvna', 726 'GBP' => 'United Kingdom Pound', 727 'UYU' => 'Uruguay Peso', 728 'UZS' => 'Uzbekistan Som', 729 'VEF' => 'Venezuela Bolivar', 730 'VND' => 'Viet Nam Dong', 731 'YER' => 'Yemen Rial', 732 'ZWD' => 'Zimbabwe Dollar' 760 'TND' => 'Tunisian Dinar', 761 'TRY' => 'Turkish Lira', 762 'TMT' => 'Turkmenistan New Manat', 763 'UGX' => 'Uganda Shilling', 764 'UAH' => 'Ukrainian Hryvnia', 765 'CLF' => 'Unidad de Fomento', 766 'COU' => 'Unidad de Valor Real', 767 'AED' => 'United Arab Emirates Dirham', 768 'GBP' => 'United Kingdom Pound Sterling', 769 'UZS' => 'Uzbekistan Sum', 770 'VUV' => 'Vanuatu Vatu', 771 'VEF' => 'Venezuelan Bolívar', 772 'VND' => 'Vietnamese Dong', 773 'CHE' => 'WIR Euro', 774 'CHW' => 'WIR Franc', 775 'XOF' => 'West African CFA Franc', 776 'YER' => 'Yemeni Rial', 777 'ZMW' => 'Zambian Kwacha', 778 'ZWL' => 'Zimbabwe Dollar', 733 779 ); 734 780 -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/views/budget-tool/main.php
r4967 r6067 179 179 <# if (data.name == 'currency') { #> 180 180 <select class="value"> 181 <# _.each(wcb.currencies, function(v, k) { #> 182 <option value="{{k}}" <#if(k==data.value){#>selected<#}#>>{{k}} - {{v}}</option> 183 <# }); #> 181 <option value=""> 182 <?php _e( '-- Select a Currency --', 'wordcamporg' ); ?> 183 </option> 184 185 <option value=""></option> 186 187 <# _.each( wcb.currencies, function( value, key ) { #> 188 <option value="{{key}}" <# if( key === data.value ) { #> selected <# } #> > 189 {{value}} 190 191 <# if ( key ) { #> 192 ({{key}}) 193 <# } #> 194 </option> 195 <# }); #> 184 196 </select> 185 197 <# } else { #> -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/views/payment-request/input-select.php
r4967 r6067 12 12 <?php __checked_selected_helper( $required, true, true, 'required' ); ?> 13 13 > 14 <option value="null-select-one"> 14 <option value=""> 15 <?php // translators: %s is a label in a dropdown. For example, "Select a currency", or "Select a category". ?> 15 16 <?php printf( esc_html__( '-- Select a %s --', 'wordcamporg' ), $label ); ?> 16 17 </option> 17 <option value=" null-separator1"></option>18 <option value=""></option> 18 19 19 20 <?php foreach ( $options as $value => $option_label ) : ?> 20 21 <option value="<?php echo esc_attr( $value ); ?>" <?php selected( $value, $selected ); ?>> 21 22 <?php echo esc_html( $option_label ); ?> 23 <?php if ( 'currency' === $name && $value ) : ?> 24 (<?php echo esc_html( $value ); ?>) 25 <?php endif; ?> 22 26 </option> 23 27 <?php endforeach; ?> -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/views/reimbursement-request/metabox-general-information.php
r2705 r6067 3 3 namespace WordCamp\Budgets\Reimbursement_Requests; 4 4 defined( 'WPINC' ) or die(); 5 6 /** @var \WP_Post $post */ 7 /** @var string $name_of_payer */ 8 /** @var array $available_currencies */ 9 /** @var string $selected_currency */ 10 /** @var array $available_reasons */ 11 /** @var string $selected_reason */ 12 /** @var string $other_reason */ 13 /** @var int $date_paid */ 5 14 6 15 ?> … … 31 40 32 41 <select id="_wcbrr_currency" name="_wcbrr_currency"> 33 <option value=" null-select-one">42 <option value=""> 34 43 <?php _e( '-- Select a Currency --', 'wordcamporg' ); ?> 35 44 </option> 36 <option value=" null-separator1"></option>45 <option value=""></option> 37 46 38 47 <?php foreach ( $available_currencies as $currency_key => $currency_name ) : ?> 39 48 <option value="<?php echo esc_attr( $currency_key ); ?>" <?php selected( $currency_key, $selected_currency ); ?> > 40 49 <?php echo esc_html( $currency_name ); ?> 41 <?php // todo - For better UX, prepend the code to the name (USD - United States Dollar), and sort by the code. Updating the sorting in get_currencies(). Also make this change other places this is used ?> 50 <?php if ( $currency_key ) : ?> 51 (<?php echo esc_html( $currency_key ); ?>) 52 <?php endif; ?> 42 53 </option> 43 54 <?php endforeach; ?> … … 53 64 54 65 <select id="_wcbrr_reason" name="_wcbrr_reason"> 55 <option value=" null-select-one">66 <option value=""> 56 67 <?php _e( '-- Select a Reason --', 'wordcamporg' ); ?> 57 68 </option> 58 <option value=" null-separator1"></option>69 <option value=""></option> 59 70 60 71 <?php foreach ( $available_reasons as $reason_key => $reason_name ) : ?> -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/views/reimbursement-request/template-expense.php
r2683 r6067 18 18 19 19 <select id="_wcbrr_category_{{data.id}}" name="_wcbrr_category_{{data.id}}"> 20 <option value=" null-select-one">20 <option value=""> 21 21 <?php _e( '-- Select a Category --', 'wordcamporg' ); ?> 22 22 </option> 23 <option value=" null-separator1"></option>23 <option value=""></option> 24 24 25 25 <# _.each( wcbPaymentCategories, function( categoryName, categoryKey ) { #> -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/views/sponsor-invoice/metabox-general.php
r3308 r6067 109 109 <option value="<?php echo esc_attr( $currency_key ); ?>" <?php selected( $currency_key, $selected_currency ); ?> > 110 110 <?php echo esc_html( $currency_name ); ?> 111 <?php if ( $currency_key ) : ?> 112 (<?php echo esc_html( $currency_key ); ?>) 113 <?php endif; ?> 111 114 </option> 112 115 <?php endforeach; ?> -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/views/sponsor-payment/main.php
r5262 r6067 43 43 <select name="currency"> 44 44 <option value="" disabled selected><?php esc_html_e( 'Select a Currency', 'wordcamporg' ); ?></option> 45 <option value=""></option> 46 45 47 <?php foreach ( $data['currencies'] as $currency_key => $currency_name ) : ?> 46 <option value="<?php echo esc_attr( $currency_key ); ?>">47 <?php echo esc_html( $currency_name ); ?>48 </option>48 <option value="<?php echo esc_attr( $currency_key ); ?>"> 49 <?php echo esc_html( $currency_name ); ?> 50 </option> 49 51 <?php endforeach; ?> 50 52 </select>
Note: See TracChangeset
for help on using the changeset viewer.