From 2662a21a5c9f055a64fd2562837f150e2e51e19a Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 29 Aug 2014 15:16:19 +0200 Subject: [PATCH] Bug 12852: The "preview" param can be removed serials/claims.pl This case (preview=1) never appened. This patch remove all occurrences in the pl and the tt files. Test plan: Verify you don't manage to find a place where preview is set to 1 on the claim serials page. Signed-off-by: Paola Rossi Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit fd38d8c565ce3efe21b2633f67f7349db28faddd) Signed-off-by: Chris Cormack --- .../prog/en/modules/serials/claims.tt | 76 ------------------- serials/claims.pl | 42 +++++----- 2 files changed, 18 insertions(+), 100 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt index 4eb131a329..4cd666e9fb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt @@ -9,7 +9,6 @@ [% INCLUDE 'header.inc' %] -[% UNLESS ( preview ) %] [% INCLUDE 'serials-search.inc' %] -[% END %] -[% UNLESS ( preview ) %] -
@@ -354,77 +344,11 @@ [% END %] -[% ELSE %] - -
-
- -[% IF ( supplierloop ) %] - [% FOREACH supplierloo IN supplierloop %] - [% IF ( supplierloo.name ) %] -

[% supplierloo.name %]
- [% END %] - [% IF ( supplierloo.postal ) %] - [% supplierloo.postal %]
- [% END %] - [% IF ( supplierloo.contphone ) %] - Ph: [% supplierloo.contphone %]
- [% END %] - [% IF ( supplierloo.contfax ) %] - Fax: [% supplierloo.contfax %]
- [% END %] - [% IF ( supplierloo.contemail ) %] - Email: [% supplierloo.contemail %]
- [% END %] - [% IF ( supplierloo.accountnumber ) %] - A/C: [% supplierloo.accountnumber %]

- [% END %] - [% IF ( supplierloo.contact ) %] -

Dear [% supplierloo.contact %]

- [% ELSE %] -

To whom it may concern

- [% END %] -

The following items have not been received from you and are now considered missing:

- [% END %] -[% END %] - [% IF ( missingissues ) %] -

Missing issues

- - - - - - - - [% FOREACH missingissue IN missingissues %] - - - - - - - [% END %] -
VendorTitleIssue numberMissing since
- [% missingissue.name %] - - [% missingissue.Title |html %] - - [% missingissue.serialseq %] - - [% missingissue.planneddate %] -
- [% END %] - -

Print   Close

-[% END %] -
-[% UNLESS ( preview ) %]
[% INCLUDE 'serials-menu.inc' %]
-[% END %]
[% INCLUDE 'intranet-bottom.inc' %] diff --git a/serials/claims.pl b/serials/claims.pl index 822a1ff163..dc55fad0fb 100755 --- a/serials/claims.pl +++ b/serials/claims.pl @@ -59,30 +59,25 @@ for my $s (@{$supplierlist} ) { my $branchloop = GetBranchesLoop(); -my $preview=0; -if($op && $op eq 'preview'){ - $preview = 1; -} else { - my @serialnums=$input->param('serialid'); - if (@serialnums) { # i.e. they have been flagged to generate claims - my $err; - eval { - $err = SendAlerts('claimissues',\@serialnums,$input->param("letter_code")); - if ( not ref $err or not exists $err->{error} ) { - UpdateClaimdateIssues(\@serialnums); - } - }; - if ( $@ ) { - $template->param(error_claim => $@); - } elsif ( ref $err and exists $err->{error} ) { - if ( $err->{error} eq "no_email" ) { - $template->param( error_claim => 'no_vendor_email' ); - } elsif ( $err->{error} =~ m|Bad or missing From address| ) { - $template->param( error_claim => 'no_loggedin_user_email' ); - } - } else { - $template->param( info_claim => 1 ); +my @serialnums=$input->param('serialid'); +if (@serialnums) { # i.e. they have been flagged to generate claims + my $err; + eval { + $err = SendAlerts('claimissues',\@serialnums,$input->param("letter_code")); + if ( not ref $err or not exists $err->{error} ) { + UpdateClaimdateIssues(\@serialnums); } + }; + if ( $@ ) { + $template->param(error_claim => $@); + } elsif ( ref $err and exists $err->{error} ) { + if ( $err->{error} eq "no_email" ) { + $template->param( error_claim => 'no_vendor_email' ); + } elsif ( $err->{error} =~ m|Bad or missing From address| ) { + $template->param( error_claim => 'no_loggedin_user_email' ); + } + } else { + $template->param( info_claim => 1 ); } } @@ -100,7 +95,6 @@ $template->param( phone => $supplierinfo[0]->{phone}, booksellerfax => $supplierinfo[0]->{booksellerfax}, bookselleremail => $supplierinfo[0]->{bookselleremail}, - preview => $preview, missingissues => \@missingissues, supplierid => $supplierid, claimletter => $claimletter, -- 2.39.5