Index: trunk/extensions/EducationProgram/EducationProgram.i18n.alias.php |
— | — | @@ -17,8 +17,8 @@ |
18 | 18 | /** English (English) */ |
19 | 19 | $specialPageAliases['en'] = array( |
20 | 20 | 'MyCourses' => array( 'MyCourses' ), |
21 | | - 'Institution' => array( 'Institution' ), |
22 | | - 'Institutions' => array( 'Institutions' ), |
| 21 | + 'Institution' => array( 'Institution', 'Org' ), |
| 22 | + 'Institutions' => array( 'Institutions', 'Orgs' ), |
23 | 23 | 'Student' => array( 'Student' ), |
24 | 24 | 'Students' => array( 'Students' ), |
25 | 25 | 'Course' => array( 'Course' ), |
Index: trunk/extensions/EducationProgram/specials/SpecialEditTerm.php |
— | — | @@ -42,7 +42,6 @@ |
43 | 43 | 'validation-callback' => function ( $value, array $alldata = null ) use ( $courseOptions ) { |
44 | 44 | return in_array( (int)$value, array_values( $courseOptions ) ) ? true : wfMsg( 'ep-term-invalid-course' ); |
45 | 45 | }, |
46 | | - 'default' => array_shift( $courseOptions ) |
47 | 46 | ); |
48 | 47 | |
49 | 48 | $fields['year'] = array ( |
— | — | @@ -71,22 +70,6 @@ |
72 | 71 | |
73 | 72 | /** |
74 | 73 | * (non-PHPdoc) |
75 | | - * @see SpecialEPFormPage::getDefaultFromItem() |
76 | | - */ |
77 | | - protected function getDefaultFromItem( EPDBObject $item, $name ) { |
78 | | - $default = $item->getField( $name ); |
79 | | - |
80 | | - if ( in_array( $name, array( 'start', 'end' ) ) ) { |
81 | | - $default = wfTimestamp( TS_ISO_8601, $default ); |
82 | | - $default = explode( 'T', $default ); |
83 | | - $default = $default[0]; |
84 | | - } |
85 | | - |
86 | | - return $default; |
87 | | - } |
88 | | - |
89 | | - /** |
90 | | - * (non-PHPdoc) |
91 | 74 | * @see SpecialEPFormPage::getTitleConditions() |
92 | 75 | */ |
93 | 76 | protected function getTitleConditions() { |
— | — | @@ -132,6 +115,11 @@ |
133 | 116 | : 20; |
134 | 117 | } |
135 | 118 | |
| 119 | + function getInputHTML( $value ) { |
| 120 | + $value = explode( 'T', wfTimestamp( TS_ISO_8601, $value ) ); |
| 121 | + return parent::getInputHTML( $value[0] ); |
| 122 | + } |
| 123 | + |
136 | 124 | function validate( $value, $alldata ) { |
137 | 125 | $p = parent::validate( $value, $alldata ); |
138 | 126 | |
Index: trunk/extensions/EducationProgram/specials/SpecialEditCourse.php |
— | — | @@ -49,7 +49,6 @@ |
50 | 50 | 'validation-callback' => function ( $value, array $alldata = null ) use ( $orgOptions ) { |
51 | 51 | return in_array( (int)$value, array_values( $orgOptions ) ) ? true : wfMsg( 'ep-course-invalid-org' ); |
52 | 52 | }, |
53 | | - 'default' => array_shift( $orgOptions ) |
54 | 53 | ); |
55 | 54 | |
56 | 55 | $fields['description'] = array ( |
— | — | @@ -59,8 +58,7 @@ |
60 | 59 | 'validation-callback' => function ( $value, array $alldata = null ) { |
61 | 60 | return strlen( $value ) < 10 ? wfMsgExt( 'ep-course-invalid-description', 'parsemag', 10 ) : true; |
62 | 61 | }, |
63 | | - 'default' => '', |
64 | | - 'rows' => 5 |
| 62 | + 'rows' => 10 |
65 | 63 | ); |
66 | 64 | |
67 | 65 | return $this->processFormFields( $fields ); |
Index: trunk/extensions/EducationProgram/includes/EPOrg.php |
— | — | @@ -29,7 +29,11 @@ |
30 | 30 | 'country' => 'str', |
31 | 31 | ); |
32 | 32 | } |
33 | | - |
| 33 | + |
| 34 | + /** |
| 35 | + * (non-PHPdoc) |
| 36 | + * @see EPDBObject::getDefaults() |
| 37 | + */ |
34 | 38 | public static function getDefaults() { |
35 | 39 | return array( |
36 | 40 | 'name' => '', |
Index: trunk/extensions/EducationProgram/includes/EPTerm.php |
— | — | @@ -31,5 +31,17 @@ |
32 | 32 | 'end' => 'str', // TS_MW |
33 | 33 | ); |
34 | 34 | } |
| 35 | + |
| 36 | + /** |
| 37 | + * (non-PHPdoc) |
| 38 | + * @see EPDBObject::getDefaults() |
| 39 | + */ |
| 40 | + public static function getDefaults() { |
| 41 | + return array( |
| 42 | + 'year' => substr( wfTimestamp( TS_MW ), 0, 4 ), |
| 43 | + 'start' => wfTimestamp( TS_MW ), |
| 44 | + 'end' => wfTimestamp( TS_MW ), |
| 45 | + ); |
| 46 | + } |
35 | 47 | |
36 | 48 | } |
Index: trunk/extensions/EducationProgram/includes/EPCoursePager.php |
— | — | @@ -32,8 +32,8 @@ |
33 | 33 | */ |
34 | 34 | public function getFieldNames() { |
35 | 35 | return parent::getFieldNameList( array( |
| 36 | + 'name', |
36 | 37 | 'org_id', |
37 | | - 'name', |
38 | 38 | ) ); |
39 | 39 | } |
40 | 40 | |
Index: trunk/extensions/EducationProgram/includes/EPCourse.php |
— | — | @@ -32,6 +32,16 @@ |
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
| 36 | + * (non-PHPdoc) |
| 37 | + * @see EPDBObject::getDefaults() |
| 38 | + */ |
| 39 | + public static function getDefaults() { |
| 40 | + return array( |
| 41 | + 'description' => '', |
| 42 | + ); |
| 43 | + } |
| 44 | + |
| 45 | + /** |
36 | 46 | * Returns a list of courses in an array that can be fed to select inputs. |
37 | 47 | * |
38 | 48 | * @since 0.1 |