Making WordPress.org

Changeset 2701


Ignore:
Timestamp:
03/07/2016 11:34:12 PM (9 years ago)
Author:
iandunn
Message:

WordCamp Budgets: Remove redundant country fields.

ISO 3166-compliant country fields were added in r2420, and these old ones should have been removed then.

We don't need to worry about back-compat because there aren't any current requests that are missing the new fields, and the data for the old fields is still in the database if we ever need it.

Location:
sites/trunk/wordcamp.org/public_html/wp-content/plugins
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network/includes/wordcamp-budgets-dashboard.php

    r2694 r2701  
    364364        }
    365365
     366        $country_name = \WordCamp_Budgets::get_country_name(
     367            get_post_meta( $index->post_id, '_camppayments_vendor_country_iso3166', true )
     368        );
     369
    366370        $row = array(
    367371            get_wordcamp_name(),
     
    378382            get_post_meta( $index->post_id, '_camppayments_vendor_name', true ),
    379383            get_post_meta( $index->post_id, '_camppayments_vendor_contact_person', true ),
    380             get_post_meta( $index->post_id, '_camppayments_vendor_country', true ),
     384            $country_name,
    381385            \WCP_Encryption::maybe_decrypt( get_post_meta( $index->post_id, '_camppayments_payable_to', true ) ),
    382386            get_edit_post_link( $index->post_id ),
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/payment-request.php

    r2682 r2701  
    752752                case 'vendor_state':
    753753                case 'vendor_zip_code':
    754                 case 'vendor_country':
    755754                case 'vendor_contact_person':
    756755                case 'other_category_explanation':
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/wordcamp-budgets.php

    r2682 r2701  
    441441
    442442    /**
     443     * Get a country name from an alpha-2 or alpha-3 code
     444     *
     445     * @param string $country_code
     446     *
     447     * @return string
     448     */
     449    public static function get_country_name( $country_code ) {
     450        $countries = self::get_valid_countries_iso3166();
     451        $name      = '';
     452
     453        foreach ( $countries as $country ) {
     454            if ( $country_code === $country['alpha2'] || $country_code === $country['alpha3'] ) {
     455                $name = $country['name'];
     456            }
     457        }
     458
     459        return $name;
     460    }
     461
     462    /**
    443463     * Get a list of valid payment methods
    444464     *
     
    473493                case 'bank_state':
    474494                case 'bank_zip_code':
    475                 case 'bank_country':
    476495                case 'bank_bic':
    477496
     
    490509                case 'beneficiary_state':
    491510                case 'beneficiary_zip_code':
    492                 case 'beneficiary_country':
    493511
    494512                case 'payable_to':
     
    575593            'beneficiary_state',
    576594            'beneficiary_zip_code',
    577             'beneficiary_country',
    578595            'beneficiary_country_iso3166',
    579596            'ach_bank_name',
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/views/payment-request/metabox-payment.php

    r2684 r2701  
    4949            <?php $this->render_text_input( $post, 'Beneficiary’s Bank State / Province',  'bank_state' ); ?>
    5050            <?php $this->render_text_input( $post, 'Beneficiary’s Bank ZIP / Postal Code', 'bank_zip_code' ); ?>
    51             <?php $this->render_text_input( $post, 'Beneficiary’s Bank Country',           'bank_country' ); ?>
    52             <?php $this->render_country_input( $post, 'Beneficiary’s Bank Country ISO 3166', 'bank_country_iso3166' ); ?>
     51            <?php $this->render_country_input( $post, 'Beneficiary’s Bank Country',        'bank_country_iso3166' ); ?>
    5352            <?php $this->render_text_input( $post, 'Beneficiary’s Bank SWIFT BIC',         'bank_bic' ); ?>
    5453            <?php $this->render_text_input( $post, 'Beneficiary’s Account Number or IBAN', 'beneficiary_account_number' ); ?>
     
    8887            <?php $this->render_text_input( $post, 'Beneficiary’s State / Province',  'beneficiary_state' ); ?>
    8988            <?php $this->render_text_input( $post, 'Beneficiary’s ZIP / Postal Code', 'beneficiary_zip_code' ); ?>
    90             <?php $this->render_text_input( $post, 'Beneficiary’s Country',           'beneficiary_country' ); ?>
    91             <?php $this->render_country_input( $post, 'Beneficiary’s Country ISO 3166', 'beneficiary_country_iso3166' ); ?>
     89            <?php $this->render_country_input( $post, 'Beneficiary’s Country',        'beneficiary_country_iso3166' ); ?>
    9290        </table>
    9391    </div>
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/views/payment-request/metabox-vendor.php

    r2682 r2701  
    99        $this->render_text_input( $post, 'State / Province', 'vendor_state' );
    1010        $this->render_text_input( $post, 'ZIP / Postal Code', 'vendor_zip_code' );
    11         $this->render_text_input( $post, 'Country', 'vendor_country' );
    12         $this->render_country_input( $post, 'Country ISO3166', 'vendor_country_iso3166' );
     11        $this->render_country_input( $post, 'Country', 'vendor_country_iso3166' );
    1312    ?>
    1413</table>
Note: See TracChangeset for help on using the changeset viewer.