Index: trunk/extensions/EducationProgram/EducationProgram.php |
— | — | @@ -466,6 +466,7 @@ |
467 | 467 | 'dependencies' => array( |
468 | 468 | 'jquery.ui.button', |
469 | 469 | 'jquery.ui.dialog', |
| 470 | + 'jquery.ui.autocomplete', |
470 | 471 | ), |
471 | 472 | 'messages' => array( |
472 | 473 | 'ep-articletable-addreviwer-title', |
Index: trunk/extensions/EducationProgram/actions/EPDeleteAction.php |
— | — | @@ -59,14 +59,17 @@ |
60 | 60 | |
61 | 61 | if ( $success ) { |
62 | 62 | $title = SpecialPage::getTitleFor( $this->page->getListPage() ); |
63 | | - $query = array( 'deleted' => $this->getTitle()->getText() ); // TODO: handle |
| 63 | + $this->getRequest()->setSessionData( |
| 64 | + 'epdeleted', |
| 65 | + $this->msg( $this->prefixMsg( 'deleted' ) ) |
| 66 | + ); |
64 | 67 | } |
65 | 68 | else { |
66 | 69 | $title = $this->getTitle(); |
67 | | - $query = array( 'delfailed' => '1' ); // TODO: handle |
| 70 | + $this->getRequest()->setSessionData( 'epdelfailed', true ); |
68 | 71 | } |
69 | 72 | |
70 | | - $this->getOutput()->redirect( $title->getLocalURL( $query ) ); |
| 73 | + $this->getOutput()->redirect( $title->getLocalURL() ); |
71 | 74 | } |
72 | 75 | else { |
73 | 76 | $this->displayForm( $object ); |
Index: trunk/extensions/EducationProgram/specials/SpecialEPPage.php |
— | — | @@ -66,6 +66,11 @@ |
67 | 67 | return false; |
68 | 68 | } |
69 | 69 | |
| 70 | + if ( $this->getRequest()->getSessionData( 'epdeleted' ) ) { |
| 71 | + $this->showSuccess( $this->getRequest()->getSessionData( 'epdeleted' ) ); |
| 72 | + $this->getRequest()->setSessionData( 'epdeleted', false ); |
| 73 | + } |
| 74 | + |
70 | 75 | return true; |
71 | 76 | } |
72 | 77 | |
Index: trunk/extensions/EducationProgram/includes/EPArticleTable.php |
— | — | @@ -121,7 +121,7 @@ |
122 | 122 | $user = $this->getUser(); |
123 | 123 | |
124 | 124 | $rowCount = array_reduce( $articles, function( /* integer */ $sum, EPArticle $article ) use ( $user ) { |
125 | | - return $sum += max( count( $article->getField( 'reviewers' ) ), 1 ); |
| 125 | + return $sum + max( count( $article->getField( 'reviewers' ) ), 1 ); |
126 | 126 | }, 0 ); |
127 | 127 | |
128 | 128 | $html = Html::openElement( 'tr', $this->getRowAttrs( $row ) ); |
Index: trunk/extensions/EducationProgram/resources/ep.articletable.js |
— | — | @@ -257,6 +257,36 @@ |
258 | 258 | $( '.ep-rem-student' ).click( removeStudent ); |
259 | 259 | |
260 | 260 | $( '.ep-rem-article' ).click( removeArticle ); |
| 261 | + |
| 262 | + $( '#addarticlename' ).autocomplete( { // TODO |
| 263 | + source: function( request, response ) { |
| 264 | + $.getJSON( |
| 265 | + wgScriptPath + '/api.php', |
| 266 | + { |
| 267 | + 'action': 'opensearch', |
| 268 | + 'format': 'json', |
| 269 | + 'search': request.term, |
| 270 | + 'limit': 8 |
| 271 | + }, |
| 272 | + function( data ) { |
| 273 | + response( $.map( data[1], function( item ) { |
| 274 | + return { |
| 275 | + 'label': item, |
| 276 | + 'value': item |
| 277 | + }; |
| 278 | + } ) ); |
| 279 | + } |
| 280 | + ); |
| 281 | + }, |
| 282 | + minLength: 2, |
| 283 | + open: function() { |
| 284 | + $( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" ); |
| 285 | + }, |
| 286 | + close: function() { |
| 287 | + $( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" ); |
| 288 | + } |
| 289 | + } ); |
| 290 | + |
261 | 291 | } ); |
262 | 292 | |
263 | 293 | })( window.jQuery, mw.educationProgram ); |
\ No newline at end of file |