Index: trunk/extensions/EducationProgram/specials/SpecialInstitution.php |
— | — | @@ -68,6 +68,12 @@ |
69 | 69 | $out->addHTML( Html::element( 'h2', array(), wfMsg( 'ep-institution-courses' ) ) ); |
70 | 70 | |
71 | 71 | EPCourse::displayPager( $this->getContext(), array( 'org_id' => $org->getId() ) ); |
| 72 | + |
| 73 | + if ( $this->getUser()->isAllowed( 'epadmin' ) ) { |
| 74 | + $out->addHTML( Html::element( 'h2', array(), wfMsg( 'ep-institution-add-course' ) ) ); |
| 75 | + |
| 76 | + EPCourse::displayAddNewControl( $this->getContext(), array( 'org' => $org->getId() ) ); |
| 77 | + } |
72 | 78 | } |
73 | 79 | } |
74 | 80 | } |
Index: trunk/extensions/EducationProgram/specials/SpecialCourse.php |
— | — | @@ -72,6 +72,12 @@ |
73 | 73 | $out->addHTML( Html::element( 'h2', array(), wfMsg( 'ep-course-terms' ) ) ); |
74 | 74 | |
75 | 75 | EPTerm::displayPager( $this->getContext(), array( 'course_id' => $course->getId() ) ); |
| 76 | + |
| 77 | + if ( $course->useCanManage( $this->getUser() ) ) { |
| 78 | + $out->addHTML( Html::element( 'h2', array(), wfMsg( 'ep-course-add-term' ) ) ); |
| 79 | + |
| 80 | + EPCourse::displayAddNewControl( $this->getContext(), array( 'course' => $course->getId() ) ); |
| 81 | + } |
76 | 82 | } |
77 | 83 | } |
78 | 84 | } |
Index: trunk/extensions/EducationProgram/includes/EPOrg.php |
— | — | @@ -167,7 +167,7 @@ |
168 | 168 | $options = array(); |
169 | 169 | |
170 | 170 | foreach ( $orgs as /* EPOrg */ $org ) { |
171 | | - $options[$org->getField( 'name' )] = $org->getId(); |
| 171 | + $options[$org->getField( 'name' )] = (string)$org->getId(); |
172 | 172 | } |
173 | 173 | |
174 | 174 | return $options; |
Index: trunk/extensions/EducationProgram/includes/EPCourse.php |
— | — | @@ -190,7 +190,7 @@ |
191 | 191 | $options = array(); |
192 | 192 | |
193 | 193 | foreach ( $courses as /* EPCourse */ $course ) { |
194 | | - $options[$course->getField( 'name' )] = $course->getId(); |
| 194 | + $options[$course->getField( 'name' )] = (string)$course->getId(); |
195 | 195 | } |
196 | 196 | |
197 | 197 | return $options; |
— | — | @@ -275,11 +275,11 @@ |
276 | 276 | $out->addHTML( Html::element( 'label', array( 'for' => 'neworg' ), wfMsg( 'ep-courses-neworg' ) ) ); |
277 | 277 | |
278 | 278 | $out->addHTML( ' ' ); |
279 | | - |
| 279 | + |
280 | 280 | $select = new XmlSelect( |
281 | 281 | 'neworg', |
282 | 282 | 'neworg', |
283 | | - array_key_exists( 'org', $args ) ? $args['org'] : false |
| 283 | + array_key_exists( 'org', $args ) ? (string)$args['org'] : false |
284 | 284 | ); |
285 | 285 | |
286 | 286 | $select->addOptions( EPOrg::getOrgOptions( EPOrg::getEditableOrgs( $context->getUser() ) ) ); |
Index: trunk/extensions/EducationProgram/EducationProgram.i18n.php |
— | — | @@ -225,6 +225,7 @@ |
226 | 226 | 'specialinstitution-summary-city' => 'City', |
227 | 227 | 'specialinstitution-summary-country' => 'Country', |
228 | 228 | 'ep-institution-nav-edit' => 'Edit this institution', |
| 229 | + 'ep-institution-add-course' => 'Add a course', |
229 | 230 | |
230 | 231 | // Special:Course |
231 | 232 | 'ep-course-title' => 'Course: $1', |
— | — | @@ -235,6 +236,7 @@ |
236 | 237 | 'specialcourse-summary-org' => 'Institution', |
237 | 238 | 'ep-course-description' => 'Description', |
238 | 239 | 'ep-course-nav-edit' => 'Edit this course', |
| 240 | + 'ep-course-add-term' => 'Add a term', |
239 | 241 | |
240 | 242 | // Special:Term |
241 | 243 | 'ep-term-title' => 'Term: $1', |