From c53e6e977ff394c4b2a70e4beae002f36869f85b Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 14 Jul 2023 12:47:29 +0000 Subject: [PATCH] Bug 32986: (follow-up) Tidy conditional in letter.pl Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- tools/letter.pl | 48 +++++++++++++++++++++--------------------------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/tools/letter.pl b/tools/letter.pl index 4214d8e2cc..0e3ece1363 100755 --- a/tools/letter.pl +++ b/tools/letter.pl @@ -240,35 +240,29 @@ sub add_form { my $field_selection; push @{$field_selection}, add_fields('branches'); - if ($module eq 'reserves') { - push @{$field_selection}, add_fields('borrowers', 'reserves', 'biblio', 'biblioitems', 'items'); - } - elsif ( $module eq 'acquisition' ) { - push @{$field_selection}, add_fields('aqbooksellers', 'aqorders', 'biblio', 'items'); - } - elsif ($module eq 'claimacquisition' || $module eq 'orderacquisition') { - push @{$field_selection}, add_fields('aqbooksellers', 'aqbasket', 'aqorders', 'biblio', 'biblioitems'); - } - elsif ($module eq 'claimissues') { - push @{$field_selection}, add_fields('aqbooksellers', 'serial', 'subscription', 'biblio', 'biblioitems'); - } - elsif ( $module eq 'patron_slip' ) { + if ( $module eq 'reserves' ) { + push @{$field_selection}, add_fields( 'borrowers', 'reserves', 'biblio', 'biblioitems', 'items' ); + } elsif ( $module eq 'acquisition' ) { + push @{$field_selection}, add_fields( 'aqbooksellers', 'aqorders', 'biblio', 'items' ); + } elsif ( $module eq 'claimacquisition' || $module eq 'orderacquisition' ) { + push @{$field_selection}, add_fields( 'aqbooksellers', 'aqbasket', 'aqorders', 'biblio', 'biblioitems' ); + } elsif ( $module eq 'claimissues' ) { + push @{$field_selection}, add_fields( 'aqbooksellers', 'serial', 'subscription', 'biblio', 'biblioitems' ); + } elsif ( $module eq 'patron_slip' ) { push @{$field_selection}, add_fields('borrowers'); - } - elsif ($module eq 'serial') { - push @{$field_selection}, add_fields('branches', 'biblio', 'biblioitems', 'borrowers', 'subscription', 'serial'); - } - elsif ($module eq 'suggestions') { - push @{$field_selection}, add_fields('suggestions', 'borrowers', 'biblio'); - } - else { - push @{$field_selection}, add_fields('biblio','biblioitems'), + } elsif ( $module eq 'serial' ) { + push @{$field_selection}, + add_fields( 'branches', 'biblio', 'biblioitems', 'borrowers', 'subscription', 'serial' ); + } elsif ( $module eq 'suggestions' ) { + push @{$field_selection}, add_fields( 'suggestions', 'borrowers', 'biblio' ); + } else { + push @{$field_selection}, add_fields( 'biblio', 'biblioitems' ), add_fields('items'), - {value => 'items.content', text => 'items.content'}, - {value => 'items.fine', text => 'items.fine'}, + { value => 'items.content', text => 'items.content' }, + { value => 'items.fine', text => 'items.fine' }, add_fields('borrowers'); - if ($module eq 'circulation') { - push @{$field_selection}, add_fields('additional_contents', 'recalls'); + if ( $module eq 'circulation' ) { + push @{$field_selection}, add_fields( 'additional_contents', 'recalls' ); } @@ -278,7 +272,7 @@ sub add_form { push @{$field_selection}, add_fields('issues'); } - if ( $module eq 'circulation' and $code and $code =~ /^AR_/ ) { + if ( $module eq 'circulation' and $code and $code =~ /^AR_/ ) { push @{$field_selection}, add_fields('article_requests'); } -- 2.39.5