Index: trunk/extensions/EducationProgram/specials/SpecialEnroll.php |
— | — | @@ -247,8 +247,12 @@ |
248 | 248 | |
249 | 249 | $success = $student->save(); |
250 | 250 | |
251 | | - $success = $success && $student->associateWithCourses( array( $course ) ); |
| 251 | + $revAction = new EPRevisionAction(); |
| 252 | + $revAction->setUser( $this->getUser() ); |
| 253 | + $revAction->setComment( '' ); // TODO? |
252 | 254 | |
| 255 | + $success = $success && $student->associateWithCourses( array( $course ), $revAction ); |
| 256 | + |
253 | 257 | return $success; |
254 | 258 | } |
255 | 259 | |
Index: trunk/extensions/EducationProgram/includes/EPRoleObject.php |
— | — | @@ -140,10 +140,11 @@ |
141 | 141 | * @since 0.1 |
142 | 142 | * |
143 | 143 | * @param array $courses |
| 144 | + * @param EPRevisionAction|null $revAction |
144 | 145 | * |
145 | 146 | * @return bool Success indicator |
146 | 147 | */ |
147 | | - public function associateWithCourses( array /* of EPCourse */ $courses ) { |
| 148 | + public function associateWithCourses( array /* of EPCourse */ $courses, EPRevisionAction $revAction = null ) { |
148 | 149 | $success = true; |
149 | 150 | |
150 | 151 | $courseIds = array(); |
— | — | @@ -151,7 +152,14 @@ |
152 | 153 | foreach ( $courses as /* EPCourse */ $course ) { |
153 | 154 | $courseIds[] = $course->getId(); |
154 | 155 | $course->setUpdateSummaries( false ); |
155 | | - $success = $course->enlistUsers( $this->getField( 'user_id' ), $this->getRoleName() ) !== false && $success; |
| 156 | + |
| 157 | + $success = $course->enlistUsers( |
| 158 | + $this->getField( 'user_id' ), |
| 159 | + $this->getRoleName(), |
| 160 | + true, |
| 161 | + $revAction |
| 162 | + ) !== false && $success; |
| 163 | + |
156 | 164 | $course->setUpdateSummaries( true ); |
157 | 165 | } |
158 | 166 | |