Making WordPress.org

Changeset 7607


Ignore:
Timestamp:
08/13/2018 11:52:14 AM (8 years ago)
Author:
vedjain
Message:

WordCamp: Support Meetup Applications and review in central.

Major refactor to WordCamp post types, to extract out code which is then used in Meetup post types and application. This code is not 5.x compatible.
Eventually, the aim is to credit contributors for their work organizing meetup groups in the WordPress chapter program, and make use of existing administrative tools to meetup applications/groups.

This is the (Non exhaustive) test plan after this commit is deployed:

  • Existing WordCamp schedule
  • WordCamp organizer application render.
  • Submit WordCamp application. Fill all fields and make sure they exists in app.
  • Verify original application.
  • Verify protected fields.
  • Verify REST API responses for wordcamp posts (#)
  • Status mapping, and transition to valid next statuses.
  • Move application from Needs Vetting to Needs Site. Add private notes.
  • Track and verify application status page.
  • Create a site for wordcamp

Test plan for Meetups

  • Submit meetup applications. Fill all fields and make sure they are saved.
  • Change application status. Add and remove meta box fields to make sure they are saved.
Location:
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt
Files:
16 added
3 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/views/applications/wordcamp/shortcode-application.php

    r6651 r7607  
    44defined( 'WPINC' ) or die();
    55
    6 // Modified from https://wordcampcentral.polldaddy.com/s/wordcamp-organizer-application
    7 
    8 ?>
    9 
    10 <form id="wordcamp-application" method="post">
    11         <div class="PDF_pageOuter">
    12                 <div class="PDF_pageInner">
    13                         <div class="PDF_question" id="pd-question-10000">
    14                                 <div class="qContent">
    15                                         <div class="PDF_QT1900">
    16                                                 <h2>Part I: About You</h2>
    17                                         </div>
    18                                 </div>
    19                         </div>
    20 
    21                         <div class="PDF_questionDivide" id="pd-divider-10000"></div>
    22 
    23                         <div class="PDF_question" id="pd-question-1">
    24                                 <div class="qNumber">
    25                                         Q.1
    26                                 </div>
    27 
    28                                 <div class="qContent">
    29                                         <div class="qText">
    30                                                 Please enter your name.
    31                                                 <span class="PDF_mand">*</span>
    32                                         </div>
    33 
    34                                         <div class="PDF_QT800">
    35                                                 <div>
    36                                                         <label for="q_1079074_first_name">First Name</label>
    37                                                         <br />
    38                                                         <input type="text" class="firstName" maxlength="50" name="q_1079074_first_name" id="q_1079074_first_name" value="" required />
    39                                                 </div>
    40 
    41                                                 <div>
    42                                                         <label for="q_1079074_last_name">Last Name</label>
    43                                                         <br />
    44                                                         <input type="text" class="lastName" maxlength="50" name="q_1079074_last_name" id="q_1079074_last_name" value="" required />
    45                                                 </div>
    46                                         </div>
    47                                 </div>
    48                         </div>
    49 
    50                         <div class="PDF_questionDivide" id="pd-divider-1"></div>
    51 
    52                         <div class="PDF_question" id="pd-question-2">
    53                                 <div class="qNumber">
    54                                         Q.2
    55                                 </div>
    56 
    57                                 <div class="qContent">
    58                                         <div class="qText">
    59                                                 Please enter your email address.
    60                                                 <span class="PDF_mand">*</span>
    61                                         </div>
    62 
    63                                         <div class="PDF_QT1400">
    64                                                 <label for="q_1079059_email">(e.g. john@example.com)</label>
    65                                                 <br />
    66                                                 <input type="email" maxlength="100" name="q_1079059_email" id="q_1079059_email" value="" class="survey-email required" autocomplete="off" required />
    67                                         </div>
    68                                 </div>
    69                         </div>
    70 
    71                         <div class="PDF_questionDivide" id="pd-divider-2"></div>
    72 
    73                         <div class="PDF_question" id="pd-question-31">
    74                                 <div class="qNumber">
    75                                         Q.31
    76                                 </div>
    77 
    78                                 <div class="qContent">
    79                                         <div class="qText">
    80                                                 What is your wordpress.org username?
    81                                                 <span class="PDF_mand">*</span>
    82                                         </div>
    83 
    84                                         <div class="qNote">
    85                                                 <p>(This is the username you'd use to log in to http://wordpress.org/support/)</p>
    86                                         </div>
    87 
    88                                         <div class="PDF_QT100">
    89                                                 <input value="" maxlength="500" name="q_4236565_wporg_username" class="large required" type="text" title="What is your wordpress.org username?" required />
    90                                         </div>
    91                                 </div>
    92                         </div>
    93 
    94                         <div class="PDF_questionDivide" id="pd-divider-31"></div>
    95 
    96                         <div class="PDF_question" id="pd-question-34">
    97                                 <div class="qNumber">
    98                                         Q.34
    99                                 </div>
    100 
    101                                 <div class="qContent">
    102                                         <div class="qText">
    103                                                 What is your username on <a href="https://chat.wordpress.org" target="_blank">WordPress' Slack workspace</a>?
    104                                         </div>
    105 
    106                                         <div class="PDF_QT100">
    107                                                 <input value="" maxlength="500" name="q_4236565_slack_username" class="large" type="text" title="What is your Slack username?" />
    108                                         </div>
    109                                 </div>
    110                         </div>
    111 
    112                         <div class="PDF_questionDivide"></div>
    113 
    114                         <div class="PDF_question">
    115                                 <div class="qContent">
    116                                         <div class="qText">
    117                                                 Where can we find you online?
    118                                         </div>
    119 
    120                                         <div class="PDF_QT100">
    121                                                 <input value="" maxlength="500" name="where_find_online" class="large" type="text" title="Where can we find you online?" />
    122                                         </div>
    123                                 </div>
    124                         </div>
    125 
    126                         <div class="PDF_questionDivide" id="pd-divider-34"></div>
    127 
    128                         <div class="PDF_question" id="pd-question-3">
    129                                 <div class="qNumber">
    130                                         Q.3
    131                                 </div>
    132 
    133                                 <div class="qContent">
    134                                         <div class="qText">
    135                                                 Please enter your mailing address (at least your city/state or city/country).
    136                                         </div>
    137 
    138                                         <div class="PDF_QT900">
    139                                                 <div>
    140                                                         <label for="q_1079060_add1">Address Line 1</label>
    141                                                         <br />
    142                                                         <input type="text" maxlength="100" class="a" name="q_1079060_add1" id="q_1079060_add1" value="" />
    143                                                 </div>
    144 
    145                                                 <div>
    146                                                         <label for="q_1079060_add2">Address Line 2</label>
    147                                                         <br />
    148                                                         <input type="text" maxlength="100" class="b" name="q_1079060_add2" id="q_1079060_add2" value="" />
    149                                                 </div>
    150 
    151                                                 <div>
    152                                                         <label for="q_1079060_city">City</label>
    153                                                         <br />
    154                                                         <input type="text" maxlength="50" class="c" name="q_1079060_city" id="q_1079060_city" value="" />
    155                                                 </div>
    156 
    157                                                 <div>
    158                                                         <label for="q_1079060_state">State</label>
    159                                                         <br />
    160                                                         <input type="text" maxlength="50" class="d" name="q_1079060_state" id="q_1079060_state" value="" />
    161                                                 </div>
    162 
    163                                                 <div>
    164                                                         <label for="q_1079060_zip">Zip Code</label>
    165                                                         <br />
    166                                                         <input type="text" maxlength="20" class="e" name="q_1079060_zip" id="q_1079060_zip" value="" />
    167                                                 </div>
    168 
    169                                                 <div>
    170                                                         <label for="q_1079060_country">Country</label>
    171                                                         <br />
    172 
    173                                                         <select name="q_1079060_country" id="q_1079060_country">
    174                                                                 <option value=""></option>
    175 
    176                                                                 <?php foreach ( $countries as $country ) : ?>
    177                                                                         <option value="<?php echo esc_attr( $country['alpha2'] ); ?>">
    178                                                                                 <?php echo esc_html( $country['name'] ); ?>
    179                                                                         </option>
    180                                                                 <?php endforeach; ?>
    181                                                         </select>
    182                                                 </div>
    183                                         </div>
    184                                 </div>
    185                         </div>
    186 
    187                         <div class="PDF_questionDivide" id="pd-divider-3"></div>
    188 
    189                         <div class="PDF_question" id="pd-question-4">
    190                                 <div class="qNumber">
    191                                         Q.4
    192                                 </div>
    193 
    194                                 <div class="qContent">
    195                                         <div class="qText">
    196                                                 How long have you been using WordPress?
    197                                         </div>
    198 
    199                                         <div class="PDF_QT400">
    200                                                 <ul>
    201                                                         <li>
    202                                                                 <input type="radio" name="q_1045947_years_using_wp" value="7+ years" id="q_1045947_1865361" />
    203 
    204                                                                 <label for="q_1045947_1865361" value="1865361">
    205                                                                         7+ years </label>
    206                                                         </li>
    207                                                         <li>
    208                                                                 <input type="radio" name="q_1045947_years_using_wp" value="6 years" id="q_1045947_1865362" />
    209 
    210                                                                 <label for="q_1045947_1865362" value="1865362">
    211                                                                         6 years </label>
    212                                                         </li>
    213                                                         <li>
    214                                                                 <input type="radio" name="q_1045947_years_using_wp" value="5 years" id="q_1045947_1865363" />
    215 
    216                                                                 <label for="q_1045947_1865363" value="1865363">
    217                                                                         5 years </label>
    218                                                         </li>
    219                                                         <li>
    220                                                                 <input type="radio" name="q_1045947_years_using_wp" value="4 years" id="q_1045947_1865369" />
    221 
    222                                                                 <label for="q_1045947_1865369" value="1865369">
    223                                                                         4 years </label>
    224                                                         </li>
    225                                                         <li>
    226                                                                 <input type="radio" name="q_1045947_years_using_wp" value="3 years" id="q_1045947_1865370" />
    227 
    228                                                                 <label for="q_1045947_1865370" value="1865370">
    229                                                                         3 years </label>
    230                                                         </li>
    231                                                         <li>
    232                                                                 <input type="radio" name="q_1045947_years_using_wp" value="2 years" id="q_1045947_1865371" />
    233 
    234                                                                 <label for="q_1045947_1865371" value="1865371">
    235                                                                         2 years </label>
    236                                                         </li>
    237                                                         <li>
    238                                                                 <input type="radio" name="q_1045947_years_using_wp" value="1 year" id="q_1045947_1865372" />
    239 
    240                                                                 <label for="q_1045947_1865372" value="1865372">
    241                                                                         1 year </label>
    242                                                         </li>
    243                                                         <li>
    244                                                                 <input type="radio" name="q_1045947_years_using_wp" value="less than a year" id="q_1045947_1865373" />
    245 
    246                                                                 <label for="q_1045947_1865373" value="1865373">
    247                                                                         Less than a year </label>
    248                                                         </li>
    249                                                         <li>
    250                                                                 <input type="radio" name="q_1045947_years_using_wp" value="I don't use WordPress yet" id="q_1045947_1865374" />
    251 
    252                                                                 <label for="q_1045947_1865374" value="1865374">
    253                                                                         I don't use WordPress yet </label>
    254                                                         </li>
    255                                                 </ul>
    256                                         </div>
    257                                 </div>
    258                         </div>
    259 
    260                         <div class="PDF_questionDivide" id="pd-divider-4"></div>
    261 
    262                         <div class="PDF_question" id="pd-question-5">
    263                                 <div class="qNumber">
    264                                         Q.5
    265                                 </div>
    266 
    267                                 <div class="qContent">
    268                                         <div class="qText">
    269                                                 How have you been involved in the WordPress community so far?
    270                                         </div>
    271 
    272                                         <div class="PDF_QT400">
    273                                                 <ul>
    274                                                         <li>
    275                                                                 <input type="checkbox" name="q_1068246_ways_involved[]" id="q_1068246_1908777" value="I use WordPress for my website(s)" />
    276 
    277                                                                 <label for="q_1068246_1908777">I use WordPress for my website(s)</label>
    278                                                         </li>
    279                                                         <li>
    280                                                                 <input type="checkbox" name="q_1068246_ways_involved[]" id="q_1068246_1908778" value="I help other people use WordPress for their websites" />
    281 
    282                                                                 <label for="q_1068246_1908778">I help other people use WordPress for their websites</label>
    283                                                         </li>
    284                                                         <li>
    285                                                                 <input type="checkbox" name="q_1068246_ways_involved[]" id="q_1068246_1908779" value="I make plugins" />
    286 
    287                                                                 <label for="q_1068246_1908779">I make plugins</label>
    288                                                         </li>
    289                                                         <li>
    290                                                                 <input type="checkbox" name="q_1068246_ways_involved[]" id="q_1068246_1908831" value="I make themes" />
    291 
    292                                                                 <label for="q_1068246_1908831">I make themes</label>
    293                                                         </li>
    294                                                         <li>
    295                                                                 <input type="checkbox" name="q_1068246_ways_involved[]" id="q_1068246_1908832" value="I contribute to the WordPress core codebase" />
    296 
    297                                                                 <label for="q_1068246_1908832">I contribute to the WordPress core codebase</label>
    298                                                         </li>
    299                                                         <li>
    300                                                                 <input type="checkbox" name="q_1068246_ways_involved[]" id="q_1068246_1908833" value="I volunteer in the support forums at wordpress.org" />
    301 
    302                                                                 <label for="q_1068246_1908833">I volunteer in the support forums at wordpress.org</label>
    303                                                         </li>
    304                                                         <li>
    305                                                                 <input type="checkbox" name="q_1068246_ways_involved[]" id="q_1068246_1908834" value="I contribute to the WordPress core UI group" />
    306 
    307                                                                 <label for="q_1068246_1908834">I contribute to the WordPress core UI group</label>
    308                                                         </li>
    309                                                         <li>
    310                                                                 <input type="checkbox" name="q_1068246_ways_involved[]" id="q_1068246_1908835" value="I'm involved with local WordPress meetups" />
    311 
    312                                                                 <label for="q_1068246_1908835">I'm involved with local WordPress meetups</label>
    313                                                         </li>
    314                                                         <li>
    315                                                                 <input type="checkbox" name="q_1068246_ways_involved[]" id="q_1068246_1908836" value="I've been involved with previous WordCamps" />
    316 
    317                                                                 <label for="q_1068246_1908836">I've been involved with previous WordCamps</label>
    318                                                         </li>
    319                                                         <li>
    320                                                                 <input type="checkbox" name="q_1068246_ways_involved[]" id="q_1068246_1926765" value="WordPress helps me make a living" />
    321 
    322                                                                 <label for="q_1068246_1926765">WordPress helps me make a living</label>
    323                                                         </li>
    324 
    325                                                         <li>
    326                                                                 <label for="q_1068246_other">Other:</label>
    327 
    328                                                                 <input type="text" class="other" name="q_1068246_ways_involved_other" id="q_1068246_other" value="" style="width: 75%" />
    329                                                         </li>
    330                                                 </ul>
    331                                         </div>
    332                                 </div>
    333                         </div>
    334 
    335                         <div class="PDF_questionDivide" id="pd-divider-5"></div>
    336 
    337                         <div class="PDF_question" id="pd-question-6">
    338                                 <div class="qNumber">
    339                                         Q.6
    340                                 </div>
    341 
    342                                 <div class="qContent">
    343                                         <div class="qText">
    344                                                 Have you ever attended a WordCamp before?
    345                                         </div>
    346 
    347                                         <div class="PDF_QT400">
    348                                                 <ul>
    349                                                         <li>
    350                                                                 <input type="radio" name="q_1046032_attended_camp_before" value="Yes, more than one" id="q_1046032_1865479" />
    351 
    352                                                                 <label for="q_1046032_1865479" value="1865479">
    353                                                                         Yes, more than one </label>
    354                                                         </li>
    355                                                         <li>
    356                                                                 <input type="radio" name="q_1046032_attended_camp_before" value="Yes, I've been to one" id="q_1046032_1865480" />
    357 
    358                                                                 <label for="q_1046032_1865480" value="1865480">
    359                                                                         Yes, I've been to one </label>
    360                                                         </li>
    361                                                         <li>
    362                                                                 <input type="radio" name="q_1046032_attended_camp_before" value="No, I haven't been to a WordCamp yet" id="q_1046032_1865481" />
    363 
    364                                                                 <label for="q_1046032_1865481" value="1865481">
    365                                                                         No, I haven't been to a WordCamp yet </label>
    366                                                         </li>
    367                                                 </ul>
    368 
    369                                         </div>
    370                                 </div>
    371                         </div>
    372 
    373                         <div class="PDF_questionDivide" id="pd-divider-6"></div>
    374 
    375                         <div class="PDF_question" id="pd-question-7">
    376                                 <div class="qNumber">
    377                                         Q.7
    378                                 </div>
    379 
    380                                 <div class="qContent">
    381                                         <div class="qText">
    382                                                 What WordCamps have you been to? Please list one per line in this format: City, Year (ex. San Francisco, 2010)
    383                                         </div>
    384 
    385                                         <div class="PDF_QT200">
    386                                                 <textarea name="q_1046033_camps_been_to" class="small" rows="10" cols="40" title="What WordCamps have you been to? Please list one pe&hellip;"></textarea>
    387                                         </div>
    388                                 </div>
    389                         </div>
    390 
    391                         <div class="PDF_questionDivide" id="pd-divider-7"></div>
    392 
    393                         <div class="PDF_question" id="pd-question-8">
    394                                 <div class="qNumber">
    395                                         Q.8
    396                                 </div>
    397 
    398                                 <div class="qContent">
    399                                         <div class="qText">
    400                                                 What do you hope to accomplish by organizing a WordCamp?
    401                                         </div>
    402 
    403                                         <div class="PDF_QT400">
    404                                                 <ul>
    405                                                         <li>
    406                                                                 <input type="checkbox" name="q_1068223_hope_to_accomplish[]" id="q_1068223_1908730" value="Grow my local WordPress community" />
    407 
    408                                                                 <label for="q_1068223_1908730">Grow my local WordPress community</label>
    409                                                         </li>
    410                                                         <li>
    411                                                                 <input type="checkbox" name="q_1068223_hope_to_accomplish[]" id="q_1068223_1908731" value="Introduce new people to WordPress/teach new users" />
    412 
    413                                                                 <label for="q_1068223_1908731">Introduce new people to WordPress/teach new users</label>
    414                                                         </li>
    415                                                         <li>
    416                                                                 <input type="checkbox" name="q_1068223_hope_to_accomplish[]" id="q_1068223_1908732" value="Find collaborators for WordPress projects" />
    417 
    418                                                                 <label for="q_1068223_1908732">Find collaborators for WordPress projects</label>
    419                                                         </li>
    420                                                         <li>
    421                                                                 <input type="checkbox" name="q_1068223_hope_to_accomplish[]" id="q_1068223_1908771" value="Raise my visibility in the community" />
    422 
    423                                                                 <label for="q_1068223_1908771">Raise my visibility in the community</label>
    424                                                         </li>
    425                                                         <li>
    426                                                                 <input type="checkbox" name="q_1068223_hope_to_accomplish[]" id="q_1068223_1908772" value="Make connections with visiting speakers (like Matt Mullenweg)" />
    427 
    428                                                                 <label for="q_1068223_1908772">Make connections with visiting speakers (like Matt Mullenweg)</label>
    429                                                         </li>
    430                                                         <li>
    431                                                                 <input type="checkbox" name="q_1068223_hope_to_accomplish[]" id="q_1068223_1908773" value="Make money from surplus ticket sales/sponsorships" />
    432 
    433                                                                 <label for="q_1068223_1908773">Make money from surplus ticket sales/sponsorships</label>
    434                                                         </li>
    435                                                         <li>
    436                                                                 <input type="checkbox" name="q_1068223_hope_to_accomplish[]" id="q_1068223_1908774" value="Have fun/throw a good party" />
    437 
    438                                                                 <label for="q_1068223_1908774">Have fun/throw a good party</label>
    439                                                         </li>
    440                                                         <li>
    441                                                                 <input type="checkbox" name="q_1068223_hope_to_accomplish[]" id="q_1068223_1908775" value="Be part of the zeitgeist, as WordCamps are very popular right now" />
    442 
    443                                                                 <label for="q_1068223_1908775">Be part of the zeitgeist, as WordCamps are very popular right now</label>
    444                                                         </li>
    445                                                         <li>
    446                                                                 <input type="checkbox" name="q_1068223_hope_to_accomplish[]" id="q_1068223_1908776" value="Inspire people to do more with WordPress" />
    447 
    448                                                                 <label for="q_1068223_1908776">Inspire people to do more with WordPress</label>
    449                                                         </li>
    450 
    451                                                         <li>
    452                                                                 <label for="q_1068223_other">Other:</label>
    453 
    454                                                                 <input type="text" class="other" name="q_1068223_hope_to_accomplish_other" id="q_1068223_other" value="" style="width: 75%" />
    455                                                         </li>
    456                                                 </ul>
    457                                         </div>
    458                                 </div>
    459                         </div>
    460 
    461                         <div class="PDF_questionDivide" id="pd-divider-8"></div>
    462 
    463                         <div class="PDF_question" id="pd-question-10001">
    464                                 <div class="qContent">
    465                                         <div class="PDF_QT1900">
    466                                                 <h2>Part II: About Your Local Community</h2>
    467                                         </div>
    468                                 </div>
    469                         </div>
    470 
    471                         <div class="PDF_questionDivide" id="pd-divider-10001"></div>
    472 
    473                         <div class="PDF_question" id="pd-question-9">
    474                                 <div class="qNumber">
    475                                         Q.9
    476                                 </div>
    477 
    478                                 <div class="qContent">
    479                                         <div class="qText">
    480                                                 Is there an active WordPress meetup in your area?
    481                                         </div>
    482 
    483                                         <div class="PDF_QT400">
    484                                                 <ul>
    485                                                         <li>
    486                                                                 <input type="radio" name="q_1045950_active_meetup" value="Yes" id="q_1045950_1865375" />
    487 
    488                                                                 <label for="q_1045950_1865375" value="1865375">
    489                                                                         Yes </label>
    490                                                         </li>
    491                                                         <li>
    492                                                                 <input type="radio" name="q_1045950_active_meetup" value="No" id="q_1045950_1865376" />
    493 
    494                                                                 <label for="q_1045950_1865376" value="1865376">
    495                                                                         No </label>
    496                                                         </li>
    497                                                         <li>
    498                                                                 <input type="radio" name="q_1045950_active_meetup" value="I don't know" id="q_1045950_1865377" />
    499 
    500                                                                 <label for="q_1045950_1865377" value="1865377">
    501                                                                         I don't know </label>
    502                                                         </li>
    503                                                 </ul>
    504                                         </div>
    505                                 </div>
    506                         </div>
    507 
    508                         <div class="PDF_questionDivide" id="pd-divider-9"></div>
    509 
    510                         <div class="PDF_question" id="pd-question-10">
    511                                 <div class="qNumber">
    512                                         Q.10
    513                                 </div>
    514 
    515                                 <div class="qContent">
    516                                         <div class="qText">
    517                                                 What is your role in the meetup group?
    518                                         </div>
    519 
    520                                         <div class="PDF_QT400">
    521                                                 <ul>
    522                                                         <li>
    523                                                                 <input type="radio" name="q_1045953_role_in_meetup" value="I am the organizer" id="q_1045953_1865378" />
    524 
    525                                                                 <label for="q_1045953_1865378" value="1865378">
    526                                                                         I am the organizer </label>
    527                                                         </li>
    528                                                         <li>
    529                                                                 <input type="radio" name="q_1045953_role_in_meetup" value="I am a regular attendee and presenter" id="q_1045953_1865379" />
    530 
    531                                                                 <label for="q_1045953_1865379" value="1865379">
    532                                                                         I am a regular attendee and presenter </label>
    533                                                         </li>
    534                                                         <li>
    535                                                                 <input type="radio" name="q_1045953_role_in_meetup" value="I attend regularly but don't present" id="q_1045953_1865380" />
    536 
    537                                                                 <label for="q_1045953_1865380" value="1865380">
    538                                                                         I attend regularly but don't present </label>
    539                                                         </li>
    540                                                         <li>
    541                                                                 <input type="radio" name="q_1045953_role_in_meetup" value="I attend sometimes" id="q_1045953_1865381" />
    542 
    543                                                                 <label for="q_1045953_1865381" value="1865381">
    544                                                                         I attend sometimes </label>
    545                                                         </li>
    546                                                         <li>
    547                                                                 <input type="radio" name="q_1045953_role_in_meetup" value="I attend rarely" id="q_1045953_1865382" />
    548 
    549                                                                 <label for="q_1045953_1865382" value="1865382">
    550                                                                         I attend rarely </label>
    551                                                         </li>
    552                                                         <li>
    553                                                                 <input type="radio" name="q_1045953_role_in_meetup" value="I do not attend the meetups" id="q_1045953_1865383" />
    554 
    555                                                                 <label for="q_1045953_1865383" value="1865383">
    556                                                                         I do not attend the meetups </label>
    557                                                         </li>
    558                                                 </ul>
    559                                         </div>
    560                                 </div>
    561                         </div>
    562 
    563                         <div class="PDF_questionDivide" id="pd-divider-10"></div>
    564 
    565                         <div class="PDF_question" id="pd-question-11">
    566                                 <div class="qNumber">
    567                                         Q.11
    568                                 </div>
    569 
    570                                 <div class="qContent">
    571                                         <div class="qText">
    572                                                 What is the URL for the meetup group&#039;s website?
    573                                         </div>
    574 
    575                                         <div class="PDF_QT100">
    576                                                 <input value="" maxlength="500" name="q_1045972_meetup_url" class="large" type="url" title="What is the URL for the meetup group&#039;s website?" />
    577                                         </div>
    578                                 </div>
    579                         </div>
    580 
    581                         <div class="PDF_questionDivide" id="pd-divider-11"></div>
    582 
    583                         <div class="PDF_question" id="pd-question-12">
    584                                 <div class="qNumber">
    585                                         Q.12
    586                                 </div>
    587 
    588                                 <div class="qContent">
    589                                         <div class="qText">
    590                                                 About how many members are there?
    591                                         </div>
    592 
    593                                         <div class="PDF_QT400">
    594                                                 <ul>
    595                                                         <li>
    596                                                                 <input type="radio" name="q_1045967_meetup_members" value="500+" id="q_1045967_1865388" />
    597 
    598                                                                 <label for="q_1045967_1865388" value="1865388">
    599                                                                         500+ </label>
    600                                                         </li>
    601                                                         <li>
    602                                                                 <input type="radio" name="q_1045967_meetup_members" value="300-499" id="q_1045967_1865389" />
    603 
    604                                                                 <label for="q_1045967_1865389" value="1865389">
    605                                                                         300-499 </label>
    606                                                         </li>
    607                                                         <li>
    608                                                                 <input type="radio" name="q_1045967_meetup_members" value="100-299" id="q_1045967_1865390" />
    609 
    610                                                                 <label for="q_1045967_1865390" value="1865390">
    611                                                                         100-299 </label>
    612                                                         </li>
    613                                                         <li>
    614                                                                 <input type="radio" name="q_1045967_meetup_members" value="50-99" id="q_1045967_1865391" />
    615 
    616                                                                 <label for="q_1045967_1865391" value="1865391">
    617                                                                         50-99 </label>
    618                                                         </li>
    619                                                         <li>
    620                                                                 <input type="radio" name="q_1045967_meetup_members" value="26-49" id="q_1045967_1865392" />
    621 
    622                                                                 <label for="q_1045967_1865392" value="1865392">
    623                                                                         26-49 </label>
    624                                                         </li>
    625                                                         <li>
    626                                                                 <input type="radio" name="q_1045967_meetup_members" value="1-25" id="q_1045967_1865393" />
    627 
    628                                                                 <label for="q_1045967_1865393" value="1865393">
    629                                                                         1-25 </label>
    630                                                         </li>
    631                                                         <li>
    632                                                                 <input type="radio" name="q_1045967_meetup_members" value="I don't know" id="q_1045967_1926755" />
    633 
    634                                                                 <label for="q_1045967_1926755" value="1926755">
    635                                                                         I don't know </label>
    636                                                         </li>
    637                                                 </ul>
    638                                         </div>
    639                                 </div>
    640                         </div>
    641 
    642                         <div class="PDF_questionDivide" id="pd-divider-12"></div>
    643 
    644                         <div class="PDF_question" id="pd-question-13">
    645                                 <div class="qNumber">
    646                                         Q.13
    647                                 </div>
    648 
    649                                 <div class="qContent">
    650                                         <div class="qText">
    651                                                 How often does the group have meetups?
    652                                         </div>
    653 
    654                                         <div class="PDF_QT400">
    655                                                 <ul>
    656                                                         <li>
    657                                                                 <input type="radio" name="q_1045956_how_often_meetup" value="Once per month" id="q_1045956_1865384" />
    658 
    659                                                                 <label for="q_1045956_1865384" value="1865384">
    660                                                                         Once per month </label>
    661                                                         </li>
    662                                                         <li>
    663                                                                 <input type="radio" name="q_1045956_how_often_meetup" value="Several per month" id="q_1045956_1865385" />
    664 
    665                                                                 <label for="q_1045956_1865385" value="1865385">
    666                                                                         Several per month </label>
    667                                                         </li>
    668                                                         <li>
    669                                                                 <input type="radio" name="q_1045956_how_often_meetup" value="One every couple of months" id="q_1045956_1865386" />
    670 
    671                                                                 <label for="q_1045956_1865386" value="1865386">
    672                                                                         One every couple of months </label>
    673                                                         </li>
    674                                                         <li>
    675                                                                 <input type="radio" name="q_1045956_how_often_meetup" value="There's a group but it never meets" id="q_1045956_1865387" />
    676 
    677                                                                 <label for="q_1045956_1865387" value="1865387">
    678                                                                         There's a group but it never meets </label>
    679                                                         </li>
    680                                                 </ul>
    681                                         </div>
    682                                 </div>
    683                         </div>
    684 
    685                         <div class="PDF_questionDivide" id="pd-divider-13"></div>
    686 
    687                         <div class="PDF_question" id="pd-question-14">
    688                                 <div class="qNumber">
    689                                         Q.14
    690                                 </div>
    691 
    692                                 <div class="qContent">
    693                                         <div class="qText">
    694                                                 About how many people usually attend the meetups?
    695                                         </div>
    696 
    697                                         <div class="PDF_QT400">
    698                                                 <ul>
    699                                                         <li>
    700                                                                 <input type="radio" name="q_1045971_how_many_attend" value="500+" id="q_1045971_1865397" />
    701 
    702                                                                 <label for="q_1045971_1865397" value="1865397">
    703                                                                         500+ </label>
    704                                                         </li>
    705                                                         <li>
    706                                                                 <input type="radio" name="q_1045971_how_many_attend" value="300-499" id="q_1045971_1865398" />
    707 
    708                                                                 <label for="q_1045971_1865398" value="1865398">
    709                                                                         300-499 </label>
    710                                                         </li>
    711                                                         <li>
    712                                                                 <input type="radio" name="q_1045971_how_many_attend" value="100-299" id="q_1045971_1865399" />
    713 
    714                                                                 <label for="q_1045971_1865399" value="1865399">
    715                                                                         100-299 </label>
    716                                                         </li>
    717                                                         <li>
    718                                                                 <input type="radio" name="q_1045971_how_many_attend" value="50-99" id="q_1045971_1865400" />
    719 
    720                                                                 <label for="q_1045971_1865400" value="1865400">
    721                                                                         50-99 </label>
    722                                                         </li>
    723                                                         <li>
    724                                                                 <input type="radio" name="q_1045971_how_many_attend" value="26-49" id="q_1045971_1865401" />
    725 
    726                                                                 <label for="q_1045971_1865401" value="1865401">
    727                                                                         26-49 </label>
    728                                                         </li>
    729                                                         <li>
    730                                                                 <input type="radio" name="q_1045971_how_many_attend" value="1-25" id="q_1045971_1865402" />
    731 
    732                                                                 <label for="q_1045971_1865402" value="1865402">
    733                                                                         1-25 </label>
    734                                                         </li>
    735                                                 </ul>
    736                                         </div>
    737                                 </div>
    738                         </div>
    739 
    740                         <div class="PDF_questionDivide" id="pd-divider-14"></div>
    741 
    742                         <div class="PDF_question" id="pd-question-15">
    743                                 <div class="qNumber">
    744                                         Q.15
    745                                 </div>
    746 
    747                                 <div class="qContent">
    748                                         <div class="qText">
    749                                                 Have other community tech events (BarCamp, meetups, open source conferences) been successful in your city?
    750                                         </div>
    751 
    752                                         <div class="PDF_QT400">
    753                                                 <ul>
    754                                                         <li>
    755                                                                 <input type="radio" name="q_1079086_other_tech_events" value="Yes, and I've attended some of them" id="q_1079086_1926723" />
    756 
    757                                                                 <label for="q_1079086_1926723" value="1926723">
    758                                                                         Yes, and I've attended some of them </label>
    759                                                         </li>
    760                                                         <li>
    761                                                                 <input type="radio" name="q_1079086_other_tech_events" value="Yes, though I haven't attended any" id="q_1079086_1926724" />
    762 
    763                                                                 <label for="q_1079086_1926724" value="1926724">
    764                                                                         Yes, though I haven't attended any </label>
    765                                                         </li>
    766                                                         <li>
    767                                                                 <input type="radio" name="q_1079086_other_tech_events" value="No, we've had a few but they weren't very well-attended" id="q_1079086_1926725" />
    768 
    769                                                                 <label for="q_1079086_1926725" value="1926725">
    770                                                                         No, we've had a few but they weren't very well-attended </label>
    771                                                         </li>
    772                                                         <li>
    773                                                                 <input type="radio" name="q_1079086_other_tech_events" value="We haven't had any community tech events yet" id="q_1079086_1926744" />
    774 
    775                                                                 <label for="q_1079086_1926744" value="1926744">
    776                                                                         We haven't had any community tech events yet </label>
    777                                                         </li>
    778                                                         <li>
    779                                                                 <input type="radio" name="q_1079086_other_tech_events" value="I am not sure what events have been held here before, or if they've been successful" id="q_1079086_1926745" />
    780 
    781                                                                 <label for="q_1079086_1926745" value="1926745">
    782                                                                         I am not sure what events have been held here before, or if they've been successful </label>
    783                                                         </li>
    784                                                 </ul>
    785                                         </div>
    786                                 </div>
    787                         </div>
    788 
    789                         <div class="PDF_questionDivide" id="pd-divider-15"></div>
    790 
    791                         <div class="PDF_question" id="pd-question-16">
    792                                 <div class="qNumber">
    793                                         Q.16
    794                                 </div>
    795 
    796                                 <div class="qContent">
    797                                         <div class="qText">
    798                                                 List any community tech events that have/have not been successful in your city.
    799                                         </div>
    800 
    801                                         <div class="PDF_QT200">
    802                                                 <textarea name="q_1079082_other_tech_events_success" class="small" rows="10" cols="40" title="List any community tech events that have/have not b&hellip;"></textarea>
    803                                         </div>
    804                                 </div>
    805                         </div>
    806 
    807                         <div class="PDF_questionDivide" id="pd-divider-16"></div>
    808 
    809                         <div class="PDF_question" id="pd-question-10002">
    810                                 <div class="qContent">
    811                                         <div class="PDF_QT1900">
    812                                                 <h2>Part III: About Your Potential WordCamp</h2>
    813                                         </div>
    814                                 </div>
    815                         </div>
    816 
    817                         <div class="PDF_questionDivide" id="pd-divider-10002"></div>
    818 
    819                         <div class="PDF_question" id="pd-question-17">
    820                                 <div class="qNumber">
    821                                         Q.17
    822                                 </div>
    823 
    824                                 <div class="qContent">
    825                                         <div class="qText">
    826                                                 Enter the city, state/province, and country where you would like to organize a WordCamp.
    827                                                 <span class="PDF_mand">*</span>
    828                                         </div>
    829 
    830                                         <div class="PDF_QT100">
    831                                                 <input value="" maxlength="500" name="q_1079103_wordcamp_location" class="large required" type="text" title="Enter the city, state/province, and country where y&hellip;" required />
    832                                         </div>
    833                                 </div>
    834                         </div>
    835 
    836                         <div class="PDF_questionDivide" id="pd-divider-17"></div>
    837 
    838                         <div class="PDF_question" id="pd-question-18">
    839                                 <div class="qNumber">
    840                                         Q.18
    841                                 </div>
    842 
    843                                 <div class="qContent">
    844                                         <div class="qText">
    845                                                 When do you want to have a WordCamp in your city? (month/year)
    846                                         </div>
    847 
    848                                         <div class="PDF_QT100">
    849                                                 <input value="" maxlength="500" name="q_1046006_wordcamp_date" class="large" type="text" title="When do you want to have a WordCamp in your city? (&hellip;" />
    850                                         </div>
    851                                 </div>
    852                         </div>
    853 
    854                         <div class="PDF_questionDivide" id="pd-divider-18"></div>
    855 
    856                         <div class="PDF_question" id="pd-question-19">
    857                                 <div class="qNumber">
    858                                         Q.19
    859                                 </div>
    860 
    861                                 <div class="qContent">
    862                                         <div class="qText">
    863                                                 How many people do you think would attend?
    864                                         </div>
    865 
    866                                         <div class="PDF_QT100">
    867                                                 <input value="" maxlength="500" name="q_1046007_how_many_attendees" class="large" type="text" title="How many people do you think would attend?" />
    868                                         </div>
    869                                 </div>
    870                         </div>
    871 
    872                         <div class="PDF_questionDivide" id="pd-divider-19"></div>
    873 
    874                         <div class="PDF_question" id="pd-question-20">
    875                                 <div class="qNumber">
    876                                         Q.20
    877                                 </div>
    878 
    879                                 <div class="qContent">
    880                                         <div class="qText">
    881                                                 Have you ever organized an event like this before?
    882                                         </div>
    883 
    884                                         <div class="PDF_QT400">
    885                                                 <ul>
    886                                                         <li>
    887                                                                 <input type="radio" name="q_1046038_organized_event_before" value="Yes, I've planned events of similar size/scope" id="q_1046038_1865485" />
    888 
    889                                                                 <label for="q_1046038_1865485" value="1865485">
    890                                                                         Yes, I've planned events of similar size/scope </label>
    891                                                         </li>
    892                                                         <li>
    893                                                                 <input type="radio" name="q_1046038_organized_event_before" value="I've organized similar types of events, but smaller" id="q_1046038_1865486" />
    894 
    895                                                                 <label for="q_1046038_1865486" value="1865486">
    896                                                                         I've organized similar types of events, but smaller </label>
    897                                                         </li>
    898                                                         <li>
    899                                                                 <input type="radio" name="q_1046038_organized_event_before" value="I've organized other events" id="q_1046038_1865487" />
    900 
    901                                                                 <label for="q_1046038_1865487" value="1865487">
    902                                                                         I've organized other events </label>
    903                                                         </li>
    904                                                         <li>
    905                                                                 <input type="radio" name="q_1046038_organized_event_before" value="I've never organized an event before" id="q_1046038_1865495" />
    906 
    907                                                                 <label for="q_1046038_1865495" value="1865495">
    908                                                                         I've never organized an event before </label>
    909                                                         </li>
    910                                                 </ul>
    911                                         </div>
    912                                 </div>
    913                         </div>
    914 
    915                         <div class="PDF_questionDivide" id="pd-divider-20"></div>
    916 
    917                         <div class="PDF_question" id="pd-question-21">
    918                                 <div class="qNumber">
    919                                         Q.21
    920                                 </div>
    921 
    922                                 <div class="qContent">
    923                                         <div class="qText">
    924                                                 Please give a brief description of the events you&#039;ve been involved in organizing and what your role was.
    925                                         </div>
    926 
    927                                         <div class="PDF_QT200">
    928                                                 <textarea name="q_1046099_describe_events" class="small" rows="10" cols="40" title="Please give a brief description of the events you&#039;v&hellip;"></textarea>
    929                                         </div>
    930                                 </div>
    931                         </div>
    932 
    933                         <div class="PDF_questionDivide" id="pd-divider-21"></div>
    934 
    935                         <div class="PDF_question" id="pd-question-22">
    936                                 <div class="qNumber">
    937                                         Q.22
    938                                 </div>
    939 
    940                                 <div class="qContent">
    941                                         <div class="qText">
    942                                                 Do you have at least 2 co-organizers?
    943                                         </div>
    944 
    945                                         <div class="PDF_QT400">
    946                                                 <ul>
    947                                                         <li>
    948                                                                 <input type="radio" name="q_1046101_have_co_organizers" value="Yes, I have co-organizers already" id="q_1046101_1908677" />
    949 
    950                                                                 <label for="q_1046101_1908677" value="1908677">
    951                                                                         Yes, I have co-organizers already </label>
    952                                                         </li>
    953                                                         <li>
    954                                                                 <input type="radio" name="q_1046101_have_co_organizers" value="Nope, but I know some people who might be interested" id="q_1046101_1865560" />
    955 
    956                                                                 <label for="q_1046101_1865560" value="1865560">
    957                                                                         Nope, but I know some people who might be interested </label>
    958                                                         </li>
    959                                                         <li>
    960                                                                 <input type="radio" name="q_1046101_have_co_organizers" value="Nope, I probably need help to find co-organizers" id="q_1046101_1865561" />
    961 
    962                                                                 <label for="q_1046101_1865561" value="1865561">
    963                                                                         Nope, I probably need help to find co-organizers </label>
    964                                                         </li>
    965                                                         <li>
    966                                                                 <input type="radio" name="q_1046101_have_co_organizers" value="Nope, I want to do it by myself" id="q_1046101_1865562" />
    967 
    968                                                                 <label for="q_1046101_1865562" value="1865562">
    969                                                                         Nope, I want to do it by myself </label>
    970                                                         </li>
    971                                                 </ul>
    972                                         </div>
    973                                 </div>
    974                         </div>
    975 
    976                         <div class="PDF_questionDivide" id="pd-divider-22"></div>
    977 
    978                         <div class="PDF_question" id="pd-question-23">
    979                                 <div class="qNumber">
    980                                         Q.23
    981                                 </div>
    982 
    983                                 <div class="qContent">
    984                                         <div class="qText">
    985                                                 What&#039;s your relationship to your co-organizers?
    986                                         </div>
    987 
    988                                         <div class="PDF_QT400">
    989                                                 <ul>
    990                                                         <li>
    991                                                                 <input type="checkbox" name="q_1068188_relationship_co_organizers[]" id="q_1068188_1908678" value="We work for the same company" />
    992 
    993                                                                 <label for="q_1068188_1908678">We work for the same company</label>
    994                                                         </li>
    995                                                         <li>
    996                                                                 <input type="checkbox" name="q_1068188_relationship_co_organizers[]" id="q_1068188_1908679" value="We're friends" />
    997 
    998                                                                 <label for="q_1068188_1908679">We're friends</label>
    999                                                         </li>
    1000                                                         <li>
    1001                                                                 <input type="checkbox" name="q_1068188_relationship_co_organizers[]" id="q_1068188_1908680" value="We've collaborated on projects before" />
    1002 
    1003                                                                 <label for="q_1068188_1908680">We've collaborated on projects before</label>
    1004                                                         </li>
    1005                                                         <li>
    1006                                                                 <input type="checkbox" name="q_1068188_relationship_co_organizers[]" id="q_1068188_1908689" value="We met through the meetup group/other tech event" />
    1007 
    1008                                                                 <label for="q_1068188_1908689">We met through the meetup group/other tech event</label>
    1009                                                         </li>
    1010                                                         <li>
    1011                                                                 <label for="q_1068188_other">Other:</label>
    1012 
    1013                                                                 <input type="text" class="other" name="q_1068188_relationship_co_organizers_other" id="q_1068188_other" value="" style="width: 75%" />
    1014                                                         </li>
    1015                                                 </ul>
    1016                                         </div>
    1017                                 </div>
    1018                         </div>
    1019 
    1020                         <div class="PDF_questionDivide" id="pd-divider-23"></div>
    1021 
    1022                         <div class="PDF_question" id="pd-question-24">
    1023                                 <div class="qNumber">
    1024                                         Q.24
    1025                                 </div>
    1026 
    1027                                 <div class="qContent">
    1028                                         <div class="qText">
    1029                                                 Please enter the names and email addresses of your co-organizers here.
    1030                                         </div>
    1031 
    1032                                         <div class="PDF_QT200">
    1033                                                 <textarea name="q_1068187_co_organizer_contact_info" class="small" rows="10" cols="40" title="Please enter the names and email addresses of your &hellip;"></textarea>
    1034                                         </div>
    1035                                 </div>
    1036                         </div>
    1037 
    1038                         <div class="PDF_questionDivide" id="pd-divider-24"></div>
    1039 
    1040                         <div class="PDF_question" id="pd-question-25">
    1041                                 <div class="qNumber">
    1042                                         Q.25
    1043                                 </div>
    1044 
    1045                                 <div class="qContent">
    1046                                         <div class="qText">
    1047                                                 Are you confident you can raise money from local sponsors to cover the event costs?
    1048                                         </div>
    1049 
    1050                                         <div class="PDF_QT400">
    1051                                                 <ul>
    1052                                                         <li>
    1053                                                                 <input type="radio" name="q_1068214_raise_money" value="Yes, I'm cool with the fundraising" id="q_1068214_1908711" />
    1054 
    1055                                                                 <label for="q_1068214_1908711" value="1908711">
    1056                                                                         Yes, I'm cool with the fundraising </label>
    1057                                                         </li>
    1058                                                         <li>
    1059                                                                 <input type="radio" name="q_1068214_raise_money" value="I'm not sure -- I haven't done this before but I'll do my best" id="q_1068214_1908712" />
    1060 
    1061                                                                 <label for="q_1068214_1908712" value="1908712">
    1062                                                                         I'm not sure -- I haven't done this before but I'll do my best </label>
    1063                                                         </li>
    1064                                                         <li>
    1065                                                                 <input type="radio" name="q_1068214_raise_money" value="Not really, I hate asking people for money" id="q_1068214_1908713" />
    1066 
    1067                                                                 <label for="q_1068214_1908713" value="1908713">
    1068                                                                         Not really, I hate asking people for money </label>
    1069                                                         </li>
    1070                                                 </ul>
    1071                                         </div>
    1072                                 </div>
    1073                         </div>
    1074 
    1075                         <div class="PDF_questionDivide" id="pd-divider-25"></div>
    1076 
    1077                         <div class="PDF_question" id="pd-question-26">
    1078                                 <div class="qNumber">
    1079                                         Q.26
    1080                                 </div>
    1081 
    1082                                 <div class="qContent">
    1083                                         <div class="qText">
    1084                                                 If there are businesses already interested in sponsoring, list them here.
    1085                                         </div>
    1086 
    1087                                         <div class="PDF_QT100">
    1088                                                 <input value="" maxlength="500" name="q_1068220_interested_sponsors" class="large" type="text" title="If there are businesses already interested in spons&hellip;" />
    1089                                         </div>
    1090                                 </div>
    1091                         </div>
    1092 
    1093                         <div class="PDF_questionDivide" id="pd-divider-26"></div>
    1094 
    1095                         <div class="PDF_question" id="pd-question-27">
    1096                                 <div class="qNumber">
    1097                                         Q.27
    1098                                 </div>
    1099 
    1100                                 <div class="qContent">
    1101                                         <div class="qText">
    1102                                                 Do you know local people who would make good presenters/speakers?
    1103                                         </div>
    1104 
    1105                                         <div class="PDF_QT400">
    1106                                                 <ul>
    1107                                                         <li>
    1108                                                                 <input type="radio" name="q_1046009_good_presenters" value="Yes, I know lots of local WordPress users/developers" id="q_1046009_1865453" />
    1109 
    1110                                                                 <label for="q_1046009_1865453" value="1865453">
    1111                                                                         Yes, I know lots of local WordPress users/developers </label>
    1112                                                         </li>
    1113                                                         <li>
    1114                                                                 <input type="radio" name="q_1046009_good_presenters" value="Yes, I know a couple of people who would be qualified" id="q_1046009_1865454" />
    1115 
    1116                                                                 <label for="q_1046009_1865454" value="1865454">
    1117                                                                         Yes, I know a couple of people who would be qualified </label>
    1118                                                         </li>
    1119                                                         <li>
    1120                                                                 <input type="radio" name="q_1046009_good_presenters" value="No, I don't know anyone local who could speak" id="q_1046009_1865455" />
    1121 
    1122                                                                 <label for="q_1046009_1865455" value="1865455">
    1123                                                                         No, I don't know anyone local who could speak </label>
    1124                                                         </li>
    1125                                                 </ul>
    1126                                         </div>
    1127                                 </div>
    1128                         </div>
    1129 
    1130                         <div class="PDF_questionDivide" id="pd-divider-27"></div>
    1131 
    1132                         <div class="PDF_question" id="pd-question-28">
    1133                                 <div class="qNumber">
    1134                                         Q.28
    1135                                 </div>
    1136 
    1137                                 <div class="qContent">
    1138                                         <div class="qText">
    1139                                                 Please enter the names of the people you have in mind, and describe them in a few words.
    1140                                         </div>
    1141 
    1142                                         <div class="PDF_QT200">
    1143                                                 <textarea name="q_1046021_presenter_names" class="small" rows="10" cols="40" title="Please enter the names of the people you have in mi&hellip;"></textarea>
    1144                                         </div>
    1145                                 </div>
    1146                         </div>
    1147 
    1148                         <div class="PDF_questionDivide" id="pd-divider-28"></div>
    1149 
    1150                         <div class="PDF_question" id="pd-question-29">
    1151                                 <div class="qNumber">
    1152                                         Q.29
    1153                                 </div>
    1154 
    1155                                 <div class="qContent">
    1156                                         <div class="qText">
    1157                                                 Do you have any connections to potential venue donations (colleges, offices, etc)?
    1158                                         </div>
    1159 
    1160                                         <div class="PDF_QT400">
    1161                                                 <ul>
    1162                                                         <li>
    1163                                                                 <input type="radio" name="q_1068197_venue_connections" value="Yes, I've been talking to people already" id="q_1068197_1908695" />
    1164 
    1165                                                                 <label for="q_1068197_1908695" value="1908695">
    1166                                                                         Yes, I've been talking to people already </label>
    1167                                                         </li>
    1168                                                         <li>
    1169                                                                 <input type="radio" name="q_1068197_venue_connections" value="No, but I have some leads" id="q_1068197_1908696" />
    1170 
    1171                                                                 <label for="q_1068197_1908696" value="1908696">
    1172                                                                         No, but I have some leads </label>
    1173                                                         </li>
    1174                                                         <li>
    1175                                                                 <input type="radio" name="q_1068197_venue_connections" value="No, I'll be looking for a venue from scratch" id="q_1068197_1908697" />
    1176 
    1177                                                                 <label for="q_1068197_1908697" value="1908697">
    1178                                                                         No, I'll be looking for a venue from scratch </label>
    1179                                                         </li>
    1180                                                 </ul>
    1181                                         </div>
    1182                                 </div>
    1183                         </div>
    1184 
    1185                         <div class="PDF_questionDivide" id="pd-divider-29"></div>
    1186 
    1187                         <div class="PDF_question" id="pd-question-30">
    1188                                 <div class="qNumber">
    1189                                         Q.30
    1190                                 </div>
    1191 
    1192                                 <div class="qContent">
    1193                                         <div class="qText">
    1194                                                 What possible venues are you considering?
    1195                                         </div>
    1196 
    1197                                         <div class="PDF_QT200">
    1198                                                 <textarea name="q_1068212_venues_considering" class="small" rows="10" cols="40" title="What possible venues are you considering?"></textarea>
    1199                                         </div>
    1200                                 </div>
    1201                         </div>
    1202 
    1203                         <div class="PDF_questionDivide" id="pd-divider-30"></div>
    1204 
    1205                         <div class="PDF_question" id="pd-question-32">
    1206                                 <div class="qNumber">
    1207                                         Q.32
    1208                                 </div>
    1209 
    1210                                 <div class="qContent">
    1211                                         <div class="qText">
    1212                                                 Anything else you want us to know while we&#039;re looking over your application?
    1213                                         </div>
    1214 
    1215                                         <div class="PDF_QT200">
    1216                                                 <textarea name="q_1079098_anything_else" class="large" rows="10" cols="40" title="Anything else you want us to know while we&#039;re looki&hellip;"></textarea>
    1217                                         </div>
    1218                                 </div>
    1219                         </div>
    1220 
    1221                         <div class="PDF_questionDivide" id="pd-divider-32"></div>
    1222 
    1223                         <div class="PDF_question" id="pd-question-10003">
    1224                                 <div class="qContent">
    1225                                         <div class="PDF_QT1900">
    1226                                                 <h2>Bonus Question!</h2>
    1227                                         </div>
    1228                                 </div>
    1229                         </div>
    1230 
    1231                         <div class="PDF_questionDivide" id="pd-divider-10003"></div>
    1232 
    1233                         <div class="PDF_question" id="pd-question-33">
    1234                                 <div class="qNumber">
    1235                                         Q.33
    1236                                 </div>
    1237 
    1238                                 <div class="qContent">
    1239                                         <div class="qText">
    1240                                                 Which of these best describes you?
    1241                                         </div>
    1242 
    1243                                         <div class="PDF_QT400">
    1244                                                 <ul>
    1245                                                         <li>
    1246                                                                 <input type="radio" name="q_1079112_best_describes_you" value="Personal Blogger" id="q_1079112_1926766" />
    1247 
    1248                                                                 <label for="q_1079112_1926766" value="1926766">
    1249                                                                         Personal Blogger </label>
    1250                                                         </li>
    1251                                                         <li>
    1252                                                                 <input type="radio" name="q_1079112_best_describes_you" value="Company Blogger" id="q_1079112_1926767" />
    1253 
    1254                                                                 <label for="q_1079112_1926767" value="1926767">
    1255                                                                         Company Blogger </label>
    1256                                                         </li>
    1257                                                         <li>
    1258                                                                 <input type="radio" name="q_1079112_best_describes_you" value="Designer" id="q_1079112_1926768" />
    1259 
    1260                                                                 <label for="q_1079112_1926768" value="1926768">
    1261                                                                         Designer </label>
    1262                                                         </li>
    1263                                                         <li>
    1264                                                                 <input type="radio" name="q_1079112_best_describes_you" value="Beginning Developer" id="q_1079112_1926769" />
    1265 
    1266                                                                 <label for="q_1079112_1926769" value="1926769">
    1267                                                                         Beginning Developer </label>
    1268                                                         </li>
    1269                                                         <li>
    1270                                                                 <input type="radio" name="q_1079112_best_describes_you" value="Advanced Developer" id="q_1079112_1926770" />
    1271 
    1272                                                                 <label for="q_1079112_1926770" value="1926770">
    1273                                                                         Advanced Developer </label>
    1274                                                         </li>
    1275                                                         <li>
    1276                                                                 <input type="radio" name="q_1079112_best_describes_you" value="Project Manager" id="q_1079112_1926771" />
    1277 
    1278                                                                 <label for="q_1079112_1926771" value="1926771">
    1279                                                                         Project Manager </label>
    1280                                                         </li>
    1281                                                         <li>
    1282                                                                 <input type="radio" name="q_1079112_best_describes_you" value="System Administrator/IT Professional" id="q_1079112_1926772" />
    1283 
    1284                                                                 <label for="q_1079112_1926772" value="1926772">
    1285                                                                         System Administrator/IT Professional </label>
    1286                                                         </li>
    1287                                                         <li>
    1288                                                                 <input type="radio" name="q_1079112_best_describes_you" value="Sales/Marketing/PR" id="q_1079112_1926773" />
    1289 
    1290                                                                 <label for="q_1079112_1926773" value="1926773">
    1291                                                                         Sales/Marketing/PR </label>
    1292                                                         </li>
    1293                                                         <li>
    1294                                                                 <input type="radio" name="q_1079112_best_describes_you" value="Business Owner" id="q_1079112_1926774" />
    1295 
    1296                                                                 <label for="q_1079112_1926774" value="1926774">
    1297                                                                         Business Owner </label>
    1298                                                         </li>
    1299                                                         <li>
    1300                                                                 <input type="radio" name="q_1079112_best_describes_you" value="WordPress Fan" id="q_1079112_1926775" />
    1301 
    1302                                                                 <label for="q_1079112_1926775" value="1926775">
    1303                                                                         WordPress Fan </label>
    1304                                                         </li>
    1305                                                         <li>
    1306                                                                 <input type="radio" name="q_1079112_best_describes_you" id="q_1079112_other" value="other" />
    1307 
    1308                                                                 <label for="q_1079112_other">
    1309                                                                         Other:
    1310                                                                 </label>
    1311 
    1312                                                                 <input type="text" class="other" name="q_1079112_best_describes_you_other" value="" style="width: 75%" />
    1313                                                         </li>
    1314                                                 </ul>
    1315                                         </div>
    1316                                 </div>
    1317                         </div>
    1318 
    1319                         <div class="PDF_questionDivide" id="pd-divider-33"></div>
    1320 
    1321                         <div class="PDF_question">
    1322                                 <div class="button">
    1323                                         <input type="submit" name="submit-application" value="Submit Application" />
    1324                                 </div>
    1325                         </div>
    1326 
    1327                 </div> <!-- PDF.pageInner -->
    1328         </div> <!-- PDF.pageOuter -->
    1329 
    1330 </form>
     6
     7/**
     8 * Renders the application form for meetup. Renders shortcode meetup-organizer-application
     9 * Modified from https://wordcampcentral.polldaddy.com/s/wordcamp-organizer-application
     10 *
     11 * @param array $countries
     12 */
     13function render_wordcamp_application_form( $countries ) {
     14        ?>
     15
     16        <form id="wordcamp-application" method="post">
     17                <div class="PDF_pageOuter">
     18                        <div class="PDF_pageInner">
     19                                <div class="PDF_question" id="pd-question-10000">
     20                                        <div class="qContent">
     21                                                <div class="PDF_QT1900">
     22                                                        <h2>Part I: About You</h2>
     23                                                </div>
     24                                        </div>
     25                                </div>
     26
     27                                <div class="PDF_questionDivide" id="pd-divider-10000"></div>
     28
     29                                <div class="PDF_question" id="pd-question-1">
     30                                        <div class="qNumber">
     31                                                Q.1
     32                                        </div>
     33
     34                                        <div class="qContent">
     35                                                <div class="qText">
     36                                                        Please enter your name.
     37                                                        <span class="PDF_mand">*</span>
     38                                                </div>
     39
     40                                                <div class="PDF_QT800">
     41                                                        <div>
     42                                                                <label for="q_1079074_first_name">First Name</label>
     43                                                                <br/>
     44                                                                <input type="text" class="firstName" maxlength="50" name="q_1079074_first_name"
     45                                                                           id="q_1079074_first_name" value="" required/>
     46                                                        </div>
     47
     48                                                        <div>
     49                                                                <label for="q_1079074_last_name">Last Name</label>
     50                                                                <br/>
     51                                                                <input type="text" class="lastName" maxlength="50" name="q_1079074_last_name"
     52                                                                           id="q_1079074_last_name" value="" required/>
     53                                                        </div>
     54                                                </div>
     55                                        </div>
     56                                </div>
     57
     58                                <div class="PDF_questionDivide" id="pd-divider-1"></div>
     59
     60                                <div class="PDF_question" id="pd-question-2">
     61                                        <div class="qNumber">
     62                                                Q.2
     63                                        </div>
     64
     65                                        <div class="qContent">
     66                                                <div class="qText">
     67                                                        Please enter your email address.
     68                                                        <span class="PDF_mand">*</span>
     69                                                </div>
     70
     71                                                <div class="PDF_QT1400">
     72                                                        <label for="q_1079059_email">(e.g. john@example.com)</label>
     73                                                        <br/>
     74                                                        <input type="email" maxlength="100" name="q_1079059_email" id="q_1079059_email" value=""
     75                                                                   class="survey-email required" autocomplete="off" required/>
     76                                                </div>
     77                                        </div>
     78                                </div>
     79
     80                                <div class="PDF_questionDivide" id="pd-divider-2"></div>
     81
     82                                <div class="PDF_question" id="pd-question-31">
     83                                        <div class="qNumber">
     84                                                Q.31
     85                                        </div>
     86
     87                                        <div class="qContent">
     88                                                <div class="qText">
     89                                                        What is your wordpress.org username?
     90                                                        <span class="PDF_mand">*</span>
     91                                                </div>
     92
     93                                                <div class="qNote">
     94                                                        <p>(This is the username you'd use to log in to http://wordpress.org/support/)</p>
     95                                                </div>
     96
     97                                                <div class="PDF_QT100">
     98                                                        <input value="" maxlength="500" name="q_4236565_wporg_username" class="large required"
     99                                                                   type="text" title="What is your wordpress.org username?" required/>
     100                                                </div>
     101                                        </div>
     102                                </div>
     103
     104                                <div class="PDF_questionDivide" id="pd-divider-31"></div>
     105
     106                                <div class="PDF_question" id="pd-question-34">
     107                                        <div class="qNumber">
     108                                                Q.34
     109                                        </div>
     110
     111                                        <div class="qContent">
     112                                                <div class="qText">
     113                                                        What is your username on <a href="https://chat.wordpress.org" target="_blank">WordPress'
     114                                                                Slack workspace</a>?
     115                                                </div>
     116
     117                                                <div class="PDF_QT100">
     118                                                        <input value="" maxlength="500" name="q_4236565_slack_username" class="large" type="text"
     119                                                                   title="What is your Slack username?"/>
     120                                                </div>
     121                                        </div>
     122                                </div>
     123
     124                                <div class="PDF_questionDivide"></div>
     125
     126                                <div class="PDF_question">
     127                                        <div class="qContent">
     128                                                <div class="qText">
     129                                                        Where can we find you online?
     130                                                </div>
     131
     132                                                <div class="PDF_QT100">
     133                                                        <input value="" maxlength="500" name="where_find_online" class="large" type="text"
     134                                                                   title="Where can we find you online?"/>
     135                                                </div>
     136                                        </div>
     137                                </div>
     138
     139                                <div class="PDF_questionDivide" id="pd-divider-34"></div>
     140
     141                                <div class="PDF_question" id="pd-question-3">
     142                                        <div class="qNumber">
     143                                                Q.3
     144                                        </div>
     145
     146                                        <div class="qContent">
     147                                                <div class="qText">
     148                                                        Please enter your mailing address (at least your city/state or city/country).
     149                                                </div>
     150
     151                                                <div class="PDF_QT900">
     152                                                        <div>
     153                                                                <label for="q_1079060_add1">Address Line 1</label>
     154                                                                <br/>
     155                                                                <input type="text" maxlength="100" class="a" name="q_1079060_add1" id="q_1079060_add1"
     156                                                                           value=""/>
     157                                                        </div>
     158
     159                                                        <div>
     160                                                                <label for="q_1079060_add2">Address Line 2</label>
     161                                                                <br/>
     162                                                                <input type="text" maxlength="100" class="b" name="q_1079060_add2" id="q_1079060_add2"
     163                                                                           value=""/>
     164                                                        </div>
     165
     166                                                        <div>
     167                                                                <label for="q_1079060_city">City</label>
     168                                                                <br/>
     169                                                                <input type="text" maxlength="50" class="c" name="q_1079060_city" id="q_1079060_city"
     170                                                                           value=""/>
     171                                                        </div>
     172
     173                                                        <div>
     174                                                                <label for="q_1079060_state">State</label>
     175                                                                <br/>
     176                                                                <input type="text" maxlength="50" class="d" name="q_1079060_state" id="q_1079060_state"
     177                                                                           value=""/>
     178                                                        </div>
     179
     180                                                        <div>
     181                                                                <label for="q_1079060_zip">Zip Code</label>
     182                                                                <br/>
     183                                                                <input type="text" maxlength="20" class="e" name="q_1079060_zip" id="q_1079060_zip"
     184                                                                           value=""/>
     185                                                        </div>
     186
     187                                                        <div>
     188                                                                <label for="q_1079060_country">Country</label>
     189                                                                <br/>
     190
     191                                                                <select name="q_1079060_country" id="q_1079060_country">
     192                                                                        <option value=""></option>
     193
     194                                                                        <?php foreach ( $countries as $country ) : ?>
     195                                                                                <option value="<?php echo esc_attr( $country['alpha2'] ); ?>">
     196                                                                                        <?php echo esc_html( $country['name'] ); ?>
     197                                                                                </option>
     198                                                                        <?php endforeach; ?>
     199                                                                </select>
     200                                                        </div>
     201                                                </div>
     202                                        </div>
     203                                </div>
     204
     205                                <div class="PDF_questionDivide" id="pd-divider-3"></div>
     206
     207                                <div class="PDF_question" id="pd-question-4">
     208                                        <div class="qNumber">
     209                                                Q.4
     210                                        </div>
     211
     212                                        <div class="qContent">
     213                                                <div class="qText">
     214                                                        How long have you been using WordPress?
     215                                                </div>
     216
     217                                                <div class="PDF_QT400">
     218                                                        <ul>
     219                                                                <li>
     220                                                                        <input type="radio" name="q_1045947_years_using_wp" value="7+ years"
     221                                                                                   id="q_1045947_1865361"/>
     222
     223                                                                        <label for="q_1045947_1865361" value="1865361">
     224                                                                                7+ years </label>
     225                                                                </li>
     226                                                                <li>
     227                                                                        <input type="radio" name="q_1045947_years_using_wp" value="6 years"
     228                                                                                   id="q_1045947_1865362"/>
     229
     230                                                                        <label for="q_1045947_1865362" value="1865362">
     231                                                                                6 years </label>
     232                                                                </li>
     233                                                                <li>
     234                                                                        <input type="radio" name="q_1045947_years_using_wp" value="5 years"
     235                                                                                   id="q_1045947_1865363"/>
     236
     237                                                                        <label for="q_1045947_1865363" value="1865363">
     238                                                                                5 years </label>
     239                                                                </li>
     240                                                                <li>
     241                                                                        <input type="radio" name="q_1045947_years_using_wp" value="4 years"
     242                                                                                   id="q_1045947_1865369"/>
     243
     244                                                                        <label for="q_1045947_1865369" value="1865369">
     245                                                                                4 years </label>
     246                                                                </li>
     247                                                                <li>
     248                                                                        <input type="radio" name="q_1045947_years_using_wp" value="3 years"
     249                                                                                   id="q_1045947_1865370"/>
     250
     251                                                                        <label for="q_1045947_1865370" value="1865370">
     252                                                                                3 years </label>
     253                                                                </li>
     254                                                                <li>
     255                                                                        <input type="radio" name="q_1045947_years_using_wp" value="2 years"
     256                                                                                   id="q_1045947_1865371"/>
     257
     258                                                                        <label for="q_1045947_1865371" value="1865371">
     259                                                                                2 years </label>
     260                                                                </li>
     261                                                                <li>
     262                                                                        <input type="radio" name="q_1045947_years_using_wp" value="1 year"
     263                                                                                   id="q_1045947_1865372"/>
     264
     265                                                                        <label for="q_1045947_1865372" value="1865372">
     266                                                                                1 year </label>
     267                                                                </li>
     268                                                                <li>
     269                                                                        <input type="radio" name="q_1045947_years_using_wp" value="less than a year"
     270                                                                                   id="q_1045947_1865373"/>
     271
     272                                                                        <label for="q_1045947_1865373" value="1865373">
     273                                                                                Less than a year </label>
     274                                                                </li>
     275                                                                <li>
     276                                                                        <input type="radio" name="q_1045947_years_using_wp"
     277                                                                                   value="I don't use WordPress yet" id="q_1045947_1865374"/>
     278
     279                                                                        <label for="q_1045947_1865374" value="1865374">
     280                                                                                I don't use WordPress yet </label>
     281                                                                </li>
     282                                                        </ul>
     283                                                </div>
     284                                        </div>
     285                                </div>
     286
     287                                <div class="PDF_questionDivide" id="pd-divider-4"></div>
     288
     289                                <div class="PDF_question" id="pd-question-5">
     290                                        <div class="qNumber">
     291                                                Q.5
     292                                        </div>
     293
     294                                        <div class="qContent">
     295                                                <div class="qText">
     296                                                        How have you been involved in the WordPress community so far?
     297                                                </div>
     298
     299                                                <div class="PDF_QT400">
     300                                                        <ul>
     301                                                                <li>
     302                                                                        <input type="checkbox" name="q_1068246_ways_involved[]" id="q_1068246_1908777"
     303                                                                                   value="I use WordPress for my website(s)"/>
     304
     305                                                                        <label for="q_1068246_1908777">I use WordPress for my website(s)</label>
     306                                                                </li>
     307                                                                <li>
     308                                                                        <input type="checkbox" name="q_1068246_ways_involved[]" id="q_1068246_1908778"
     309                                                                                   value="I help other people use WordPress for their websites"/>
     310
     311                                                                        <label for="q_1068246_1908778">I help other people use WordPress for their
     312                                                                                websites</label>
     313                                                                </li>
     314                                                                <li>
     315                                                                        <input type="checkbox" name="q_1068246_ways_involved[]" id="q_1068246_1908779"
     316                                                                                   value="I make plugins"/>
     317
     318                                                                        <label for="q_1068246_1908779">I make plugins</label>
     319                                                                </li>
     320                                                                <li>
     321                                                                        <input type="checkbox" name="q_1068246_ways_involved[]" id="q_1068246_1908831"
     322                                                                                   value="I make themes"/>
     323
     324                                                                        <label for="q_1068246_1908831">I make themes</label>
     325                                                                </li>
     326                                                                <li>
     327                                                                        <input type="checkbox" name="q_1068246_ways_involved[]" id="q_1068246_1908832"
     328                                                                                   value="I contribute to the WordPress core codebase"/>
     329
     330                                                                        <label for="q_1068246_1908832">I contribute to the WordPress core codebase</label>
     331                                                                </li>
     332                                                                <li>
     333                                                                        <input type="checkbox" name="q_1068246_ways_involved[]" id="q_1068246_1908833"
     334                                                                                   value="I volunteer in the support forums at wordpress.org"/>
     335
     336                                                                        <label for="q_1068246_1908833">I volunteer in the support forums at
     337                                                                                wordpress.org</label>
     338                                                                </li>
     339                                                                <li>
     340                                                                        <input type="checkbox" name="q_1068246_ways_involved[]" id="q_1068246_1908834"
     341                                                                                   value="I contribute to the WordPress core UI group"/>
     342
     343                                                                        <label for="q_1068246_1908834">I contribute to the WordPress core UI group</label>
     344                                                                </li>
     345                                                                <li>
     346                                                                        <input type="checkbox" name="q_1068246_ways_involved[]" id="q_1068246_1908835"
     347                                                                                   value="I'm involved with local WordPress meetups"/>
     348
     349                                                                        <label for="q_1068246_1908835">I'm involved with local WordPress meetups</label>
     350                                                                </li>
     351                                                                <li>
     352                                                                        <input type="checkbox" name="q_1068246_ways_involved[]" id="q_1068246_1908836"
     353                                                                                   value="I've been involved with previous WordCamps"/>
     354
     355                                                                        <label for="q_1068246_1908836">I've been involved with previous WordCamps</label>
     356                                                                </li>
     357                                                                <li>
     358                                                                        <input type="checkbox" name="q_1068246_ways_involved[]" id="q_1068246_1926765"
     359                                                                                   value="WordPress helps me make a living"/>
     360
     361                                                                        <label for="q_1068246_1926765">WordPress helps me make a living</label>
     362                                                                </li>
     363
     364                                                                <li>
     365                                                                        <label for="q_1068246_other">Other:</label>
     366
     367                                                                        <input type="text" class="other" name="q_1068246_ways_involved_other"
     368                                                                                   id="q_1068246_other" value="" style="width: 75%"/>
     369                                                                </li>
     370                                                        </ul>
     371                                                </div>
     372                                        </div>
     373                                </div>
     374
     375                                <div class="PDF_questionDivide" id="pd-divider-5"></div>
     376
     377                                <div class="PDF_question" id="pd-question-6">
     378                                        <div class="qNumber">
     379                                                Q.6
     380                                        </div>
     381
     382                                        <div class="qContent">
     383                                                <div class="qText">
     384                                                        Have you ever attended a WordCamp before?
     385                                                </div>
     386
     387                                                <div class="PDF_QT400">
     388                                                        <ul>
     389                                                                <li>
     390                                                                        <input type="radio" name="q_1046032_attended_camp_before" value="Yes, more than one"
     391                                                                                   id="q_1046032_1865479"/>
     392
     393                                                                        <label for="q_1046032_1865479" value="1865479">
     394                                                                                Yes, more than one </label>
     395                                                                </li>
     396                                                                <li>
     397                                                                        <input type="radio" name="q_1046032_attended_camp_before"
     398                                                                                   value="Yes, I've been to one" id="q_1046032_1865480"/>
     399
     400                                                                        <label for="q_1046032_1865480" value="1865480">
     401                                                                                Yes, I've been to one </label>
     402                                                                </li>
     403                                                                <li>
     404                                                                        <input type="radio" name="q_1046032_attended_camp_before"
     405                                                                                   value="No, I haven't been to a WordCamp yet" id="q_1046032_1865481"/>
     406
     407                                                                        <label for="q_1046032_1865481" value="1865481">
     408                                                                                No, I haven't been to a WordCamp yet </label>
     409                                                                </li>
     410                                                        </ul>
     411
     412                                                </div>
     413                                        </div>
     414                                </div>
     415
     416                                <div class="PDF_questionDivide" id="pd-divider-6"></div>
     417
     418                                <div class="PDF_question" id="pd-question-7">
     419                                        <div class="qNumber">
     420                                                Q.7
     421                                        </div>
     422
     423                                        <div class="qContent">
     424                                                <div class="qText">
     425                                                        What WordCamps have you been to? Please list one per line in this format: City, Year (ex.
     426                                                        San Francisco, 2010)
     427                                                </div>
     428
     429                                                <div class="PDF_QT200">
     430                                                        <textarea name="q_1046033_camps_been_to" class="small" rows="10" cols="40"
     431                                                                          title="What WordCamps have you been to? Please list one pe&hellip;"></textarea>
     432                                                </div>
     433                                        </div>
     434                                </div>
     435
     436                                <div class="PDF_questionDivide" id="pd-divider-7"></div>
     437
     438                                <div class="PDF_question" id="pd-question-8">
     439                                        <div class="qNumber">
     440                                                Q.8
     441                                        </div>
     442
     443                                        <div class="qContent">
     444                                                <div class="qText">
     445                                                        What do you hope to accomplish by organizing a WordCamp?
     446                                                </div>
     447
     448                                                <div class="PDF_QT400">
     449                                                        <ul>
     450                                                                <li>
     451                                                                        <input type="checkbox" name="q_1068223_hope_to_accomplish[]" id="q_1068223_1908730"
     452                                                                                   value="Grow my local WordPress community"/>
     453
     454                                                                        <label for="q_1068223_1908730">Grow my local WordPress community</label>
     455                                                                </li>
     456                                                                <li>
     457                                                                        <input type="checkbox" name="q_1068223_hope_to_accomplish[]" id="q_1068223_1908731"
     458                                                                                   value="Introduce new people to WordPress/teach new users"/>
     459
     460                                                                        <label for="q_1068223_1908731">Introduce new people to WordPress/teach new
     461                                                                                users</label>
     462                                                                </li>
     463                                                                <li>
     464                                                                        <input type="checkbox" name="q_1068223_hope_to_accomplish[]" id="q_1068223_1908732"
     465                                                                                   value="Find collaborators for WordPress projects"/>
     466
     467                                                                        <label for="q_1068223_1908732">Find collaborators for WordPress projects</label>
     468                                                                </li>
     469                                                                <li>
     470                                                                        <input type="checkbox" name="q_1068223_hope_to_accomplish[]" id="q_1068223_1908771"
     471                                                                                   value="Raise my visibility in the community"/>
     472
     473                                                                        <label for="q_1068223_1908771">Raise my visibility in the community</label>
     474                                                                </li>
     475                                                                <li>
     476                                                                        <input type="checkbox" name="q_1068223_hope_to_accomplish[]" id="q_1068223_1908772"
     477                                                                                   value="Make connections with visiting speakers (like Matt Mullenweg)"/>
     478
     479                                                                        <label for="q_1068223_1908772">Make connections with visiting speakers (like Matt
     480                                                                                Mullenweg)</label>
     481                                                                </li>
     482                                                                <li>
     483                                                                        <input type="checkbox" name="q_1068223_hope_to_accomplish[]" id="q_1068223_1908773"
     484                                                                                   value="Make money from surplus ticket sales/sponsorships"/>
     485
     486                                                                        <label for="q_1068223_1908773">Make money from surplus ticket
     487                                                                                sales/sponsorships</label>
     488                                                                </li>
     489                                                                <li>
     490                                                                        <input type="checkbox" name="q_1068223_hope_to_accomplish[]" id="q_1068223_1908774"
     491                                                                                   value="Have fun/throw a good party"/>
     492
     493                                                                        <label for="q_1068223_1908774">Have fun/throw a good party</label>
     494                                                                </li>
     495                                                                <li>
     496                                                                        <input type="checkbox" name="q_1068223_hope_to_accomplish[]" id="q_1068223_1908775"
     497                                                                                   value="Be part of the zeitgeist, as WordCamps are very popular right now"/>
     498
     499                                                                        <label for="q_1068223_1908775">Be part of the zeitgeist, as WordCamps are very
     500                                                                                popular right now</label>
     501                                                                </li>
     502                                                                <li>
     503                                                                        <input type="checkbox" name="q_1068223_hope_to_accomplish[]" id="q_1068223_1908776"
     504                                                                                   value="Inspire people to do more with WordPress"/>
     505
     506                                                                        <label for="q_1068223_1908776">Inspire people to do more with WordPress</label>
     507                                                                </li>
     508
     509                                                                <li>
     510                                                                        <label for="q_1068223_other">Other:</label>
     511
     512                                                                        <input type="text" class="other" name="q_1068223_hope_to_accomplish_other"
     513                                                                                   id="q_1068223_other" value="" style="width: 75%"/>
     514                                                                </li>
     515                                                        </ul>
     516                                                </div>
     517                                        </div>
     518                                </div>
     519
     520                                <div class="PDF_questionDivide" id="pd-divider-8"></div>
     521
     522                                <div class="PDF_question" id="pd-question-10001">
     523                                        <div class="qContent">
     524                                                <div class="PDF_QT1900">
     525                                                        <h2>Part II: About Your Local Community</h2>
     526                                                </div>
     527                                        </div>
     528                                </div>
     529
     530                                <div class="PDF_questionDivide" id="pd-divider-10001"></div>
     531
     532                                <div class="PDF_question" id="pd-question-9">
     533                                        <div class="qNumber">
     534                                                Q.9
     535                                        </div>
     536
     537                                        <div class="qContent">
     538                                                <div class="qText">
     539                                                        Is there an active WordPress meetup in your area?
     540                                                </div>
     541
     542                                                <div class="PDF_QT400">
     543                                                        <ul>
     544                                                                <li>
     545                                                                        <input type="radio" name="q_1045950_active_meetup" value="Yes"
     546                                                                                   id="q_1045950_1865375"/>
     547
     548                                                                        <label for="q_1045950_1865375" value="1865375">
     549                                                                                Yes </label>
     550                                                                </li>
     551                                                                <li>
     552                                                                        <input type="radio" name="q_1045950_active_meetup" value="No"
     553                                                                                   id="q_1045950_1865376"/>
     554
     555                                                                        <label for="q_1045950_1865376" value="1865376">
     556                                                                                No </label>
     557                                                                </li>
     558                                                                <li>
     559                                                                        <input type="radio" name="q_1045950_active_meetup" value="I don't know"
     560                                                                                   id="q_1045950_1865377"/>
     561
     562                                                                        <label for="q_1045950_1865377" value="1865377">
     563                                                                                I don't know </label>
     564                                                                </li>
     565                                                        </ul>
     566                                                </div>
     567                                        </div>
     568                                </div>
     569
     570                                <div class="PDF_questionDivide" id="pd-divider-9"></div>
     571
     572                                <div class="PDF_question" id="pd-question-10">
     573                                        <div class="qNumber">
     574                                                Q.10
     575                                        </div>
     576
     577                                        <div class="qContent">
     578                                                <div class="qText">
     579                                                        What is your role in the meetup group?
     580                                                </div>
     581
     582                                                <div class="PDF_QT400">
     583                                                        <ul>
     584                                                                <li>
     585                                                                        <input type="radio" name="q_1045953_role_in_meetup" value="I am the organizer"
     586                                                                                   id="q_1045953_1865378"/>
     587
     588                                                                        <label for="q_1045953_1865378" value="1865378">
     589                                                                                I am the organizer </label>
     590                                                                </li>
     591                                                                <li>
     592                                                                        <input type="radio" name="q_1045953_role_in_meetup"
     593                                                                                   value="I am a regular attendee and presenter" id="q_1045953_1865379"/>
     594
     595                                                                        <label for="q_1045953_1865379" value="1865379">
     596                                                                                I am a regular attendee and presenter </label>
     597                                                                </li>
     598                                                                <li>
     599                                                                        <input type="radio" name="q_1045953_role_in_meetup"
     600                                                                                   value="I attend regularly but don't present" id="q_1045953_1865380"/>
     601
     602                                                                        <label for="q_1045953_1865380" value="1865380">
     603                                                                                I attend regularly but don't present </label>
     604                                                                </li>
     605                                                                <li>
     606                                                                        <input type="radio" name="q_1045953_role_in_meetup" value="I attend sometimes"
     607                                                                                   id="q_1045953_1865381"/>
     608
     609                                                                        <label for="q_1045953_1865381" value="1865381">
     610                                                                                I attend sometimes </label>
     611                                                                </li>
     612                                                                <li>
     613                                                                        <input type="radio" name="q_1045953_role_in_meetup" value="I attend rarely"
     614                                                                                   id="q_1045953_1865382"/>
     615
     616                                                                        <label for="q_1045953_1865382" value="1865382">
     617                                                                                I attend rarely </label>
     618                                                                </li>
     619                                                                <li>
     620                                                                        <input type="radio" name="q_1045953_role_in_meetup"
     621                                                                                   value="I do not attend the meetups" id="q_1045953_1865383"/>
     622
     623                                                                        <label for="q_1045953_1865383" value="1865383">
     624                                                                                I do not attend the meetups </label>
     625                                                                </li>
     626                                                        </ul>
     627                                                </div>
     628                                        </div>
     629                                </div>
     630
     631                                <div class="PDF_questionDivide" id="pd-divider-10"></div>
     632
     633                                <div class="PDF_question" id="pd-question-11">
     634                                        <div class="qNumber">
     635                                                Q.11
     636                                        </div>
     637
     638                                        <div class="qContent">
     639                                                <div class="qText">
     640                                                        What is the URL for the meetup group&#039;s website?
     641                                                </div>
     642
     643                                                <div class="PDF_QT100">
     644                                                        <input value="" maxlength="500" name="q_1045972_meetup_url" class="large" type="url"
     645                                                                   title="What is the URL for the meetup group&#039;s website?"/>
     646                                                </div>
     647                                        </div>
     648                                </div>
     649
     650                                <div class="PDF_questionDivide" id="pd-divider-11"></div>
     651
     652                                <div class="PDF_question" id="pd-question-12">
     653                                        <div class="qNumber">
     654                                                Q.12
     655                                        </div>
     656
     657                                        <div class="qContent">
     658                                                <div class="qText">
     659                                                        About how many members are there?
     660                                                </div>
     661
     662                                                <div class="PDF_QT400">
     663                                                        <ul>
     664                                                                <li>
     665                                                                        <input type="radio" name="q_1045967_meetup_members" value="500+"
     666                                                                                   id="q_1045967_1865388"/>
     667
     668                                                                        <label for="q_1045967_1865388" value="1865388">
     669                                                                                500+ </label>
     670                                                                </li>
     671                                                                <li>
     672                                                                        <input type="radio" name="q_1045967_meetup_members" value="300-499"
     673                                                                                   id="q_1045967_1865389"/>
     674
     675                                                                        <label for="q_1045967_1865389" value="1865389">
     676                                                                                300-499 </label>
     677                                                                </li>
     678                                                                <li>
     679                                                                        <input type="radio" name="q_1045967_meetup_members" value="100-299"
     680                                                                                   id="q_1045967_1865390"/>
     681
     682                                                                        <label for="q_1045967_1865390" value="1865390">
     683                                                                                100-299 </label>
     684                                                                </li>
     685                                                                <li>
     686                                                                        <input type="radio" name="q_1045967_meetup_members" value="50-99"
     687                                                                                   id="q_1045967_1865391"/>
     688
     689                                                                        <label for="q_1045967_1865391" value="1865391">
     690                                                                                50-99 </label>
     691                                                                </li>
     692                                                                <li>
     693                                                                        <input type="radio" name="q_1045967_meetup_members" value="26-49"
     694                                                                                   id="q_1045967_1865392"/>
     695
     696                                                                        <label for="q_1045967_1865392" value="1865392">
     697                                                                                26-49 </label>
     698                                                                </li>
     699                                                                <li>
     700                                                                        <input type="radio" name="q_1045967_meetup_members" value="1-25"
     701                                                                                   id="q_1045967_1865393"/>
     702
     703                                                                        <label for="q_1045967_1865393" value="1865393">
     704                                                                                1-25 </label>
     705                                                                </li>
     706                                                                <li>
     707                                                                        <input type="radio" name="q_1045967_meetup_members" value="I don't know"
     708                                                                                   id="q_1045967_1926755"/>
     709
     710                                                                        <label for="q_1045967_1926755" value="1926755">
     711                                                                                I don't know </label>
     712                                                                </li>
     713                                                        </ul>
     714                                                </div>
     715                                        </div>
     716                                </div>
     717
     718                                <div class="PDF_questionDivide" id="pd-divider-12"></div>
     719
     720                                <div class="PDF_question" id="pd-question-13">
     721                                        <div class="qNumber">
     722                                                Q.13
     723                                        </div>
     724
     725                                        <div class="qContent">
     726                                                <div class="qText">
     727                                                        How often does the group have meetups?
     728                                                </div>
     729
     730                                                <div class="PDF_QT400">
     731                                                        <ul>
     732                                                                <li>
     733                                                                        <input type="radio" name="q_1045956_how_often_meetup" value="Once per month"
     734                                                                                   id="q_1045956_1865384"/>
     735
     736                                                                        <label for="q_1045956_1865384" value="1865384">
     737                                                                                Once per month </label>
     738                                                                </li>
     739                                                                <li>
     740                                                                        <input type="radio" name="q_1045956_how_often_meetup" value="Several per month"
     741                                                                                   id="q_1045956_1865385"/>
     742
     743                                                                        <label for="q_1045956_1865385" value="1865385">
     744                                                                                Several per month </label>
     745                                                                </li>
     746                                                                <li>
     747                                                                        <input type="radio" name="q_1045956_how_often_meetup"
     748                                                                                   value="One every couple of months" id="q_1045956_1865386"/>
     749
     750                                                                        <label for="q_1045956_1865386" value="1865386">
     751                                                                                One every couple of months </label>
     752                                                                </li>
     753                                                                <li>
     754                                                                        <input type="radio" name="q_1045956_how_often_meetup"
     755                                                                                   value="There's a group but it never meets" id="q_1045956_1865387"/>
     756
     757                                                                        <label for="q_1045956_1865387" value="1865387">
     758                                                                                There's a group but it never meets </label>
     759                                                                </li>
     760                                                        </ul>
     761                                                </div>
     762                                        </div>
     763                                </div>
     764
     765                                <div class="PDF_questionDivide" id="pd-divider-13"></div>
     766
     767                                <div class="PDF_question" id="pd-question-14">
     768                                        <div class="qNumber">
     769                                                Q.14
     770                                        </div>
     771
     772                                        <div class="qContent">
     773                                                <div class="qText">
     774                                                        About how many people usually attend the meetups?
     775                                                </div>
     776
     777                                                <div class="PDF_QT400">
     778                                                        <ul>
     779                                                                <li>
     780                                                                        <input type="radio" name="q_1045971_how_many_attend" value="500+"
     781                                                                                   id="q_1045971_1865397"/>
     782
     783                                                                        <label for="q_1045971_1865397" value="1865397">
     784                                                                                500+ </label>
     785                                                                </li>
     786                                                                <li>
     787                                                                        <input type="radio" name="q_1045971_how_many_attend" value="300-499"
     788                                                                                   id="q_1045971_1865398"/>
     789
     790                                                                        <label for="q_1045971_1865398" value="1865398">
     791                                                                                300-499 </label>
     792                                                                </li>
     793                                                                <li>
     794                                                                        <input type="radio" name="q_1045971_how_many_attend" value="100-299"
     795                                                                                   id="q_1045971_1865399"/>
     796
     797                                                                        <label for="q_1045971_1865399" value="1865399">
     798                                                                                100-299 </label>
     799                                                                </li>
     800                                                                <li>
     801                                                                        <input type="radio" name="q_1045971_how_many_attend" value="50-99"
     802                                                                                   id="q_1045971_1865400"/>
     803
     804                                                                        <label for="q_1045971_1865400" value="1865400">
     805                                                                                50-99 </label>
     806                                                                </li>
     807                                                                <li>
     808                                                                        <input type="radio" name="q_1045971_how_many_attend" value="26-49"
     809                                                                                   id="q_1045971_1865401"/>
     810
     811                                                                        <label for="q_1045971_1865401" value="1865401">
     812                                                                                26-49 </label>
     813                                                                </li>
     814                                                                <li>
     815                                                                        <input type="radio" name="q_1045971_how_many_attend" value="1-25"
     816                                                                                   id="q_1045971_1865402"/>
     817
     818                                                                        <label for="q_1045971_1865402" value="1865402">
     819                                                                                1-25 </label>
     820                                                                </li>
     821                                                        </ul>
     822                                                </div>
     823                                        </div>
     824                                </div>
     825
     826                                <div class="PDF_questionDivide" id="pd-divider-14"></div>
     827
     828                                <div class="PDF_question" id="pd-question-15">
     829                                        <div class="qNumber">
     830                                                Q.15
     831                                        </div>
     832
     833                                        <div class="qContent">
     834                                                <div class="qText">
     835                                                        Have other community tech events (BarCamp, meetups, open source conferences) been successful
     836                                                        in your city?
     837                                                </div>
     838
     839                                                <div class="PDF_QT400">
     840                                                        <ul>
     841                                                                <li>
     842                                                                        <input type="radio" name="q_1079086_other_tech_events"
     843                                                                                   value="Yes, and I've attended some of them" id="q_1079086_1926723"/>
     844
     845                                                                        <label for="q_1079086_1926723" value="1926723">
     846                                                                                Yes, and I've attended some of them </label>
     847                                                                </li>
     848                                                                <li>
     849                                                                        <input type="radio" name="q_1079086_other_tech_events"
     850                                                                                   value="Yes, though I haven't attended any" id="q_1079086_1926724"/>
     851
     852                                                                        <label for="q_1079086_1926724" value="1926724">
     853                                                                                Yes, though I haven't attended any </label>
     854                                                                </li>
     855                                                                <li>
     856                                                                        <input type="radio" name="q_1079086_other_tech_events"
     857                                                                                   value="No, we've had a few but they weren't very well-attended"
     858                                                                                   id="q_1079086_1926725"/>
     859
     860                                                                        <label for="q_1079086_1926725" value="1926725">
     861                                                                                No, we've had a few but they weren't very well-attended </label>
     862                                                                </li>
     863                                                                <li>
     864                                                                        <input type="radio" name="q_1079086_other_tech_events"
     865                                                                                   value="We haven't had any community tech events yet" id="q_1079086_1926744"/>
     866
     867                                                                        <label for="q_1079086_1926744" value="1926744">
     868                                                                                We haven't had any community tech events yet </label>
     869                                                                </li>
     870                                                                <li>
     871                                                                        <input type="radio" name="q_1079086_other_tech_events"
     872                                                                                   value="I am not sure what events have been held here before, or if they've been successful"
     873                                                                                   id="q_1079086_1926745"/>
     874
     875                                                                        <label for="q_1079086_1926745" value="1926745">
     876                                                                                I am not sure what events have been held here before, or if they've been
     877                                                                                successful </label>
     878                                                                </li>
     879                                                        </ul>
     880                                                </div>
     881                                        </div>
     882                                </div>
     883
     884                                <div class="PDF_questionDivide" id="pd-divider-15"></div>
     885
     886                                <div class="PDF_question" id="pd-question-16">
     887                                        <div class="qNumber">
     888                                                Q.16
     889                                        </div>
     890
     891                                        <div class="qContent">
     892                                                <div class="qText">
     893                                                        List any community tech events that have/have not been successful in your city.
     894                                                </div>
     895
     896                                                <div class="PDF_QT200">
     897                                                        <textarea name="q_1079082_other_tech_events_success" class="small" rows="10" cols="40"
     898                                                                          title="List any community tech events that have/have not b&hellip;"></textarea>
     899                                                </div>
     900                                        </div>
     901                                </div>
     902
     903                                <div class="PDF_questionDivide" id="pd-divider-16"></div>
     904
     905                                <div class="PDF_question" id="pd-question-10002">
     906                                        <div class="qContent">
     907                                                <div class="PDF_QT1900">
     908                                                        <h2>Part III: About Your Potential WordCamp</h2>
     909                                                </div>
     910                                        </div>
     911                                </div>
     912
     913                                <div class="PDF_questionDivide" id="pd-divider-10002"></div>
     914
     915                                <div class="PDF_question" id="pd-question-17">
     916                                        <div class="qNumber">
     917                                                Q.17
     918                                        </div>
     919
     920                                        <div class="qContent">
     921                                                <div class="qText">
     922                                                        Enter the city, state/province, and country where you would like to organize a WordCamp.
     923                                                        <span class="PDF_mand">*</span>
     924                                                </div>
     925
     926                                                <div class="PDF_QT100">
     927                                                        <input value="" maxlength="500" name="q_1079103_wordcamp_location" class="large required"
     928                                                                   type="text" title="Enter the city, state/province, and country where y&hellip;"
     929                                                                   required/>
     930                                                </div>
     931                                        </div>
     932                                </div>
     933
     934                                <div class="PDF_questionDivide" id="pd-divider-17"></div>
     935
     936                                <div class="PDF_question" id="pd-question-18">
     937                                        <div class="qNumber">
     938                                                Q.18
     939                                        </div>
     940
     941                                        <div class="qContent">
     942                                                <div class="qText">
     943                                                        When do you want to have a WordCamp in your city? (month/year)
     944                                                </div>
     945
     946                                                <div class="PDF_QT100">
     947                                                        <input value="" maxlength="500" name="q_1046006_wordcamp_date" class="large" type="text"
     948                                                                   title="When do you want to have a WordCamp in your city? (&hellip;"/>
     949                                                </div>
     950                                        </div>
     951                                </div>
     952
     953                                <div class="PDF_questionDivide" id="pd-divider-18"></div>
     954
     955                                <div class="PDF_question" id="pd-question-19">
     956                                        <div class="qNumber">
     957                                                Q.19
     958                                        </div>
     959
     960                                        <div class="qContent">
     961                                                <div class="qText">
     962                                                        How many people do you think would attend?
     963                                                </div>
     964
     965                                                <div class="PDF_QT100">
     966                                                        <input value="" maxlength="500" name="q_1046007_how_many_attendees" class="large"
     967                                                                   type="text" title="How many people do you think would attend?"/>
     968                                                </div>
     969                                        </div>
     970                                </div>
     971
     972                                <div class="PDF_questionDivide" id="pd-divider-19"></div>
     973
     974                                <div class="PDF_question" id="pd-question-20">
     975                                        <div class="qNumber">
     976                                                Q.20
     977                                        </div>
     978
     979                                        <div class="qContent">
     980                                                <div class="qText">
     981                                                        Have you ever organized an event like this before?
     982                                                </div>
     983
     984                                                <div class="PDF_QT400">
     985                                                        <ul>
     986                                                                <li>
     987                                                                        <input type="radio" name="q_1046038_organized_event_before"
     988                                                                                   value="Yes, I've planned events of similar size/scope"
     989                                                                                   id="q_1046038_1865485"/>
     990
     991                                                                        <label for="q_1046038_1865485" value="1865485">
     992                                                                                Yes, I've planned events of similar size/scope </label>
     993                                                                </li>
     994                                                                <li>
     995                                                                        <input type="radio" name="q_1046038_organized_event_before"
     996                                                                                   value="I've organized similar types of events, but smaller"
     997                                                                                   id="q_1046038_1865486"/>
     998
     999                                                                        <label for="q_1046038_1865486" value="1865486">
     1000                                                                                I've organized similar types of events, but smaller </label>
     1001                                                                </li>
     1002                                                                <li>
     1003                                                                        <input type="radio" name="q_1046038_organized_event_before"
     1004                                                                                   value="I've organized other events" id="q_1046038_1865487"/>
     1005
     1006                                                                        <label for="q_1046038_1865487" value="1865487">
     1007                                                                                I've organized other events </label>
     1008                                                                </li>
     1009                                                                <li>
     1010                                                                        <input type="radio" name="q_1046038_organized_event_before"
     1011                                                                                   value="I've never organized an event before" id="q_1046038_1865495"/>
     1012
     1013                                                                        <label for="q_1046038_1865495" value="1865495">
     1014                                                                                I've never organized an event before </label>
     1015                                                                </li>
     1016                                                        </ul>
     1017                                                </div>
     1018                                        </div>
     1019                                </div>
     1020
     1021                                <div class="PDF_questionDivide" id="pd-divider-20"></div>
     1022
     1023                                <div class="PDF_question" id="pd-question-21">
     1024                                        <div class="qNumber">
     1025                                                Q.21
     1026                                        </div>
     1027
     1028                                        <div class="qContent">
     1029                                                <div class="qText">
     1030                                                        Please give a brief description of the events you&#039;ve been involved in organizing and
     1031                                                        what your role was.
     1032                                                </div>
     1033
     1034                                                <div class="PDF_QT200">
     1035                                                        <textarea name="q_1046099_describe_events" class="small" rows="10" cols="40"
     1036                                                                          title="Please give a brief description of the events you&#039;v&hellip;"></textarea>
     1037                                                </div>
     1038                                        </div>
     1039                                </div>
     1040
     1041                                <div class="PDF_questionDivide" id="pd-divider-21"></div>
     1042
     1043                                <div class="PDF_question" id="pd-question-22">
     1044                                        <div class="qNumber">
     1045                                                Q.22
     1046                                        </div>
     1047
     1048                                        <div class="qContent">
     1049                                                <div class="qText">
     1050                                                        Do you have at least 2 co-organizers?
     1051                                                </div>
     1052
     1053                                                <div class="PDF_QT400">
     1054                                                        <ul>
     1055                                                                <li>
     1056                                                                        <input type="radio" name="q_1046101_have_co_organizers"
     1057                                                                                   value="Yes, I have co-organizers already" id="q_1046101_1908677"/>
     1058
     1059                                                                        <label for="q_1046101_1908677" value="1908677">
     1060                                                                                Yes, I have co-organizers already </label>
     1061                                                                </li>
     1062                                                                <li>
     1063                                                                        <input type="radio" name="q_1046101_have_co_organizers"
     1064                                                                                   value="Nope, but I know some people who might be interested"
     1065                                                                                   id="q_1046101_1865560"/>
     1066
     1067                                                                        <label for="q_1046101_1865560" value="1865560">
     1068                                                                                Nope, but I know some people who might be interested </label>
     1069                                                                </li>
     1070                                                                <li>
     1071                                                                        <input type="radio" name="q_1046101_have_co_organizers"
     1072                                                                                   value="Nope, I probably need help to find co-organizers"
     1073                                                                                   id="q_1046101_1865561"/>
     1074
     1075                                                                        <label for="q_1046101_1865561" value="1865561">
     1076                                                                                Nope, I probably need help to find co-organizers </label>
     1077                                                                </li>
     1078                                                                <li>
     1079                                                                        <input type="radio" name="q_1046101_have_co_organizers"
     1080                                                                                   value="Nope, I want to do it by myself" id="q_1046101_1865562"/>
     1081
     1082                                                                        <label for="q_1046101_1865562" value="1865562">
     1083                                                                                Nope, I want to do it by myself </label>
     1084                                                                </li>
     1085                                                        </ul>
     1086                                                </div>
     1087                                        </div>
     1088                                </div>
     1089
     1090                                <div class="PDF_questionDivide" id="pd-divider-22"></div>
     1091
     1092                                <div class="PDF_question" id="pd-question-23">
     1093                                        <div class="qNumber">
     1094                                                Q.23
     1095                                        </div>
     1096
     1097                                        <div class="qContent">
     1098                                                <div class="qText">
     1099                                                        What&#039;s your relationship to your co-organizers?
     1100                                                </div>
     1101
     1102                                                <div class="PDF_QT400">
     1103                                                        <ul>
     1104                                                                <li>
     1105                                                                        <input type="checkbox" name="q_1068188_relationship_co_organizers[]"
     1106                                                                                   id="q_1068188_1908678" value="We work for the same company"/>
     1107
     1108                                                                        <label for="q_1068188_1908678">We work for the same company</label>
     1109                                                                </li>
     1110                                                                <li>
     1111                                                                        <input type="checkbox" name="q_1068188_relationship_co_organizers[]"
     1112                                                                                   id="q_1068188_1908679" value="We're friends"/>
     1113
     1114                                                                        <label for="q_1068188_1908679">We're friends</label>
     1115                                                                </li>
     1116                                                                <li>
     1117                                                                        <input type="checkbox" name="q_1068188_relationship_co_organizers[]"
     1118                                                                                   id="q_1068188_1908680" value="We've collaborated on projects before"/>
     1119
     1120                                                                        <label for="q_1068188_1908680">We've collaborated on projects before</label>
     1121                                                                </li>
     1122                                                                <li>
     1123                                                                        <input type="checkbox" name="q_1068188_relationship_co_organizers[]"
     1124                                                                                   id="q_1068188_1908689"
     1125                                                                                   value="We met through the meetup group/other tech event"/>
     1126
     1127                                                                        <label for="q_1068188_1908689">We met through the meetup group/other tech
     1128                                                                                event</label>
     1129                                                                </li>
     1130                                                                <li>
     1131                                                                        <label for="q_1068188_other">Other:</label>
     1132
     1133                                                                        <input type="text" class="other" name="q_1068188_relationship_co_organizers_other"
     1134                                                                                   id="q_1068188_other" value="" style="width: 75%"/>
     1135                                                                </li>
     1136                                                        </ul>
     1137                                                </div>
     1138                                        </div>
     1139                                </div>
     1140
     1141                                <div class="PDF_questionDivide" id="pd-divider-23"></div>
     1142
     1143                                <div class="PDF_question" id="pd-question-24">
     1144                                        <div class="qNumber">
     1145                                                Q.24
     1146                                        </div>
     1147
     1148                                        <div class="qContent">
     1149                                                <div class="qText">
     1150                                                        Please enter the names and email addresses of your co-organizers here.
     1151                                                </div>
     1152
     1153                                                <div class="PDF_QT200">
     1154                                                        <textarea name="q_1068187_co_organizer_contact_info" class="small" rows="10" cols="40"
     1155                                                                          title="Please enter the names and email addresses of your &hellip;"></textarea>
     1156                                                </div>
     1157                                        </div>
     1158                                </div>
     1159
     1160                                <div class="PDF_questionDivide" id="pd-divider-24"></div>
     1161
     1162                                <div class="PDF_question" id="pd-question-25">
     1163                                        <div class="qNumber">
     1164                                                Q.25
     1165                                        </div>
     1166
     1167                                        <div class="qContent">
     1168                                                <div class="qText">
     1169                                                        Are you confident you can raise money from local sponsors to cover the event costs?
     1170                                                </div>
     1171
     1172                                                <div class="PDF_QT400">
     1173                                                        <ul>
     1174                                                                <li>
     1175                                                                        <input type="radio" name="q_1068214_raise_money"
     1176                                                                                   value="Yes, I'm cool with the fundraising" id="q_1068214_1908711"/>
     1177
     1178                                                                        <label for="q_1068214_1908711" value="1908711">
     1179                                                                                Yes, I'm cool with the fundraising </label>
     1180                                                                </li>
     1181                                                                <li>
     1182                                                                        <input type="radio" name="q_1068214_raise_money"
     1183                                                                                   value="I'm not sure -- I haven't done this before but I'll do my best"
     1184                                                                                   id="q_1068214_1908712"/>
     1185
     1186                                                                        <label for="q_1068214_1908712" value="1908712">
     1187                                                                                I'm not sure -- I haven't done this before but I'll do my best </label>
     1188                                                                </li>
     1189                                                                <li>
     1190                                                                        <input type="radio" name="q_1068214_raise_money"
     1191                                                                                   value="Not really, I hate asking people for money" id="q_1068214_1908713"/>
     1192
     1193                                                                        <label for="q_1068214_1908713" value="1908713">
     1194                                                                                Not really, I hate asking people for money </label>
     1195                                                                </li>
     1196                                                        </ul>
     1197                                                </div>
     1198                                        </div>
     1199                                </div>
     1200
     1201                                <div class="PDF_questionDivide" id="pd-divider-25"></div>
     1202
     1203                                <div class="PDF_question" id="pd-question-26">
     1204                                        <div class="qNumber">
     1205                                                Q.26
     1206                                        </div>
     1207
     1208                                        <div class="qContent">
     1209                                                <div class="qText">
     1210                                                        If there are businesses already interested in sponsoring, list them here.
     1211                                                </div>
     1212
     1213                                                <div class="PDF_QT100">
     1214                                                        <input value="" maxlength="500" name="q_1068220_interested_sponsors" class="large"
     1215                                                                   type="text" title="If there are businesses already interested in spons&hellip;"/>
     1216                                                </div>
     1217                                        </div>
     1218                                </div>
     1219
     1220                                <div class="PDF_questionDivide" id="pd-divider-26"></div>
     1221
     1222                                <div class="PDF_question" id="pd-question-27">
     1223                                        <div class="qNumber">
     1224                                                Q.27
     1225                                        </div>
     1226
     1227                                        <div class="qContent">
     1228                                                <div class="qText">
     1229                                                        Do you know local people who would make good presenters/speakers?
     1230                                                </div>
     1231
     1232                                                <div class="PDF_QT400">
     1233                                                        <ul>
     1234                                                                <li>
     1235                                                                        <input type="radio" name="q_1046009_good_presenters"
     1236                                                                                   value="Yes, I know lots of local WordPress users/developers"
     1237                                                                                   id="q_1046009_1865453"/>
     1238
     1239                                                                        <label for="q_1046009_1865453" value="1865453">
     1240                                                                                Yes, I know lots of local WordPress users/developers </label>
     1241                                                                </li>
     1242                                                                <li>
     1243                                                                        <input type="radio" name="q_1046009_good_presenters"
     1244                                                                                   value="Yes, I know a couple of people who would be qualified"
     1245                                                                                   id="q_1046009_1865454"/>
     1246
     1247                                                                        <label for="q_1046009_1865454" value="1865454">
     1248                                                                                Yes, I know a couple of people who would be qualified </label>
     1249                                                                </li>
     1250                                                                <li>
     1251                                                                        <input type="radio" name="q_1046009_good_presenters"
     1252                                                                                   value="No, I don't know anyone local who could speak"
     1253                                                                                   id="q_1046009_1865455"/>
     1254
     1255                                                                        <label for="q_1046009_1865455" value="1865455">
     1256                                                                                No, I don't know anyone local who could speak </label>
     1257                                                                </li>
     1258                                                        </ul>
     1259                                                </div>
     1260                                        </div>
     1261                                </div>
     1262
     1263                                <div class="PDF_questionDivide" id="pd-divider-27"></div>
     1264
     1265                                <div class="PDF_question" id="pd-question-28">
     1266                                        <div class="qNumber">
     1267                                                Q.28
     1268                                        </div>
     1269
     1270                                        <div class="qContent">
     1271                                                <div class="qText">
     1272                                                        Please enter the names of the people you have in mind, and describe them in a few words.
     1273                                                </div>
     1274
     1275                                                <div class="PDF_QT200">
     1276                                                        <textarea name="q_1046021_presenter_names" class="small" rows="10" cols="40"
     1277                                                                          title="Please enter the names of the people you have in mi&hellip;"></textarea>
     1278                                                </div>
     1279                                        </div>
     1280                                </div>
     1281
     1282                                <div class="PDF_questionDivide" id="pd-divider-28"></div>
     1283
     1284                                <div class="PDF_question" id="pd-question-29">
     1285                                        <div class="qNumber">
     1286                                                Q.29
     1287                                        </div>
     1288
     1289                                        <div class="qContent">
     1290                                                <div class="qText">
     1291                                                        Do you have any connections to potential venue donations (colleges, offices, etc)?
     1292                                                </div>
     1293
     1294                                                <div class="PDF_QT400">
     1295                                                        <ul>
     1296                                                                <li>
     1297                                                                        <input type="radio" name="q_1068197_venue_connections"
     1298                                                                                   value="Yes, I've been talking to people already" id="q_1068197_1908695"/>
     1299
     1300                                                                        <label for="q_1068197_1908695" value="1908695">
     1301                                                                                Yes, I've been talking to people already </label>
     1302                                                                </li>
     1303                                                                <li>
     1304                                                                        <input type="radio" name="q_1068197_venue_connections"
     1305                                                                                   value="No, but I have some leads" id="q_1068197_1908696"/>
     1306
     1307                                                                        <label for="q_1068197_1908696" value="1908696">
     1308                                                                                No, but I have some leads </label>
     1309                                                                </li>
     1310                                                                <li>
     1311                                                                        <input type="radio" name="q_1068197_venue_connections"
     1312                                                                                   value="No, I'll be looking for a venue from scratch" id="q_1068197_1908697"/>
     1313
     1314                                                                        <label for="q_1068197_1908697" value="1908697">
     1315                                                                                No, I'll be looking for a venue from scratch </label>
     1316                                                                </li>
     1317                                                        </ul>
     1318                                                </div>
     1319                                        </div>
     1320                                </div>
     1321
     1322                                <div class="PDF_questionDivide" id="pd-divider-29"></div>
     1323
     1324                                <div class="PDF_question" id="pd-question-30">
     1325                                        <div class="qNumber">
     1326                                                Q.30
     1327                                        </div>
     1328
     1329                                        <div class="qContent">
     1330                                                <div class="qText">
     1331                                                        What possible venues are you considering?
     1332                                                </div>
     1333
     1334                                                <div class="PDF_QT200">
     1335                                                        <textarea name="q_1068212_venues_considering" class="small" rows="10" cols="40"
     1336                                                                          title="What possible venues are you considering?"></textarea>
     1337                                                </div>
     1338                                        </div>
     1339                                </div>
     1340
     1341                                <div class="PDF_questionDivide" id="pd-divider-30"></div>
     1342
     1343                                <div class="PDF_question" id="pd-question-32">
     1344                                        <div class="qNumber">
     1345                                                Q.32
     1346                                        </div>
     1347
     1348                                        <div class="qContent">
     1349                                                <div class="qText">
     1350                                                        Anything else you want us to know while we&#039;re looking over your application?
     1351                                                </div>
     1352
     1353                                                <div class="PDF_QT200">
     1354                                                        <textarea name="q_1079098_anything_else" class="large" rows="10" cols="40"
     1355                                                                          title="Anything else you want us to know while we&#039;re looki&hellip;"></textarea>
     1356                                                </div>
     1357                                        </div>
     1358                                </div>
     1359
     1360                                <div class="PDF_questionDivide" id="pd-divider-32"></div>
     1361
     1362                                <div class="PDF_question" id="pd-question-10003">
     1363                                        <div class="qContent">
     1364                                                <div class="PDF_QT1900">
     1365                                                        <h2>Bonus Question!</h2>
     1366                                                </div>
     1367                                        </div>
     1368                                </div>
     1369
     1370                                <div class="PDF_questionDivide" id="pd-divider-10003"></div>
     1371
     1372                                <div class="PDF_question" id="pd-question-33">
     1373                                        <div class="qNumber">
     1374                                                Q.33
     1375                                        </div>
     1376
     1377                                        <div class="qContent">
     1378                                                <div class="qText">
     1379                                                        Which of these best describes you?
     1380                                                </div>
     1381
     1382                                                <div class="PDF_QT400">
     1383                                                        <ul>
     1384                                                                <li>
     1385                                                                        <input type="radio" name="q_1079112_best_describes_you" value="Personal Blogger"
     1386                                                                                   id="q_1079112_1926766"/>
     1387
     1388                                                                        <label for="q_1079112_1926766" value="1926766">
     1389                                                                                Personal Blogger </label>
     1390                                                                </li>
     1391                                                                <li>
     1392                                                                        <input type="radio" name="q_1079112_best_describes_you" value="Company Blogger"
     1393                                                                                   id="q_1079112_1926767"/>
     1394
     1395                                                                        <label for="q_1079112_1926767" value="1926767">
     1396                                                                                Company Blogger </label>
     1397                                                                </li>
     1398                                                                <li>
     1399                                                                        <input type="radio" name="q_1079112_best_describes_you" value="Designer"
     1400                                                                                   id="q_1079112_1926768"/>
     1401
     1402                                                                        <label for="q_1079112_1926768" value="1926768">
     1403                                                                                Designer </label>
     1404                                                                </li>
     1405                                                                <li>
     1406                                                                        <input type="radio" name="q_1079112_best_describes_you" value="Beginning Developer"
     1407                                                                                   id="q_1079112_1926769"/>
     1408
     1409                                                                        <label for="q_1079112_1926769" value="1926769">
     1410                                                                                Beginning Developer </label>
     1411                                                                </li>
     1412                                                                <li>
     1413                                                                        <input type="radio" name="q_1079112_best_describes_you" value="Advanced Developer"
     1414                                                                                   id="q_1079112_1926770"/>
     1415
     1416                                                                        <label for="q_1079112_1926770" value="1926770">
     1417                                                                                Advanced Developer </label>
     1418                                                                </li>
     1419                                                                <li>
     1420                                                                        <input type="radio" name="q_1079112_best_describes_you" value="Project Manager"
     1421                                                                                   id="q_1079112_1926771"/>
     1422
     1423                                                                        <label for="q_1079112_1926771" value="1926771">
     1424                                                                                Project Manager </label>
     1425                                                                </li>
     1426                                                                <li>
     1427                                                                        <input type="radio" name="q_1079112_best_describes_you"
     1428                                                                                   value="System Administrator/IT Professional" id="q_1079112_1926772"/>
     1429
     1430                                                                        <label for="q_1079112_1926772" value="1926772">
     1431                                                                                System Administrator/IT Professional </label>
     1432                                                                </li>
     1433                                                                <li>
     1434                                                                        <input type="radio" name="q_1079112_best_describes_you" value="Sales/Marketing/PR"
     1435                                                                                   id="q_1079112_1926773"/>
     1436
     1437                                                                        <label for="q_1079112_1926773" value="1926773">
     1438                                                                                Sales/Marketing/PR </label>
     1439                                                                </li>
     1440                                                                <li>
     1441                                                                        <input type="radio" name="q_1079112_best_describes_you" value="Business Owner"
     1442                                                                                   id="q_1079112_1926774"/>
     1443
     1444                                                                        <label for="q_1079112_1926774" value="1926774">
     1445                                                                                Business Owner </label>
     1446                                                                </li>
     1447                                                                <li>
     1448                                                                        <input type="radio" name="q_1079112_best_describes_you" value="WordPress Fan"
     1449                                                                                   id="q_1079112_1926775"/>
     1450
     1451                                                                        <label for="q_1079112_1926775" value="1926775">
     1452                                                                                WordPress Fan </label>
     1453                                                                </li>
     1454                                                                <li>
     1455                                                                        <input type="radio" name="q_1079112_best_describes_you" id="q_1079112_other"
     1456                                                                                   value="other"/>
     1457
     1458                                                                        <label for="q_1079112_other">
     1459                                                                                Other:
     1460                                                                        </label>
     1461
     1462                                                                        <input type="text" class="other" name="q_1079112_best_describes_you_other" value=""
     1463                                                                                   style="width: 75%"/>
     1464                                                                </li>
     1465                                                        </ul>
     1466                                                </div>
     1467                                        </div>
     1468                                </div>
     1469
     1470                                <div class="PDF_questionDivide" id="pd-divider-33"></div>
     1471
     1472                                <div class="PDF_question">
     1473                                        <div class="button">
     1474                                                <input type="submit" name="submit-application" value="Submit Application"/>
     1475                                        </div>
     1476                                </div>
     1477
     1478                        </div> <!-- PDF.pageInner -->
     1479                </div> <!-- PDF.pageOuter -->
     1480
     1481        </form>
     1482
     1483        <?php
     1484}
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/views/wordcamp/metabox-status.php

    r6186 r7607  
    22defined( 'WPINC' ) || die();
    33
    4 $wcpt = get_post_type_object( WCPT_POST_TYPE_ID );
    5 ?>
     4/**
     5 * Renders the status metabox for events. Will display current status of the event. If user has edit_post access then will display dropdown of all available statuses for this post.
     6 *
     7 * @param Event_Admin $event_admin Event admin object. Must have methods `get_valid_status_transitions` and `get_post_statuses`
     8 * @param WP_Post $post Post object
     9 * @param string $event_type Type of event. Could be 'wordcamp' or 'wp_meetup'.
     10 * @param string $label Label to display. Could be 'WordCamp' or 'Meetup' as of now.
     11 * @param string $edit_capability Name of the capability which allows to edit the event
     12 */
     13function render_event_metabox( $event_admin, $post, $event_type, $label, $edit_capability ) {
     14        $wcpt = get_post_type_object( $event_type );
     15        ?>
    616
    7 <div id="submitpost" class="wcb submitbox">
    8         <div id="minor-publishing">
    9                 <div id="misc-publishing-actions">
    10                         <div class="misc-pub-section misc-pub-post-status">
    11                                 <label>
    12                                         WordCamp Status:
     17        <div id="submitpost" class="wcb submitbox">
     18                <div id="minor-publishing">
     19                        <div id="misc-publishing-actions">
     20                                <div class="misc-pub-section misc-pub-post-status">
     21                                        <label>
     22                                                <?php echo $label; ?> Status:
    1323
    14                                         <?php if ( current_user_can( 'wordcamp_wrangle_wordcamps' ) ) : ?>
     24                                                <?php if ( current_user_can( $edit_capability ) ) : ?>
    1525
    16                                                 <span id="post-status-display">
     26                                                        <span id="post-status-display">
    1727                                                        <select name="post_status">
    18                                                                 <?php $transitions = WordCamp_Loader::get_valid_status_transitions( $post->post_status ); ?>
    19                                                                 <?php foreach ( WordCamp_Loader::get_post_statuses() as $key => $label ) : ?>
     28                                                                <?php $transitions = $event_admin->get_valid_status_transitions( $post->post_status );
     29                                                                ?>
     30                                                                <?php foreach ( $event_admin->get_post_statuses() as $key => $label ) : ?>
    2031                                                                        <?php $status = get_post_status_object( $key ); ?>
    2132                                                                        <option value="<?php echo esc_attr( $status->name ); ?>" <?php
     
    3243                                                </span>
    3344
    34                                         <?php else : ?>
     45                                                <?php else : ?>
    3546
    36                                                 <span id="post-status-display">
     47                                                        <span id="post-status-display">
    3748                                                        <?php
    3849                                                                $status = get_post_status_object( $post->post_status );
     
    4152                                                </span>
    4253
    43                                         <?php endif; ?>
    44                                 </label>
     54                                                <?php endif; ?>
     55                                        </label>
     56                                </div>
     57                                <div class="clear"></div>
     58                        </div> <!-- #misc-publishing-actions -->
     59
     60                        <div class="clear"></div>
     61                </div> <!-- #minor-publishing -->
     62
     63                <div id="major-publishing-actions">
     64                        <div id="delete-action">
     65                                <?php if ( current_user_can( $wcpt->cap->delete_post, $post->ID ) ) : ?>
     66                                        <a class="submitdelete deletion" href="<?php echo get_delete_post_link( $post->ID ); ?>">
     67                                                <?php _e( 'Delete', 'wordcamporg' ); ?>
     68                                        </a>
     69                                <?php endif; ?>
    4570                        </div>
     71
     72                        <div id="publishing-action">
     73                                <?php submit_button( 'Update', 'primary button-large', 'wcpt-update', false, array( 'accesskey' => 'p' ) ); ?>
     74                        </div>
     75
    4676                        <div class="clear"></div>
    47                 </div> <!-- #misc-publishing-actions -->
     77                </div> <!-- #major-publishing-actions -->
    4878
    49                 <div class="clear"></div>
    50         </div> <!-- #minor-publishing -->
    51        
    52         <div id="major-publishing-actions">
    53                 <div id="delete-action">
    54                         <?php if ( current_user_can( $wcpt->cap->delete_post, $post->ID ) ) : ?>
    55                                 <a class="submitdelete deletion" href="<?php echo get_delete_post_link( $post->ID ); ?>">
    56                                         <?php _e( 'Delete', 'wordcamporg' ); ?>
    57                                 </a>
    58                         <?php endif; ?>
    59                 </div>
    60 
    61                 <div id="publishing-action">
    62                         <?php submit_button( 'Update', 'primary button-large', 'wcpt-update', false, array( 'accesskey' => 'p' ) ); ?>
    63                 </div>
    64 
    65                 <div class="clear"></div>
    66         </div> <!-- #major-publishing-actions -->
    67 
    68 </div> <!-- .submitbox -->
     79        </div> <!-- .submitbox -->
     80        <?php
     81}
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-functions.php

    r6727 r7607  
    7272 * Get all the the entries
    7373 *
    74  * @param int $wordcamp_id
     74 * @param int $event_id
    7575 *
    7676 * @return array
    7777 */
    78 function wcpt_get_log_entries( $wordcamp_id ) {
     78function wcpt_get_log_entries( $event_id ) {
    7979        /*
    8080         * @todo Rename `_note` meta fields to `_private_note` to make it obvious to devs that the value should be
     
    8383         */
    8484        $entries        = array();
    85         $private_notes  = get_post_meta( $wordcamp_id, '_note'          );
    86         $status_changes = get_post_meta( $wordcamp_id, '_status_change' );
     85        $private_notes  = get_post_meta( $event_id, '_note'          );
     86        $status_changes = get_post_meta( $event_id, '_status_change' );
    8787
    8888        foreach ( array( 'note' => $private_notes, 'status_change' => $status_changes ) as $entry_type => $raw_entries ) {
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-loader.php

    r7221 r7607  
    4646                require_once ( WCPT_DIR . 'wcpt-functions.php' );
    4747                require_once ( WCPT_DIR . 'wcpt-wordcamp/wordcamp-loader.php' );
    48                 require_once ( WCPT_DIR . 'applications/common.php' );
    49                 require_once ( WCPT_DIR . 'applications/tracker.php' );
    50                 require_once ( WCPT_DIR . 'applications/wordcamp.php' );
     48                require_once ( WCPT_DIR . 'wcpt-meetup/meetup-loader.php' );
     49                require_once ( WCPT_DIR . 'wcpt-event/tracker.php' );
     50                require_once ( WCPT_DIR . 'wcpt-wordcamp/wordcamp.php' );
     51                require_once ( WCPT_DIR . 'wcpt-meetup/meetup.php' );
     52                require_once ( WCPT_DIR . 'wcpt-meetup/class-meetup-admin.php' );
    5153
    5254                // Require admin files.
     
    6870                $GLOBALS['wcpt_admin'] = new WCPT_Admin;
    6971                $GLOBALS['wordcamp_admin'] = new WordCamp_Admin;
     72                $GLOBALS['meetup_admin'] = new Meetup_Admin();
    7073        }
    7174
     
    8891$wcpt_loader     = new WCPT_Loader;
    8992$wordcamp_loader = new WordCamp_Loader;
     93$meetup_loader = new Meetup_Loader();
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-admin.php

    r7485 r7607  
    22
    33use WordCamp\Mentors_Dashboard;
     4use WordPress_Community\Applications\WordCamp_Application;
     5
     6require_once WCPT_DIR . 'wcpt-event/class-event-admin.php';
    47
    58if ( ! class_exists( 'WordCamp_Admin' ) ) :
    6 /**
    7  * WCPT_Admin
    8  *
    9  * Loads plugin admin area
    10  *
    11  * @package WordCamp Post Type
    12  * @subpackage Admin
    13  * @since WordCamp Post Type (0.1)
    14  */
    15 class WordCamp_Admin {
    16         protected $active_admin_notices;
    17 
    189        /**
    19          * Initialize WCPT Admin
     10         * WCPT_Admin
     11         *
     12         * Loads plugin admin area
     13         *
     14         * @package WordCamp Post Type
     15         * @subpackage Admin
     16         * @since WordCamp Post Type (0.1)
    2017         */
    21         function __construct() {
    22                 $this->active_admin_notices = array();
    23 
    24                 // Add some general styling to the admin area
    25                 add_action( 'wcpt_admin_head',                                array( $this, 'admin_head' ) );
    26 
    27                 // Forum column headers.
    28                 add_filter( 'manage_' . WCPT_POST_TYPE_ID . '_posts_columns', array( $this, 'column_headers' ) );
    29                 add_filter( 'display_post_states',                            array( $this, 'display_post_states' ) );
    30 
    31                 // Forum columns (in page row)
    32                 add_action( 'manage_posts_custom_column',                     array( $this, 'column_data' ), 10, 2 );
    33                 add_filter( 'post_row_actions',                               array( $this, 'post_row_actions' ), 10, 2 );
    34 
    35                 // Topic metabox actions
    36                 add_action( 'add_meta_boxes',                                 array( $this, 'metabox' ) );
    37                 add_action( 'save_post_' . WCPT_POST_TYPE_ID,                 array( $this, 'metabox_save' ), 10, 2 );
    38 
    39                 // Scripts and CSS
    40                 add_action( 'admin_enqueue_scripts',                          array( $this, 'admin_scripts' ) );
    41                 add_action( 'admin_print_styles',                             array( $this, 'admin_styles' ) );
    42 
    43                 // Post status transitions
    44                 add_action( 'transition_post_status',                         array( $this, 'trigger_schedule_actions' ), 10, 3 );
    45                 add_action( 'transition_post_status',                         array( $this, 'log_status_changes'       ), 10, 3 );
    46                 add_action( 'wcpt_approved_for_pre_planning',                 array( $this, 'add_organizer_to_central' ), 10 );
    47                 add_action( 'wcpt_approved_for_pre_planning',                 array( $this, 'mark_date_added_to_planning_schedule' ), 10 );
    48                 add_filter( 'wp_insert_post_data',                            array( $this, 'enforce_post_status' ), 10, 2 );
    49                 add_filter( 'wp_insert_post_data',                            array( $this, 'require_complete_meta_to_publish_wordcamp' ), 11, 2 ); // after enforce_post_status
    50 
    51                 // Admin notices
    52                 add_action( 'admin_notices',                                  array( $this, 'print_admin_notices' ) );
    53                 add_filter( 'redirect_post_location',                         array( $this, 'add_admin_notices_to_redirect_url' ), 10, 2 );
    54 
    55                 // Cron jobs
    56                 add_action( 'plugins_loaded',                                 array( $this, 'schedule_cron_jobs'          ), 11 );
    57                 add_action( 'wcpt_close_wordcamps_after_event',               array( $this, 'close_wordcamps_after_event' )     );
    58         }
    59 
    60         /**
    61          * metabox ()
    62          *
    63          * Add the metabox
    64          *
    65          * @uses add_meta_box
    66          */
    67         function metabox() {
    68                 add_meta_box(
    69                         'wcpt_information',
    70                         __( 'WordCamp Information', 'wcpt' ),
    71                         'wcpt_wordcamp_metabox',
    72                         WCPT_POST_TYPE_ID,
    73                         'advanced',
    74                         'high'
    75                 );
    76 
    77                 add_meta_box(
    78                         'wcpt_organizer_info',
    79                         __( 'Organizing Team', 'wcpt' ),
    80                         'wcpt_organizer_metabox',
    81                         WCPT_POST_TYPE_ID,
    82                         'advanced',
    83                         'high'
    84                 );
    85 
    86                 add_meta_box(
    87                         'wcpt_venue_info',
    88                         __( 'Venue Information', 'wcpt' ),
    89                         'wcpt_venue_metabox',
    90                         WCPT_POST_TYPE_ID,
    91                         'advanced',
    92                         'high'
    93                 );
    94 
    95                 add_meta_box(
    96                         'wcpt_contributor_info',
    97                         __( 'Contributor Day Information', 'wcpt' ),
    98                         'wcpt_contributor_metabox',
    99                         WCPT_POST_TYPE_ID,
    100                         'advanced'
    101                 );
    102 
    103                 add_meta_box(
    104                         'wcpt_original_application',
    105                         'Original Application',
    106                         array( $this, 'original_application_metabox' ),
    107                         WCPT_POST_TYPE_ID,
    108                         'advanced',
    109                         'low'
    110                 );
    111 
    112                 // Notes are private, so only show them to WordCamp Wranglers
    113                 if ( current_user_can( 'wordcamp_wrangle_wordcamps' ) ) {
     18        class WordCamp_Admin extends Event_Admin {
     19                protected $active_admin_notices;
     20
     21                /**
     22                 * Initialize WCPT Admin
     23                 */
     24                function __construct() {
     25
     26                        parent::__construct();
     27
     28                        $this->active_admin_notices = array();
     29
     30                        // Add some general styling to the admin area
     31                        add_action( 'wcpt_admin_head', array( $this, 'admin_head' ) );
     32
     33                        // Scripts and CSS
     34                        add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );
     35
     36                        // Post status transitions
     37                        add_action( 'transition_post_status', array( $this, 'trigger_schedule_actions' ), 10, 3 );
     38                        add_action( 'wcpt_approved_for_pre_planning', array( $this, 'add_organizer_to_central' ), 10 );
     39                        add_action( 'wcpt_approved_for_pre_planning', array( $this, 'mark_date_added_to_planning_schedule' ), 10 );
     40
     41                        add_filter( 'wp_insert_post_data', array( $this, 'enforce_post_status' ), 10, 2 );
     42
     43                        add_filter(
     44                                'wp_insert_post_data', array(
     45                                        $this,
     46                                        'require_complete_meta_to_publish_wordcamp',
     47                                ), 11, 2
     48                        ); // after enforce_post_status
     49
     50                        // Admin notices
     51                        add_action( 'admin_notices', array( $this, 'print_admin_notices' ) );
     52
     53                        add_filter( 'redirect_post_location', array( $this, 'add_admin_notices_to_redirect_url' ), 10, 2 );
     54
     55                        // Cron jobs
     56                        add_action( 'plugins_loaded', array( $this, 'schedule_cron_jobs' ), 11 );
     57                        add_action( 'wcpt_close_wordcamps_after_event', array( $this, 'close_wordcamps_after_event' ) );
     58                        add_action( 'wcpt_metabox_save_done', array( $this, 'update_venue_address' ) );
     59                        add_action( 'wcpt_metabox_save_done', array( $this, 'update_mentor' ) );
     60                }
     61
     62                /**
     63                 * metabox ()
     64                 *
     65                 * Add the metabox
     66                 *
     67                 * @uses add_meta_box
     68                 */
     69                function metabox() {
    11470                        add_meta_box(
    115                                 'wcpt_notes',
    116                                 __( 'Add Private Note', 'wordcamporg' ),
    117                                 'wcpt_add_note_metabox',
    118                                 WCPT_POST_TYPE_ID,
    119                                 'side',
    120                                 'low'
    121                         );
    122 
    123                         add_meta_box(
    124                                 'wcpt_log',
    125                                 'Log',
    126                                 'wcpt_log_metabox',
     71                                'wcpt_information',
     72                                __( 'WordCamp Information', 'wcpt' ),
     73                                'wcpt_wordcamp_metabox',
    12774                                WCPT_POST_TYPE_ID,
    12875                                'advanced',
    129                                 'low'
     76                                'high'
    13077                        );
    131                 }
    132 
    133                 // Remove core's submitdiv.
    134                 remove_meta_box( 'submitdiv', WCPT_POST_TYPE_ID, 'side' );
    135 
    136                 $statuses = WordCamp_Loader::get_post_statuses();
    137 
    138                 add_meta_box(
    139                         'submitdiv',
    140                         __( 'Status', 'wordcamporg' ),
    141                         array( $this, 'metabox_status' ),
    142                         WCPT_POST_TYPE_ID,
    143                         'side',
    144                         'high'
    145                 );
    146         }
    147 
    148         /**
    149          * metabox_save ()
    150          *
    151          * Pass the metabox values before saving
    152          *
    153          * @param int $post_id
    154          * @return int
    155          */
    156         function metabox_save( $post_id, $post ) {
    157                 // Don't add/remove meta on revisions and auto-saves
    158                 if ( wp_is_post_autosave( $post_id ) || wp_is_post_revision( $post_id ) )
    159                         return;
    160 
    161                 // Don't add/remove meta on trash, untrash, restore, etc
    162                 if ( empty( $_POST['action'] ) || 'editpost' != $_POST['action'] ) {
    163                         return;
    164                 }
    165 
    166                 // WordCamp post type only
    167                 if ( WCPT_POST_TYPE_ID != get_post_type() ) {
    168                         return;
    169                 }
    170 
    171                 // Make sure the requset came from the edit post screen.
    172                 if ( empty( $_POST['_wpnonce'] ) || ! wp_verify_nonce( $_POST['_wpnonce'], 'update-post_' . $post_id ) ) {
    173                         return;
    174                 }
    175 
    176                 // If the venue address was changed, update its coordinates
    177                 $new_address = $_POST[ wcpt_key_to_str( 'Physical Address', 'wcpt_' ) ];
    178                 if ( $new_address != get_post_meta( $post_id, 'Physical Address', true ) ) {
    179                         $this->update_venue_address( $post_id, $new_address );
    180                 }
    181 
    182                 // If the Mentor username changed, update the site
    183                 $mentor_username = $_POST[ wcpt_key_to_str( 'Mentor WordPress.org User Name', 'wcpt_' ) ];
    184                 if ( $mentor_username !== get_post_meta( $post_id, 'Mentor WordPress.org User Name', true ) ) {
    185                     $this->add_mentor( $post, $mentor_username );
    186         }
    187 
    188                 // Post meta keys
    189                 $wcpt_meta_keys = WordCamp_Admin::meta_keys();
    190 
    191                 // Loop through meta keys and update
    192                 foreach ( $wcpt_meta_keys as $key => $value ) {
    193                         // Get post value
    194                         $post_value   = wcpt_key_to_str( $key, 'wcpt_' );
    195                         $values[ $key ] = isset( $_POST[ $post_value ] ) ? esc_attr( $_POST[ $post_value ] ) : '';
    196 
    197                         // Don't update protected fields
    198                         if ( self::is_protected_field( $key ) ) {
    199                                 continue;
    200                         }
    201 
    202                         switch ( $value ) {
    203                                 case 'text'     :
    204                                 case 'textarea' :
    205                                         update_post_meta( $post_id, $key, $values[ $key ] );
    206                                         break;
    207 
    208                                 case 'number' :
    209                                         update_post_meta( $post_id, $key, floatval( $values[ $key ] ) );
    210                                         break;
    211 
    212                                 case 'checkbox' :
    213                                         if ( ! empty( $values[ $key ] ) && 'on' == $values[ $key ] ) {
    214                                                 update_post_meta( $post_id, $key, true );
    215                                         } else {
    216                                                 update_post_meta( $post_id, $key, false );
     78
     79                        add_meta_box(
     80                                'wcpt_organizer_info',
     81                                __( 'Organizing Team', 'wcpt' ),
     82                                'wcpt_organizer_metabox',
     83                                WCPT_POST_TYPE_ID,
     84                                'advanced',
     85                                'high'
     86                        );
     87
     88                        add_meta_box(
     89                                'wcpt_venue_info',
     90                                __( 'Venue Information', 'wcpt' ),
     91                                'wcpt_venue_metabox',
     92                                WCPT_POST_TYPE_ID,
     93                                'advanced',
     94                                'high'
     95                        );
     96
     97                        add_meta_box(
     98                                'wcpt_contributor_info',
     99                                __( 'Contributor Day Information', 'wcpt' ),
     100                                'wcpt_contributor_metabox',
     101                                WCPT_POST_TYPE_ID,
     102                                'advanced'
     103                        );
     104
     105                }
     106
     107                /**
     108                 * Get label for event type
     109                 *
     110                 * @return string
     111                 */
     112                static function get_event_label() {
     113                        return WordCamp_Application::get_event_label();
     114                }
     115
     116                /**
     117                 * Get wordcamp post type
     118                 *
     119                 * @return string
     120                 */
     121                static function get_event_type() {
     122                        return WordCamp_Application::get_event_type();
     123                }
     124
     125                /**
     126                 * Check if a field is readonly.
     127                 *
     128                 * @param $key
     129                 *
     130                 * @return bool
     131                 */
     132                function _is_protected_field( $key ) {
     133                        return self::is_protected_field( $key );
     134                }
     135
     136                public function update_mentor( $post_id ) {
     137                        if ( $this->get_event_type() !== get_post_type() ) {
     138                                return;
     139                        }
     140
     141                        // If the Mentor username changed, update the site
     142                        $mentor_username = $_POST[ wcpt_key_to_str( 'Mentor WordPress.org User Name', 'wcpt_' ) ];
     143                        if ( $mentor_username !== get_post_meta( $post_id, 'Mentor WordPress.org User Name', true ) ) {
     144                                $this->add_mentor( get_post( $post_id ), $mentor_username );
     145                        }
     146
     147                }
     148
     149                /**
     150                 * Update venue address co-ords if changed
     151                 *
     152                 * These are used for the maps on Central, stats, etc.
     153                 *
     154                 * @param int $post_id Post id
     155                 */
     156                public function update_venue_address( $post_id ) {
     157                        if ( $this->get_event_type() !== get_post_type() ) {
     158                                return;
     159                        }
     160
     161                        // If the venue address was changed, update its coordinates
     162                        $new_address = $_POST[ wcpt_key_to_str( 'Physical Address', 'wcpt_' ) ];
     163                        if ( $new_address === get_post_meta( $post_id, 'Physical Address', true ) ) {
     164                                return;
     165                        }
     166
     167                        $request_url = add_query_arg(
     168                                'address',
     169                                urlencode( $new_address ),
     170                                'https://maps.googleapis.com/maps/api/geocode/json'
     171                        );
     172
     173                        $response = wcorg_redundant_remote_get( $request_url );
     174
     175                        // Don't delete the existing (and probably good) values if the request failed
     176                        if ( is_wp_error( $response ) ) {
     177                                return;
     178                        }
     179
     180                        $meta_values = $this->parse_geocode_response( $response );
     181
     182                        foreach ( $meta_values as $key => $value ) {
     183                                if ( is_null( $value ) ) {
     184                                        delete_post_meta( $post_id, $key );
     185                                } else {
     186                                        update_post_meta( $post_id, $key, $value );
     187                                }
     188                        }
     189
     190                }
     191
     192                /**
     193                 * Parse the values we want out of the Geocode API response
     194                 *
     195                 * @see https://developers.google.com/maps/documentation/geocoding/intro#Types API response schema
     196                 *
     197                 * @param $response
     198                 *
     199                 * @return array
     200                 */
     201                protected function parse_geocode_response( $response ) {
     202                        $body = json_decode( wp_remote_retrieve_body( $response ) );
     203                        $body = isset( $body->results[0] ) ? $body->results[0] : null;
     204
     205                        if ( isset( $body->geometry->location->lat ) ) {
     206                                $coordinates = array(
     207                                        'latitude'  => $body->geometry->location->lat,
     208                                        'longitude' => $body->geometry->location->lng,
     209                                );
     210                        }
     211
     212                        if ( isset( $body->address_components ) ) {
     213                                foreach ( $body->address_components as $component ) {
     214                                        foreach ( $component->types as $type ) {
     215                                                switch ( $type ) {
     216
     217                                                        case 'locality':
     218                                                        case 'administrative_area_level_1':
     219                                                        case 'postal_code':
     220                                                                $$type = $component->long_name;
     221                                                                break;
     222
     223                                                        case 'country':
     224                                                                $country_code = $component->short_name; // This is not guaranteed to be ISO 3166-1 alpha-2, but should match in most cases
     225                                                                $country_name = $component->long_name;
     226                                                                break;
     227
     228                                                }
    217229                                        }
    218                                         break;
    219 
    220                                 case 'date' :
    221                                         if ( !empty( $values[ $key ] ) ) {
    222                                                 $values[ $key ] = strtotime( $values[ $key ] );
    223                                         }
    224 
    225                                         update_post_meta( $post_id, $key, $values[ $key ] );
    226                                         break;
    227 
    228                                 case 'select-currency' :
    229                                         $currencies = WordCamp_Budgets::get_currencies();
    230                                         $new_value  = ( array_key_exists( $values[ $key ], $currencies ) ) ? $values[ $key ] : '';
    231 
    232                                         update_post_meta( $post_id, $key, $new_value );
    233                                         break;
    234 
     230                                }
     231                        }
     232
     233                        $values = array(
     234                                '_venue_coordinates'  => isset( $coordinates ) ? $coordinates : null,
     235                                '_venue_city'         => isset( $locality ) ? $locality : null,
     236                                '_venue_state'        => isset( $administrative_area_level_1 ) ? $administrative_area_level_1 : null,
     237                                '_venue_country_code' => isset( $country_code ) ? $country_code : null,
     238                                '_venue_country_name' => isset( $country_name ) ? $country_name : null,
     239                                '_venue_zip'          => isset( $postal_code ) ? $postal_code : null,
     240                        );
     241
     242                        return $values;
     243                }
     244
     245                /**
     246                 * Add the Mentor as an administrator on the given site.
     247                 *
     248                 * @param WP_Post $wordcamp        WordCamp post object.
     249                 * @param string  $mentor_username Mentor's WP.org user login.
     250                 */
     251                protected function add_mentor( $wordcamp, $mentor_username ) {
     252                        $blog_id    = get_wordcamp_site_id( $wordcamp );
     253                        $new_mentor = get_user_by( 'login', $mentor_username );
     254
     255                        if ( ! $blog_id || ! $new_mentor ) {
     256                                return;
     257                        }
     258
     259                        add_user_to_blog( $blog_id, $new_mentor->ID, 'administrator' );
     260                }
     261
     262                /**
     263                 * meta_keys ()
     264                 *
     265                 * Returns post meta key
     266                 *
     267                 * @param string $meta_group
     268                 *
     269                 * @return array
     270                 */
     271                static function meta_keys( $meta_group = '' ) {
     272                        /*
     273                         * Warning: These keys are used for both the input field label and the postmeta key, so if you want to
     274                         * modify an existing label then you'll also need to migrate any rows in the database to use the new key.
     275                         *
     276                         * Some of them are also exposed via the JSON API, so you'd need to build in a back-compat layer for that
     277                         * as well.
     278                         *
     279                         * When adding new keys, updating the wcorg-json-api plugin to either whitelist it, or test that it's not
     280                         * being exposed.
     281                         */
     282
     283                        switch ( $meta_group ) {
     284                                case 'organizer':
     285                                        $retval = array(
     286                                                'Organizer Name'                   => 'text',
     287                                                'WordPress.org Username'           => 'text',
     288                                                'Email Address'                    => 'text', // Note: This is the lead organizer's e-mail address, which is different than the "E-mail Address" field
     289                                                'Telephone'                        => 'text',
     290                                                'Mailing Address'                  => 'textarea',
     291                                                'Sponsor Wrangler Name'            => 'text',
     292                                                'Sponsor Wrangler E-mail Address'  => 'text',
     293                                                'Budget Wrangler Name'             => 'text',
     294                                                'Budget Wrangler E-mail Address'   => 'text',
     295                                                'Venue Wrangler Name'              => 'text',
     296                                                'Venue Wrangler E-mail Address'    => 'text',
     297                                                'Speaker Wrangler Name'            => 'text',
     298                                                'Speaker Wrangler E-mail Address'  => 'text',
     299                                                'Food/Beverage Wrangler Name'      => 'text',
     300                                                'Food/Beverage Wrangler E-mail Address' => 'text',
     301                                                'Swag Wrangler Name'               => 'text',
     302                                                'Swag Wrangler E-mail Address'     => 'text',
     303                                                'Volunteer Wrangler Name'          => 'text',
     304                                                'Volunteer Wrangler E-mail Address' => 'text',
     305                                                'Printing Wrangler Name'           => 'text',
     306                                                'Printing Wrangler E-mail Address' => 'text',
     307                                                'Design Wrangler Name'             => 'text',
     308                                                'Design Wrangler E-mail Address'   => 'text',
     309                                                'Website Wrangler Name'            => 'text',
     310                                                'Website Wrangler E-mail Address'  => 'text',
     311                                                'Social Media/Publicity Wrangler Name' => 'text',
     312                                                'Social Media/Publicity Wrangler E-mail Address' => 'text',
     313                                                'A/V Wrangler Name'                => 'text',
     314                                                'A/V Wrangler E-mail Address'      => 'text',
     315                                                'Party Wrangler Name'              => 'text',
     316                                                'Party Wrangler E-mail Address'    => 'text',
     317                                                'Travel Wrangler Name'             => 'text',
     318                                                'Travel Wrangler E-mail Address'   => 'text',
     319                                                'Safety Wrangler Name'             => 'text',
     320                                                'Safety Wrangler E-mail Address'   => 'text',
     321                                                'Mentor WordPress.org User Name'   => 'text',
     322                                                'Mentor Name'                      => 'text',
     323                                                'Mentor E-mail Address'            => 'text',
     324                                        );
     325
     326                                        break;
     327
     328                                case 'venue':
     329                                        $retval = array(
     330                                                'Venue Name'                 => 'text',
     331                                                'Physical Address'           => 'textarea',
     332                                                'Maximum Capacity'           => 'text',
     333                                                'Available Rooms'            => 'text',
     334                                                'Website URL'                => 'text',
     335                                                'Contact Information'        => 'textarea',
     336                                                'Exhibition Space Available' => 'checkbox',
     337                                        );
     338                                        break;
     339
     340                                case 'contributor':
     341                                        // These fields names need to be unique, hence the 'Contributor' prefix on each one
     342                                        $retval = array(
     343                                                'Contributor Day'                => 'checkbox',
     344                                                'Contributor Day Date (YYYY-mm-dd)' => 'date',
     345                                                'Contributor Venue Name'         => 'text',
     346                                                'Contributor Venue Address'      => 'textarea',
     347                                                'Contributor Venue Capacity'     => 'text',
     348                                                'Contributor Venue Website URL'  => 'text',
     349                                                'Contributor Venue Contact Info' => 'textarea',
     350                                        );
     351                                        break;
     352
     353                                case 'wordcamp':
     354                                        $retval = array(
     355                                                'Start Date (YYYY-mm-dd)'         => 'date',
     356                                                'End Date (YYYY-mm-dd)'           => 'date',
     357                                                'Location'                        => 'text',
     358                                                'URL'                             => 'wc-url',
     359                                                'E-mail Address'                  => 'text',
     360                                                // Note: This is the address for the entire organizing team, which is different than the "Email Address" field
     361                                                'Twitter'                         => 'text',
     362                                                'WordCamp Hashtag'                => 'text',
     363                                                'Number of Anticipated Attendees' => 'text',
     364                                                'Multi-Event Sponsor Region'      => 'mes-dropdown',
     365                                                'Global Sponsorship Grant Currency' => 'select-currency',
     366                                                'Global Sponsorship Grant Amount' => 'number',
     367                                                'Global Sponsorship Grant'        => 'text',
     368                                        );
     369                                        break;
     370
     371                                case 'all':
    235372                                default:
    236                                         do_action( 'wcpt_metabox_save', $key, $value, $post_id );
    237                                         break;
    238                         }
    239                 }
    240 
    241                 do_action( 'wcpt_metabox_save_done', $post_id );
    242 
    243                 $this->validate_and_add_note( $post_id );
    244         }
    245 
    246         /**
    247          * Validate and add a new private note
    248          *
    249          * @param int $post_id
    250          */
    251         protected function validate_and_add_note( $post_id ) {
    252                 if ( empty( $_POST['wcpt_new_note' ] ) )
    253                         return;
    254 
    255                 check_admin_referer( 'wcpt_notes', 'wcpt_notes_nonce' );
    256 
    257                 $new_note_message = sanitize_text_field( wp_unslash( $_POST['wcpt_new_note'] ) );
    258 
    259                 if ( empty( $new_note_message ) ) {
    260                         return;
    261                 }
    262 
    263                 // Note that this is private, see wcpt_get_log_entries()
    264                 add_post_meta( $post_id, '_note', array(
    265                         'timestamp' => time(),
    266                         'user_id'   => get_current_user_id(),
    267                         'message'   => $new_note_message,
    268                 ) );
    269         }
    270 
    271         /**
    272          * Store the individual components of a camp's venue address
    273          *
    274          * These are used for the maps on Central, stats, etc.
    275          *
    276          * @param int    $post_id
    277          * @param string $address
    278          */
    279         function update_venue_address( $post_id, $address ) {
    280                 $request_url = add_query_arg(
    281                         'address',
    282                         urlencode( $address ),
    283                         'https://maps.googleapis.com/maps/api/geocode/json'
    284                 );
    285 
    286                 $response = wcorg_redundant_remote_get( $request_url );
    287 
    288                 // Don't delete the existing (and probably good) values if the request failed
    289                 if ( is_wp_error( $response ) ) {
    290                         return;
    291                 }
    292 
    293                 $meta_values = $this->parse_geocode_response( $response );
    294 
    295                 foreach ( $meta_values as $key => $value ) {
    296                         if ( is_null( $value ) ) {
    297                                 delete_post_meta( $post_id, $key );
    298                         } else {
    299                                 update_post_meta( $post_id, $key, $value );
    300                         }
    301                 }
    302         }
    303 
    304         /**
    305          * Parse the values we want out of the Geocode API response
    306          *
    307          * @see https://developers.google.com/maps/documentation/geocoding/intro#Types API response schema
    308          *
    309          * @param $response
    310          *
    311          * @return array
    312          */
    313         protected function parse_geocode_response( $response ) {
    314                 $body = json_decode( wp_remote_retrieve_body( $response ) );
    315                 $body = isset ( $body->results[0] ) ? $body->results[0] : null;
    316 
    317                 if ( isset( $body->geometry->location->lat ) ) {
    318                         $coordinates = array(
    319                                 'latitude'  => $body->geometry->location->lat,
    320                                 'longitude' => $body->geometry->location->lng
    321                         );
    322                 }
    323 
    324                 if ( isset ( $body->address_components ) ) {
    325                         foreach ( $body->address_components as $component ) {
    326                                 foreach ( $component->types as $type ) {
    327                                         switch ( $type ) {
    328 
    329                                                 case 'locality':
    330                                                 case 'administrative_area_level_1':
    331                                                 case 'postal_code':
    332                                                         $$type = $component->long_name;
    333                                                         break;
    334 
    335                                                 case 'country':
    336                                                         $country_code = $component->short_name; // This is not guaranteed to be ISO 3166-1 alpha-2, but should match in most cases
    337                                                         $country_name = $component->long_name;
    338                                                         break;
    339 
    340                                         }
    341                                 }
    342                         }
    343                 }
    344 
    345                 $values = array(
    346                         '_venue_coordinates'  => isset( $coordinates                 ) ? $coordinates                 : null,
    347                         '_venue_city'         => isset( $locality                    ) ? $locality                    : null,
    348                         '_venue_state'        => isset( $administrative_area_level_1 ) ? $administrative_area_level_1 : null,
    349                         '_venue_country_code' => isset( $country_code                ) ? $country_code                : null,
    350                         '_venue_country_name' => isset( $country_name                ) ? $country_name                : null,
    351                         '_venue_zip'          => isset( $postal_code                 ) ? $postal_code                 : null,
    352                 );
    353 
    354                 return $values;
    355         }
    356 
    357         /**
    358      * Add the Mentor as an administrator on the given site.
    359      *
    360          * @param WP_Post $wordcamp        WordCamp post object.
    361          * @param string  $mentor_username Mentor's WP.org user login.
    362          */
    363         protected function add_mentor( $wordcamp, $mentor_username ) {
    364                 $blog_id    = get_wordcamp_site_id( $wordcamp );
    365             $new_mentor = get_user_by( 'login', $mentor_username );
    366 
    367                 if ( ! $blog_id || ! $new_mentor ) {
    368                     return;
    369         }
    370 
    371         add_user_to_blog( $blog_id, $new_mentor->ID, 'administrator' );
    372     }
    373 
    374         /**
    375          * meta_keys ()
    376          *
    377          * Returns post meta key
    378          *
    379          * @param string $meta_group
    380          *
    381          * @return array
    382          */
    383         function meta_keys( $meta_group = '' ) {
    384                 /*
    385                  * Warning: These keys are used for both the input field label and the postmeta key, so if you want to
    386                  * modify an existing label then you'll also need to migrate any rows in the database to use the new key.
    387                  *
    388                  * Some of them are also exposed via the JSON API, so you'd need to build in a back-compat layer for that
    389                  * as well.
    390                  *
    391                  * When adding new keys, updating the wcorg-json-api plugin to either whitelist it, or test that it's not
    392                  * being exposed.
    393                  */
    394 
    395                 switch ( $meta_group ) {
    396                         case 'organizer':
    397                                 $retval = array (
    398                                         'Organizer Name'                                 => 'text',
    399                                         'WordPress.org Username'                         => 'text',
    400                                         'Email Address'                                  => 'text', // Note: This is the lead organizer's e-mail address, which is different than the "E-mail Address" field
    401                                         'Telephone'                                      => 'text',
    402                                         'Mailing Address'                                => 'textarea',
    403                                         'Sponsor Wrangler Name'                          => 'text',
    404                                         'Sponsor Wrangler E-mail Address'                => 'text',
    405                                         'Budget Wrangler Name'                           => 'text',
    406                                         'Budget Wrangler E-mail Address'                 => 'text',
    407                                         'Venue Wrangler Name'                            => 'text',
    408                                         'Venue Wrangler E-mail Address'                  => 'text',
    409                                         'Speaker Wrangler Name'                          => 'text',
    410                                         'Speaker Wrangler E-mail Address'                => 'text',
    411                                         'Food/Beverage Wrangler Name'                    => 'text',
    412                                         'Food/Beverage Wrangler E-mail Address'          => 'text',
    413                                         'Swag Wrangler Name'                             => 'text',
    414                                         'Swag Wrangler E-mail Address'                   => 'text',
    415                                         'Volunteer Wrangler Name'                        => 'text',
    416                                         'Volunteer Wrangler E-mail Address'              => 'text',
    417                                         'Printing Wrangler Name'                         => 'text',
    418                                         'Printing Wrangler E-mail Address'               => 'text',
    419                                         'Design Wrangler Name'                           => 'text',
    420                                         'Design Wrangler E-mail Address'                 => 'text',
    421                                         'Website Wrangler Name'                          => 'text',
    422                                         'Website Wrangler E-mail Address'                => 'text',
    423                                         'Social Media/Publicity Wrangler Name'           => 'text',
    424                                         'Social Media/Publicity Wrangler E-mail Address' => 'text',
    425                                         'A/V Wrangler Name'                              => 'text',
    426                                         'A/V Wrangler E-mail Address'                    => 'text',
    427                                         'Party Wrangler Name'                            => 'text',
    428                                         'Party Wrangler E-mail Address'                  => 'text',
    429                                         'Travel Wrangler Name'                           => 'text',
    430                                         'Travel Wrangler E-mail Address'                 => 'text',
    431                                         'Safety Wrangler Name'                           => 'text',
    432                                         'Safety Wrangler E-mail Address'                 => 'text',
    433                                         'Mentor WordPress.org User Name'                 => 'text',
    434                                         'Mentor Name'                                    => 'text',
    435                                         'Mentor E-mail Address'                          => 'text',
     373                                        $retval = array(
     374                                                'Start Date (YYYY-mm-dd)'          => 'date',
     375                                                'End Date (YYYY-mm-dd)'            => 'date',
     376                                                'Location'                         => 'text',
     377                                                'URL'                              => 'wc-url',
     378                                                'E-mail Address'                   => 'text',
     379                                                'Twitter'                          => 'text',
     380                                                'WordCamp Hashtag'                 => 'text',
     381                                                'Number of Anticipated Attendees'  => 'text',
     382                                                'Multi-Event Sponsor Region'       => 'mes-dropdown',
     383                                                'Global Sponsorship Grant Currency' => 'select-currency',
     384                                                'Global Sponsorship Grant Amount'  => 'number',
     385                                                'Global Sponsorship Grant'         => 'text',
     386
     387                                                'Organizer Name'                   => 'text',
     388                                                'WordPress.org Username'           => 'text',
     389                                                'Email Address'                    => 'text',
     390                                                'Telephone'                        => 'text',
     391                                                'Mailing Address'                  => 'textarea',
     392                                                'Sponsor Wrangler Name'            => 'text',
     393                                                'Sponsor Wrangler E-mail Address'  => 'text',
     394                                                'Budget Wrangler Name'             => 'text',
     395                                                'Budget Wrangler E-mail Address'   => 'text',
     396                                                'Venue Wrangler Name'              => 'text',
     397                                                'Venue Wrangler E-mail Address'    => 'text',
     398                                                'Speaker Wrangler Name'            => 'text',
     399                                                'Speaker Wrangler E-mail Address'  => 'text',
     400                                                'Food/Beverage Wrangler Name'      => 'text',
     401                                                'Food/Beverage Wrangler E-mail Address' => 'text',
     402                                                'Swag Wrangler Name'               => 'text',
     403                                                'Swag Wrangler E-mail Address'     => 'text',
     404                                                'Volunteer Wrangler Name'          => 'text',
     405                                                'Volunteer Wrangler E-mail Address' => 'text',
     406                                                'Printing Wrangler Name'           => 'text',
     407                                                'Printing Wrangler E-mail Address' => 'text',
     408                                                'Design Wrangler Name'             => 'text',
     409                                                'Design Wrangler E-mail Address'   => 'text',
     410                                                'Website Wrangler Name'            => 'text',
     411                                                'Website Wrangler E-mail Address'  => 'text',
     412                                                'Social Media/Publicity Wrangler Name' => 'text',
     413                                                'Social Media/Publicity Wrangler E-mail Address' => 'text',
     414                                                'A/V Wrangler Name'                => 'text',
     415                                                'A/V Wrangler E-mail Address'      => 'text',
     416                                                'Party Wrangler Name'              => 'text',
     417                                                'Party Wrangler E-mail Address'    => 'text',
     418                                                'Travel Wrangler Name'             => 'text',
     419                                                'Travel Wrangler E-mail Address'   => 'text',
     420                                                'Safety Wrangler Name'             => 'text',
     421                                                'Safety Wrangler E-mail Address'   => 'text',
     422                                                'Mentor WordPress.org User Name'   => 'text',
     423                                                'Mentor Name'                      => 'text',
     424                                                'Mentor E-mail Address'            => 'text',
     425
     426                                                'Venue Name'                       => 'text',
     427                                                'Physical Address'                 => 'textarea',
     428                                                'Maximum Capacity'                 => 'text',
     429                                                'Available Rooms'                  => 'text',
     430                                                'Website URL'                      => 'text',
     431                                                'Contact Information'              => 'textarea',
     432                                                'Exhibition Space Available'       => 'checkbox',
     433
     434                                                'Contributor Day'                  => 'checkbox',
     435                                                'Contributor Day Date (YYYY-mm-dd)' => 'date',
     436                                                'Contributor Venue Name'           => 'text',
     437                                                'Contributor Venue Address'        => 'textarea',
     438                                                'Contributor Venue Capacity'       => 'text',
     439                                                'Contributor Venue Website URL'    => 'text',
     440                                                'Contributor Venue Contact Info'   => 'textarea',
     441                                        );
     442                                        break;
     443
     444                        }
     445
     446                        return apply_filters( 'wcpt_admin_meta_keys', $retval, $meta_group );
     447                }
     448
     449                /**
     450                 * Fired during admin_print_styles
     451                 * Adds jQuery UI
     452                 */
     453                function admin_scripts() {
     454
     455                        // Edit WordCamp screen
     456                        if ( WCPT_POST_TYPE_ID === get_post_type() ) {
     457
     458                                // Default data
     459                                $data = array(
     460                                        'Mentors' => array(
     461                                                'l10n' => array(
     462                                                        'selectLabel' => esc_html__( 'Available mentors', 'wordcamporg' ),
     463                                                        'confirm'     => esc_html__( 'Update Mentor field contents?', 'wordcamporg' ),
     464                                                ),
     465                                        ),
    436466                                );
    437467
    438                                 break;
    439 
    440                         case 'venue':
    441                                 $retval = array (
    442                                         'Venue Name'                      => 'text',
    443                                         'Physical Address'                => 'textarea',
    444                                         'Maximum Capacity'                => 'text',
    445                                         'Available Rooms'                 => 'text',
    446                                         'Website URL'                     => 'text',
    447                                         'Contact Information'             => 'textarea',
    448                                         'Exhibition Space Available'      => 'checkbox',
     468                                // Only include mentor data if the Mentor username field is editable
     469                                if ( current_user_can( 'wordcamp_manage_mentors' ) ) {
     470                                        $data['Mentors']['data'] = Mentors_Dashboard\get_all_mentor_data();
     471                                }
     472
     473                                wp_localize_script(
     474                                        'wcpt-admin',
     475                                        'wordCampPostType',
     476                                        $data
    449477                                );
    450                                 break;
    451 
    452                         case 'contributor':
    453                                 // These fields names need to be unique, hence the 'Contributor' prefix on each one
    454                                 $retval = array (
    455                                         'Contributor Day'                   => 'checkbox',
    456                                         'Contributor Day Date (YYYY-mm-dd)' => 'date',
    457                                         'Contributor Venue Name'            => 'text',
    458                                         'Contributor Venue Address'         => 'textarea',
    459                                         'Contributor Venue Capacity'        => 'text',
    460                                         'Contributor Venue Website URL'     => 'text',
    461                                         'Contributor Venue Contact Info'    => 'textarea',
    462                                 );
    463                                 break;
    464 
    465                         case 'wordcamp':
    466                                 $retval = array (
    467                                         'Start Date (YYYY-mm-dd)'           => 'date',
    468                                         'End Date (YYYY-mm-dd)'             => 'date',
    469                                         'Location'                          => 'text',
    470                                         'URL'                               => 'wc-url',
    471                                         'E-mail Address'                    => 'text',
    472                                         // Note: This is the address for the entire organizing team, which is different than the "Email Address" field
    473                                         'Twitter'                           => 'text',
    474                                         'WordCamp Hashtag'                  => 'text',
    475                                         'Number of Anticipated Attendees'   => 'text',
    476                                         'Multi-Event Sponsor Region'        => 'mes-dropdown',
    477                                         'Global Sponsorship Grant Currency' => 'select-currency',
    478                                         'Global Sponsorship Grant Amount'   => 'number',
    479                                         'Global Sponsorship Grant'          => 'text',
    480                                 );
    481                                 break;
    482 
    483                         case 'all':
    484                         default:
    485                                 $retval = array(
    486                                         'Start Date (YYYY-mm-dd)'           => 'date',
    487                                         'End Date (YYYY-mm-dd)'             => 'date',
    488                                         'Location'                          => 'text',
    489                                         'URL'                               => 'wc-url',
    490                                         'E-mail Address'                    => 'text',
    491                                         'Twitter'                           => 'text',
    492                                         'WordCamp Hashtag'                  => 'text',
    493                                         'Number of Anticipated Attendees'   => 'text',
    494                                         'Multi-Event Sponsor Region'        => 'mes-dropdown',
    495                                         'Global Sponsorship Grant Currency' => 'select-currency',
    496                                         'Global Sponsorship Grant Amount'   => 'number',
    497                                         'Global Sponsorship Grant'          => 'text',
    498 
    499                                         'Organizer Name'                                 => 'text',
    500                                         'WordPress.org Username'                         => 'text',
    501                                         'Email Address'                                  => 'text',
    502                                         'Telephone'                                      => 'text',
    503                                         'Mailing Address'                                => 'textarea',
    504                                         'Sponsor Wrangler Name'                          => 'text',
    505                                         'Sponsor Wrangler E-mail Address'                => 'text',
    506                                         'Budget Wrangler Name'                           => 'text',
    507                                         'Budget Wrangler E-mail Address'                 => 'text',
    508                                         'Venue Wrangler Name'                            => 'text',
    509                                         'Venue Wrangler E-mail Address'                  => 'text',
    510                                         'Speaker Wrangler Name'                          => 'text',
    511                                         'Speaker Wrangler E-mail Address'                => 'text',
    512                                         'Food/Beverage Wrangler Name'                    => 'text',
    513                                         'Food/Beverage Wrangler E-mail Address'          => 'text',
    514                                         'Swag Wrangler Name'                             => 'text',
    515                                         'Swag Wrangler E-mail Address'                   => 'text',
    516                                         'Volunteer Wrangler Name'                        => 'text',
    517                                         'Volunteer Wrangler E-mail Address'              => 'text',
    518                                         'Printing Wrangler Name'                         => 'text',
    519                                         'Printing Wrangler E-mail Address'               => 'text',
    520                                         'Design Wrangler Name'                           => 'text',
    521                                         'Design Wrangler E-mail Address'                 => 'text',
    522                                         'Website Wrangler Name'                          => 'text',
    523                                         'Website Wrangler E-mail Address'                => 'text',
    524                                         'Social Media/Publicity Wrangler Name'           => 'text',
    525                                         'Social Media/Publicity Wrangler E-mail Address' => 'text',
    526                                         'A/V Wrangler Name'                              => 'text',
    527                                         'A/V Wrangler E-mail Address'                    => 'text',
    528                                         'Party Wrangler Name'                            => 'text',
    529                                         'Party Wrangler E-mail Address'                  => 'text',
    530                                         'Travel Wrangler Name'                           => 'text',
    531                                         'Travel Wrangler E-mail Address'                 => 'text',
    532                                         'Safety Wrangler Name'                           => 'text',
    533                                         'Safety Wrangler E-mail Address'                 => 'text',
    534                                         'Mentor WordPress.org User Name'                 => 'text',
    535                                         'Mentor Name'                                    => 'text',
    536                                         'Mentor E-mail Address'                          => 'text',
    537 
    538                                         'Venue Name'                      => 'text',
    539                                         'Physical Address'                => 'textarea',
    540                                         'Maximum Capacity'                => 'text',
    541                                         'Available Rooms'                 => 'text',
    542                                         'Website URL'                     => 'text',
    543                                         'Contact Information'             => 'textarea',
    544                                         'Exhibition Space Available'      => 'checkbox',
    545 
    546                                         'Contributor Day'                   => 'checkbox',
    547                                         'Contributor Day Date (YYYY-mm-dd)' => 'date',
    548                                         'Contributor Venue Name'            => 'text',
    549                                         'Contributor Venue Address'         => 'textarea',
    550                                         'Contributor Venue Capacity'        => 'text',
    551                                         'Contributor Venue Website URL'     => 'text',
    552                                         'Contributor Venue Contact Info'    => 'textarea',
    553                                 );
    554                                 break;
    555 
    556                 }
    557 
    558                 return apply_filters( 'wcpt_admin_meta_keys', $retval, $meta_group );
    559         }
    560 
    561         /**
    562          * Fired during admin_print_styles
    563          * Adds jQuery UI
    564          */
    565         function admin_scripts() {
    566                 wp_register_script(
    567                         'wcpt-admin',
    568                         WCPT_URL . 'javascript/wcpt-wordcamp/admin.js',
    569                         array( 'jquery', 'jquery-ui-datepicker' ),
    570                         WCPT_VERSION,
    571                         true
    572                 );
    573 
    574                 // Edit WordCamp screen
    575                 if ( WCPT_POST_TYPE_ID === get_post_type() ) {
    576                         wp_enqueue_script( 'wcpt-admin' );
    577 
    578                         // Default data
    579             $data = array(
    580                     'Mentors' => array(
    581                     'l10n' => array(
    582                         'selectLabel' => esc_html__( 'Available mentors', 'wordcamporg' ),
    583                         'confirm'     => esc_html__( 'Update Mentor field contents?', 'wordcamporg' ),
    584                     ),
    585                     )
    586             );
    587 
    588             // Only include mentor data if the Mentor username field is editable
    589             if ( current_user_can( 'wordcamp_manage_mentors' ) ) {
    590                 $data['Mentors']['data'] = Mentors_Dashboard\get_all_mentor_data();
    591             }
    592 
    593                         wp_localize_script(
    594                                 'wcpt-admin',
    595                                 'wordCampPostType',
    596                                 $data
    597                         );
    598                 }
    599                 wp_enqueue_script( 'select2' );
    600         }
    601 
    602         function admin_styles() {
    603                 if ( get_post_type() == WCPT_POST_TYPE_ID ) {
    604                         wp_enqueue_style( 'jquery-ui' );
    605                         wp_enqueue_style( 'wp-datepicker-skins' );
    606                 }
    607                 wp_enqueue_style( 'select2' );
    608         }
    609 
    610         /**
    611          * admin_head ()
    612          *
    613          * Add some general styling to the admin area
    614          */
    615         function admin_head() {
    616                 if ( !empty( $_GET['post_type'] ) && $_GET['post_type'] == WCPT_POST_TYPE_ID ) : ?>
     478                        }
     479                }
     480
     481                /**
     482                 * admin_head ()
     483                 *
     484                 * Add some general styling to the admin area
     485                 */
     486                function admin_head() {
     487                        if ( ! empty( $_GET['post_type'] ) && $_GET['post_type'] == WCPT_POST_TYPE_ID ) : ?>
    617488
    618489                        .column-title { width: 40%; }
    619490                        .column-wcpt_location, .column-wcpt_date, column-wcpt_organizer { white-space: nowrap; }
    620491
    621                 <?php endif;
    622         }
    623 
    624         /**
    625          * user_profile_update ()
    626          *
    627          * Responsible for showing additional profile options and settings
    628          *
    629          * @todo Everything
    630          */
    631         function user_profile_update( $user_id ) {
    632                 if ( !wcpt_has_access() )
    633                         return false;
    634         }
    635 
    636         /**
    637          * user_profile_wordcamp ()
    638          *
    639          * Responsible for saving additional profile options and settings
    640          *
    641          * @todo Everything
    642          */
    643         function user_profile_wordcamp( $profileuser ) {
    644                 if ( !wcpt_has_access() )
    645                         return false;
    646                 ?>
     492                                <?php
     493                endif;
     494                }
     495
     496                /**
     497                 * user_profile_update ()
     498                 *
     499                 * Responsible for showing additional profile options and settings
     500                 *
     501                 * @todo Everything
     502                 */
     503                function user_profile_update( $user_id ) {
     504                        if ( ! wcpt_has_access() ) {
     505                                return false;
     506                        }
     507                }
     508
     509                /**
     510                 * user_profile_wordcamp ()
     511                 *
     512                 * Responsible for saving additional profile options and settings
     513                 *
     514                 * @todo Everything
     515                 */
     516                function user_profile_wordcamp( $profileuser ) {
     517                        if ( ! wcpt_has_access() ) {
     518                                return false;
     519                        }
     520                        ?>
    647521
    648522                <h3><?php _e( 'WordCamps', 'wcpt' ); ?></h3>
     
    657531                </table>
    658532
    659                 <?php
    660         }
    661 
    662         /**
    663          * column_headers ()
    664          *
    665          * Manage the column headers
    666          *
    667          * @param array $columns
    668          * @return array $columns
    669          */
    670         function column_headers( $columns ) {
    671                 $columns = array (
    672                         'cb'               => '<input type="checkbox" />',
    673                         'title'            => __( 'Title', 'wcpt' ),
    674                         //'wcpt_location'    => __( 'Location', 'wcpt' ),
    675                         'wcpt_date'        => __( 'Date',      'wcpt' ),
    676                         'wcpt_organizer'   => __( 'Organizer', 'wcpt' ),
    677                         'wcpt_venue'       => __( 'Venue',     'wcpt' ),
    678                         'date'             => __( 'Status',    'wcpt' )
    679                 );
    680                 return $columns;
    681         }
    682 
    683         /**
    684          * Display the status of a WordCamp post
    685          *
    686          * @param array $states
    687          *
    688          * @return array
    689          */
    690         public function display_post_states( $states ) {
    691                 global $post;
    692 
    693                 if ( $post->post_type != WCPT_POST_TYPE_ID ) {
    694                         return $states;
    695                 }
    696 
    697                 $status = get_post_status_object( $post->post_status );
    698                 if ( get_query_var( 'post_status' ) != $post->post_status ) {
    699                         $states[ $status->name ] = $status->label;
    700                 }
    701 
    702                 return $states;
    703         }
    704 
    705         /**
    706          * column_data ( $column, $post_id )
    707          *
    708          * Print extra columns
    709          *
    710          * @param string $column
    711          * @param int $post_id
    712          */
    713         function column_data( $column, $post_id ) {
    714                 if ( $_GET['post_type'] !== WCPT_POST_TYPE_ID )
    715                         return $column;
    716 
    717                 switch ( $column ) {
    718                         case 'wcpt_location' :
    719                                 echo wcpt_get_wordcamp_location() ? wcpt_get_wordcamp_location() : __( 'No Location', 'wcpt' );
    720                                 break;
    721 
    722                         case 'wcpt_date' :
    723                                 // Has a start date
    724                                 if ( $start = wcpt_get_wordcamp_start_date() ) {
    725 
    726                                         // Has an end date
    727                                         if ( $end = wcpt_get_wordcamp_end_date() ) {
    728                                                 $string_date = sprintf( __( 'Start: %1$s<br />End: %2$s', 'wcpt' ), $start, $end );
    729 
    730                                         // No end date
     533                        <?php
     534                }
     535
     536                /**
     537                 * column_headers ()
     538                 *
     539                 * Manage the column headers
     540                 *
     541                 * @param array $columns
     542                 * @return array $columns
     543                 */
     544                function column_headers( $columns ) {
     545                        $columns = array(
     546                                'cb'             => '<input type="checkbox" />',
     547                                'title'          => __( 'Title', 'wcpt' ),
     548                                // 'wcpt_location'    => __( 'Location', 'wcpt' ),
     549                                'wcpt_date'      => __( 'Date', 'wcpt' ),
     550                                'wcpt_organizer' => __( 'Organizer', 'wcpt' ),
     551                                'wcpt_venue'     => __( 'Venue', 'wcpt' ),
     552                                'date'           => __( 'Status', 'wcpt' ),
     553                        );
     554                        return $columns;
     555                }
     556
     557                /**
     558                 * column_data ( $column, $post_id )
     559                 *
     560                 * Print extra columns
     561                 *
     562                 * @param string $column
     563                 * @param int    $post_id
     564                 */
     565                function column_data( $column, $post_id ) {
     566                        if ( $_GET['post_type'] !== WCPT_POST_TYPE_ID ) {
     567                                return $column;
     568                        }
     569
     570                        switch ( $column ) {
     571                                case 'wcpt_location':
     572                                        echo wcpt_get_wordcamp_location() ? wcpt_get_wordcamp_location() : __( 'No Location', 'wcpt' );
     573                                        break;
     574
     575                                case 'wcpt_date':
     576                                        // Has a start date
     577                                        if ( $start = wcpt_get_wordcamp_start_date() ) {
     578
     579                                                // Has an end date
     580                                                if ( $end = wcpt_get_wordcamp_end_date() ) {
     581                                                        $string_date = sprintf( __( 'Start: %1$s<br />End: %2$s', 'wcpt' ), $start, $end );
     582
     583                                                        // No end date
     584                                                } else {
     585                                                        $string_date = sprintf( __( 'Start: %1$s', 'wcpt' ), $start );
     586                                                }
     587
     588                                                // No date
    731589                                        } else {
    732                                                 $string_date = sprintf( __( 'Start: %1$s', 'wcpt' ), $start );
     590                                                $string_date = __( 'No Date', 'wcpt' );
    733591                                        }
    734592
    735                                 // No date
    736                                 } else {
    737                                         $string_date = __( 'No Date', 'wcpt' );
    738                                 }
    739 
    740                                 echo $string_date;
    741                                 break;
    742 
    743                         case 'wcpt_organizer' :
    744                                 echo wcpt_get_wordcamp_organizer_name() ? wcpt_get_wordcamp_organizer_name() : __( 'No Organizer', 'wcpt' );
    745                                 break;
    746 
    747                         case 'wcpt_venue' :
    748                                 echo wcpt_get_wordcamp_venue_name() ? wcpt_get_wordcamp_venue_name() : __( 'No Venue', 'wcpt' );
    749                                 break;
    750                 }
    751         }
    752 
    753         /**
    754          * post_row_actions ( $actions, $post )
    755          *
    756          * Remove the quick-edit action link and display the description under
    757          *
    758          * @param array $actions
    759          * @param array $post
    760          * @return array $actions
    761          */
    762         function post_row_actions( $actions, $post ) {
    763                 if ( WCPT_POST_TYPE_ID == $post->post_type ) {
    764                         unset( $actions['inline hide-if-no-js'] );
    765 
    766                         $wc = array();
    767 
    768                         if ( $wc_location = wcpt_get_wordcamp_location() )
    769                                 $wc['location'] = $wc_location;
    770 
    771                         if ( $wc_url = make_clickable( wcpt_get_wordcamp_url() ) )
    772                                 $wc['url'] = $wc_url;
    773 
    774                         echo implode( ' - ', (array) $wc );
    775                 }
    776 
    777                 return $actions;
    778         }
    779 
    780         /**
    781          * Trigger actions related to WordCamps being scheduled.
    782          *
    783          * @param string $new_status
    784          * @param string $old_status
    785          * @param WP_Post $post
    786          */
    787         public function trigger_schedule_actions( $new_status, $old_status, $post ) {
    788                 if ( empty( $post->post_type ) || WCPT_POST_TYPE_ID != $post->post_type ) {
    789                         return;
    790                 }
    791 
    792                 if ( $new_status == $old_status ) {
    793                         return;
    794                 }
    795 
    796                 if ( 'wcpt-pre-planning' == $new_status ) {
    797                         do_action( 'wcpt_approved_for_pre_planning', $post );
    798                 } elseif ( $old_status == 'wcpt-needs-schedule' && $new_status == 'wcpt-scheduled' ) {
    799                         do_action( 'wcpt_added_to_final_schedule', $post );
    800                 }
    801 
    802                 // todo add new triggers - which ones?
    803         }
    804 
    805         /**
    806          * Log when the post status changes
    807          *
    808          * @param string  $new_status
    809          * @param string  $old_status
    810          * @param WP_Post $post
    811          */
    812         public function log_status_changes( $new_status, $old_status, $post ) {
    813                 if ( $new_status === $old_status || $new_status == 'auto-draft' ) {
    814                         return;
    815                 }
    816 
    817                 if ( empty( $post->post_type ) || WCPT_POST_TYPE_ID != $post->post_type ) {
    818                         return;
    819                 }
    820 
    821                 $old_status = get_post_status_object( $old_status );
    822                 $new_status = get_post_status_object( $new_status );
    823 
    824                 add_post_meta( $post->ID, '_status_change', array(
    825                         'timestamp' => time(),
    826                         'user_id'   => get_current_user_id(),
    827                         'message'   => sprintf( '%s &rarr; %s', $old_status->label, $new_status->label ),
    828                 ) );
    829         }
    830 
    831         /**
    832          * Add the lead organizer to Central when a WordCamp application is accepted.
    833          *
    834          * Adding the lead organizer to Central allows them to enter all the `wordcamp`
    835          * meta info themselves, and also post updates to the Central blog.
    836          *
    837          * @param WP_Post $post
    838          */
    839         public function add_organizer_to_central( $post ) {
    840                 $lead_organizer = get_user_by( 'login', $_POST['wcpt_wordpress_org_username'] );
    841 
    842                 if ( $lead_organizer && add_user_to_blog( get_current_blog_id(), $lead_organizer->ID, 'contributor' ) ) {
    843                         do_action( 'wcor_organizer_added_to_central', $post );
    844                 }
    845         }
    846 
    847         /**
    848          * Record when the WordCamp was added to the planning schedule.
    849          *
    850          * This is used by the Organizer Reminders plugin to send automated e-mails at certain points after the camp
    851          * has been added to the planning schedule.
    852          *
    853          * @param WP_Post $wordcamp
    854          */
    855         public function mark_date_added_to_planning_schedule( $wordcamp ) {
    856                 update_post_meta( $wordcamp->ID, '_timestamp_added_to_planning_schedule', time() );
    857         }
    858 
    859         /**
    860          * Enforce a valid post status for WordCamps.
    861          *
    862          * @param array $post_data
    863          * @param array $post_data_raw
    864          * @return array
    865          */
    866         public function enforce_post_status( $post_data, $post_data_raw ) {
    867                 if ( $post_data['post_type'] != WCPT_POST_TYPE_ID || empty( $_POST['post_ID'] ) ) {
     593                                        echo $string_date;
     594                                        break;
     595
     596                                case 'wcpt_organizer':
     597                                        echo wcpt_get_wordcamp_organizer_name() ? wcpt_get_wordcamp_organizer_name() : __( 'No Organizer', 'wcpt' );
     598                                        break;
     599
     600                                case 'wcpt_venue':
     601                                        echo wcpt_get_wordcamp_venue_name() ? wcpt_get_wordcamp_venue_name() : __( 'No Venue', 'wcpt' );
     602                                        break;
     603                        }
     604                }
     605
     606                /**
     607                 * post_row_actions ( $actions, $post )
     608                 *
     609                 * Remove the quick-edit action link and display the description under
     610                 *
     611                 * @param array $actions
     612                 * @param array $post
     613                 * @return array $actions
     614                 */
     615                function post_row_actions( $actions, $post ) {
     616                        if ( WCPT_POST_TYPE_ID == $post->post_type ) {
     617                                unset( $actions['inline hide-if-no-js'] );
     618
     619                                $wc = array();
     620
     621                                if ( $wc_location = wcpt_get_wordcamp_location() ) {
     622                                        $wc['location'] = $wc_location;
     623                                }
     624
     625                                if ( $wc_url = make_clickable( wcpt_get_wordcamp_url() ) ) {
     626                                        $wc['url'] = $wc_url;
     627                                }
     628
     629                                echo implode( ' - ', (array) $wc );
     630                        }
     631
     632                        return $actions;
     633                }
     634
     635                /**
     636                 * Trigger actions related to WordCamps being scheduled.
     637                 *
     638                 * @param string  $new_status
     639                 * @param string  $old_status
     640                 * @param WP_Post $post
     641                 */
     642                public function trigger_schedule_actions( $new_status, $old_status, $post ) {
     643                        if ( empty( $post->post_type ) || WCPT_POST_TYPE_ID != $post->post_type ) {
     644                                return;
     645                        }
     646
     647                        if ( $new_status == $old_status ) {
     648                                return;
     649                        }
     650
     651                        if ( 'wcpt-pre-planning' == $new_status ) {
     652                                do_action( 'wcpt_approved_for_pre_planning', $post );
     653                        } elseif ( $old_status == 'wcpt-needs-schedule' && $new_status == 'wcpt-scheduled' ) {
     654                                do_action( 'wcpt_added_to_final_schedule', $post );
     655                        }
     656
     657                        // todo add new triggers - which ones?
     658                }
     659
     660
     661                /**
     662                 * Add the lead organizer to Central when a WordCamp application is accepted.
     663                 *
     664                 * Adding the lead organizer to Central allows them to enter all the `wordcamp`
     665                 * meta info themselves, and also post updates to the Central blog.
     666                 *
     667                 * @param WP_Post $post
     668                 */
     669                public function add_organizer_to_central( $post ) {
     670                        $lead_organizer = get_user_by( 'login', $_POST['wcpt_wordpress_org_username'] );
     671
     672                        if ( $lead_organizer && add_user_to_blog( get_current_blog_id(), $lead_organizer->ID, 'contributor' ) ) {
     673                                do_action( 'wcor_organizer_added_to_central', $post );
     674                        }
     675                }
     676
     677                /**
     678                 * Record when the WordCamp was added to the planning schedule.
     679                 *
     680                 * This is used by the Organizer Reminders plugin to send automated e-mails at certain points after the camp
     681                 * has been added to the planning schedule.
     682                 *
     683                 * @param WP_Post $wordcamp
     684                 */
     685                public function mark_date_added_to_planning_schedule( $wordcamp ) {
     686                        update_post_meta( $wordcamp->ID, '_timestamp_added_to_planning_schedule', time() );
     687                }
     688
     689                /**
     690                 * Enforce a valid post status for WordCamps.
     691                 *
     692                 * @param array $post_data
     693                 * @param array $post_data_raw
     694                 * @return array
     695                 */
     696                public function enforce_post_status( $post_data, $post_data_raw ) {
     697                        if ( $post_data['post_type'] != WCPT_POST_TYPE_ID || empty( $_POST['post_ID'] ) ) {
     698                                return $post_data;
     699                        }
     700
     701                        $post = get_post( $_POST['post_ID'] );
     702                        if ( ! $post ) {
     703                                return $post_data;
     704                        }
     705
     706                        if ( ! empty( $post_data['post_status'] ) ) {
     707                                $wcpt = get_post_type_object( WCPT_POST_TYPE_ID );
     708
     709                                // Only WordCamp Wranglers can change WordCamp statuses.
     710                                if ( ! current_user_can( 'wordcamp_wrangle_wordcamps' ) ) {
     711                                        $post_data['post_status'] = $post->post_status;
     712                                }
     713
     714                                // Enforce a valid status.
     715                                $statuses = array_keys( WordCamp_Loader::get_post_statuses() );
     716                                $statuses = array_merge( $statuses, array( 'trash' ) );
     717
     718                                if ( ! in_array( $post_data['post_status'], $statuses ) ) {
     719                                        $post_data['post_status'] = $statuses[0];
     720                                }
     721                        }
     722
    868723                        return $post_data;
    869724                }
    870725
    871                 $post = get_post( $_POST['post_ID'] );
    872                 if ( ! $post ) {
     726                /**
     727                 * Prevent WordCamp posts from being set to pending or published until all the required fields are completed.
     728                 *
     729                 * @param array $post_data
     730                 * @param array $post_data_raw
     731                 * @return array
     732                 */
     733                public function require_complete_meta_to_publish_wordcamp( $post_data, $post_data_raw ) {
     734                        if ( WCPT_POST_TYPE_ID != $post_data['post_type'] ) {
     735                                return $post_data;
     736                        }
     737
     738                        // The ID of the last site that was created before this rule went into effect, so that we don't apply the rule retroactively.
     739                        $min_site_id = apply_filters( 'wcpt_require_complete_meta_min_site_id', '2416297' );
     740
     741                        $required_needs_site_fields = $this->get_required_fields( 'needs-site' );
     742                        $required_scheduled_fields  = $this->get_required_fields( 'scheduled' );
     743
     744                        // Check pending posts
     745                        if ( 'wcpt-needs-site' == $post_data['post_status'] && absint( $_POST['post_ID'] ) > $min_site_id ) {
     746                                foreach ( $required_needs_site_fields as $field ) {
     747                                        $value = $_POST[ wcpt_key_to_str( $field, 'wcpt_' ) ];
     748
     749                                        if ( empty( $value ) || 'null' == $value ) {
     750                                                $post_data['post_status']     = 'wcpt-needs-email';
     751                                                $this->active_admin_notices[] = 1;
     752                                                break;
     753                                        }
     754                                }
     755                        }
     756
     757                        // Check published posts
     758                        if ( 'wcpt-scheduled' == $post_data['post_status'] && isset( $_POST['post_ID'] ) && absint( $_POST['post_ID'] ) > $min_site_id ) {
     759                                foreach ( $required_scheduled_fields as $field ) {
     760                                        $value = $_POST[ wcpt_key_to_str( $field, 'wcpt_' ) ];
     761
     762                                        if ( empty( $value ) || 'null' == $value ) {
     763                                                $post_data['post_status']     = 'wcpt-needs-schedule';
     764                                                $this->active_admin_notices[] = 3;
     765                                                break;
     766                                        }
     767                                }
     768                        }
     769
    873770                        return $post_data;
    874771                }
    875772
    876                 if ( ! empty( $post_data['post_status'] ) ) {
    877                         $wcpt = get_post_type_object( WCPT_POST_TYPE_ID );
    878 
    879                         // Only WordCamp Wranglers can change WordCamp statuses.
     773                /**
     774                 * Get a list of fields required to move to a certain post status
     775                 *
     776                 * @param string $status 'needs-site' | 'scheduled' | 'any'
     777                 *
     778                 * @return array
     779                 */
     780                public static function get_required_fields( $status ) {
     781                        $needs_site = array( 'E-mail Address' );
     782
     783                        $scheduled = array(
     784                                // WordCamp
     785                                'Start Date (YYYY-mm-dd)',
     786                                'Location',
     787                                'URL',
     788                                'E-mail Address',
     789                                'Number of Anticipated Attendees',
     790                                'Multi-Event Sponsor Region',
     791
     792                                // Organizing Team
     793                                'Organizer Name',
     794                                'WordPress.org Username',
     795                                'Email Address',
     796                                'Telephone',
     797                                'Mailing Address',
     798                                'Sponsor Wrangler Name',
     799                                'Sponsor Wrangler E-mail Address',
     800                                'Budget Wrangler Name',
     801                                'Budget Wrangler E-mail Address',
     802
     803                                // Venue
     804                                'Physical Address', // used to build stats
     805                        );
     806
     807                        switch ( $status ) {
     808                                case 'needs-site':
     809                                        $required_fields = $needs_site;
     810                                        break;
     811
     812                                case 'scheduled':
     813                                        $required_fields = $scheduled;
     814                                        break;
     815
     816                                case 'any':
     817                                default:
     818                                        $required_fields = array_merge( $needs_site, $scheduled );
     819                                        break;
     820                        }
     821
     822                        return $required_fields;
     823                }
     824
     825                public static function get_protected_fields() {
     826                        $protected_fields = array();
     827
     828                        if ( ! current_user_can( 'wordcamp_manage_mentors' ) ) {
     829                                $protected_fields = array_merge(
     830                                        $protected_fields, array(
     831                                                'Mentor WordPress.org User Name',
     832                                                'Mentor Name',
     833                                                'Mentor E-mail Address',
     834                                        )
     835                                );
     836                        }
     837
    880838                        if ( ! current_user_can( 'wordcamp_wrangle_wordcamps' ) ) {
    881                                 $post_data['post_status'] = $post->post_status;
    882                         }
    883 
    884                         // Enforce a valid status.
    885                         $statuses = array_keys( WordCamp_Loader::get_post_statuses() );
    886                         $statuses = array_merge( $statuses, array( 'trash' ) );
    887 
    888                         if ( ! in_array( $post_data['post_status'], $statuses ) ) {
    889                                 $post_data['post_status'] = $statuses[0];
    890                         }
    891                 }
    892 
    893                 return $post_data;
    894         }
    895 
    896         /**
    897          * Prevent WordCamp posts from being set to pending or published until all the required fields are completed.
    898          *
    899          * @param array $post_data
    900          * @param array $post_data_raw
    901          * @return array
    902          */
    903         public function require_complete_meta_to_publish_wordcamp( $post_data, $post_data_raw ) {
    904                 if ( WCPT_POST_TYPE_ID != $post_data['post_type'] ) {
    905                         return $post_data;
    906                 }
    907 
    908                 // The ID of the last site that was created before this rule went into effect, so that we don't apply the rule retroactively.
    909                 $min_site_id = apply_filters( 'wcpt_require_complete_meta_min_site_id', '2416297' );
    910 
    911                 $required_needs_site_fields = $this->get_required_fields( 'needs-site' );
    912                 $required_scheduled_fields  = $this->get_required_fields( 'scheduled' );
    913 
    914                 // Check pending posts
    915                 if ( 'wcpt-needs-site' == $post_data['post_status'] && absint( $_POST['post_ID'] ) > $min_site_id ) {
    916                         foreach( $required_needs_site_fields as $field ) {
    917                                 $value = $_POST[ wcpt_key_to_str( $field, 'wcpt_' ) ];
    918 
    919                                 if ( empty( $value ) || 'null' == $value ) {
    920                                         $post_data['post_status']     = 'wcpt-needs-email';
    921                                         $this->active_admin_notices[] = 1;
    922                                         break;
    923                                 }
    924                         }
    925                 }
    926 
    927                 // Check published posts
    928                 if ( 'wcpt-scheduled' == $post_data['post_status'] && isset( $_POST['post_ID'] ) && absint( $_POST['post_ID'] ) > $min_site_id ) {
    929                         foreach( $required_scheduled_fields as $field ) {
    930                                 $value = $_POST[ wcpt_key_to_str( $field, 'wcpt_' ) ];
    931 
    932                                 if ( empty( $value ) || 'null' == $value ) {
    933                                         $post_data['post_status']     = 'wcpt-needs-schedule';
    934                                         $this->active_admin_notices[] = 3;
    935                                         break;
    936                                 }
    937                         }
    938                 }
    939 
    940                 return $post_data;
    941         }
    942 
    943         /**
    944          * Get a list of fields required to move to a certain post status
    945          *
    946          * @param string $status 'needs-site' | 'scheduled' | 'any'
    947          *
    948          * @return array
    949          */
    950         public static function get_required_fields( $status ) {
    951                 $needs_site = array( 'E-mail Address' );
    952 
    953                 $scheduled = array(
    954                         // WordCamp
    955                         'Start Date (YYYY-mm-dd)',
    956                         'Location',
    957                         'URL',
    958                         'E-mail Address',
    959                         'Number of Anticipated Attendees',
    960                         'Multi-Event Sponsor Region',
    961 
    962                         // Organizing Team
    963                         'Organizer Name',
    964                         'WordPress.org Username',
    965                         'Email Address',
    966                         'Telephone',
    967                         'Mailing Address',
    968                         'Sponsor Wrangler Name',
    969                         'Sponsor Wrangler E-mail Address',
    970                         'Budget Wrangler Name',
    971                         'Budget Wrangler E-mail Address',
    972 
    973                         // Venue
    974                         'Physical Address' // used to build stats
    975                 );
    976 
    977                 switch ( $status ) {
    978                         case 'needs-site':
    979                                 $required_fields = $needs_site;
    980                                 break;
    981 
    982                         case 'scheduled':
    983                                 $required_fields = $scheduled;
    984                                 break;
    985 
    986                         case 'any':
    987                         default:
    988                                 $required_fields = array_merge( $needs_site, $scheduled );
    989                                 break;
    990                 }
    991 
    992                 return $required_fields;
    993         }
    994 
    995         /**
    996          * Check if a field should be readonly, based on the current user's caps.
    997          *
    998          * @param string $field_name The field to check.
    999          *
    1000          * @return bool
    1001          */
    1002         public static function is_protected_field( $field_name ) {
    1003                 $protected_fields = array();
    1004 
    1005                 if ( ! current_user_can( 'wordcamp_manage_mentors' ) ) {
    1006                         $protected_fields = array_merge( $protected_fields, array(
    1007                                 'Mentor WordPress.org User Name',
    1008                                 'Mentor Name',
    1009                                 'Mentor E-mail Address',
    1010                         ) );
    1011                 }
    1012 
    1013                 if ( ! current_user_can( 'wordcamp_wrangle_wordcamps' ) ) {
    1014                         $protected_fields = array_merge( $protected_fields, array(
    1015                                 'Multi-Event Sponsor Region',
    1016                         ) );
    1017                 }
    1018 
    1019                 return in_array( $field_name, $protected_fields );
    1020         }
    1021 
    1022         /**
    1023          * Add our custom admin notice keys to the redirect URL.
    1024          *
    1025          * Any member can add a key to $this->active_admin_notices to signify that the corresponding message should
    1026          * be shown when the redirect finished. When it does, print_admin_notices() will examine the URL and create
    1027          * a notice with the message that corresponds to the key.
    1028          *
    1029          * @param $location
    1030          * @param $post_id
    1031          * @return string
    1032          */
    1033         public function add_admin_notices_to_redirect_url( $location, $post_id ) {
    1034                 if ( $this->active_admin_notices ) {
    1035                         $location = add_query_arg( 'wcpt_messages', implode( ',', $this->active_admin_notices ), $location );
    1036                 }
    1037 
    1038                 // Don't show conflicting messages like 'Post submitted.'
    1039                 if ( in_array( 1, $this->active_admin_notices ) && false !== strpos( $location, 'message=8' ) ) {
    1040                         $location = remove_query_arg( 'message', $location );
    1041                 }
    1042 
    1043                 return $location;
    1044         }
    1045 
    1046         /**
    1047          * Create admin notices for messages that were passed in the URL.
    1048          *
    1049          * Any member can add a key to $this->active_admin_notices to signify that the corresponding message should
    1050          * be shown when the redirect finished. add_admin_notices_to_redirect_url() adds those keys to the redirect
    1051          * url, and this function examines the URL and create a notice with the message that corresponds to the key.
    1052          *
    1053          * $notices[key]['type'] should equal 'error' or 'updated'.
    1054          */
    1055         public function print_admin_notices() {
    1056                 global $post;
    1057                 $screen = get_current_screen();
    1058 
    1059                 if ( empty( $post->post_type ) || WCPT_POST_TYPE_ID != $post->post_type || 'post' !== $screen->base ) {
    1060                         return;
    1061                 }
    1062 
    1063                 $notices = array(
    1064                         1 => array(
    1065                                 'type'   => 'error',
    1066                                 'notice' => sprintf(
    1067                                         __( 'This WordCamp cannot be moved to Needs Site until all of its required metadata is filled in: %s.', 'wordcamporg' ),
    1068                                         implode( ', ', $this->get_required_fields( 'needs-site' ) )
     839                                $protected_fields = array_merge(
     840                                        $protected_fields, array(
     841                                                'Multi-Event Sponsor Region',
     842                                        )
     843                                );
     844                        }
     845
     846                        return $protected_fields;
     847                }
     848
     849                /**
     850                 * Check if a field should be readonly, based on the current user's caps.
     851                 *
     852                 * @param string $field_name The field to check.
     853                 *
     854                 * @return bool
     855                 */
     856                public static function is_protected_field( $field_name ) {
     857
     858                        $protected_fields = self::get_protected_fields();
     859
     860                        return in_array( $field_name, $protected_fields );
     861                }
     862
     863                /**
     864                 * Add our custom admin notice keys to the redirect URL.
     865                 *
     866                 * Any member can add a key to $this->active_admin_notices to signify that the corresponding message should
     867                 * be shown when the redirect finished. When it does, print_admin_notices() will examine the URL and create
     868                 * a notice with the message that corresponds to the key.
     869                 *
     870                 * @param $location
     871                 * @param $post_id
     872                 * @return string
     873                 */
     874                public function add_admin_notices_to_redirect_url( $location, $post_id ) {
     875                        if ( $this->active_admin_notices ) {
     876                                $location = add_query_arg( 'wcpt_messages', implode( ',', $this->active_admin_notices ), $location );
     877                        }
     878
     879                        // Don't show conflicting messages like 'Post submitted.'
     880                        if ( in_array( 1, $this->active_admin_notices ) && false !== strpos( $location, 'message=8' ) ) {
     881                                $location = remove_query_arg( 'message', $location );
     882                        }
     883
     884                        return $location;
     885                }
     886
     887                /**
     888                 * Create admin notices for messages that were passed in the URL.
     889                 *
     890                 * Any member can add a key to $this->active_admin_notices to signify that the corresponding message should
     891                 * be shown when the redirect finished. add_admin_notices_to_redirect_url() adds those keys to the redirect
     892                 * url, and this function examines the URL and create a notice with the message that corresponds to the key.
     893                 *
     894                 * $notices[key]['type'] should equal 'error' or 'updated'.
     895                 */
     896                public function print_admin_notices() {
     897                        global $post;
     898                        $screen = get_current_screen();
     899
     900                        if ( empty( $post->post_type ) || WCPT_POST_TYPE_ID != $post->post_type || 'post' !== $screen->base ) {
     901                                return;
     902                        }
     903
     904                        $notices = array(
     905                                1 => array(
     906                                        'type'   => 'error',
     907                                        'notice' => sprintf(
     908                                                __( 'This WordCamp cannot be moved to Needs Site until all of its required metadata is filled in: %s.', 'wordcamporg' ),
     909                                                implode( ', ', $this->get_required_fields( 'needs-site' ) )
     910                                        ),
    1069911                                ),
    1070                         ),
    1071 
    1072                         3 => array(
    1073                                 'type'   => 'error',
    1074                                 'notice' => sprintf(
    1075                                         __( 'This WordCamp cannot be added to the schedule until all of its required metadata is filled in: %s.', 'wordcamporg' ),
    1076                                         implode( ', ', $this->get_required_fields( 'scheduled' ) )
     912
     913                                3 => array(
     914                                        'type'   => 'error',
     915                                        'notice' => sprintf(
     916                                                __( 'This WordCamp cannot be added to the schedule until all of its required metadata is filled in: %s.', 'wordcamporg' ),
     917                                                implode( ', ', $this->get_required_fields( 'scheduled' ) )
     918                                        ),
    1077919                                ),
    1078                         ),
    1079 
    1080                         4 => array(
    1081                                 'type'   => 'error',
    1082                                 'notice' => __( 'The physical address could not be geocoded, which prevents the camp from showing up in the Events Widget. Please tweak the address so that Google can parse it.', 'wordcamporg' )
    1083                         ),
    1084                 );
    1085 
    1086                 // Show this error permenantly, not just after updating.
    1087                 if ( ! empty( $post->{'Physical Address'} ) && empty( get_post_meta( $post->ID, '_venue_coordinates', true ) ) ) {
    1088                         $_REQUEST['wcpt_messages'] = empty( $_REQUEST['wcpt_messages'] ) ? '4' : $_REQUEST['wcpt_messages'] . ',4';
    1089                 }
    1090 
    1091                 if ( ! empty( $_REQUEST['wcpt_messages'] ) ) {
    1092                         $active_notices = explode( ',', $_REQUEST['wcpt_messages'] );
    1093 
    1094                         foreach ( $active_notices as $notice_key ) {
    1095                                 if ( isset( $notices[ $notice_key ] ) ) {
    1096                                         ?>
     920
     921                                4 => array(
     922                                        'type'   => 'error',
     923                                        'notice' => __( 'The physical address could not be geocoded, which prevents the camp from showing up in the Events Widget. Please tweak the address so that Google can parse it.', 'wordcamporg' ),
     924                                ),
     925                        );
     926
     927                        // Show this error permenantly, not just after updating.
     928                        if ( ! empty( $post->{'Physical Address'} ) && empty( get_post_meta( $post->ID, '_venue_coordinates', true ) ) ) {
     929                                $_REQUEST['wcpt_messages'] = empty( $_REQUEST['wcpt_messages'] ) ? '4' : $_REQUEST['wcpt_messages'] . ',4';
     930                        }
     931
     932                        if ( ! empty( $_REQUEST['wcpt_messages'] ) ) {
     933                                $active_notices = explode( ',', $_REQUEST['wcpt_messages'] );
     934
     935                                foreach ( $active_notices as $notice_key ) {
     936                                        if ( isset( $notices[ $notice_key ] ) ) {
     937                                                ?>
    1097938
    1098939                                        <div class="<?php echo esc_attr( $notices[ $notice_key ]['type'] ); ?>">
     
    1100941                                        </div>
    1101942
    1102                                         <?php
    1103                                 }
     943                                                <?php
     944                                        }
     945                                }
     946                        }
     947                }
     948
     949                /**
     950                 * Get list of valid status transitions from given status
     951                 *
     952                 * @param string $status
     953                 *
     954                 * @return array
     955                 */
     956                public static function get_valid_status_transitions( $status ) {
     957                        return WordCamp_Loader::get_valid_status_transitions( $status );
     958                }
     959
     960                /**
     961                 * Get list of all available post statuses.
     962                 *
     963                 * @return array
     964                 */
     965                public static function get_post_statuses() {
     966                        return WordCamp_Loader::get_post_statuses();
     967                }
     968
     969                /**
     970                 * Capability required to edit wordcamp posts
     971                 *
     972                 * @return string
     973                 */
     974                public static function get_edit_capability() {
     975                        return 'wordcamp_wrangle_wordcamps';
     976                }
     977
     978                /**
     979                 * Schedule cron jobs
     980                 */
     981                public function schedule_cron_jobs() {
     982                        if ( wp_next_scheduled( 'wcpt_close_wordcamps_after_event' ) ) {
     983                                return;
     984                        }
     985
     986                        wp_schedule_event( current_time( 'timestamp' ), 'hourly', 'wcpt_close_wordcamps_after_event' );
     987                }
     988
     989                /**
     990                 * Set WordCamp posts to the Closed status after the event is over
     991                 */
     992                public function close_wordcamps_after_event() {
     993                        $scheduled_wordcamps = get_posts(
     994                                array(
     995                                        'post_type'      => WCPT_POST_TYPE_ID,
     996                                        'post_status'    => 'wcpt-scheduled',
     997                                        'posts_per_page' => -1,
     998                                )
     999                        );
     1000
     1001                        foreach ( $scheduled_wordcamps as $wordcamp ) {
     1002                                $start_date = get_post_meta( $wordcamp->ID, 'Start Date (YYYY-mm-dd)', true );
     1003                                $end_date   = get_post_meta( $wordcamp->ID, 'End Date (YYYY-mm-dd)', true );
     1004
     1005                                if ( empty( $start_date ) ) {
     1006                                        continue;
     1007                                }
     1008
     1009                                if ( empty( $end_date ) ) {
     1010                                        $end_date = $start_date;
     1011                                }
     1012
     1013                                $end_date_at_midnight = strtotime( '23:59', $end_date );    // $end_date is the date at time 00:00, but the event isn't over until 23:59
     1014
     1015                                if ( $end_date_at_midnight > time() ) {
     1016                                        continue;
     1017                                }
     1018
     1019                                wp_update_post(
     1020                                        array(
     1021                                                'ID'          => $wordcamp->ID,
     1022                                                'post_status' => 'wcpt-closed',
     1023                                        )
     1024                                );
    11041025                        }
    11051026                }
    11061027        }
    1107 
    1108         /**
    1109          * Render the WordCamp status meta box.
    1110          */
    1111         public function metabox_status( $post ) {
    1112                 require_once( WCPT_DIR . 'views/wordcamp/metabox-status.php' );
    1113         }
    1114 
    1115         /**
    1116          * Render the WordCamp status meta box.
    1117          */
    1118         public function original_application_metabox( $post ) {
    1119                 $application_data = get_post_meta( $post->ID, '_application_data', true );
    1120                 require_once( WCPT_DIR . 'views/wordcamp/metabox-original-application.php' );
    1121         }
    1122 
    1123         /**
    1124          * Schedule cron jobs
    1125          */
    1126         public function schedule_cron_jobs() {
    1127                 if ( wp_next_scheduled( 'wcpt_close_wordcamps_after_event' ) ) {
    1128                         return;
    1129                 }
    1130 
    1131                 wp_schedule_event( current_time( 'timestamp' ), 'hourly', 'wcpt_close_wordcamps_after_event' );
    1132         }
    1133 
    1134         /**
    1135          * Set WordCamp posts to the Closed status after the event is over
    1136          */
    1137         public function close_wordcamps_after_event() {
    1138                 $scheduled_wordcamps = get_posts( array(
    1139                         'post_type'      => WCPT_POST_TYPE_ID,
    1140                         'post_status'    => 'wcpt-scheduled',
    1141                         'posts_per_page' => -1
    1142                 ) );
    1143 
    1144                 foreach ( $scheduled_wordcamps as $wordcamp ) {
    1145                         $start_date = get_post_meta( $wordcamp->ID, 'Start Date (YYYY-mm-dd)', true );
    1146                         $end_date   = get_post_meta( $wordcamp->ID, 'End Date (YYYY-mm-dd)',   true );
    1147 
    1148                         if ( empty( $start_date ) ) {
    1149                                 continue;
    1150                         }
    1151 
    1152                         if ( empty( $end_date ) ) {
    1153                                 $end_date = $start_date;
    1154                         }
    1155 
    1156                         $end_date_at_midnight = strtotime( '23:59', $end_date );    // $end_date is the date at time 00:00, but the event isn't over until 23:59
    1157 
    1158                         if ( $end_date_at_midnight > time() ) {
    1159                                 continue;
    1160                         }
    1161 
    1162                         wp_update_post( array(
    1163                                 'ID'          => $wordcamp->ID,
    1164                                 'post_status' => 'wcpt-closed',
    1165                         ) );
    1166                 }
    1167         }
    1168 }
    11691028endif; // class_exists check
    11701029
     
    12151074        );
    12161075
    1217         foreach ( $meta_keys as $key => $value ) :
    1218                 $object_name = wcpt_key_to_str( $key, 'wcpt_' );
    1219                 $readonly = ( WordCamp_Admin::is_protected_field( $key ) ) ? ' readonly="readonly"' : '';
    1220         ?>
    1221 
    1222                 <div class="inside">
    1223                         <?php if ( 'checkbox' == $value ) : ?>
    1224 
    1225                                 <p>
    1226                                         <strong><?php echo $key; ?></strong>:
    1227                                         <input type="checkbox" name="<?php echo $object_name; ?>" id="<?php echo $object_name; ?>" <?php checked( get_post_meta( $post_id, $key, true ) ); ?><?php echo $readonly; ?> />
    1228                                 </p>
    1229 
    1230                         <?php else : ?>
    1231 
    1232                                 <p>
    1233                                         <strong><?php echo $key; ?></strong>
    1234                                         <?php if ( in_array( $key, $required_fields, true ) ) : ?>
    1235                                                 <span class="description"><?php _e( '(required)', 'wordcamporg' ); ?></span>
    1236                                         <?php endif; ?>
    1237                                 </p>
    1238 
    1239                                 <p>
    1240                                         <label class="screen-reader-text" for="<?php echo $object_name; ?>"><?php echo $key; ?></label>
    1241 
    1242                                         <?php switch ( $value ) :
    1243                                                 case 'text' : ?>
    1244 
    1245                                                         <input type="text" size="36" name="<?php echo $object_name; ?>" id="<?php echo $object_name; ?>" value="<?php echo esc_attr( get_post_meta( $post_id, $key, true ) ); ?>"<?php echo $readonly; ?> />
    1246 
    1247                                                 <?php break;
    1248                                                 case 'number' : ?>
    1249 
    1250                                                         <input type="number" size="16" name="<?php echo $object_name; ?>" id="<?php echo $object_name; ?>" value="<?php echo esc_attr( get_post_meta( $post_id, $key, true ) ); ?>" step="any" min="0"<?php echo $readonly; ?> />
    1251 
    1252                                                 <?php break;
    1253                                                 case 'date' :
    1254 
    1255                                                         // Quick filter on dates
    1256                                                         if ( $date = get_post_meta( $post_id, $key, true ) ) {
    1257                                                                 $date = date( 'Y-m-d', $date );
    1258                                                         }
    1259 
    1260                                                         ?>
    1261 
    1262                                                         <input type="text" size="36" class="date-field" name="<?php echo $object_name; ?>" id="<?php echo $object_name; ?>" value="<?php echo $date; ?>"<?php echo $readonly; ?> />
    1263 
    1264                                                 <?php break;
    1265                                                 case 'textarea' : ?>
    1266 
    1267                                                         <textarea rows="4" cols="23" name="<?php echo $object_name; ?>" id="<?php echo $object_name; ?>"<?php echo $readonly; ?>><?php echo esc_attr( get_post_meta( $post_id, $key, true ) ); ?></textarea>
    1268 
    1269                                                 <?php break;
    1270                                                 case 'select-currency' :
    1271                                                         $currencies = WordCamp_Budgets::get_currencies(); ?>
    1272 
    1273                                                         <?php if ( $readonly ) :
    1274                                                                 $value = get_post_meta( $post_id, $key, true ); ?>
    1275                                                                 <select name="<?php echo $object_name; ?>" id="<?php echo $object_name; ?>"<?php echo $readonly; ?>>
    1276                                                                         <option value="<?php echo esc_attr( $value ); ?>" selected>
    1277                                                                                 <?php echo ( $value ) ? esc_html( $currencies[ $value ] . ' (' . $value . ')' ) : ''; ?>
    1278                                                                         </option>
    1279                                                                 </select>
    1280                                                         <?php else : ?>
    1281                                                                 <select name="<?php echo esc_attr( $object_name ); ?>" id="<?php echo esc_attr( $object_name ); ?>" class="select-currency">
    1282                                                                         <?php foreach ( $currencies as $symbol => $name ) : ?>
    1283                                                                                 <option value="<?php echo esc_attr( $symbol ); ?>"<?php selected( $symbol, get_post_meta( $post_id, $key, true ) ); ?>>
    1284                                                                                         <?php echo ( $symbol ) ? esc_html( $name . ' (' . $symbol . ')' ) : ''; ?>
    1285                                                                                 </option>
    1286                                                                         <?php endforeach; ?>
    1287                                                                 </select>
    1288                                                         <?php endif; ?>
    1289 
    1290                                                 <?php break;
    1291 
    1292                                                 default:
    1293                                                         do_action( 'wcpt_metabox_value', $key, $value, $object_name );
    1294                                                         break;
    1295 
    1296                                         endswitch; ?>
    1297 
    1298                                         <?php if ( ! empty( $messages[ $key ] ) ) : ?>
    1299                                                 <?php if ( 'textarea' == $value ) { echo '<br />'; } ?>
    1300 
    1301                                                 <span class="description"><?php echo esc_html( $messages[ $key ] ); ?></span>
    1302                                         <?php endif; ?>
    1303                                 </p>
    1304 
    1305                         <?php endif; ?>
    1306                 </div>
    1307 
    1308         <?php endforeach;
     1076        Event_Admin::display_meta_boxes( $required_fields, $meta_keys, $messages, $post_id, WordCamp_Admin::get_protected_fields() );
     1077
    13091078}
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-loader.php

    r6186 r7607  
    66define( 'WCPT_DEFAULT_STATUS', 'wcpt-needs-vetting' );
    77define( 'WCPT_FINAL_STATUS',   'wcpt-closed'        );
     8
     9require_once WCPT_DIR . 'wcpt-event/class-event-loader.php';
    810
    911if ( ! class_exists( 'WordCamp_Loader' ) ) :
     
    1618 *
    1719 */
    18 class WordCamp_Loader {
     20class WordCamp_Loader extends Event_Loader {
    1921
    2022        /**
     
    2224         */
    2325        function __construct() {
    24                 add_action( 'plugins_loaded',                  array( $this, 'includes'                          ) );
    25                 add_action( 'init',                            array( $this, 'register_post_types'               ) );
    26                 add_action( 'init',                            array( $this, 'register_post_capabilities'        ) );
    27                 add_action( 'init',                            array( $this, 'register_post_statuses'            ) );
    28                 add_filter( 'pre_get_posts',                   array( $this, 'query_public_statuses_on_archives' ) );
     26                parent::__construct();
    2927                add_action( 'wp_insert_post_data',             array( $this, 'set_scheduled_date'                ) );
    3028                add_filter( 'wordcamp_rewrite_rules',          array( $this, 'wordcamp_rewrite_rules'            ) );
     
    132130        }
    133131
    134         public function register_post_statuses() {
    135                 foreach ( self::get_post_statuses() as $key => $label ) {
    136                         register_post_status( $key, array(
    137                                 'label' => $label,
    138                                 'public' => true,
    139                                 'label_count' => _nx_noop(
    140                                         sprintf( '%s <span class="count">(%s)</span>', $label, '%s' ),
    141                                         sprintf( '%s <span class="count">(%s)</span>', $label, '%s' ),
    142                                         'wordcamporg'
    143                                 ),
    144                         ) );
    145                 }
    146         }
    147 
    148         /**
    149          * Only query the public post statuses on WordCamp archives and feeds
    150          *
    151          * By default, any public post statuses are queried when the `post_status` parameter is not explicitly passed
    152          * to WP_Query. This causes central.wordcamp.org/wordcamps/ and central.wordcamp.org/wordcamps/feed/ to display
    153          * camps that are `needs-vetting`, etc, which is not desired.
    154          *
    155          * Another way to fix this would have been to register some of the posts statuses as `private`, but they're not
    156          * consistently used in a public or private way, so that would have had more side effects.
    157          *
    158          * @param WP_Query $query
    159          */
    160         public function query_public_statuses_on_archives( $query ) {
    161                 if ( ! $query->is_post_type_archive( WCPT_POST_TYPE_ID ) ) {
    162                         return;
    163                 }
    164 
    165                 if ( is_admin() ) {
    166                         return;
    167                 }
    168 
    169                 // Sort by the date it was added to the schedule. See WordCamp_Loader::set_scheduled_date() for details.
    170                 if ( '' === $query->get( 'orderby' ) ) {
    171                         $query->set( 'orderby', 'menu_order date' );
    172                 }
    173 
    174                 if ( ! empty( $query->query_vars['post_status'] ) ) {
    175                         return;
    176                 }
    177 
    178                 $query->query_vars['post_status'] = self::get_public_post_statuses();
    179         }
     132
    180133
    181134        /**
Note: See TracChangeset for help on using the changeset viewer.