exit 0;
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
=cut
1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
return undef;
}
- unless ( $c->stash->{'autor_edit'} ) {
+ unless ( $c->stash->{'autor_edit'}{'name'} ) {
$c->stash->{'error_message'} = "Kein Name des Autors angegeben.";
return undef;
}
=cut
1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
#-------------------------------------------------------
1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
=cut
1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
=cut
1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
} ## end sub default :
+#-------------------------------------------------------
+
+=head2 form_new( )
+
+Erstellen eines neuen Verlages.
+
+=cut
+
+sub form_new : Path('new') {
+
+ my ( $self, $c ) = @_;
+ my $K = __PACKAGE__ . "::form_new(): ";
+
+ $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("/verlag/new"),
+ 'name' => "Neu"
+ };
+
+ $c->stash->{'template'} = 'verlag/new.tt2';
+ push @{$c->stash->{'cssfiles'}}, 'verlag/form.css';
+
+ $c->stash->{'error_message'} = '';
+
+# $self->prepare_data_structures($c);
+
+ $self->verlag_cgi2session($c);
+
+ $c->stash->{'verlag_edit'} = {} unless $c->stash->{'verlag_edit'};
+ $self->verlag_session2stash($c);
+ $c->stash->{'verlag_edit'}{'name'} = "Neuer Verlag" unless $c->stash->{'verlag_edit'}{'name'};
+
+ $c->stash->{'return_target_verlag_save'} = $c->session->{'return_target_verlag_save'} || $c->web_path('/verlag');
+
+ return 1 unless $c->request->params->{'verlag_form_sent'} and $c->request->params->{'do_save'};
+
+ return $self->do_save_verlag($c);
+
+}
+
+#-------------------------------------------------------
+
+sub do_save_verlag : Private {
+
+ my ( $self, $c ) = @_;
+ my $K = __PACKAGE__ . "::do_save_verlag(): ";
+
+ return 1 unless $self->check_formparams($c);
+
+ eval {
+ die "Speichern des Verlags misslungen." unless save_verlag( $c, $c->stash->{'verlag_edit'} );
+ };
+ if ( $@ ) {
+ $c->stash->{'error_message'} = $@;
+ return undef;
+ }
+
+ $c->stash->{'template'} = 'verlag/save_success.tt2';
+ delete $c->session->{'verlag_data_edit'} if exists $c->session->{'verlag_data_edit'};
+ delete $c->session->{'return_target_verlag_save'} if exists $c->session->{'return_target_verlag_save'};
+
+ return 1;
+
+}
+
+#-------------------------------------------------------
+
+sub check_formparams : Private {
+
+ my ( $self, $c ) = @_;
+ my $K = __PACKAGE__ . "::check_formparams(): ";
+
+ unless ( $c->stash->{'verlag_edit'} ) {
+ $c->stash->{'error_message'} = "Interner Fehler";
+ return undef;
+ }
+
+ unless ( $c->stash->{'verlag_edit'}{'name'} ) {
+ $c->stash->{'error_message'} = "Kein Name des Verlags angegeben.";
+ return undef;
+ }
+
+ return 1;
+
+}
+
+#-------------------------------------------------------
+
+sub verlag_cgi2session : Private {
+
+ my ( $self, $c ) = @_;
+ my $K = __PACKAGE__ . "::verlag_cgi2session(): ";
+
+ return 1 unless $c->request->params->{'verlag_form_sent'};
+
+ $c->session->{'return_target_verlag_save'} = $c->request->params->{'return_target_form'} if $c->request->params->{'return_target_form'};
+
+ # Basis anlegen, wenn notwendig
+ $c->session->{'verlag_data_edit'} = {} unless $c->session->{'verlag_data_edit'};
+
+ # Autor-Id eintragen, wenn notwendig
+ $c->session->{'verlag_data_edit'}{'id'} = $c->request->params->{'verlag_id'} if $c->request->params->{'verlag_id'};
+
+ # Kurzname des Verlags
+ if ( defined $c->request->params->{'verlag_name'} ) {
+ my $name = $c->request->params->{'verlag_name'};
+ $name =~ s/^\s+//;
+ $name =~ s/\s+$//;
+ $c->session->{'verlag_data_edit'}{'name'} = $name;
+ }
+
+ # Langname des Verlags
+ if ( defined $c->request->params->{'verlag_name_long'} ) {
+ my $name = $c->request->params->{'verlag_name_long'};
+ $name =~ s/^\s+//;
+ $name =~ s/\s+$//;
+ $c->session->{'verlag_data_edit'}{'name_long'} = $name;
+ }
+
+ return 1;
+
+}
+
+#-------------------------------------------------------
+
+sub verlag_session2stash : Private {
+
+ my ( $self, $c ) = @_;
+ my $K = __PACKAGE__ . "::verlag_session2stash(): ";
+
+ $c->stash->{'verlag_edit'} = {} unless $c->stash->{'verlag_edit'};
+ $c->stash->{'verlag_edit'}{'id'} = $c->session->{'verlag_data_edit'}{'id'} if $c->session->{'verlag_data_edit'}{'id'};
+ $c->stash->{'verlag_edit'}{'name'} = $c->session->{'verlag_data_edit'}{'name'} if $c->session->{'verlag_data_edit'}{'name'};
+ $c->stash->{'verlag_edit'}{'name_long'} = $c->session->{'verlag_data_edit'}{'name_long'} if $c->session->{'verlag_data_edit'}{'desc'};
+
+ return 1;
+
+}
#-------------------------------------------------------
=cut
1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
# You can replace this text with custom content, and it will be preserved on regeneration
1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
# You can replace this text with custom content, and it will be preserved on regeneration
1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
# You can replace this text with custom content, and it will be preserved on regeneration
1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
__PACKAGE__->add_unique_constraint("art_name", ["art_name"]);
1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
# You can replace this text with custom content, and it will be preserved on regeneration
1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
# You can replace this text with custom content, and it will be preserved on regeneration
1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
# You can replace this text with custom content, and it will be preserved on regeneration
1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
# You can replace this text with custom content, and it will be preserved on regeneration
1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
# You can replace this text with custom content, and it will be preserved on regeneration
1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
# You can replace this text with custom content, and it will be preserved on regeneration
1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
# You can replace this text with custom content, and it will be preserved on regeneration
1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
# You can replace this text with custom content, and it will be preserved on regeneration
1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
# You can replace this text with custom content, and it will be preserved on regeneration
1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
=cut
1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
#---------------------------------------------------------------------------
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
1;
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
=cut
1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
=cut
1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
=cut
1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
=cut
1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
sub save_verlag {
- my $c = shift;
- my $autor = shift;
- my $K = __PACKAGE__ . "::save_verlag(): ";
+ my $c = shift;
+ my $verlag = shift;
+ my $K = __PACKAGE__ . "::save_verlag(): ";
$c->log->debug( $K . "aufgerufen." ) if $c->stash->{'debug_level'} > 2;
$sth->execute( $verlags_id, $name_short, $name_long, $name_short, $name_long );
};
- $storage->dbh_do( $save_func, $verlag->{'id'}, $verlag->{'name'}, $verlag->{'desc'} );
+ $storage->dbh_do( $save_func, $verlag->{'id'}, $verlag->{'name'}, $verlag->{'name_long'} );
return $storage->last_insert_id();
=cut
1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
=cut
1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
=cut
1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
#------------------------------------------------------------------------------------------
__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
alle Farbdefinitionen
+ vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+
$Id$
$URL$
[%# config/main
+ vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+
$Id$
$URL$
config/url.tt2
+ vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+
# alle URL-Definitionen
#
# $Id$
[%#
** Template fuer Fusszeile
**
+ ** vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+ **
** $Id$
** $URL$
** -%]
[%#
** Template fuer Seitenkopf
**
+ ** vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+ **
** $Id$
** $URL$
**
Template fuer HTML-Seite als Ganzes
+ vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+
$Id$
$URL$
Template fuer Einbindung reines JavaScripts
+ vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+
$Id$
$URL$
Template fuer HTML-Seite als Ganzes
+ vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+
$Id$
$URL$
[%#
** Template fuer Allgemeines Seiten-Layout
**
+ ** vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+ **
** $Id$
** $URL$
**
Template fuer den Statusbalken / Menuezeile
+ vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+
$Id$
$URL$
Template fuer HTML-Seite als Ganzes
+ vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+
$Id$
$URL$
[%#
Template fuer Autorenangaben
+ vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+
$Id$
$URL$
index.tt2 - Index-Template (Menue) fuer Autoren-Dinge
- #$Id$
- #$URL$
+ vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+
+ $Id$
+ $URL$
-%]
<div style="text-align: center">
[%#
- Template fuer neuen Autor
+ Template fuer neuen Autor
- $Id$
- $URL$
+ vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+
+ $Id$
+ $URL$
-%]
[%- autor_form_title = 'Neuer Autor' -%]
index.tt2 - Template fuer erfolgreiches Speichern des Autors
- #$Id$
- #$URL$
+ vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+
+ $Id$
+ $URL$
-%]
<div style="text-align: center">
[%#
- Template fuer Buchangaben
+ Template fuer Buchangaben
- $Id$
- $URL$
+ vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+
+ $Id$
+ $URL$
-%]
message.tt2 - Universal-Template
- #$Id$
- #$URL$
+ vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+
+ $Id$
+ $URL$
-%]
<div style="text-align: center">
[%#
** Template fuer Buecherliste
**
+ ** vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+ **
** $Id$
** $URL$
** -%]
[%#
- Template fuer neues Buch
+ Template fuer neues Buch
- $Id$
- $URL$
+ vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+
+ $Id$
+ $URL$
-%]
[%- book_form_title = 'Neues Buch' -%]
error.tt2 - Template zur Darstellung eines Template-Fehlers
- #$Id$
- #$URL$
+ vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+
+ $Id$
+ $URL$
-%]
[% META title = 'Fehler' %]
message.tt2 - Universal-Template
- #$Id$
- #$URL$
+ vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+
+ $Id$
+ $URL$
-%]
[%- META title = 'Willkommen in Franks Büchersammlung' -%]
-[%- #
- # Template zur Darstellung eines noch nicht implementierten Features
- #
- # $Id$
- # $URL$
- #
+[%#
+ Template zur Darstellung eines noch nicht implementierten Features
+
+ vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+
+ $Id$
+ $URL$
+
-%]
<h3>Das gewünschte Feature wurde leider noch nicht implementiert.</h3>
--- /dev/null
+[%#
+ # Template fuer Stylesheets Verlagsformulare
+ #
+ # $Id$
+ # $URL$
+ #
+-%]
+/* Stylesheets Verlags-Formulare */
+
+
index.tt2 - Index-Template (Menue) fuer Verlags-Dinge
- #$Id$
- #$URL$
+ vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+
+ $Id$
+ $URL$
-%]
<div style="text-align: center">
--- /dev/null
+[%#
+
+ Template fuer neuen Verlag
+
+ vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+
+ $Id$
+ $URL$
+
+-%]
+[%- book_form_title = 'Neuer Verlag' -%]
+[% PROCESS verlag/verlag_form.tt2 %]
+
+<div class="back">
+<h2><a href="[% path('/books') %]">[% 'Zurück' %]</a></h2>
+</div>
--- /dev/null
+[%#
+
+ save_success.tt2 - Template fuer erfolgreiches Speichern des Verlags
+
+ vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+
+ $Id$
+ $URL$
+
+-%]
+<div style="text-align: center">
+
+Der Verlag <b>"[% verlag_edit.name %]</b> wurde erfolgreich gespeichert.
+
+<h2><a href="[% return_target_verlag_save %]">OK</a></h2>
+
+</div>
--- /dev/null
+[%#
+
+ Template fuer Verlagsangaben
+
+ vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+
+ $Id$
+ $URL$
+
+-%]
+
+<!-- Verlags-Formular -->
+
+<form method="post" name="verlag_form" action="[% self_url %]">
+<input type="hidden" name="verlag_form_sent" value="sent" />
+[%- IF verlag_edit.id %]<input type="hidden" name="verlag_id" value="[% verlag_edit.id | html %]" />[% END %]
+ <table class="ftable" cellspacing="0">
+ <tr>
+ <th colspan="2" class="title">[% verlag_form_title %]</th>
+ </tr><tr>
+ <td colspan="2"> </td>
+ </tr><tr>
+ <th>Name des Verlags:</th>
+ <td><input type="text" name="verlag_name" size="50" maxlength="250" value="[% verlag_edit.name | html %]" /></td>
+ </tr><tr>
+ <th>Kompletter Verlagsname:</th>
+ <td><textarea name="verlag_name_long" cols="50" rows="5">[% verlag_edit.name_long | html %]</textarea></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 -%]
message.tt2 - Universal-Template
- #$Id$
- #$URL$
+ vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+
+ $Id$
+ $URL$
-%]
[%- META title = 'Standard-Seite' %]
it under the same terms as Perl itself.
=cut
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
it under the same terms as Perl itself.
=cut
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
it under the same terms as Perl itself.
=cut
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
it under the same terms as Perl itself.
=cut
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
it under the same terms as Perl itself.
=cut
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :