Index: trunk/extensions/EducationProgram/EducationProgram.php |
— | — | @@ -230,6 +230,8 @@ |
231 | 231 | $wgAvailableRights[] = 'ep-beinstructor'; // Add or remove yourself as instructor from courses |
232 | 232 | $wgAvailableRights[] = 'ep-bereviewer'; // Add or remove yourself as reviewer from articles |
233 | 233 | $wgAvailableRights[] = 'ep-remreviewer'; // Remove reviewers from articles |
| 234 | +$wgAvailableRights[] = 'ep-bulkdelorgs'; // Bulk delete institutions |
| 235 | +$wgAvailableRights[] = 'ep-bulkdelcourses'; // Bulk delete courses |
234 | 236 | |
235 | 237 | // User group rights |
236 | 238 | $wgGroupPermissions['*']['ep-enroll'] = true; |
— | — | @@ -243,8 +245,10 @@ |
244 | 246 | $wgGroupPermissions['*']['ep-beonline'] = false; |
245 | 247 | $wgGroupPermissions['*']['ep-becampus'] = false; |
246 | 248 | $wgGroupPermissions['*']['ep-beinstructor'] = false; |
247 | | -$wgGroupPermissions['*']['ep-bereviewer'] = true; |
| 249 | +$wgGroupPermissions['*']['ep-bereviewer'] = true; // TODO: do we want this? |
248 | 250 | $wgGroupPermissions['*']['ep-remreviewer'] = false; |
| 251 | +$wgGroupPermissions['*']['ep-bulkdelorgs'] = false; |
| 252 | +$wgGroupPermissions['*']['ep-bulkdelcourses'] = false; |
249 | 253 | |
250 | 254 | $wgGroupPermissions['epstaff']['ep-org'] = true; |
251 | 255 | $wgGroupPermissions['epstaff']['ep-course'] = true; |
— | — | @@ -259,6 +263,8 @@ |
260 | 264 | $wgGroupPermissions['epstaff']['ep-beinstructor'] = true; |
261 | 265 | $wgGroupPermissions['epstaff']['ep-bereviewer'] = true; |
262 | 266 | $wgGroupPermissions['epstaff']['ep-remreviewer'] = true; |
| 267 | +$wgGroupPermissions['epstaff']['ep-bulkdelorgs'] = true; |
| 268 | +$wgGroupPermissions['epstaff']['ep-bulkdelcourses'] = true; |
263 | 269 | |
264 | 270 | $wgGroupPermissions['epadmin']['ep-org'] = true; |
265 | 271 | $wgGroupPermissions['epadmin']['ep-course'] = true; |
— | — | @@ -273,6 +279,7 @@ |
274 | 280 | $wgGroupPermissions['epadmin']['ep-beinstructor'] = true; |
275 | 281 | $wgGroupPermissions['epadmin']['ep-bereviewer'] = true; |
276 | 282 | $wgGroupPermissions['epadmin']['ep-remreviewer'] = true; |
| 283 | +$wgGroupPermissions['epadmin']['ep-bulkdelcourses'] = true; |
277 | 284 | |
278 | 285 | $wgGroupPermissions['eponlineamb']['ep-org'] = true; |
279 | 286 | $wgGroupPermissions['eponlineamb']['ep-course'] = true; |
— | — | @@ -595,5 +602,7 @@ |
596 | 603 | |
597 | 604 | $egEPSettings = array(); |
598 | 605 | |
599 | | -# The default value for the user preferences. |
| 606 | +// The default value for the user preferences. |
600 | 607 | $wgDefaultUserOptions['ep_showtoplink'] = false; |
| 608 | +$wgDefaultUserOptions['ep_bulkdelorgs'] = false; |
| 609 | +$wgDefaultUserOptions['ep_bulkdelcourses'] = true; |
Index: trunk/extensions/EducationProgram/includes/EPOrgPager.php |
— | — | @@ -166,7 +166,10 @@ |
167 | 167 | protected function getMultipleItemActions() { |
168 | 168 | $actions = parent::getMultipleItemActions(); |
169 | 169 | |
170 | | - if ( $this->getUser()->isAllowed( 'ep-org' ) ) { |
| 170 | + if ( $this->getUser()->isAllowed( 'ep-org' ) |
| 171 | + && $this->getUser()->isAllowed( 'ep-bulkdelorgs' ) |
| 172 | + && $this->getUser()->getOption( 'ep_bulkdelorgs' ) ) { |
| 173 | + |
171 | 174 | $actions[wfMsg( 'ep-pager-delete-selected' )] = array( |
172 | 175 | 'class' => 'ep-pager-delete-selected', |
173 | 176 | 'data-type' => ApiDeleteEducation::getTypeForClassName( get_class( $this->table ) ) |
Index: trunk/extensions/EducationProgram/includes/EPCoursePager.php |
— | — | @@ -217,7 +217,11 @@ |
218 | 218 | protected function getMultipleItemActions() { |
219 | 219 | $actions = parent::getMultipleItemActions(); |
220 | 220 | |
221 | | - if ( !$this->readOnlyMode && $this->getUser()->isAllowed( 'ep-course' ) ) { |
| 221 | + if ( !$this->readOnlyMode |
| 222 | + && $this->getUser()->isAllowed( 'ep-course' ) |
| 223 | + && $this->getUser()->isAllowed( 'ep-bulkdelcourses' ) |
| 224 | + && $this->getUser()->getOption( 'ep_bulkdelcourses' ) ) { |
| 225 | + |
222 | 226 | $actions[wfMsg( 'ep-pager-delete-selected' )] = array( |
223 | 227 | 'class' => 'ep-pager-delete-selected', |
224 | 228 | 'data-type' => ApiDeleteEducation::getTypeForClassName( get_class( $this->table ) ) |
Index: trunk/extensions/EducationProgram/EducationProgram.i18n.php |
— | — | @@ -115,6 +115,8 @@ |
116 | 116 | // Preferences |
117 | 117 | 'prefs-education' => 'Education', |
118 | 118 | 'ep-prefs-showtoplink' => 'Show a link to [[Special:MyCourses|your courses]] at the top of every page.', |
| 119 | + 'ep-prefs-bulkdelorgs' => 'Show a bulk deletion control for the [[Special:Institutions|institutions]].', |
| 120 | + 'ep-prefs-bulkdelcourses' => 'Show a bulk deletion control for the [[Special:Courses|courses]].', |
119 | 121 | |
120 | 122 | // Rights |
121 | 123 | 'right-ep-org' => 'Manage Education Program institutions', |
— | — | @@ -125,6 +127,13 @@ |
126 | 128 | 'right-ep-online' => 'Add or remove online ambassadors to courses', |
127 | 129 | 'right-ep-campus' => 'Add or remove campus ambassadors to courses', |
128 | 130 | 'right-ep-instructor' => 'Add or remove instructors to courses', |
| 131 | + 'right-ep-beonline' => 'Add or remove yourself as online ambassador from terms', |
| 132 | + 'right-ep-becampus' => 'Add or remove yourself as campus ambassador from terms', |
| 133 | + 'right-ep-beinstructor' => ' Add or remove yourself as instructor from courses', |
| 134 | + 'right-ep-bereviewer' => 'Add or remove yourself as reviewer from articles', |
| 135 | + 'right-ep-remreviewer' => 'Remove reviewers from articles', |
| 136 | + 'right-ep-bulkdelorgs' => 'Bulk delete institutions', |
| 137 | + 'right-ep-bulkdelcourses' => 'Bulk delete courses', |
129 | 138 | |
130 | 139 | // Actions |
131 | 140 | 'action-ep-org' => 'manage institutions', |
— | — | @@ -135,6 +144,13 @@ |
136 | 145 | 'action-ep-online' => 'add or remove online ambassadors to courses', |
137 | 146 | 'action-ep-campus' => 'add or remove campus ambassadors to courses', |
138 | 147 | 'action-ep-instructor' => 'add or remove instructors to courses', |
| 148 | + 'action-ep-beonline' => 'add or remove yourself as online ambassador from terms', |
| 149 | + 'action-ep-becampus' => 'add or remove yourself as campus ambassador from terms', |
| 150 | + 'action-ep-beinstructor' => ' add or remove yourself as instructor from courses', |
| 151 | + 'action-ep-bereviewer' => 'add or remove yourself as reviewer from articles', |
| 152 | + 'action-ep-remreviewer' => 'remove reviewers from articles', |
| 153 | + 'action-ep-bulkdelorgs' => 'bulk delete institutions', |
| 154 | + 'action-ep-bulkdelcourses' => 'bulk delete courses', |
139 | 155 | |
140 | 156 | // Groups |
141 | 157 | 'group-epadmin' => 'Education program admins', |
Index: trunk/extensions/EducationProgram/EducationProgram.hooks.php |
— | — | @@ -118,6 +118,22 @@ |
119 | 119 | 'section' => 'education', |
120 | 120 | ); |
121 | 121 | } |
| 122 | + |
| 123 | + if ( $user->isAllowed( 'ep-bulkdelorgs' ) ) { |
| 124 | + $preferences['ep_bulkdelorgs'] = array( |
| 125 | + 'type' => 'toggle', |
| 126 | + 'label-message' => 'ep-prefs-bulkdelorgs', |
| 127 | + 'section' => 'education', |
| 128 | + ); |
| 129 | + } |
| 130 | + |
| 131 | + if ( $user->isAllowed( 'ep-bulkdelcourses' ) ) { |
| 132 | + $preferences['ep_bulkdelcourses'] = array( |
| 133 | + 'type' => 'toggle', |
| 134 | + 'label-message' => 'ep-prefs-bulkdelcourses', |
| 135 | + 'section' => 'education', |
| 136 | + ); |
| 137 | + } |
122 | 138 | |
123 | 139 | return true; |
124 | 140 | } |