--- /dev/null
+--
+-- Änderungen an der Datenstruktur
+--
+
+--
+-- $Id$
+-- $URL$
+--
+
+-- ----------------------------------------------------------------------------------
+-- Tabelle `autoren` aufmotzen.
+
+ALTER TABLE `autoren`
+ ADD `created_at` datetime,
+ ADD `created_by` int(10) unsigned,
+ ADD `changed_at` datetime,
+ ADD `changed_by` int(10) unsigned,
+ ADD KEY `created_by` (`created_by`),
+ ADD KEY `changed_by` (`changed_by`),
+ ADD CONSTRAINT `autoren_ibfk_1` FOREIGN KEY (`created_by`) REFERENCES `users` (`user_id`),
+ ADD CONSTRAINT `autoren_ibfk_2` FOREIGN KEY (`changed_by`) REFERENCES `users` (`user_id`);
+
+UPDATE `autoren` SET
+ `created_at` = NOW(),
+ `created_by` = 1,
+ `changed_at` = NOW(),
+ `changed_by` = 1;
+
+COMMIT;
+
+ALTER TABLE `autoren`
+ MODIFY `created_at` datetime NOT NULL COMMENT 'Wann erstellt',
+ MODIFY `created_by` int(10) unsigned NOT NULL COMMENT 'Von welcher User-Id erstellt',
+ MODIFY `changed_at` datetime NOT NULL COMMENT 'Wann geändert',
+ MODIFY `changed_by` int(10) unsigned NOT NULL COMMENT 'Von welcher User-Id geändert';
+
+-- ----------------------------------------------------------------------------------
+-- Tabelle `buecher` aufmotzen.
+
+
+ALTER TABLE `buecher`
+ ADD `notes` text COMMENT 'Anmerkungen',
+ ADD `created_at` datetime,
+ ADD `created_by` int(10) unsigned,
+ ADD `changed_at` datetime,
+ ADD `changed_by` int(10) unsigned,
+ ADD KEY `created_by` (`created_by`),
+ ADD KEY `changed_by` (`changed_by`),
+ ADD CONSTRAINT `buecher_ibfk_5` FOREIGN KEY (`created_by`) REFERENCES `users` (`user_id`),
+ ADD CONSTRAINT `buecher_ibfk_6` FOREIGN KEY (`changed_by`) REFERENCES `users` (`user_id`);
+
+UPDATE `buecher` SET
+ `created_at` = NOW(),
+ `created_by` = 1,
+ `changed_at` = NOW(),
+ `changed_by` = 1;
+
+COMMIT;
+
+ALTER TABLE `buecher`
+ MODIFY `created_at` datetime NOT NULL COMMENT 'Wann erstellt',
+ MODIFY `created_by` int(10) unsigned NOT NULL COMMENT 'Von welcher User-Id erstellt',
+ MODIFY `changed_at` datetime NOT NULL COMMENT 'Wann geändert',
+ MODIFY `changed_by` int(10) unsigned NOT NULL COMMENT 'Von welcher User-Id geändert';
+
+-- ----------------------------------------------------------------------------------
+
+-- vim: noai : ts=4 fenc=utf-8 filetype=sql expandtab :
$c->stash->{'last_login_name'} = $c->session->{'last_login_name'};
$c->log->debug( $K . "Aktuelle Script-URL: '" . $c->stash->{'self_url'} . "'." ) if $c->stash->{'debug_level'} >= 2;
- $c->log->debug( get_output_string( $K, "Aktueller Request: ", $c->req ) ) if $c->config->{'debug_level'} >= 3;
+# $c->log->debug( get_output_string( $K, "Aktueller Request: ", $c->req ) ) if $c->config->{'debug_level'} >= 3;
# Listenlaenge festlegen
$c->stash->{'list_length'} = $c->session->{'list_length'} || $c->config->{'default_list_length'} || 20;
__PACKAGE__->load_components("Core");
__PACKAGE__->table("autoren");
__PACKAGE__->add_columns(
- "id" => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
- "titel" => { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 100, },
- "vorname" => { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 150, },
- "mittelname" => { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 150, },
- "nachname" => { data_type => "VARCHAR", default_value => undef, is_nullable => 0, size => 150, },
- "name_suffix" => { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 100, },
- "autor_descr" => { data_type => "TEXT", default_value => undef, is_nullable => 0, size => 65535, },
- "about" => { data_type => "TEXT", default_value => undef, is_nullable => 0, size => 65535, },
+ "id" => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
+ "titel" => { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 100, },
+ "vorname" => { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 150, },
+ "mittelname" => { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 150, },
+ "nachname" => { data_type => "VARCHAR", default_value => undef, is_nullable => 0, size => 150, },
+ "name_suffix" => { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 100, },
+ "autor_descr" => { data_type => "TEXT", default_value => undef, is_nullable => 0, size => 65535, },
+ "about" => { data_type => "TEXT", default_value => undef, is_nullable => 0, size => 65535, },
+ "created_at" => { data_type => "DATETIME", default_value => undef, is_nullable => 0, size => 19, },
+ "created_by" => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
+ "changed_at" => { data_type => "DATETIME", default_value => undef, is_nullable => 0, size => 19, },
+ "changed_by" => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
+
);
__PACKAGE__->set_primary_key("id");
__PACKAGE__->add_unique_constraint( "name", [ "nachname", "vorname", "mittelname", "name_suffix" ] );
+__PACKAGE__->belongs_to( "created_by", "FrBr::Books::Db::Result::Users", { 'foreign.user_id' => "self.created_by" },);
+__PACKAGE__->belongs_to( "changed_by", "FrBr::Books::Db::Result::Users", { 'foreign.user_id' => "self.changed_by" },);
+
__PACKAGE__->has_many( 'autor_buch' => 'FrBr::Books::Db::Result::Autor2Buch', { 'foreign.autor_id' => 'self.id' } );
__PACKAGE__->many_to_many( 'buecher' => 'autor_buch', 'buch' );
"preis" => { data_type => "FLOAT", default_value => undef, is_nullable => 1, size => 32 },
"waehrungs_id" => { data_type => "INT", default_value => undef, is_nullable => 1, size => 10 },
"kurzinhalt" => { data_type => "TEXT", default_value => undef, is_nullable => 1, size => 65535, },
+ "notes" => { data_type => "TEXT", default_value => undef, is_nullable => 1, size => 65535, },
+ "created_at" => { data_type => "DATETIME", default_value => undef, is_nullable => 0, size => 19, },
+ "created_by" => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
+ "changed_at" => { data_type => "DATETIME", default_value => undef, is_nullable => 0, size => 19, },
+ "changed_by" => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
);
__PACKAGE__->set_primary_key("id");
__PACKAGE__->has_many( 'buch_serie' => 'FrBr::Books::Db::Result::Buch2serie', { 'foreign.buch_id' => 'self.id' } );
__PACKAGE__->many_to_many( 'serien' => 'buch_serie', 'serie' );
+__PACKAGE__->belongs_to( "created_by", "FrBr::Books::Db::Result::Users", { 'foreign.user_id' => "self.created_by" },);
+__PACKAGE__->belongs_to( "changed_by", "FrBr::Books::Db::Result::Users", { 'foreign.user_id' => "self.changed_by" },);
+
=pod
# Make a new ResultSource based on the buecher class
# Created by DBIx::Class::Schema::Loader v0.04004 @ 2008-03-17 17:53:52
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dE3Et+cb9hDWcDvAu7CS+A
+__PACKAGE__->has_many( "autoren_created", "FrBr::Books::Db::Result::Autoren", { "foreign.created_by" => "self.user_id" },);
+__PACKAGE__->has_many( "autoren_changed", "FrBr::Books::Db::Result::Autoren", { "foreign.changed_by" => "self.user_id" },);
+__PACKAGE__->has_many( "buecher_created", "FrBr::Books::Db::Result::Buecher", { "foreign.created_by" => "self.user_id" },);
+__PACKAGE__->has_many( "buecher_changed", "FrBr::Books::Db::Result::Buecher", { "foreign.changed_by" => "self.user_id" },);
+
# You can replace this text with custom content, and it will be preserved on regeneration
1;
$res = [
{
- 'id' => 1,
- 'name' => 'J.R.R. Tolkien',
- 'titel' => undef,
- 'vorname' => 'J.R.R.',
- 'mittelname' => undef,
- 'nachname' => 'Tolkien',
- 'name_suffix' => undef,
- 'descr' => 'Bla Blub',
- 'about' => 'Der Autor wurde ...',
+ 'id' => 1,
+ 'name' => 'J.R.R. Tolkien',
+ 'titel' => undef,
+ 'vorname' => 'J.R.R.',
+ 'mittelname' => undef,
+ 'nachname' => 'Tolkien',
+ 'name_suffix' => undef,
+ 'descr' => 'Bla Blub',
+ 'about' => 'Der Autor wurde ...',
+ 'created_at' => '2010-02-22 12:13:14',
+ 'id_created_by' => 1,
+ 'name_created_by' => 'Frank Brehm',
+ 'changed_at' => '2010-02-29 13:14:15',
+ 'id_changed_by' => 2,
+ 'name_changed_by' => 'Doris Hennig',
'books' => [
{
'id' => 22,
$c->log->debug( get_output_string( $K, "Anzahl gefundene Autoren: ", $anzahl_autoren ) ) if $c->stash->{'debug_level'} >= 2;
my $other_params = {};
- $other_params->{'order_by'} = [ 'nachname', 'vorname', 'mittelname', 'name_suffix' ];
+ $other_params->{'order_by'} = [ 'me.nachname', 'me.vorname', 'me.mittelname', 'me.name_suffix' ];
+ $other_params->{'join'} = [
+ 'created_by',
+ 'changed_by',
+ ];
$other_params->{'select'} = [
- 'id',
- 'titel',
- 'vorname',
- 'mittelname',
- 'nachname',
- 'name_suffix',
- 'autor_descr',
- 'about',
+ 'me.id',
+ 'me.titel',
+ 'me.vorname',
+ 'me.mittelname',
+ 'me.nachname',
+ 'me.name_suffix',
+ 'me.autor_descr',
+ 'me.about',
+ 'me.created_by',
+ 'created_by.vorname',
+ 'created_by.nachname',
+ 'me.created_at',
+ 'me.changed_by',
+ 'changed_by.vorname',
+ 'changed_by.nachname',
+ 'me.changed_at',
];
$other_params->{'as'} = [
'id',
'name_suffix',
'autor_descr',
'about',
+ 'created_by',
+ 'created_by_vorname',
+ 'created_by_nachname',
+ 'created_at',
+ 'changed_by',
+ 'changed_by_vorname',
+ 'changed_by_nachname',
+ 'changed_at',
];
if ( $page ) {
}
for my $autor_rs ( $c->model('Schema::Autoren')->search( $search_params, $other_params )->all() ) {
+ my $vorname = '';
my $autor = {};
$autor->{'id'} = $autor_rs->id();
$autor->{'titel'} = $autor_rs->titel();
$autor->{'name_suffix'} = $autor_rs->name_suffix();
$autor->{'descr'} = $autor_rs->autor_descr();
$autor->{'about'} = $autor_rs->about();
+
+ $autor->{'id_created_by'} = $autor_rs->get_column('created_by');
+ $autor->{'created_at'} = $autor_rs->get_column('created_at');
+ $autor->{'name_created_by'} = $autor_rs->get_column('created_by_nachname');
+ $vorname = $autor_rs->get_column('created_by_vorname');
+ $autor->{'name_created_by'} = $vorname . ' ' . $autor->{'name_created_by'} if $vorname;
+
+ $autor->{'id_changed_by'} = $autor_rs->get_column('changed_by');
+ $autor->{'changed_at'} = $autor_rs->get_column('changed_at');
+ $autor->{'name_changed_by'} = $autor_rs->get_column('changed_by_nachname');
+ $vorname = $autor_rs->get_column('changed_by_vorname');
+ $autor->{'name_changed_by'} = $vorname . ' ' . $autor->{'name_changed_by'} if $vorname;
+
$autor->{'books'} = [];
my @N;
push @N, $autor->{'titel'} if $autor->{'titel'};
$c->log->debug( $K . "aufgerufen." ) if $c->stash->{'debug_level'} > 2;
+ my $schema = $c->model('Schema')->{'schema'};
my $storage = $c->model('Schema')->storage;
$c->stash->{'save_autor_result'} = '';
$row->{'about'} = $tmp eq '' ? undef : $tmp;
my $saved_aid = $c->b_get_autor_id( $search_params );
-
- # Zuerst einmal Test im nichgelocktem Zustand ...
+
+ my $user_id = $c->stash->{'current_user_id'} || 1;
+ $row->{'changed_at'} = \'NOW()';
+ $row->{'changed_by'} = $user_id;
+
+ # Zuerst einmal Test außerhalb der Transaktion ...
if ( $autor->{'id'} ) {
if ( $saved_aid and ( $saved_aid != $autor->{'id'} ) ) {
$c->stash->{'save_autor_result'} = 'Es existiert bereits ein Autor mit den übergebenen Angaben.';
$c->log->info( $K . "Es existiert bereits ein Autor mit den übergebenen Angaben." );
return undef;
}
+ $row->{'id'} = $autor->{'id'};
}
else {
if ( $saved_aid ) {
}
}
+ $c->log->debug( get_output_string( $K, "Zu speichernder Autor: ", $row ) ) if $c->stash->{'debug_level'} >= 3;
+ my $id = undef;
+
+ # Der Transaktionscode ...
+ my $txn_code = sub {
+
+ my $key_hash = {};
+ $key_hash->{'key'} = $row->{'id'} ? 'primary' : 'name';
+
+ my $rs = $c->model('Schema::Autoren')->update_or_new( $row, $key_hash );
+
+ if ( $rs->in_storage() ) {
+
+ $c->log->debug( $K . "Den Autor gibt es schon ..." );
+
+ my $spalten = {};
+ %$spalten = $rs->get_columns();
+ $c->log->debug( get_output_string( $K, "Die Spalten des Autors: ", $spalten ) );
+ $spalten = {};
+
+ $rs->set_column( 'id' => \'LAST_INSERT_ID(`id`)' );
+ %$spalten = $rs->get_columns();
+ $c->log->debug( get_output_string( $K, "Die Spalten des Autors nochmal: ", $spalten ) );
+ $spalten = {};
+
+ $rs->update();
+
+ }
+ else {
+ $rs->set_column( 'created_by' => $user_id );
+ $rs->set_column( 'created_at' => \'NOW()' );
+ $rs->insert();
+ }
+
+ $id = $storage->last_insert_id();
+
+ };
+
+ # Und ab ...
+ eval {
+ $schema->txn_do($txn_code);
+ };
+
+ if ($@) { # Transaction failed
+ my $msg = $@ =~ /Rollback failed/i ? "Rollback nicht erfolgreich!" : $@;
+ $c->stash->{'save_autor_result'} = $msg;
+ die $msg . "\n";
+ return undef;
+ }
+
+ $c->stash->{'save_autor_result'} = 'OK';
+ return $id;
+
+=pod
+
# Sperren der Autoren-Tabelle
$c->lock_tables( 'write' => [ 'autoren', 'autoren', 'as', 'me' ] );
$c->stash->{'save_autor_result'} = 'OK';
return $new_id;
+=cut
+
}
#-----------------------------------------------------------------------------------
my $schema = $c->model('Schema')->{'schema'};
-# # Sperren der Autoren- und der Buecher-Tabelle
-# $c->lock_tables( 'write' => [ 'autoren', 'autoren', 'as', 'me', ], 'read' => [ 'autor2buch', 'autor2buch', 'as', 'me', ] );
-
# Raus, wenn der Autor noch Buecher hat ...
if ( $c->model('Schema::Autor2buch')->count( { 'autor_id' => $autor_id, } ) ) {
my $msg = 'Es existieren noch Buecher dieses Autors.';
-# $c->unlock_tables();
die $msg . "\n";
}
if ($@) { # Transaction failed
my $msg = $@ =~ /Rollback failed/i ? "Rollback nicht erfolgreich!" : $@;
-# $c->unlock_tables();
die $msg . "\n";
return undef;
}
-# $c->unlock_tables();
return 1;
}
$list = [
{
- 'ausgabejahr' => '2003',
- 'autor_ids' => [
+ 'ausgabejahr' => '2003',
+ 'autor_ids' => [
'5'
],
- 'autoren' => [
+ 'autoren' => [
'Bill Napier'
],
- 'bindungsart' => 'Softcover (Taschenbuch)',
- 'bindungsart_id' => '4',
- 'buch_nr' => '093314',
- 'druckjahr' => '2007',
- 'id' => '5',
- 'isbn' => undef,
- 'kategorie_ids' => [
+ 'bindungsart' => 'Softcover (Taschenbuch)',
+ 'bindungsart_id' => '4',
+ 'buch_nr' => '093314',
+ 'druckjahr' => '2007',
+ 'id' => '5',
+ 'isbn' => undef,
+ 'kategorie_ids' => [
'4'
],
- 'kategorien' => [
+ 'kategorien' => [
'Mystery-Thriller'
],
- 'kurzinhalt' => 'Bla bla bla, tolles Buch',
- 'ort_beschreibung' => undef,
- 'ort_ist_statisch' => undef,
- 'orts_id' => undef,
- 'ortsname' => undef,
- 'preis' => '7.45',
- 'seiten' => '416',
- 'serien' => [],
- 'serien_ids' => [],
- 'title' => 'Der 77. Grad',
- 'title_original' => 'Shattered Icon',
+ 'kurzinhalt' => 'Bla bla bla, tolles Buch',
+ 'notes' => 'naja, geht so',
+ 'ort_beschreibung' => undef,
+ 'ort_ist_statisch' => undef,
+ 'orts_id' => undef,
+ 'ortsname' => undef,
+ 'preis' => '7.45',
+ 'seiten' => '416',
+ 'serien' => [],
+ 'serien_ids' => [],
+ 'title' => 'Der 77. Grad',
+ 'title_original' => 'Shattered Icon',
'umrechnung_in_euro' => '1',
- 'untertitel' => undef,
- 'verlags_id' => '3',
- 'verlagsname_long' => 'Bertelsmann Club GmbH - Taschenbuch',
- 'verlagsname_short' => 'Club Taschenbuch',
- 'waehrungs_id' => '1',
- 'waehrungs_kuerzel' => '€',
- 'waehrungs_name' => 'Euro'
+ 'untertitel' => undef,
+ 'verlags_id' => '3',
+ 'verlagsname_long' => 'Bertelsmann Club GmbH - Taschenbuch',
+ 'verlagsname_short' => 'Club Taschenbuch',
+ 'waehrungs_id' => '1',
+ 'waehrungs_kuerzel' => '€',
+ 'waehrungs_name' => 'Euro'
+ 'created_at' => '2010-02-22 12:13:14',
+ 'id_created_by' => 1,
+ 'name_created_by' => 'Frank Brehm',
+ 'changed_at' => '2010-02-29 13:14:15',
+ 'id_changed_by' => 2,
+ 'name_changed_by' => 'Doris Hennig',
},
...
];
$b_search_params = { 'me.id' => \$in };
$other_params = {};
- $other_params->{'join'} = [ 'waehrung', 'verlag', 'ort', 'bindungsart' ];
+ $other_params->{'join'} = [
+ 'waehrung',
+ 'verlag',
+ 'ort',
+ 'bindungsart',
+ 'created_by',
+ 'changed_by',
+ ];
$other_params->{'select'} = [
'me.id',
'me.title',
'me.druckjahr',
'me.seiten',
'me.kurzinhalt',
+ 'me.notes',
'me.preis',
'me.waehrungs_id',
'waehrung.waehrungs_kuerzel',
'ort.name',
'ort.descr',
'ort.statisch',
+ 'me.created_by',
+ 'created_by.vorname',
+ 'created_by.nachname',
+ 'me.created_at',
+ 'me.changed_by',
+ 'changed_by.vorname',
+ 'changed_by.nachname',
+ 'me.changed_at',
];
$other_params->{'as'} = [
'id',
'druckjahr',
'seiten',
'kurzinhalt',
+ 'notes',
'preis',
'waehrungs_id',
'waehrungs_kuerzel',
'ortsname',
'ort_beschreibung',
'ort_ist_statisch',
+ 'created_by',
+ 'created_by_vorname',
+ 'created_by_nachname',
+ 'created_at',
+ 'changed_by',
+ 'changed_by_vorname',
+ 'changed_by_nachname',
+ 'changed_at',
];
my $buchmap = {};
for my $book ( $c->model('Schema::Buecher')->search( $b_search_params, $other_params )->all() ) {
my $buch = {};
+ my $vorname = '';
my $id = $book->id();
$buch->{'id'} = $id;
$buch->{'title'} = $book->title();
$buch->{'druckjahr'} = $book->druckjahr();
$buch->{'seiten'} = $book->seiten();
$buch->{'kurzinhalt'} = $book->kurzinhalt();
+ $buch->{'notes'} = $book->notes();
$buch->{'preis'} = $book->preis();
$buch->{'waehrungs_id'} = $book->waehrungs_id();
$buch->{'waehrungs_kuerzel'} = $book->get_column('waehrungs_kuerzel');
$buch->{'ortsname'} = $book->get_column('ortsname');
$buch->{'ort_beschreibung'} = $book->get_column('ort_beschreibung');
$buch->{'ort_ist_statisch'} = $book->get_column('ort_ist_statisch');
- $buch->{'autoren'} = [];
- $buch->{'autor_ids'} = [];
- $buch->{'kategorien'} = [];
- $buch->{'kategorie_ids'} = [];
- $buch->{'serien'} = [];
- $buch->{'serien_ids'} = [];
+
+ $buch->{'id_created_by'} = $book->get_column('created_by');
+ $buch->{'created_at'} = $book->get_column('created_at');
+ $buch->{'name_created_by'} = $book->get_column('created_by_nachname');
+ $vorname = $book->get_column('created_by_vorname');
+ $buch->{'name_created_by'} = $vorname . ' ' . $buch->{'name_created_by'} if $vorname;
+
+ $buch->{'id_changed_by'} = $book->get_column('changed_by');
+ $buch->{'changed_at'} = $book->get_column('changed_at');
+ $buch->{'name_changed_by'} = $book->get_column('changed_by_nachname');
+ $vorname = $book->get_column('changed_by_vorname');
+ $buch->{'name_changed_by'} = $vorname . ' ' . $buch->{'name_changed_by'} if $vorname;
+
+ $buch->{'autoren'} = [];
+ $buch->{'autor_ids'} = [];
+ $buch->{'kategorien'} = [];
+ $buch->{'kategorie_ids'} = [];
+ $buch->{'serien'} = [];
+ $buch->{'serien_ids'} = [];
+
$buchmap->{$id} = $buch;
}
=head2 $c->b_save_book( $book )
$book = {
- 'ausgabejahr' => '2004',
- 'autoren' => [
+ 'ausgabejahr' => '2004',
+ 'autoren' => [
'11'
],
'bindungsart_id' => 4,
- 'book_nr' => '',
- 'druckjahr' => '2006',
- 'isbn' => '3-492-70076-4',
- 'kategorien' => [
+ 'book_nr' => '',
+ 'druckjahr' => '2006',
+ 'isbn' => '3-492-70076-4',
+ 'kategorien' => [
'2'
],
- 'kurzinhalt' => 'bla bla bla',
+ 'kurzinhalt' => 'bla bla bla',
+ 'notes' => 'geht so ...',
'original_title' => '',
- 'orts_id' => '2',
- 'preis' => 14,
- 'seiten' => '640',
- 'serien' => [
+ 'orts_id' => '2',
+ 'preis' => 14,
+ 'seiten' => '640',
+ 'serien' => [
'4'
],
- 'title' => 'Die Zwerge',
- 'untertitel' => '',
- 'verlags_id' => '8',
- 'waehrungs_id' => '1'
+ 'title' => 'Die Zwerge',
+ 'untertitel' => '',
+ 'verlags_id' => '8',
+ 'waehrungs_id' => '1'
};
=cut
$c->log->debug( $K . "aufgerufen." ) if $c->stash->{'debug_level'} > 2;
+ my $schema = $c->model('Schema')->{'schema'};
my $storage = $c->model('Schema')->storage;
my $tmp = $book->{'kurzinhalt'};
$tmp =~ s/\s+$//;
$book->{'kurzinhalt'} = $tmp eq '' ? undef : $tmp;
+ $tmp = $book->{'notes'};
+ $tmp = '' unless defined $tmp;
+ $tmp =~ s/^\s+//;
+ $tmp =~ s/\s+$//;
+ $book->{'notes'} = $tmp eq '' ? undef : $tmp;
+
my $save_func = sub {
my $storage = shift;
<td colspan="2" class="empty"></td>
</tr><tr>
<th>Titel des Autors :</th>
- <td>[% autor.title | html %]</td>
+ <td>[% autor.titel | html %]</td>
</tr><tr>
<th>Vorname:</th>
<td>[% autor.vorname | html %]</td>