Bug 5263 - Add support for including fields from the ISSUES table in advanced due notices
Adding support for including fields from the Issues table in advanced due notices. This is primarily to allow the inclusion of the due date for each item in the advanced due notice, but will allow the inclusion of any field from the ISSUES table. This also adds code to exclude timestamp fields as these are irrelevant to the end user in this context. Note: Documentation should be updated to reflect the availability of the additional fields in all circulation notices. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
parent
a869a4d43b
commit
57155db213
3 changed files with 10 additions and 2 deletions
|
@ -489,6 +489,8 @@ sub parseletter_sth {
|
|||
($table eq 'biblio' ) ? "SELECT * FROM $table WHERE biblionumber = ?" :
|
||||
($table eq 'biblioitems' ) ? "SELECT * FROM $table WHERE biblionumber = ?" :
|
||||
($table eq 'items' ) ? "SELECT * FROM $table WHERE itemnumber = ?" :
|
||||
($table eq 'issues' ) ? "SELECT * FROM $table WHERE itemnumber = ?" :
|
||||
($table eq 'suggestions' ) ? "SELECT * FROM $table WHERE borrowernumber = ? and biblionumber = ?" :
|
||||
($table eq 'reserves' ) ? "SELECT * FROM $table WHERE borrowernumber = ? and biblionumber = ?" :
|
||||
($table eq 'borrowers' ) ? "SELECT * FROM $table WHERE borrowernumber = ?" :
|
||||
($table eq 'branches' ) ? "SELECT * FROM $table WHERE branchcode = ?" :
|
||||
|
|
|
@ -170,6 +170,7 @@ UPCOMINGITEM: foreach my $upcoming ( @$upcoming_dues ) {
|
|||
borrowernumber => $upcoming->{'borrowernumber'},
|
||||
branchcode => $upcoming->{'branchcode'},
|
||||
biblionumber => $biblio->{'biblionumber'},
|
||||
itemnumber => $upcoming->{'itemnumber'},
|
||||
substitute => { 'items.content' => $titles }
|
||||
} );
|
||||
}
|
||||
|
@ -201,6 +202,7 @@ UPCOMINGITEM: foreach my $upcoming ( @$upcoming_dues ) {
|
|||
borrowernumber => $upcoming->{'borrowernumber'},
|
||||
branchcode => $upcoming->{'branchcode'},
|
||||
biblionumber => $biblio->{'biblionumber'},
|
||||
itemnumber => $upcoming->{'itemnumber'},
|
||||
substitute => { 'items.content' => $titles }
|
||||
} );
|
||||
}
|
||||
|
@ -345,10 +347,13 @@ sub parse_letter {
|
|||
if ( $params->{'branchcode'} ) {
|
||||
C4::Letters::parseletter( $params->{'letter'}, 'branches', $params->{'branchcode'} );
|
||||
}
|
||||
|
||||
if ( $params->{'itemnumber'} ) {
|
||||
C4::Letters::parseletter( $params->{'letter'}, 'issues', $params->{'itemnumber'} );
|
||||
}
|
||||
if ( $params->{'biblionumber'} ) {
|
||||
C4::Letters::parseletter( $params->{'letter'}, 'biblio', $params->{'biblionumber'} );
|
||||
C4::Letters::parseletter( $params->{'letter'}, 'biblioitems', $params->{'biblionumber'} );
|
||||
C4::Letters::parseletter( $params->{'letter'}, 'items', $params->{'biblionumber'} );
|
||||
}
|
||||
|
||||
return $params->{'letter'};
|
||||
|
|
|
@ -172,7 +172,7 @@ sub add_form {
|
|||
push @{$field_selection}, add_fields('biblio','biblioitems'),
|
||||
{value => q{}, text => '---ITEMS---' },
|
||||
{value => 'items.content', text => 'items.content'},
|
||||
add_fields('borrowers');
|
||||
add_fields('issues','borrowers');
|
||||
}
|
||||
|
||||
$template->param(
|
||||
|
@ -309,6 +309,7 @@ sub get_columns_for {
|
|||
my $table_prefix = $table . q|.|;
|
||||
my $rows = C4::Context->dbh->selectall_arrayref($sql, { Slice => {} });
|
||||
for my $row (@{$rows}) {
|
||||
next if $row->{'Field'} eq 'timestamp'; # this is really an irrelevant field and there may be other common fields that should be excluded from the list
|
||||
push @fields, {
|
||||
value => $table_prefix . $row->{Field},
|
||||
text => $table_prefix . $row->{Field},
|
||||
|
|
Loading…
Reference in a new issue