Index: trunk/extensions/EducationProgram/specials/SpecialStudent.php |
— | — | @@ -46,9 +46,20 @@ |
47 | 47 | $out->addWikiMsg( 'ep-student-none', $this->subPage ); |
48 | 48 | } |
49 | 49 | else { |
50 | | - $out->setPageTitle( wfMsgExt( 'ep-student-title', 'parsemag', $student->getUser()->getName() ) ); |
| 50 | + $out->setPageTitle( wfMsgExt( 'ep-student-title', 'parsemag', $student->getName() ) ); |
51 | 51 | |
52 | 52 | $this->displaySummary( $student ); |
| 53 | + |
| 54 | + $out->addHTML( Html::element( 'h2', array(), wfMsg( 'ep-student-terms' ) ) ); |
| 55 | + |
| 56 | + $termIds = array_map( |
| 57 | + function( EPTerm $term ) { |
| 58 | + return $term->getId(); |
| 59 | + }, |
| 60 | + $student->getTerms( 'id' ) |
| 61 | + ); |
| 62 | + |
| 63 | + EPTerm::displayPager( $this->getContext(), array( 'id' => $termIds ) ); |
53 | 64 | } |
54 | 65 | } |
55 | 66 | } |
— | — | @@ -65,6 +76,9 @@ |
66 | 77 | protected function getSummaryData( EPDBObject $student ) { |
67 | 78 | $stats = array(); |
68 | 79 | |
| 80 | + $id = $student->getUser()->getId(); |
| 81 | + $stats['user'] = Linker::userLink( $id, $student->getName() ) . Linker::userToolLinks( $id, $student->getName() ); |
| 82 | + |
69 | 83 | $stats['first-enroll'] = htmlspecialchars( $this->getLanguage()->timeanddate( $student->getField( 'first_enroll' ), true ) ); |
70 | 84 | $stats['last-active'] = htmlspecialchars( $this->getLanguage()->timeanddate( $student->getField( 'last_active' ), true ) ); |
71 | 85 | $stats['active-enroll'] = wfMsgHtml( $student->getField( 'active_enroll' ) ? 'ep-student-actively-enrolled' : 'ep-student-no-active-enroll' ); |
Index: trunk/extensions/EducationProgram/includes/EPStudent.php |
— | — | @@ -268,4 +268,15 @@ |
269 | 269 | return $this->user; |
270 | 270 | } |
271 | 271 | |
| 272 | + /** |
| 273 | + * Returns the display name for the student. |
| 274 | + * |
| 275 | + * @since 0.1 |
| 276 | + * |
| 277 | + * @return String |
| 278 | + */ |
| 279 | + public function getName() { |
| 280 | + return $this->getUser()->getRealName() === '' ? $this->user->getName() : $this->user->getRealName(); |
| 281 | + } |
| 282 | + |
272 | 283 | } |
Index: trunk/extensions/EducationProgram/includes/EPPager.php |
— | — | @@ -185,7 +185,7 @@ |
186 | 186 | } |
187 | 187 | |
188 | 188 | foreach ( $this->getFields() as $field ) { |
189 | | - if ( !array_key_exists( $field, $this->conds ) ) { |
| 189 | + if ( !array_key_exists( $field, $this->conds ) || is_array( $this->conds[$field] ) ) { |
190 | 190 | $fields[$field] = $field; |
191 | 191 | } |
192 | 192 | } |
Index: trunk/extensions/EducationProgram/EducationProgram.i18n.php |
— | — | @@ -276,6 +276,8 @@ |
277 | 277 | 'specialstudent-summary-active-enroll' => 'Enrollment status', |
278 | 278 | 'specialstudent-summary-last-active' => 'Last activity', |
279 | 279 | 'specialstudent-summary-first-enroll' => 'First enrollment', |
| 280 | + 'specialstudent-summary-user' => 'User', |
| 281 | + 'ep-student-terms' => 'Terms this student has enrolled in', |
280 | 282 | |
281 | 283 | // Special:Enroll |
282 | 284 | 'ep-enroll-title' => 'Enroll for $1 at $2', |