Index: trunk/extensions/EducationProgram/EducationProgram.php |
— | — | @@ -503,7 +503,7 @@ |
504 | 504 | 'ep-articletable-remarticle-button', |
505 | 505 | 'ep-articletable-remarticle-cancel', |
506 | 506 | 'ep-articletable-remarticle-text', |
507 | | - 'ep-articletable-remarticle-text-course', |
| 507 | + 'ep-articletable-remarticle-text-self', |
508 | 508 | ), |
509 | 509 | ); |
510 | 510 | |
Index: trunk/extensions/EducationProgram/includes/EPArticleTable.php |
— | — | @@ -302,6 +302,12 @@ |
303 | 303 | 'class' => 'ep-rem-article', |
304 | 304 | ); |
305 | 305 | |
| 306 | + $user = $this->getUser(); |
| 307 | + |
| 308 | + if ( $user->getId() !== $article->getField( 'user_id' ) ) { |
| 309 | + $attr['data-student-name'] = $user->getName(); |
| 310 | + } |
| 311 | + |
306 | 312 | if ( array_key_exists( 'course_id', $this->articleConds ) && is_integer( $this->articleConds['course_id'] ) ) { |
307 | 313 | $attr['data-course-name'] = $this->getCourseName(); |
308 | 314 | |
— | — | @@ -310,7 +316,7 @@ |
311 | 317 | 'returnto' => $this->getTitle()->getFullText(), |
312 | 318 | ) ); |
313 | 319 | |
314 | | - if ( $article->userCanRemove( $this->getUser() ) ) { |
| 320 | + if ( $article->userCanRemove( $user ) ) { |
315 | 321 | $html .= ' (' . Html::element( |
316 | 322 | 'a', |
317 | 323 | $attr, |
Index: trunk/extensions/EducationProgram/EducationProgram.i18n.php |
— | — | @@ -342,8 +342,8 @@ |
343 | 343 | 'ep-articletable-remarticle-title' => 'Remove article $1', |
344 | 344 | 'ep-articletable-remarticle-button' => 'Remove article', |
345 | 345 | 'ep-articletable-remarticle-cancel' => 'Cancel', |
346 | | - 'ep-articletable-remarticle-text' => 'You are about to remove article $1 from the list of articles you are working on.', |
347 | | - 'ep-articletable-remarticle-text-course' => 'You are about to remove article $1 from the list of articles you are working on as part of course $2.', |
| 346 | + 'ep-articletable-remarticle-text-self' => 'You are about to remove article $1 from the list of articles you are working on as part of course $2.', |
| 347 | + 'ep-articletable-remarticle-text' => 'You are about to remove article $1 from the list of articles $3 is working on as part of course $2.', |
348 | 348 | |
349 | 349 | // Article pager |
350 | 350 | 'ep-articles-noresults' => 'There are no articles to list.', |
Index: trunk/extensions/EducationProgram/resources/ep.articletable.js |
— | — | @@ -126,15 +126,19 @@ |
127 | 127 | |
128 | 128 | function removeArticle() { |
129 | 129 | var $this = $( this ), |
130 | | - courseName = $this.attr( 'data-course-name' ); |
| 130 | + courseName = $this.attr( 'data-course-name' ), |
| 131 | + isSelf = $this.attr( 'data-student-name' ) === undefined, |
| 132 | + selfSuffix = isSelf ? '-self' : '', |
| 133 | + studentName = isSelf ? mw.user.name : $this.attr( 'data-student-name' ); |
131 | 134 | |
132 | 135 | var $form = $( '<form>' ).attr( { |
133 | 136 | 'method': 'post', |
134 | 137 | 'action': $this.attr( 'data-remove-target' ) |
135 | 138 | } ).msg( |
136 | | - 'ep-articletable-remarticle-text-course', |
| 139 | + 'ep-articletable-remarticle-text' + selfSuffix, |
137 | 140 | $( '<b>' ).text( $this.attr( 'data-article-name' ) ), |
138 | | - $( '<b>' ).text( courseName ) |
| 141 | + $( '<b>' ).text( courseName ), |
| 142 | + $( '<b>' ).text( studentName ) |
139 | 143 | ); |
140 | 144 | |
141 | 145 | $form.append( $( '<input>' ).attr( { |