Index: trunk/extensions/EducationProgram/specials/SpecialEnroll.php |
— | — | @@ -55,14 +55,14 @@ |
56 | 56 | $tokenIsValid = $term->getField( 'token' ) === ''; |
57 | 57 | |
58 | 58 | if ( !$tokenIsValid ) { |
59 | | - $tokenIsValid = $term->getField( 'token' ) === $token; |
60 | | - |
61 | 59 | if ( count( $args ) === 2 ) { |
62 | 60 | $token = $args[1]; |
63 | 61 | } |
64 | 62 | elseif ( $this->getRequest()->wasPosted() && $this->getRequest()->getCheck( 'wptoken' ) ) { |
65 | 63 | $token = $this->getRequest()->getText( 'wptoken' ); |
66 | 64 | } |
| 65 | + |
| 66 | + $tokenIsValid = $term->getField( 'token' ) === $token; |
67 | 67 | } |
68 | 68 | |
69 | 69 | if ( $tokenIsValid ) { |
Index: trunk/extensions/EducationProgram/specials/SpecialCourse.php |
— | — | @@ -146,11 +146,11 @@ |
147 | 147 | $instList[] = $instructor->getUserLink() . $instructor->getToolLinks( $this->getContext(), $course ); |
148 | 148 | } |
149 | 149 | |
150 | | - if ( count( $instructors ) == 1 ) { |
| 150 | + if ( false ) { // count( $instructors ) == 1 |
151 | 151 | return $instList[0]; |
152 | 152 | } |
153 | 153 | else { |
154 | | - return '<ul><li>' . implode( '</li><li>', $instList ) . '</li></ul>'; |
| 154 | + return '<ul id="ep-course-instructors"><li>' . implode( '</li><li>', $instList ) . '</li></ul>'; |
155 | 155 | } |
156 | 156 | } |
157 | 157 | else { |
Index: trunk/extensions/EducationProgram/specials/SpecialTerm.php |
— | — | @@ -75,7 +75,7 @@ |
76 | 76 | }, |
77 | 77 | $term->getStudents( 'id' ) |
78 | 78 | ); |
79 | | - |
| 79 | + |
80 | 80 | if ( count( $studentIds ) > 0 ) { |
81 | 81 | $out->addHTML( Html::element( 'h2', array(), wfMsg( 'ep-term-students' ) ) ); |
82 | 82 | EPStudent::displayPager( $this->getContext(), array( 'id' => $studentIds ) ); |
Index: trunk/extensions/EducationProgram/includes/EPTerm.php |
— | — | @@ -134,7 +134,7 @@ |
135 | 135 | $conditions, |
136 | 136 | array(), |
137 | 137 | array( |
138 | | - 'ep_students_per_term' => array( 'INNER JOIN', array( array( array( 'ep_students_per_term', 'term_id' ), array( 'ep_terms', 'id' ) ) ) ), |
| 138 | + 'ep_students_per_term' => array( 'INNER JOIN', array( array( array( 'ep_students_per_term', 'student_id' ), array( 'ep_students', 'id' ) ) ) ), |
139 | 139 | 'ep_terms' => array( 'INNER JOIN', array( array( array( 'ep_students_per_term', 'term_id' ), array( 'ep_terms', 'id' ) ) ) ) |
140 | 140 | ) |
141 | 141 | ); |
Index: trunk/extensions/EducationProgram/includes/EPDBObject.php |
— | — | @@ -939,7 +939,7 @@ |
940 | 940 | $cond[1][] = implode( '=', $parts ); |
941 | 941 | } |
942 | 942 | |
943 | | - $conds[] = $cond; |
| 943 | + $conds[$table] = $cond; |
944 | 944 | } |
945 | 945 | |
946 | 946 | return $conds; |
Index: trunk/extensions/EducationProgram/resources/ep.instructor.js |
— | — | @@ -37,9 +37,7 @@ |
38 | 38 | $remove.remove(); |
39 | 39 | $cancel.button( 'option', 'label', ep.msg( 'ep-instructor-close-button' ) ); |
40 | 40 | $cancel.focus(); |
41 | | - |
42 | | - // TODO: update UI to reflect the addition |
43 | | - location.reload(); |
| 41 | + $this.closest( 'li' ).remove(); |
44 | 42 | } ).fail( function() { |
45 | 43 | $remove.button( 'option', 'disabled', false ); |
46 | 44 | $remove.button( 'option', 'label', ep.msg( 'ep-instructor-remove-retry' ) ); |
— | — | @@ -134,14 +132,15 @@ |
135 | 133 | _this.getName(), |
136 | 134 | _this.courseName |
137 | 135 | ) ); |
| 136 | + |
138 | 137 | $add.remove(); |
139 | 138 | $cancel.button( 'option', 'label', ep.msg( 'ep-instructor-add-close-button' ) ); |
140 | 139 | $cancel.focus(); |
141 | 140 | |
142 | | - // TODO: update UI to reflect the addition |
143 | | - location.reload(); |
| 141 | + // TODO: link name to user page and show control links |
| 142 | + $( '#ep-course-instructors' ).append( $( '<li>' ).text( _this.getName() ) ) |
144 | 143 | } ).fail( function() { |
145 | | - // TODO: implement handling for fails caused by invalid user name |
| 144 | + // TODO: implement nicer handling for fails caused by invalid user name |
146 | 145 | |
147 | 146 | $add.button( 'option', 'disabled', false ); |
148 | 147 | $add.button( 'option', 'label', ep.msg( 'ep-instructor-add-retry' ) ); |