#-------------------------------------------------------
+=head2 form_view( )
+
+Ansehen eines vorhandenen Buches.
+
+=cut
+
+sub form_view : Path('view') {
+
+ my ( $self, $c ) = @_;
+ my $K = ( caller(0) )[3] . "(): ";
+
+ $c->log->debug( $K . "aufgerufen." ) if $c->stash->{'debug_level'} > 2;
+
+ $c->stash->{'menu_path'} = [] unless $c->stash->{'menu_path'};
+ push @{ $c->stash->{'menu_path'} }, {
+ 'path' => $c->web_path("/books/view"),
+ 'name' => "Betrachten"
+ };
+
+ $c->stash->{'template'} = 'books/view.tt2';
+ push @{$c->stash->{'cssfiles'}}, 'books/view.css';
+
+ $c->stash->{'error_message'} = '';
+
+ $self->prepare_data_structures($c);
+
+ $self->bookdata_cgi2session($c);
+
+ if ( $c->request->params->{'neuer_autor'} ) {
+ $c->session->{'return_target_autor_save'} = $c->stash->{'self_url'};
+ $c->detach('/autor/form_new');
+ }
+
+ $c->stash->{'book_edit'} = {} unless $c->stash->{'book_edit'};
+ $self->bookdata_session2stash($c);
+ $c->stash->{'book_edit'}{'title'} = "Neues Buch" unless $c->stash->{'book_edit'}{'title'};
+
+ unless ( $c->request->params->{'book_form_sent'} and $c->request->params->{'do_save'} ) {
+ return 1;
+ }
+
+ return $self->do_save_book($c);
+
+}
+
+#-------------------------------------------------------
+
sub do_save_book : Private {
my ( $self, $c ) = @_;
--- /dev/null
+[%#
+ Template fuer Buchanzeige
+
+ vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+
+ $Id$
+ $URL$
+
+-%]
+
+<!-- Buchanzeige -->
+
+<table class="ftable" cellspacing="0">
+ <tr>
+ <th colspan="2" class="title">Buchangaben '[%- book_edit.title | html -%]'</th>
+ </tr><tr>
+ <td colspan="2"> </td>
+ </tr><tr>
+ <th>Autor (-en):</th>
+ <td>[% FOR autor_id IN autor_list_book %]
+ [% autor_list.$autor_id %][% END %]</td>
+ </tr><tr>
+ <th>Buchtitel:</th>
+ <td>[% book_edit.title | html %]</td>
+ </tr><tr>
+ <th>Untertitel:</th>
+ <td>[% book_edit.untertitel | html %]</td>
+ </tr><tr>
+ <th>Original-Titel:</th>
+ <td>[% book_edit.original_title | html %]</td>
+ </tr><tr>
+ <th>Verlag:</th>
+ <td>[% book_edit.verlagsname_long %]<select name="verlags_id" size="1">
+ <option value="">-- Verlag auswählen --</option>[% FOR verlagsid IN verlags_ids %]
+ <option value="[% verlagsid %]"[% IF book_edit.verlags_id == verlagsid %] selected[% END %]>[% verlagsliste.$verlagsid %]</option>[% END %]
+ </select> <input type="button" name="neuer_verlag" value="*" class="shift_button" title="Neuer Verlag" onclick="goto_new_verlag();" /></td>
+ </tr><tr>
+ <th>Aufbewahrungsort:</th>
+ <td><select name="orts_id" size="1">
+ <option value="">-- Aufbewahrungsort auswählen --</option>[% FOR ortsid IN orts_ids %]
+ <option value="[% ortsid %]"[% IF book_edit.orts_id == ortsid %] selected[% END %]>[% ortsliste.$ortsid %]</option>[% END %]
+ </select> <input type="button" name="neuer_aufbewahrungsort" value="*" class="shift_button" title="Neuer Aufbewahrungsort" onclick="goto_new_ort();" /></td>
+ </tr><tr>
+ <th>Bindungsart:</th>
+ <td><select name="bindungsart_id" size="1">
+ <option value="">-- Bindungsart auswählen --</option>[% FOR bart_id IN bindungsarten_ids %]
+ <option value="[% bart_id %]"[% IF book_edit.bindungsart_id == bart_id %] selected[% END %]>[% bindungsartenliste.$bart_id %]</option>[% END %]
+ </select></td>
+ </tr><tr>
+ <th>Kategorie(n):</th>
+ <td>
+ <table class="two_lists" cellspacing="0">
+ <tr>
+ <th>Verfügbare Kategorien</th>
+ <th></th>
+ <th>Kategorien des Buchs</th>
+ </tr><tr>
+ <td><select name="kategorie_not" size="7" multiple>
+ <option value="">-- Kategorie oder Kategorien wählen --</option>[% FOR cat_id IN kategorie_list_no %]
+ <option value="[% cat_id %]">[% kategorie_list.$cat_id %]</option>
+ [% END %]</select></td>
+ <td><input type="submit" name="wird_kategorie" value="⇒" class="shift_button" title="Wird Kategorie" /><br /><br />
+ <input type="button" name="neue_kategorie" value="*" class="shift_button" title="Neue Kategorie" onclick="goto_new_category();" /><br /><br />
+ <input type="submit" name="entf_kategorie" value="⇐" class="shift_button" title="Kategorie entfernen" />
+ </td>
+ <td><select name="kategorie_book" size="7" multiple>
+ <option value="">-- Kategorie oder Kategorien entfernen --</option>[% FOR cat_id IN kategorie_list_book %]
+ <option value="[% cat_id %]">[% kategorie_list.$cat_id %]</option>[% END %]
+ </select></td>
+ </tr></table></td>
+ </tr><tr>
+ <th>Buchserien:</th>
+ <td>
+ <table class="two_lists" cellspacing="0">
+ <tr>
+ <th>Verfügbare Buchserien</th>
+ <th></th>
+ <th>Serien des Buchs</th>
+ </tr><tr>
+ <td><select name="buchserie_not" size="7" multiple>
+ <option value="">-- Buchserie wählen --</option>[% FOR serien_id IN serienliste_no %]
+ <option value="[% serien_id %]">[% serienliste.$serien_id %]</option>
+ [% END %]</select></td>
+ <td><input type="submit" name="wird_serie" value="⇒" class="shift_button" title="Wird Serie" /><br /><br />
+ <input type="button" name="neue_serie" value="*" class="shift_button" title="Neue Serie" onclick="goto_new_serie();" /><br /><br />
+ <input type="submit" name="entf_serie" value="⇐" class="shift_button" title="Serie entfernen" />
+ </td>
+ <td><select name="serie_book" size="7" multiple>
+ <option value="">-- Buchserie entfernen --</option>[% FOR serien_id IN serienliste_book %]
+ <option value="[% serien_id %]">[% serienliste.$serien_id %]</option>[% END %]
+ </select></td>
+ </tr></table></td>
+ </tr><tr>
+ <th>ISBN:</th>
+ <td><input type="text" name="book_isbn" size="20" maxlength="20" value="[% book_edit.isbn | html %]" /></td>
+ </tr><tr>
+ <th>Buch-Nummer (verlagseigen):</th>
+ <td><input type="text" name="book_nr" size="20" maxlength="100" value="[% book_edit.book_nr | html %]" /></td>
+ </tr><tr>
+ <th>Ausgabejahr:</th>
+ <td><input type="text" name="book_ajahr" size="20" maxlength="20" value="[% book_edit.ausgabejahr | html %]" class="zahl" /></td>
+ </tr><tr>
+ <th>Druckjahr:</th>
+ <td><input type="text" name="book_djahr" size="20" maxlength="20" value="[% book_edit.druckjahr | html %]" class="zahl" /></td>
+ </tr><tr>
+ <th>Seiten:</th>
+ <td><input type="text" name="book_seiten" size="20" maxlength="20" value="[% book_edit.seiten | html %]" class="zahl" /></td>
+ </tr><tr>
+ <th>Preis:</th>
+ <td><input type="text" name="book_preis" size="20" maxlength="20" value="[% book_edit.preis | replace('\.', ',') %]" class="zahl" />
+ <select name="waehrungs_id" size="1">
+ <option value="">-- Währung auswählen --</option>[% FOR waehrungsid IN waehrungs_ids %]
+ <option value="[% waehrungsid %]"[% IF book_edit.waehrungs_id == waehrungsid %] selected[% END %]>[% waehrungsliste.$waehrungsid.kuerzel %]</option>[% END %]
+ </select> <input type="button" name="neue_waehrung" value="*" class="shift_button" title="Neue Währung" /></td>
+ </tr><tr>
+ <td colspan="2"> </td>
+ </tr><tr>
+ <th colspan="2" class="button"><input type="submit" name="do_save" value=" OK " /></th>
+ </tr>
+ </table>
+</form>
+[%- IF error_message %]
+<div class="error">
+<span class="bold">Fehler:</span> [% error_message %]
+</div>
+[% END -%]
+
+<div class="back">
+<h2><a href="[% path('/books') %]">[% 'Zurück' %]</a></h2>
+</div>
+