Index: trunk/extensions/CommunityHiring/tables.sql |
— | — | @@ -0,0 +1,6 @@ |
| 2 | +-- Adds tables for CommunityHiring |
| 3 | +CREATE TABLE community_hiring_application ( |
| 4 | + ch_id int unsigned auto_increment, |
| 5 | + ch_data LONGBLOB, |
| 6 | + primary key (ch_id) |
| 7 | +); |
Index: trunk/extensions/CommunityHiring/CommunityHiring.php |
— | — | @@ -0,0 +1,7 @@ |
| 2 | +<?php |
| 3 | +// Community department job applications |
| 4 | + |
| 5 | +$wgSpecialPages['CommunityHiring'] = 'SpecialCommunityHiring'; |
| 6 | +$wgAutoloadClasses['SpecialCommunityHiring'] = dirname(__FILE__)."/SpecialCommunityHiring.php"; |
| 7 | + |
| 8 | +$wgExtensionMessagesFiles['CommunityHiring'] = dirname( __FILE__ )."/Messages.php"; |
Index: trunk/extensions/CommunityHiring/SpecialCommunityHiring.php |
— | — | @@ -0,0 +1,203 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +class SpecialCommunityHiring extends SpecialPage { |
| 5 | + function __construct() { |
| 6 | + parent::__construct( 'CommunityHiring' ); |
| 7 | + wfLoadExtensionMessages( 'CommunityHiring' ); |
| 8 | + } |
| 9 | + |
| 10 | + function execute( $par ) { |
| 11 | + global $wgRequest, $wgOut; |
| 12 | + |
| 13 | + wfLoadExtensionMessages( 'CommunityHiring' ); |
| 14 | + |
| 15 | + $wgOut->setPageTitle( 'Job Openings/Community Department' ); |
| 16 | + |
| 17 | + $formDescriptor = array( |
| 18 | + 'about-intro' => array( |
| 19 | + 'type' => 'info', |
| 20 | + 'default' => wfMsgExt( 'communityhiring-about-intro', 'parse' ), |
| 21 | + 'raw' => 1, |
| 22 | + 'section' => 'aboutyou', |
| 23 | + ), |
| 24 | + 'given-name' => array( |
| 25 | + 'type' => 'text', |
| 26 | + 'label-message' => 'communityhiring-given', |
| 27 | + 'section' => 'aboutyou', |
| 28 | + ), |
| 29 | + 'family-name' => array( |
| 30 | + 'type' => 'text', |
| 31 | + 'label-message' => 'communityhiring-family', |
| 32 | + 'section' => 'aboutyou', |
| 33 | + ), |
| 34 | + 'address-line1' => array( |
| 35 | + 'type' => 'textarea', |
| 36 | + 'label-message' => 'communityhiring-address', |
| 37 | + 'section' => 'aboutyou', |
| 38 | + 'rows' => '3', |
| 39 | + 'cols' => '20', |
| 40 | + ), |
| 41 | + 'address-city' => array( |
| 42 | + 'type' => 'text', |
| 43 | + 'label-message' => 'communityhiring-address-city', |
| 44 | + 'section' => 'aboutyou', |
| 45 | + ), |
| 46 | + 'address-postal' => array( |
| 47 | + 'type' => 'text', |
| 48 | + 'label-message' => 'communityhiring-address-postal', |
| 49 | + 'section' => 'aboutyou', |
| 50 | + ), |
| 51 | + 'address-country' => array( |
| 52 | + 'type' => 'text', |
| 53 | + 'label-message' => 'communityhiring-address-country', |
| 54 | + 'section' => 'aboutyou', |
| 55 | + ), |
| 56 | + 'phone' => array( |
| 57 | + 'type' => 'text', |
| 58 | + 'label-message' => 'communityhiring-phone', |
| 59 | + 'section' => 'aboutyou', |
| 60 | + ), |
| 61 | + 'email' => array( |
| 62 | + 'type' => 'text', |
| 63 | + 'label-message' => 'communityhiring-email', |
| 64 | + 'section' => 'aboutyou', |
| 65 | + ), |
| 66 | + |
| 67 | + // Pararaph answers |
| 68 | + 'paragraph-intro' => array( |
| 69 | + 'type' => 'info', |
| 70 | + 'default' => wfMsgExt( 'communityhiring-paragraphs-intro', 'parse' ), |
| 71 | + 'raw' => 1, |
| 72 | + 'section' => 'paragraphs', |
| 73 | + 'vertical-label' => 1, |
| 74 | + ), |
| 75 | + 'significance' => array( |
| 76 | + 'type' => 'textarea', |
| 77 | + 'label-message' => 'communityhiring-significance', |
| 78 | + 'section' => 'paragraphs', |
| 79 | + 'rows' => 10, |
| 80 | + 'vertical-label' => 1, |
| 81 | + ), |
| 82 | + 'excitement' => array( |
| 83 | + 'type' => 'textarea', |
| 84 | + 'label-message' => 'communityhiring-excitement', |
| 85 | + 'section' => 'paragraphs', |
| 86 | + 'rows' => 10, |
| 87 | + 'vertical-label' => 1, |
| 88 | + ), |
| 89 | + 'experiences' => array( |
| 90 | + 'type' => 'textarea', |
| 91 | + 'label-message' => 'communityhiring-experiences', |
| 92 | + 'section' => 'paragraphs', |
| 93 | + 'rows' => 10, |
| 94 | + 'vertical-label' => 1, |
| 95 | + ), |
| 96 | + 'other' => array( |
| 97 | + 'type' => 'textarea', |
| 98 | + 'label-message' => 'communityhiring-other', |
| 99 | + 'section' => 'paragraphs', |
| 100 | + 'rows' => 10, |
| 101 | + 'vertical-label' => 1, |
| 102 | + ), |
| 103 | + |
| 104 | + // Demonstrative info |
| 105 | + 'languages' => array( |
| 106 | + 'type' => 'textarea', |
| 107 | + 'options' => array_flip( Language::getLanguageNames() ), |
| 108 | + 'section' => 'demonstrative/languages', |
| 109 | + 'rows' => '3', |
| 110 | + 'label-message' => 'communityhiring-languages-label', |
| 111 | + 'vertical-label' => 1, |
| 112 | + ), |
| 113 | + |
| 114 | + 'contributor' => array( |
| 115 | + 'type' => 'radio', |
| 116 | + 'label-message' => 'communityhiring-contributor', |
| 117 | + 'section' => 'demonstrative/involvement', |
| 118 | + 'options' => array( |
| 119 | + 'Yes' => 1, |
| 120 | + 'No' => 0, |
| 121 | + ), |
| 122 | + ), |
| 123 | + 'usernames' => array( |
| 124 | + 'type' => 'textarea', |
| 125 | + 'rows' => '3', |
| 126 | + 'cols' => '20', |
| 127 | + 'label-message' => 'communityhiring-usernames', |
| 128 | + 'section' => 'demonstrative/involvement', |
| 129 | + 'vertical-label' => 1, |
| 130 | + ), |
| 131 | + 'wikimedia-links' => array( |
| 132 | + 'type' => 'textarea', |
| 133 | + 'label-message' => 'communityhiring-links', |
| 134 | + 'section' => 'demonstrative/involvement', |
| 135 | + 'rows' => '3', |
| 136 | + 'cols' => '20', |
| 137 | + 'vertical-label' => 1, |
| 138 | + ), |
| 139 | + 'other-links' => array( |
| 140 | + 'type' => 'textarea', |
| 141 | + 'label-message' => 'communityhiring-links-other', |
| 142 | + 'section' => 'demonstrative', |
| 143 | + 'rows' => '3', |
| 144 | + 'cols' => '20', |
| 145 | + 'vertical-label' => 1, |
| 146 | + ), |
| 147 | + |
| 148 | + // Availability |
| 149 | + 'availability-time' => array( |
| 150 | + 'type' => 'text', |
| 151 | + 'label-message' => 'communityhiring-availability-intro', |
| 152 | + 'section' => 'availability', |
| 153 | + 'vertical-label' => 1, |
| 154 | + ), |
| 155 | + 'availability-info' => array( |
| 156 | + 'type' => 'textarea', |
| 157 | + 'label-message' => 'communityhiring-availability-info', |
| 158 | + 'section' => 'availability', |
| 159 | + 'rows' => '5', |
| 160 | + 'cols' => '20', |
| 161 | + 'vertical-label' => 1, |
| 162 | + ), |
| 163 | + 'relocation' => array( |
| 164 | + 'type' => 'radio', |
| 165 | + 'label-message' => 'communityhiring-relocation-ok', |
| 166 | + 'section' => 'availability', |
| 167 | + 'vertical-label' => 1, |
| 168 | + 'options' => array( |
| 169 | + 'Yes' => 'yes', |
| 170 | + 'No' => 'no', |
| 171 | + 'It would be hard, but maybe I would' => 'maybe' |
| 172 | + ), |
| 173 | + ), |
| 174 | + |
| 175 | + // Quick research question |
| 176 | + 'research' => array( |
| 177 | + 'type' => 'textarea', |
| 178 | + 'label-message' => 'communityhiring-research', |
| 179 | + 'vertical-label' => 1, |
| 180 | + ), |
| 181 | + ); |
| 182 | + |
| 183 | + $form = new HTMLForm( $formDescriptor, 'communityhiring' ); |
| 184 | + |
| 185 | + $form->setIntro( wfMsgExt( 'communityhiring-intro', 'parse' ) ); |
| 186 | + $form->setSubmitCallback( array( $this, 'submit' ) ); |
| 187 | + $form->setTitle( $this->getTitle() ); |
| 188 | + |
| 189 | + $form->show(); |
| 190 | + } |
| 191 | + |
| 192 | + function submit( $info ) { |
| 193 | + global $wgOut; |
| 194 | + |
| 195 | + $dbw = wfGetDB( DB_MASTER ); |
| 196 | + |
| 197 | + $dbw->insert( 'community_hiring_application', array( 'ch_data' => json_encode($info) ), |
| 198 | + __METHOD__ ); |
| 199 | + |
| 200 | + $wgOut->addWikiMsg( 'communityhiring-done' ); |
| 201 | + |
| 202 | + return true; |
| 203 | + } |
| 204 | +} |
Index: trunk/extensions/CommunityHiring/Messages.php |
— | — | @@ -0,0 +1,38 @@ |
| 2 | +<?php |
| 3 | +$messages = array(); |
| 4 | + |
| 5 | +$messages['en'] = array( |
| 6 | + 'communityhiring-aboutyou' => 'Tell us about yourself', |
| 7 | + 'communityhiring-about-intro' => 'Please tell us about yourself and your interest in a position at Wikimedia Foundation.', |
| 8 | + 'communityhiring-given' => 'Given Name:', |
| 9 | + 'communityhiring-family' => 'Family Name:', |
| 10 | + 'communityhiring-address' => 'Address:', |
| 11 | + 'communityhiring-address-city' => 'City:', |
| 12 | + 'communityhiring-address-postal' => 'Postal Code:', |
| 13 | + 'communityhiring-address-country' => 'Country:', |
| 14 | + 'communityhiring-phone' => 'Phone:', |
| 15 | + 'communityhiring-email' => 'Email:', |
| 16 | + 'communityhiring-paragraphs' => 'Wikimedia', |
| 17 | + 'communityhiring-paragraphs-intro' => 'Please answer the next six questions with a single, well thought out paragraph.', |
| 18 | + 'communityhiring-significance' => 'Tell us how you see the significance of Wikimedia communities in the world.', |
| 19 | + 'communityhiring-excitement' => 'Tell us what you find personally exciting about Wikipedia or any other Wikimedia community.', |
| 20 | + 'communityhiring-experiences' => 'Describe the experiences and/or training that qualify you to serve the Wikimedia communities in a staff position at Wikimedia Foundation.', |
| 21 | + 'communityhiring-other' => "Is there anything else you'd like to tell us about yourself? (Optional)", |
| 22 | + 'communityhiring-demonstrative' => '', |
| 23 | + 'communityhiring-involvement' => 'Community Involvement', |
| 24 | + 'communityhiring-contributor' => 'Are you a contributor to any Wikimedia Projects?', |
| 25 | + 'communityhiring-usernames' => 'Feel free to tell us your usenames on the projects you work on:', |
| 26 | + 'communityhiring-links' => "Give us up to three links to work in the Wikimedia communities that you're proud of:", |
| 27 | + 'communityhiring-languages' => 'Language proficiency', |
| 28 | + 'communityhiring-languages-label' => 'What languages can you speak and write proficiently?', |
| 29 | + 'communityhiring-links-other' => "Give us up to three URLs of work outside of Wikimedia communities that you're proud of:", |
| 30 | + 'communityhiring-availability' => 'Availability', |
| 31 | + 'communityhiring-availability-intro' => "Tell us if there is a particular time when you'd be available to come work at Wikimedia Foundation:", |
| 32 | + 'communityhiring-availability-info' => "Anything else we should know about when you'd be available: (Optional)", |
| 33 | + 'communityhiring-relocation-ok' => 'Are you willing to relocate to San Francisco, California?', |
| 34 | + 'communityhiring-research' => "In one or two sentences, describe the process in which users are approved to become administrators on English Wikipedia. |
| 35 | + |
| 36 | + (You are not expected to know the answer to this question already. You can find the answer [[Wikipedia:RFA|here]] but feel free to consult other resources. We're not looking for a detailed description of the process, but a sentence that captures the essence of the process and why it works.)", |
| 37 | + |
| 38 | + 'communityhiring-intro' => "", |
| 39 | +); |