r108646 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108645‎ | r108646 | r108647 >
Date:18:40, 11 January 2012
Author:jeroendedauw
Status:deferred
Tags:
Comment:
add term/course control added to special course/institution
Modified paths:
  • /trunk/extensions/EducationProgram/EducationProgram.i18n.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPCourse.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPOrg.php (modified) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialCourse.php (modified) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialInstitution.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/specials/SpecialInstitution.php
@@ -68,6 +68,12 @@
6969 $out->addHTML( Html::element( 'h2', array(), wfMsg( 'ep-institution-courses' ) ) );
7070
7171 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+ }
7278 }
7379 }
7480 }
Index: trunk/extensions/EducationProgram/specials/SpecialCourse.php
@@ -72,6 +72,12 @@
7373 $out->addHTML( Html::element( 'h2', array(), wfMsg( 'ep-course-terms' ) ) );
7474
7575 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+ }
7682 }
7783 }
7884 }
Index: trunk/extensions/EducationProgram/includes/EPOrg.php
@@ -167,7 +167,7 @@
168168 $options = array();
169169
170170 foreach ( $orgs as /* EPOrg */ $org ) {
171 - $options[$org->getField( 'name' )] = $org->getId();
 171+ $options[$org->getField( 'name' )] = (string)$org->getId();
172172 }
173173
174174 return $options;
Index: trunk/extensions/EducationProgram/includes/EPCourse.php
@@ -190,7 +190,7 @@
191191 $options = array();
192192
193193 foreach ( $courses as /* EPCourse */ $course ) {
194 - $options[$course->getField( 'name' )] = $course->getId();
 194+ $options[$course->getField( 'name' )] = (string)$course->getId();
195195 }
196196
197197 return $options;
@@ -275,11 +275,11 @@
276276 $out->addHTML( Html::element( 'label', array( 'for' => 'neworg' ), wfMsg( 'ep-courses-neworg' ) ) );
277277
278278 $out->addHTML( ' ' );
279 -
 279+
280280 $select = new XmlSelect(
281281 'neworg',
282282 'neworg',
283 - array_key_exists( 'org', $args ) ? $args['org'] : false
 283+ array_key_exists( 'org', $args ) ? (string)$args['org'] : false
284284 );
285285
286286 $select->addOptions( EPOrg::getOrgOptions( EPOrg::getEditableOrgs( $context->getUser() ) ) );
Index: trunk/extensions/EducationProgram/EducationProgram.i18n.php
@@ -225,6 +225,7 @@
226226 'specialinstitution-summary-city' => 'City',
227227 'specialinstitution-summary-country' => 'Country',
228228 'ep-institution-nav-edit' => 'Edit this institution',
 229+ 'ep-institution-add-course' => 'Add a course',
229230
230231 // Special:Course
231232 'ep-course-title' => 'Course: $1',
@@ -235,6 +236,7 @@
236237 'specialcourse-summary-org' => 'Institution',
237238 'ep-course-description' => 'Description',
238239 'ep-course-nav-edit' => 'Edit this course',
 240+ 'ep-course-add-term' => 'Add a term',
239241
240242 // Special:Term
241243 'ep-term-title' => 'Term: $1',

Follow-up revisions

RevisionCommit summaryAuthorDate
r108659Follow up to r108646; fixed call to method of wrong class and incorrect castingjeroendedauw19:32, 11 January 2012

Status & tagging log