WordPress.org

Making WordPress.org

Ticket #3199: 3199.2.diff

File 3199.2.diff, 6.3 KB (added by casiepa, 18 months ago)

Changed as requested

  • wordcamp.org/public_html/wp-content/plugins/wordcamp-docs/templates/attendee-visa.php

    diff --git wordcamp.org/public_html/wp-content/plugins/wordcamp-docs/templates/attendee-visa.php wordcamp.org/public_html/wp-content/plugins/wordcamp-docs/templates/attendee-visa.php
    index 172ee7c5..a1956cda 100644
     
    44 */
    55class WordCamp_Docs_Template_Attendee_Visa implements WordCamp_Docs_Template {
    66        public function form( $data ) {
     7                $wordcamp = get_wordcamp_post();
     8                $start_date = ! empty( $wordcamp->meta['Start Date (YYYY-mm-dd)'][0] ) ? date( 'j F Y', $wordcamp->meta['Start Date (YYYY-mm-dd)'][0] ) : '';
     9                $end_date = ! empty( $wordcamp->meta['End Date (YYYY-mm-dd)'][0] ) ? date( 'j F Y', $wordcamp->meta['End Date (YYYY-mm-dd)'][0] ) : $start_date;
     10                $wc_location = ! empty( $wordcamp->meta['Location'][0] ) ? $wordcamp->meta['Location'][0] : '';
     11                $org_name = ! empty( $wordcamp->meta['Organizer Name'][0] ) ? $wordcamp->meta['Organizer Name'][0] : '';
     12                $wc_name = ! empty ( $wordcamp->post_title ) ? $wordcamp->post_title : '';
     13               
    714                $data = wp_parse_args( $data, array(
    815                        'attendee_first_name' => '',
    916                        'attendee_last_name' => '',
    1017                        'country_of_residency' => '',
    1118                        'passport_number' => '',
    1219
    13                         'wordcamp_name' => '',
    14                         'wordcamp_location' => '',
    15                         'wordcamp_date_start' => '',
    16                         'wordcamp_date_end' => '',
     20                        'wordcamp_name' => $wc_name,
     21                        'wordcamp_location' => $wc_location,
     22                        'wordcamp_date_start' => $start_date,
     23                        'wordcamp_date_end' => $end_date,
    1724
    18                         'organizer_name' => '',
     25                        'organizer_name' => $org_name,
    1926                        'organizer_contacts' => '',
    2027                ) );
    2128                ?>
    class WordCamp_Docs_Template_Attendee_Visa implements WordCamp_Docs_Template { 
    4148                        clear: both;
    4249                }
    4350                </style>
    44 
     51               
     52                <h2>Attendee Visa Letter</h2>
    4553                <div class="wcorg-docs-form">
    4654                        <label><?php _e( 'Attendee First Name:', 'wordcamporg' ); ?></label>
    4755                        <input name="attendee_first_name" value="<?php echo esc_attr( $data['attendee_first_name'] ); ?>" />
  • wordcamp.org/public_html/wp-content/plugins/wordcamp-docs/templates/speaker-visa.php

    diff --git wordcamp.org/public_html/wp-content/plugins/wordcamp-docs/templates/speaker-visa.php wordcamp.org/public_html/wp-content/plugins/wordcamp-docs/templates/speaker-visa.php
    index a8a77dea..37fea32b 100644
     
    44 */
    55class WordCamp_Docs_Template_Speaker_Visa implements WordCamp_Docs_Template {
    66        public function form( $data ) {
     7                $wordcamp = get_wordcamp_post();
     8                $start_date = ! empty( $wordcamp->meta['Start Date (YYYY-mm-dd)'][0] ) ? date( 'j F Y', $wordcamp->meta['Start Date (YYYY-mm-dd)'][0] ) : '';
     9                $end_date = ! empty( $wordcamp->meta['End Date (YYYY-mm-dd)'][0] ) ? date( 'j F Y', $wordcamp->meta['End Date (YYYY-mm-dd)'][0] ) : $start_date;
     10                $wc_location = ! empty( $wordcamp->meta['Location'][0] ) ? $wordcamp->meta['Location'][0] : '';
     11                $org_name = ! empty( $wordcamp->meta['Organizer Name'][0] ) ? $wordcamp->meta['Organizer Name'][0] : '';
     12                $wc_name = ! empty ( $wordcamp->post_title ) ? $wordcamp->post_title : '';
     13               
    714                $data = wp_parse_args( $data, array(
    8                         'attendee_first_name' => '',
    9                         'attendee_last_name' => '',
     15                        'speaker_first_name' => '',
     16                        'speaker_last_name' => '',
    1017                        'country_of_residency' => '',
    1118                        'passport_number' => '',
    1219
    13                         'wordcamp_name' => '',
    14                         'wordcamp_location' => '',
    15                         'wordcamp_date_start' => '',
    16                         'wordcamp_date_end' => '',
     20                        'wordcamp_name' => $wc_name,
     21                        'wordcamp_location' => $wc_location,
     22                        'wordcamp_date_start' => $start_date,
     23                        'wordcamp_date_end' => $end_date,
    1724
    18                         'organizer_name' => '',
     25                        'organizer_name' => $org_name,
    1926                        'organizer_contacts' => '',
    2027                ) );
    2128                ?>
    class WordCamp_Docs_Template_Speaker_Visa implements WordCamp_Docs_Template { 
    4249                }
    4350                </style>
    4451
     52                <h2>Speaker Visa Letter</h2>
    4553                <div class="wcorg-docs-form">
    4654                        <label><?php _e( 'Speaker First Name:', 'wordcamporg' ); ?></label>
    47                         <input name="attendee_first_name" value="<?php echo esc_attr( $data['attendee_first_name'] ); ?>" />
     55                        <input name="speaker_first_name" value="<?php echo esc_attr( $data['speaker_first_name'] ); ?>" />
    4856
    4957                        <label><?php _e( 'Speaker Last Name:', 'wordcamporg' ); ?></label>
    50                         <input name="attendee_last_name" value="<?php echo esc_attr( $data['attendee_last_name'] ); ?>" />
     58                        <input name="speaker_last_name" value="<?php echo esc_attr( $data['speaker_last_name'] ); ?>" />
    5159
    5260                        <label><?php _e( 'Country of Residency:', 'wordcamporg' ); ?></label>
    5361                        <input name="country_of_residency" value="<?php echo esc_attr( $data['country_of_residency'] ); ?>" />
    h2 { 
    163171
    164172                <p>To Whom It May Concern:</p>
    165173
    166                 <p>This letter is to confirm that <?php echo esc_html( $data['attendee_first_name'] ); ?> <?php echo esc_html( $data['attendee_last_name'] ); ?>
     174                <p>This letter is to confirm that <?php echo esc_html( $data['speaker_first_name'] ); ?> <?php echo esc_html( $data['speaker_last_name'] ); ?>
    167175                <?php echo esc_html( $data['country_of_residency'] ); ?> passport number <?php echo esc_html( $data['passport_number'] ); ?>,
    168176                has been invited to speak at <?php echo esc_html( $data['wordcamp_name'] ); ?>, a community-organized event focusing on WordPress
    169177                development and technology.</p>
    h2 { 
    171179                <p>WordPress is a web software you can use to create a beautiful website or blog. The core software is built by hundreds of community
    172180                volunteers. The mission of the WordPress open source project is to democratize publishing through Open Source, GPL software.</p>
    173181
    174                 <p>To fulfill speaking duties at <?php echo esc_html( $data['wordcamp_name'] ); ?>, <?php echo esc_html( $data['attendee_first_name'] ); ?>
     182                <p>To fulfill speaking duties at <?php echo esc_html( $data['wordcamp_name'] ); ?>, <?php echo esc_html( $data['speaker_first_name'] ); ?>
    175183                will need to be in <?php echo esc_html( $data['wordcamp_location'] ); ?> from <?php echo esc_html( $data['wordcamp_date_start'] ); ?>
    176184                through <?php echo esc_html( $data['wordcamp_date_end'] ); ?>.
    177185
    h2 { 
    196204        public function sanitize( $input ) {
    197205                $output = array();
    198206                foreach ( array(
    199                         'attendee_first_name',
    200                         'attendee_last_name',
     207                        'speaker_first_name',
     208                        'speaker_last_name',
    201209                        'country_of_residency',
    202210                        'passport_number',
    203211                        'wordcamp_name',