Index: trunk/extensions/EducationProgram/specials/SpecialCourse.php |
— | — | @@ -100,11 +100,11 @@ |
101 | 101 | htmlspecialchars( $org ) |
102 | 102 | ); |
103 | 103 | |
104 | | - $course = EPCourse::selectFieldsRow( 'name', array( 'id' => $course->getField( 'course_id' ) ) ); |
| 104 | + $masterCourse = EPMC::selectFieldsRow( 'name', array( 'id' => $course->getField( 'mc_id' ) ) ); |
105 | 105 | |
106 | | - $stats['course'] = Linker::linkKnown( |
107 | | - SpecialPage::getTitleFor( 'Course', $course ), |
108 | | - htmlspecialchars( $course ) |
| 106 | + $stats['mastercourse'] = Linker::linkKnown( |
| 107 | + SpecialPage::getTitleFor( 'MasterCourse', $masterCourse ), |
| 108 | + htmlspecialchars( $masterCourse ) |
109 | 109 | ); |
110 | 110 | |
111 | 111 | $stats['year'] = htmlspecialchars( $this->getLanguage()->formatNum( $course->getField( 'year' ), true ) ); |
Index: trunk/extensions/EducationProgram/specials/SpecialMasterCourse.php |
— | — | @@ -180,8 +180,8 @@ |
181 | 181 | array( |
182 | 182 | 'href' => '#', |
183 | 183 | 'class' => 'ep-add-instructor', |
184 | | - 'data-courseid' => $masterCourse->getId(), |
185 | | - 'data-coursename' => $masterCourse->getField( 'name' ), |
| 184 | + 'data-mcid' => $masterCourse->getId(), |
| 185 | + 'data-mcname' => $masterCourse->getField( 'name' ), |
186 | 186 | 'data-mode' => 'self', |
187 | 187 | ), |
188 | 188 | wfMsg( 'ep-mc-become-instructor' ) |
— | — | @@ -194,8 +194,8 @@ |
195 | 195 | array( |
196 | 196 | 'href' => '#', |
197 | 197 | 'class' => 'ep-add-instructor', |
198 | | - 'data-courseid' => $masterCourse->getId(), |
199 | | - 'data-coursename' => $masterCourse->getField( 'name' ), |
| 198 | + 'data-mcid' => $masterCourse->getId(), |
| 199 | + 'data-mcname' => $masterCourse->getField( 'name' ), |
200 | 200 | ), |
201 | 201 | wfMsg( 'ep-mc-add-instructor' ) |
202 | 202 | ); |
Index: trunk/extensions/EducationProgram/includes/EPInstructor.php |
— | — | @@ -121,26 +121,26 @@ |
122 | 122 | * @since 0.1 |
123 | 123 | * |
124 | 124 | * @param IContextSource $context |
125 | | - * @param EPCourse|null $course |
| 125 | + * @param EPMC|null $course |
126 | 126 | * |
127 | 127 | * @return string |
128 | 128 | */ |
129 | | - public function getToolLinks( IContextSource $context, EPCourse $course = null ) { |
| 129 | + public function getToolLinks( IContextSource $context, EPMC $masterCourse = null ) { |
130 | 130 | $links = array(); |
131 | 131 | |
132 | 132 | $links[] = Linker::userTalkLink( $this->getUser()->getId(), $this->getUser()->getName() ); |
133 | 133 | |
134 | 134 | $links[] = Linker::link( SpecialPage::getTitleFor( 'Contributions', $this->getUser()->getName() ), wfMsgHtml( 'contribslink' ) ); |
135 | 135 | |
136 | | - if ( !is_null( $course ) && |
| 136 | + if ( !is_null( $masterCourse ) && |
137 | 137 | ( $context->getUser()->isAllowed( 'ep-instructor' ) || $this->getUser()->getId() == $context->getUser()->getId() ) ) { |
138 | 138 | $links[] = Html::element( |
139 | 139 | 'a', |
140 | 140 | array( |
141 | 141 | 'href' => '#', |
142 | 142 | 'class' => 'ep-instructor-remove', |
143 | | - 'data-courseid' => $course->getId(), |
144 | | - 'data-coursename' => $course->getField( 'name' ), |
| 143 | + 'data-mcid' => $masterCourse->getId(), |
| 144 | + 'data-mcname' => $masterCourse->getField( 'name' ), |
145 | 145 | 'data-userid' => $this->getUser()->getId(), |
146 | 146 | 'data-username' => $this->getUser()->getName(), |
147 | 147 | 'data-bestname' => $this->getName(), |
Index: trunk/extensions/EducationProgram/includes/EPMC.php |
— | — | @@ -85,9 +85,9 @@ |
86 | 86 | |
87 | 87 | if ( count( $termIds ) > 0 ) { |
88 | 88 | $fields['students'] = wfGetDB( DB_SLAVE )->select( |
89 | | - 'ep_students_per_term', |
| 89 | + 'ep_students_per_course', |
90 | 90 | 'COUNT(*) AS rowcount', |
91 | | - array( 'spt_term_id' => $termIds ) |
| 91 | + array( 'spc_course_id' => $termIds ) |
92 | 92 | ); |
93 | 93 | |
94 | 94 | $fields['students'] = $fields['students']->fetchObject()->rowcount; |
Index: trunk/extensions/EducationProgram/includes/EPCourse.php |
— | — | @@ -133,7 +133,7 @@ |
134 | 134 | $conditions, |
135 | 135 | array(), |
136 | 136 | array( |
137 | | - 'ep_students_per_term' => array( 'INNER JOIN', array( array( array( 'ep_students_per_course', 'student_id' ), array( 'ep_students', 'id' ) ) ) ), |
| 137 | + 'ep_students_per_course' => array( 'INNER JOIN', array( array( array( 'ep_students_per_course', 'student_id' ), array( 'ep_students', 'id' ) ) ) ), |
138 | 138 | 'ep_courses' => array( 'INNER JOIN', array( array( array( 'ep_students_per_course', 'course_id' ), array( 'ep_courses', 'id' ) ) ) ) |
139 | 139 | ) |
140 | 140 | ); |
— | — | @@ -189,9 +189,9 @@ |
190 | 190 | |
191 | 191 | if ( in_array( 'students', $summaryFields ) ) { |
192 | 192 | $fields['students'] = wfGetDB( DB_SLAVE )->select( |
193 | | - 'ep_students_per_term', |
| 193 | + 'ep_students_per_course', |
194 | 194 | 'COUNT(*) AS rowcount', |
195 | | - array( 'spt_term_id' => $this->getId() ) |
| 195 | + array( 'spc_course_id' => $this->getId() ) |
196 | 196 | ); |
197 | 197 | |
198 | 198 | $fields['students'] = $fields['students']->fetchObject()->rowcount; |
— | — | @@ -206,7 +206,7 @@ |
207 | 207 | */ |
208 | 208 | protected function insertIntoDB() { |
209 | 209 | if ( !$this->hasField( 'org_id' ) ) { |
210 | | - $this->setField( 'org_id', $this->getCourse( 'org_id' )->getField( 'org_id' ) ); |
| 210 | + $this->setField( 'org_id', $this->getMasterCourse( 'org_id' )->getField( 'org_id' ) ); |
211 | 211 | } |
212 | 212 | |
213 | 213 | $success = parent::insertIntoDB(); |
— | — | @@ -240,7 +240,7 @@ |
241 | 241 | } |
242 | 242 | |
243 | 243 | if ( $success ) { |
244 | | - $success = wfGetDB( DB_MASTER )->delete( 'ep_students_per_term', array( 'spt_term_id' => $id ) ) && $success; |
| 244 | + $success = wfGetDB( DB_MASTER )->delete( 'ep_students_per_course', array( 'spc_term_id' => $id ) ) && $success; |
245 | 245 | } |
246 | 246 | |
247 | 247 | return $success; |
— | — | @@ -409,11 +409,11 @@ |
410 | 410 | * @param array $args |
411 | 411 | */ |
412 | 412 | public static function displayAddNewRegion( IContextSource $context, array $args = array() ) { |
413 | | - if ( EPCourse::has() ) { |
| 413 | + if ( EPMC::has() ) { |
414 | 414 | EPCourse::displayAddNewControl( $context, $args ); |
415 | 415 | } |
416 | 416 | elseif ( $context->getUser()->isAllowed( 'ep-course' ) ) { |
417 | | - $context->getOutput()->addWikiMsg( 'ep-courses-addcoursefirst' ); |
| 417 | + $context->getOutput()->addWikiMsg( 'ep-courses-addmastercoursefirst' ); |
418 | 418 | } |
419 | 419 | } |
420 | 420 | |
Index: trunk/extensions/EducationProgram/EducationProgram.i18n.php |
— | — | @@ -186,7 +186,7 @@ |
187 | 187 | 'ep-courses-newmastercourse' => 'Course master course:', |
188 | 188 | 'ep-courses-add' => 'Add course', |
189 | 189 | 'ep-courses-nocourses' => 'There are no master courses yet. You need to [[Special:MasterCourses|add a master course]] before you can create any courses.', |
190 | | - 'ep-courses-addcoursefirst' => 'The institutions you are a mentor for do not have any master courses associated with them. You need to [[Special:MasterCourses|add a master course]] before you can create any courses.', |
| 190 | + 'ep-courses-addmastercoursefirst' => 'There are no master courses yet. You need to [[Special:MasterCourses|add a master course]] before you can create any courses.', |
191 | 191 | |
192 | 192 | // Special:Students |
193 | 193 | 'ep-students-noresults' => 'There are no students to list.', |
— | — | @@ -226,7 +226,7 @@ |
227 | 227 | |
228 | 228 | // Course pager |
229 | 229 | 'epcoursepager-header-id' => 'Id', |
230 | | - 'epcoursepager-header-course-id' => 'Master course', |
| 230 | + 'epcoursepager-header-mc-id' => 'Master course', |
231 | 231 | 'epcoursepager-header-year' => 'Year', |
232 | 232 | 'epcoursepager-header-start' => 'Start', |
233 | 233 | 'epcoursepager-header-end' => 'End', |
— | — | @@ -391,33 +391,33 @@ |
392 | 392 | 'ep-mycourses-not-a-student' => 'You are not enrolled in any [[Special:Courses|courses]].', |
393 | 393 | |
394 | 394 | // ep.instructor |
395 | | - 'ep-instructor-remove-title' => 'Remove instructor from course', |
| 395 | + 'ep-instructor-remove-title' => 'Remove instructor from master course', |
396 | 396 | 'ep-instructor-remove-button' => 'Remove instructor', |
397 | 397 | 'ep-instructor-removing' => 'Removing...', |
398 | | - 'ep-instructor-removal-success' => 'This instructor has been successfully removed from this course.', |
| 398 | + 'ep-instructor-removal-success' => 'This instructor has been successfully removed from this master course.', |
399 | 399 | 'ep-instructor-close-button' => 'Close', |
400 | 400 | 'ep-instructor-remove-retry' => 'Retry', |
401 | | - 'ep-instructor-remove-failed' => 'Something went wrong - could not remove the instructor from the course.', |
| 401 | + 'ep-instructor-remove-failed' => 'Something went wrong - could not remove the instructor from the master course.', |
402 | 402 | 'ep-instructor-cancel-button' => 'Cancel', |
403 | | - 'ep-instructor-remove-text' => 'You are about to remove $2 (Username: $1) as {{GENDER:$1|instructor}} from course $3. Please enter a brief summary with the reason for this removal.', |
| 403 | + 'ep-instructor-remove-text' => 'You are about to remove $2 (Username: $1) as {{GENDER:$1|instructor}} from master course $3. Please enter a brief summary with the reason for this removal.', |
404 | 404 | 'ep-instructor-adding' => 'Adding...', |
405 | | - 'ep-instructor-addittion-success' => '$1 has been successfully added as {{GENDER:$1|instructor}} for course $2!', |
406 | | - 'ep-instructor-addittion-self-success' => 'You have been successfully added as {{GENDER:$1|instructor}} for course $2!', |
| 405 | + 'ep-instructor-addittion-success' => '$1 has been successfully added as {{GENDER:$1|instructor}} for master course $2!', |
| 406 | + 'ep-instructor-addittion-self-success' => 'You have been successfully added as {{GENDER:$1|instructor}} for master course $2!', |
407 | 407 | 'ep-instructor-add-close-button' => 'Close', |
408 | 408 | 'ep-instructor-add-retry' => 'Retry', |
409 | | - 'ep-instructor-addittion-failed' => 'Something went wrong - could not add the instructor to the course.', |
410 | | - 'ep-instructor-add-title' => 'Add an instructor to the course', |
411 | | - 'ep-instructor-add-self-title' => 'Become an {{GENDER:$1|instructor}} for this course', |
| 409 | + 'ep-instructor-addittion-failed' => 'Something went wrong - could not add the instructor to the master course.', |
| 410 | + 'ep-instructor-add-title' => 'Add an instructor to the master course', |
| 411 | + 'ep-instructor-add-self-title' => 'Become an {{GENDER:$1|instructor}} for this master course', |
412 | 412 | 'ep-instructor-add-button' => 'Add instructor', |
413 | 413 | 'ep-instructor-add-self-button' => 'Become {{GENDER:$1|instructor}}', |
414 | | - 'ep-instructor-add-text' => 'You are adding an instructor for course $1. Enter the username of the instructor and a brief description why this person is being added.', |
415 | | - 'ep-instructor-add-self-text' => 'You are adding yourself as {{GENDER:$1|instructor}} for course $1. Please add a brief description why you are doing so.', |
| 414 | + 'ep-instructor-add-text' => 'You are adding an instructor for master course $1. Enter the username of the instructor and a brief description why this person is being added.', |
| 415 | + 'ep-instructor-add-self-text' => 'You are adding yourself as {{GENDER:$1|instructor}} for master course $1. Please add a brief description why you are doing so.', |
416 | 416 | 'ep-instructor-add-cancel-button' => 'Cancel', |
417 | 417 | 'ep-instructor-summary-input' => 'Summary', |
418 | 418 | 'ep-instructor-name-input' => 'User name', |
419 | 419 | |
420 | 420 | // EPInstrucor |
421 | | - 'ep-instructor-remove' => 'remove from course', |
| 421 | + 'ep-instructor-remove' => 'remove as instructor', |
422 | 422 | |
423 | 423 | // API addinstructor |
424 | 424 | 'ep-addinstructor-invalid-user-args' => 'You need to either provide the username or the userid parameter', |
Index: trunk/extensions/EducationProgram/EducationProgram.php |
— | — | @@ -394,7 +394,7 @@ |
395 | 395 | 'ep-instructor-add-cancel-button', |
396 | 396 | 'ep-instructor-summary-input', |
397 | 397 | 'ep-instructor-name-input', |
398 | | - 'ep-course-no-instructors', |
| 398 | + 'ep-mc-no-instructors', |
399 | 399 | ), |
400 | 400 | ); |
401 | 401 | |
Index: trunk/extensions/EducationProgram/resources/ep.instructor.js |
— | — | @@ -14,8 +14,8 @@ |
15 | 15 | |
16 | 16 | $( '.ep-instructor-remove' ).click( function( event ) { |
17 | 17 | var $this = $( this ), |
18 | | - courseId = $this.attr( 'data-courseid' ), |
19 | | - courseName = $this.attr( 'data-coursename' ), |
| 18 | + mcId = $this.attr( 'data-mcid' ), |
| 19 | + mcName = $this.attr( 'data-mcname' ), |
20 | 20 | userId = $this.attr( 'data-userid' ), |
21 | 21 | userName = $this.attr( 'data-username' ), |
22 | 22 | bestName = $this.attr( 'data-bestname' ), |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | $remove.button( 'option', 'label', ep.msg( 'ep-instructor-removing' ) ); |
31 | 31 | |
32 | 32 | ep.api.removeInstructor( { |
33 | | - 'courseid': courseId, |
| 33 | + 'mcid': mcId, |
34 | 34 | 'userid': userId, |
35 | 35 | 'reason': summaryInput.val() |
36 | 36 | } ).done( function() { |
— | — | @@ -43,7 +43,7 @@ |
44 | 44 | $li.remove(); |
45 | 45 | |
46 | 46 | if ( $ul.find( 'li' ).length < 1 ) { |
47 | | - $ul.closest( 'div' ).text( mw.msg( 'ep-course-no-instructors' ) ); |
| 47 | + $ul.closest( 'div' ).text( mw.msg( 'ep-mc-no-instructors' ) ); |
48 | 48 | } |
49 | 49 | } ).fail( function() { |
50 | 50 | $remove.button( 'option', 'disabled', false ); |
— | — | @@ -81,7 +81,7 @@ |
82 | 82 | 'ep-instructor-remove-text', |
83 | 83 | mw.html.escape( userName ), |
84 | 84 | '<b>' + mw.html.escape( bestName ) + '</b>', |
85 | | - '<b>' + mw.html.escape( courseName ) + '</b>' |
| 85 | + '<b>' + mw.html.escape( mcName ) + '</b>' |
86 | 86 | ) ); |
87 | 87 | |
88 | 88 | $dialog.append( summaryInput ); |
— | — | @@ -99,8 +99,8 @@ |
100 | 100 | $( '.ep-add-instructor' ).click( function( event ) { |
101 | 101 | var $this = $( this ), _this = this; |
102 | 102 | |
103 | | - this.courseId = $this.attr( 'data-courseid' ); |
104 | | - this.courseName = $this.attr( 'data-coursename' ); |
| 103 | + this.mcId = $this.attr( 'data-mcid' ); |
| 104 | + this.mcName = $this.attr( 'data-mcname' ); |
105 | 105 | this.selfMode = $this.attr( 'data-mode' ) === 'self'; |
106 | 106 | this.$dialog = null; |
107 | 107 | |
— | — | @@ -132,14 +132,14 @@ |
133 | 133 | $add.button( 'option', 'label', ep.msg( 'ep-instructor-adding' ) ); |
134 | 134 | |
135 | 135 | ep.api.addInstructor( { |
136 | | - 'courseid': _this.courseId, |
| 136 | + 'mcid': _this.mcId, |
137 | 137 | 'username': _this.getName(), |
138 | 138 | 'reason': _this.summaryInput.val() |
139 | 139 | } ).done( function() { |
140 | 140 | _this.$dialog.text( ep.msg( |
141 | 141 | _this.selfMode ? 'ep-instructor-addittion-self-success' : 'ep-instructor-addittion-success', |
142 | 142 | _this.getName(), |
143 | | - _this.courseName |
| 143 | + _this.mcName |
144 | 144 | ) ); |
145 | 145 | |
146 | 146 | $add.remove(); |
— | — | @@ -147,11 +147,11 @@ |
148 | 148 | $cancel.focus(); |
149 | 149 | |
150 | 150 | // TODO: link name to user page and show control links |
151 | | - $ul = $( '#ep-course-instructors' ).find( 'ul' ); |
| 151 | + $ul = $( '#ep-mc-instructors' ).find( 'ul' ); |
152 | 152 | |
153 | 153 | if ( $ul.length < 1 ) { |
154 | 154 | $ul = $( '<ul>' ); |
155 | | - $( '#ep-course-instructors' ).html( $ul ); |
| 155 | + $( '#ep-mc-instructors' ).html( $ul ); |
156 | 156 | } |
157 | 157 | |
158 | 158 | $ul.append( $( '<li>' ).text( _this.getName() ) ) |
— | — | @@ -185,7 +185,7 @@ |
186 | 186 | |
187 | 187 | this.$dialog.append( $( '<p>' ).text( gM( |
188 | 188 | this.selfMode ? 'ep-instructor-add-self-text' : 'ep-instructor-add-text', |
189 | | - this.courseName, |
| 189 | + this.mcName, |
190 | 190 | this.getName() |
191 | 191 | ) ) ); |
192 | 192 | |