Index: trunk/extensions/RecordAdmin/RecordAdmin_body.php |
— | — | @@ -120,8 +120,14 @@ |
121 | 121 | $text = $text ? "{{" . "$type\n$text}}" : "{{" . "$type}}"; |
122 | 122 | $success = $article->doEdit( $text, $summary, EDIT_NEW ); |
123 | 123 | |
124 | | - # Report success or error |
125 | | - if ( $success ) $wgOut->addHTML( "<div class='successbox'>" . wfMsg( 'recordadmin-createsuccess', $wpTitle ) . "</div>\n" ); |
| 124 | + # Redirect to view the record if successfully updated |
| 125 | + if ( $success ) { |
| 126 | + $wgOut->disable(); |
| 127 | + wfResetOutputBuffers(); |
| 128 | + header( "Location: " . $t->getFullUrl() ); |
| 129 | + } |
| 130 | + |
| 131 | + # Or stay in edit view and report error |
126 | 132 | else $wgOut->addHTML( "<div class='errorbox'>" . wfMsg( 'recordadmin-createerror', $type ) . "</div>\n" ); |
127 | 133 | } |
128 | 134 | } else $wgOut->addHTML( "<div class='errorbox'>" . wfMsg( 'recordadmin-badtitle' ) . "</div>\n" ); |
— | — | @@ -182,8 +188,14 @@ |
183 | 189 | $success = $article->doEdit( $text, $summary, EDIT_UPDATE|$minor ); |
184 | 190 | if ($watch) $article->doWatch(); |
185 | 191 | |
186 | | - # Report success or error |
187 | | - if ( $success ) $wgOut->addHTML( "<div class='successbox'>" . wfMsg( 'recordadmin-updatesuccess', $type ) . "</div>\n" ); |
| 192 | + # Redirect to view the record if successfully updated |
| 193 | + if ( $success ) { |
| 194 | + $wgOut->disable(); |
| 195 | + wfResetOutputBuffers(); |
| 196 | + header( "Location: " . $rtitle->getFullUrl() ); |
| 197 | + } |
| 198 | + |
| 199 | + # Stay at edit form and render error if not edited successfully |
188 | 200 | else $wgOut->addHTML( "<div class='errorbox'>" . wfMsg( 'recordadmin-updateerror' ) . "</div>\n" ); |
189 | 201 | $wgOut->addHTML( "<br /><br /><br /><br />\n" ); |
190 | 202 | } |
Index: trunk/extensions/RecordAdmin/RecordAdmin.php |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | * @licence GNU General Public Licence 2.0 or later |
13 | 13 | */ |
14 | 14 | |
15 | | -define( 'RECORDADMIN_VERSION', '0.6.3, 2009-04-01' ); |
| 15 | +define( 'RECORDADMIN_VERSION', '0.6.4, 2009-05-18' ); |
16 | 16 | |
17 | 17 | $wgRecordAdminUseNamespaces = false; # Whether record articles should be in a namespace of the same name as their type |
18 | 18 | $wgRecordAdminCategory = 'Records'; # Category containing record types |