Index: trunk/extensions/EducationProgram/includes/EPTermPager.php |
— | — | @@ -32,7 +32,11 @@ |
33 | 33 | */ |
34 | 34 | public function getFieldNames() { |
35 | 35 | return parent::getFieldNameList( array( |
36 | | - // TODO |
| 36 | + 'id', |
| 37 | + 'course_id', |
| 38 | + 'year', |
| 39 | + 'start', |
| 40 | + 'end', |
37 | 41 | ) ); |
38 | 42 | } |
39 | 43 | |
— | — | @@ -41,7 +45,7 @@ |
42 | 46 | * @see TablePager::getRowClass() |
43 | 47 | */ |
44 | 48 | function getRowClass( $row ) { |
45 | | - return 'ep-course-row'; |
| 49 | + return 'ep-term-row'; |
46 | 50 | } |
47 | 51 | |
48 | 52 | /** |
— | — | @@ -49,7 +53,7 @@ |
50 | 54 | * @see TablePager::getTableClass() |
51 | 55 | */ |
52 | 56 | public function getTableClass(){ |
53 | | - return 'TablePager ep-courses'; |
| 57 | + return 'TablePager ep-terms'; |
54 | 58 | } |
55 | 59 | |
56 | 60 | /** |
— | — | @@ -58,16 +62,32 @@ |
59 | 63 | */ |
60 | 64 | public function getFormattedValue( $name, $value ) { |
61 | 65 | switch ( $name ) { |
62 | | - case '': // TODO |
63 | | - $value = $value; |
| 66 | + case 'id': |
| 67 | + $value = Linker::linkKnown( |
| 68 | + SpecialPage::getTitleFor( 'Term', $value ), |
| 69 | + $value |
| 70 | + ); |
64 | 71 | break; |
| 72 | + case 'course_id': |
| 73 | + $value = EPCourse::selectRow( 'name', array( 'id' => $value ) )->getField( 'name' ); |
| 74 | + |
| 75 | + $value = Linker::linkKnown( |
| 76 | + SpecialPage::getTitleFor( 'Course', $value ), |
| 77 | + $value |
| 78 | + ); |
| 79 | + break; |
| 80 | + case 'year': |
| 81 | + break; |
| 82 | + case 'start': case 'end': |
| 83 | + $value = $this->getLanguage()->date( $value ); |
| 84 | + break; |
65 | 85 | } |
66 | 86 | |
67 | 87 | return $value; |
68 | 88 | } |
69 | 89 | |
70 | 90 | function getDefaultSort() { |
71 | | - return ''; // TODO |
| 91 | + return 'asc'; |
72 | 92 | } |
73 | 93 | |
74 | 94 | /** |
— | — | @@ -75,7 +95,39 @@ |
76 | 96 | * @see EPPager::getSortableFields() |
77 | 97 | */ |
78 | 98 | protected function getSortableFields() { |
79 | | - return array(); |
| 99 | + return array( |
| 100 | + 'id', |
| 101 | + 'year', |
| 102 | + 'start', |
| 103 | + 'end', |
| 104 | + ); |
80 | 105 | } |
| 106 | + |
| 107 | + /** |
| 108 | + * (non-PHPdoc) |
| 109 | + * @see EPPager::getFilterOptions() |
| 110 | + */ |
| 111 | + protected function getFilterOptions() { |
| 112 | + return array( |
| 113 | + 'course_id' => array( |
| 114 | + 'type' => 'select', |
| 115 | + 'options' => array_merge( |
| 116 | + array( '' => '' ), |
| 117 | + EPCourse::getCourseOptions( EPCourse::select( array( 'name', 'id' ) ) ) |
| 118 | + ), |
| 119 | + 'value' => '', |
| 120 | + 'datatype' => 'int', |
| 121 | + ), |
| 122 | + 'year' => array( |
| 123 | + 'type' => 'select', |
| 124 | + 'options' => array_merge( |
| 125 | + array( '' => '' ), |
| 126 | + array() // TODO |
| 127 | + ), |
| 128 | + 'value' => '', |
| 129 | + 'datatype' => 'int', |
| 130 | + ), |
| 131 | + ); |
| 132 | + } |
81 | 133 | |
82 | 134 | } |
Index: trunk/extensions/EducationProgram/EducationProgram.i18n.php |
— | — | @@ -104,6 +104,15 @@ |
105 | 105 | 'epcoursepager-header-org-id' => 'Institution', |
106 | 106 | 'epcoursepager-filter-org-id' => 'Institution', |
107 | 107 | |
| 108 | + // Term pager |
| 109 | + 'eptermpager-header-id' => 'Id', |
| 110 | + 'eptermpager-header-course-id' => 'Course', |
| 111 | + 'eptermpager-header-year' => 'Year', |
| 112 | + 'eptermpager-header-start' => 'Start', |
| 113 | + 'eptermpager-header-end' => 'End', |
| 114 | + 'eptermpager-filter-course-id' => 'Course', |
| 115 | + 'eptermpager-filter-year' => 'Year', |
| 116 | + |
108 | 117 | // Special:EditInstitution |
109 | 118 | 'editinstitution-text' => 'Enter the institution details below and click submit to save your changes.', |
110 | 119 | 'educationprogram-org-edit-name' => 'Institution name', |