Changeset 1127 for trunk/WorkflowPlugin/lib/TWiki/Plugins/WorkflowPlugin.pm
- Timestamp:
- 12/02/08 12:49:15 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WorkflowPlugin/lib/TWiki/Plugins/WorkflowPlugin.pm
r1090 r1127 241 241 if ( !$query->param('INWORKFLOWSEQUENCE') && !$TOPIC->canEdit() ) { 242 242 throw TWiki::OopsException( 243 'accessdenied', 243 'accessdenied', status => 403, 244 244 def => 'topic_access', 245 245 web => $_[2], … … 285 285 286 286 try { 287 $query->param('INWORKFLOWSEQUENCE' => 1); 288 $TOPIC->changeState($action); 289 if ($newForm) { 290 291 # If there is a form with the new state, and it's not the same 292 # form as previously, we need to kick into edit mode to support 293 # form field changes. 294 $url = TWiki::Func::getScriptUrl( 295 $web, $topic, 'edit', 296 INWORKFLOWSEQUENCE => time()); 287 try { 288 $query->param('INWORKFLOWSEQUENCE' => 1); 289 if ($newForm) { 290 # If there is a form with the new state, and it's not 291 # the same form as previously, we need to kick into edit 292 # mode to support form field changes. 293 $url = TWiki::Func::getScriptUrl( 294 $web, $topic, 'edit', 295 INWORKFLOWSEQUENCE => time()); 296 } 297 else { 298 $url = TWiki::Func::getScriptUrl( $web, $topic, 'view' ); 299 } 300 # SMELL: don't do this until the edit is over 301 $TOPIC->changeState($action); 302 TWiki::Func::redirectCgiQuery( undef, $url ); 303 } catch Error::Simple with { 304 my $error = shift; 305 throw TWiki::OopsException( 306 'oopssaveerr', 307 web => $web, topic => $topic, 308 params => [ $error || '?' ]); 309 }; 310 } catch TWiki::OopsException with { 311 my $e = shift; 312 if ($e->can('generate')) { 313 $e->generate( $session ); 314 } else { 315 # Deprecated, TWiki compatibility only 316 $e->redirect( $session ); 297 317 } 298 else {299 $url = TWiki::Func::getScriptUrl( $web, $topic, 'view' );300 }301 }302 catch Error::Simple with {303 my $error = shift;304 $url = TWiki::Func::getScriptUrl(305 $web, $topic, 'oops',306 template => "oopssaveerr",307 param1 => $error308 );309 }310 catch TWiki::OopsException with {311 shift->redirect( $session );312 318 313 319 }; 314 320 } 315 TWiki::Func::redirectCgiQuery( undef, $url );316 321 return undef; 317 322 }
Note: See TracChangeset
for help on using the changeset viewer.
