Index: trunk/extensions/EducationProgram/sql/EducationProgram.sql |
— | — | @@ -52,8 +52,8 @@ |
53 | 53 | course_id INT unsigned NOT NULL auto_increment PRIMARY KEY, |
54 | 54 | |
55 | 55 | course_mc_id INT unsigned NOT NULL, -- Foreign key on ep_mcs.mc_id |
| 56 | + course_org_id INT unsigned NOT NULL, -- Foreign key on ep_orgs.org_id. Helper field, not strictly needed. |
56 | 57 | course_name VARCHAR(255) NOT NULL, -- Name of the course |
57 | | - course_org_id INT unsigned NOT NULL, -- Foreign key on ep_orgs.org_id. Helper field, not strictly needed. |
58 | 58 | course_year SMALLINT unsigned NOT NULL, -- Year in which the course takes place |
59 | 59 | course_start varbinary(14) NOT NULL, -- Start time of the course |
60 | 60 | course_end varbinary(14) NOT NULL, -- End time of the course |
Index: trunk/extensions/EducationProgram/specials/SpecialInstitution.php |
— | — | @@ -59,12 +59,12 @@ |
60 | 60 | |
61 | 61 | $this->displaySummary( $org ); |
62 | 62 | |
63 | | - $out->addHTML( Html::element( 'h2', array(), wfMsg( 'ep-institution-courses' ) ) ); |
| 63 | + $out->addHTML( Html::element( 'h2', array(), wfMsg( 'ep-institution-mcs' ) ) ); |
64 | 64 | |
65 | 65 | EPMC::displayPager( $this->getContext(), array( 'org_id' => $org->getId() ) ); |
66 | 66 | |
67 | | - if ( $this->getUser()->isAllowed( 'ep-course' ) ) { |
68 | | - $out->addHTML( Html::element( 'h2', array(), wfMsg( 'ep-institution-add-course' ) ) ); |
| 67 | + if ( $this->getUser()->isAllowed( 'ep-mc' ) ) { |
| 68 | + $out->addHTML( Html::element( 'h2', array(), wfMsg( 'ep-institution-add-mc' ) ) ); |
69 | 69 | |
70 | 70 | EPMC::displayAddNewControl( $this->getContext(), array( 'org' => $org->getId() ) ); |
71 | 71 | } |
Index: trunk/extensions/EducationProgram/includes/EPOrgPager.php |
— | — | @@ -157,7 +157,10 @@ |
158 | 158 | array( 'wpreturnto' => $this->getTitle()->getText() ) |
159 | 159 | ); |
160 | 160 | |
161 | | - $links[] = $this->getDeletionLink( 'org', $item->getId() ); |
| 161 | + $links[] = $this->getDeletionLink( |
| 162 | + ApiDeleteEducation::getTypeForClassName( $this->className ), |
| 163 | + $item->getId() |
| 164 | + ); |
162 | 165 | } |
163 | 166 | |
164 | 167 | return $links; |
Index: trunk/extensions/EducationProgram/includes/EPMCPager.php |
— | — | @@ -147,7 +147,10 @@ |
148 | 148 | array( 'wpreturnto' => $this->getTitle()->getText() ) |
149 | 149 | ); |
150 | 150 | |
151 | | - $links[] = $this->getDeletionLink( 'course', $item->getId() ); |
| 151 | + $links[] = $this->getDeletionLink( |
| 152 | + ApiDeleteEducation::getTypeForClassName( $this->className ), |
| 153 | + $item->getId() |
| 154 | + ); |
152 | 155 | } |
153 | 156 | |
154 | 157 | return $links; |
Index: trunk/extensions/EducationProgram/includes/EPCoursePager.php |
— | — | @@ -192,7 +192,10 @@ |
193 | 193 | array( 'wpreturnto' => $this->getTitle()->getText() ) |
194 | 194 | ); |
195 | 195 | |
196 | | - $links[] = $this->getDeletionLink( 'course', $item->getId() ); |
| 196 | + $links[] = $this->getDeletionLink( |
| 197 | + ApiDeleteEducation::getTypeForClassName( $this->className ), |
| 198 | + $item->getId() |
| 199 | + ); |
197 | 200 | } |
198 | 201 | |
199 | 202 | return $links; |
Index: trunk/extensions/EducationProgram/includes/EPMC.php |
— | — | @@ -148,7 +148,7 @@ |
149 | 149 | $success = parent::insertIntoDB(); |
150 | 150 | |
151 | 151 | if ( $this->updateSummaries ) { |
152 | | - EPOrg::updateSummaryFields( array( 'courses', 'active' ), array( 'id' => $this->getField( 'org_id' ) ) ); |
| 152 | + EPOrg::updateSummaryFields( array( 'mcs', 'active' ), array( 'id' => $this->getField( 'org_id' ) ) ); |
153 | 153 | } |
154 | 154 | |
155 | 155 | return $success; |
Index: trunk/extensions/EducationProgram/includes/EPCourse.php |
— | — | @@ -216,7 +216,7 @@ |
217 | 217 | $success = parent::insertIntoDB(); |
218 | 218 | |
219 | 219 | if ( $success && $this->updateSummaries ) { |
220 | | - EPOrg::updateSummaryFields( array( 'terms', 'active' ), array( 'id' => $this->getField( 'org_id' ) ) ); |
| 220 | + EPOrg::updateSummaryFields( array( 'courses', 'active' ), array( 'id' => $this->getField( 'org_id' ) ) ); |
221 | 221 | EPMC::updateSummaryFields( 'active', array( 'id' => $this->getField( 'mc_id' ) ) ); |
222 | 222 | } |
223 | 223 | |
— | — | @@ -240,7 +240,7 @@ |
241 | 241 | |
242 | 242 | if ( $success && $this->updateSummaries ) { |
243 | 243 | EPMC::updateSummaryFields( 'students', array( 'id' => $courseId ) ); |
244 | | - EPOrg::updateSummaryFields( array( 'terms', 'students', 'active' ), array( 'id' => $orgId ) ); |
| 244 | + EPOrg::updateSummaryFields( array( 'courses', 'students', 'active' ), array( 'id' => $orgId ) ); |
245 | 245 | } |
246 | 246 | |
247 | 247 | if ( $success ) { |
Index: trunk/extensions/EducationProgram/EducationProgram.i18n.php |
— | — | @@ -304,7 +304,7 @@ |
305 | 305 | 'ep-institution-none' => 'There is no institution with name "$1". See [[Special:Institution|here]] for a list of institutions.', |
306 | 306 | 'ep-institution-create' => 'There is no institution with name "$1" yet, but you can create it.', |
307 | 307 | 'ep-institution-title' => 'Institution: $1', |
308 | | - 'ep-institution-courses' => 'Courses', |
| 308 | + 'ep-institution-mcs' => 'Master courses', |
309 | 309 | 'specialinstitution-summary-name' => 'Name', |
310 | 310 | 'specialinstitution-summary-city' => 'City', |
311 | 311 | 'specialinstitution-summary-country' => 'Country', |
— | — | @@ -313,7 +313,7 @@ |
314 | 314 | 'specialinstitution-summary-mcs' => 'Master course count', |
315 | 315 | 'specialinstitution-summary-students' => 'Student count', |
316 | 316 | 'ep-institution-nav-edit' => 'Edit this institution', |
317 | | - 'ep-institution-add-course' => 'Add a course', |
| 317 | + 'ep-institution-add-mc' => 'Add a master course', |
318 | 318 | 'ep-institution-inactive' => 'Inactive', |
319 | 319 | 'ep-institution-active' => 'Active', |
320 | 320 | |