From 1c2bd3c343fcbea925b8dc4148c55730d4525680 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Sat, 30 Oct 2010 21:22:07 +0000 Subject: [PATCH] Irgendwas --- lib/FrBr/Books/Controller/Books.pm | 40 ++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/lib/FrBr/Books/Controller/Books.pm b/lib/FrBr/Books/Controller/Books.pm index 6b8cfeb..93cb7a1 100644 --- a/lib/FrBr/Books/Controller/Books.pm +++ b/lib/FrBr/Books/Controller/Books.pm @@ -493,6 +493,46 @@ sub form_new : Path('new') { return 1; } + # Es wurde auf "Neuer Aufbewahrungsort" geklickt. + if ( $c->request->params->{'neuer_aufbewahrungsort'} ) { + $c->session->{'form'} = {} unless $c->session->{'form'}; + $c->session->{'form'}{'buch'} = {} unless $c->session->{'form'}{'buch'}; + $c->session->{'form'}{'buch'}{'neuer_ort_angefordert'} = 1; + $self->bookdata_cgi2session($c); + $c->response->redirect( $c->web_path( '/ort/new', { 'return_target_form' => $c->stash->{'self_url'} } ) ); + return 1; + } + + # Es wurde auf "Neue Kategorie" geklickt. + if ( $c->request->params->{'neue_kategorie'} ) { + $c->session->{'form'} = {} unless $c->session->{'form'}; + $c->session->{'form'}{'buch'} = {} unless $c->session->{'form'}{'buch'}; + $c->session->{'form'}{'buch'}{'neue_kategorie_angefordert'} = 1; + $self->bookdata_cgi2session($c); + $c->response->redirect( $c->web_path( '/kategorie/new', { 'return_target_form' => $c->stash->{'self_url'} } ) ); + return 1; + } + + # Es wurde auf "Neue Buchserie" geklickt. + if ( $c->request->params->{'neue_serie'} ) { + $c->session->{'form'} = {} unless $c->session->{'form'}; + $c->session->{'form'}{'buch'} = {} unless $c->session->{'form'}{'buch'}; + $c->session->{'form'}{'buch'}{'neue_serie_angefordert'} = 1; + $self->bookdata_cgi2session($c); + $c->response->redirect( $c->web_path( '/serie/new', { 'return_target_form' => $c->stash->{'self_url'} } ) ); + return 1; + } + + # Es wurde auf "Neue Währung" geklickt. + if ( $c->request->params->{'neue_waehrung'} ) { + $c->session->{'form'} = {} unless $c->session->{'form'}; + $c->session->{'form'}{'buch'} = {} unless $c->session->{'form'}{'buch'}; + $c->session->{'form'}{'buch'}{'neue_waehrung_angefordert'} = 1; + $self->bookdata_cgi2session($c); + $c->response->redirect( $c->web_path( '/waehrung/new', { 'return_target_form' => $c->stash->{'self_url'} } ) ); + return 1; + } + $c->stash->{'return_target'} = $c->session->{'return_target_new'} or $c->web_path("/books"); $c->stash->{'template'} = 'books/new.tt2'; -- 2.39.5