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 <paola.rossi@cineca.it>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
Jonathan Druart 2014-08-29 15:16:19 +02:00 committed by Tomas Cohen Arazi
parent 46e3f8169c
commit fd38d8c565
2 changed files with 18 additions and 100 deletions

View File

@ -9,7 +9,6 @@
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
[% UNLESS ( preview ) %]
var sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
"sDom": 't',
"aoColumnDefs": [
@ -19,7 +18,6 @@
],
"bPaginate": false
}));
[% END %]
$('#supplierid').change(function() {
$('#claims').submit();
});
@ -148,23 +146,15 @@
$("table#claimst tbody tr").show();
}
function popup(supplierid,serialid){
window.open('claims.pl?supplierid='+ supplierid +'&amp;serialid='+ serialid +'&amp;op=preview' ,'popup', 'width=600,height=400,toolbar=no,scrollbars=yes');
}
//]]>
</script>
</head>
<body id="ser_claims" class="ser">
[% INCLUDE 'header.inc' %]
[% UNLESS ( preview ) %]
[% INCLUDE 'serials-search.inc' %]
[% END %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> &rsaquo; Claims</div>
[% UNLESS ( preview ) %]
<div id="doc3" class="yui-t2">
<div id="bd">
@ -354,77 +344,11 @@
</fieldset>
[% END %]
[% ELSE %]
<div id="doc" class="yui-t7">
<div id="bd">
[% IF ( supplierloop ) %]
[% FOREACH supplierloo IN supplierloop %]
[% IF ( supplierloo.name ) %]
<p><b>[% supplierloo.name %]</b><br />
[% END %]
[% IF ( supplierloo.postal ) %]
[% supplierloo.postal %]<br />
[% END %]
[% IF ( supplierloo.contphone ) %]
Ph: [% supplierloo.contphone %]<br />
[% END %]
[% IF ( supplierloo.contfax ) %]
Fax: [% supplierloo.contfax %]<br />
[% END %]
[% IF ( supplierloo.contemail ) %]
Email: [% supplierloo.contemail %]<br />
[% END %]
[% IF ( supplierloo.accountnumber ) %]
A/C: [% supplierloo.accountnumber %]</p>
[% END %]
[% IF ( supplierloo.contact ) %]
<p>Dear [% supplierloo.contact %]</p>
[% ELSE %]
<p>To whom it may concern</p>
[% END %]
<p>The following items have not been received from you and are now considered missing:</p>
[% END %]
[% END %]
[% IF ( missingissues ) %]
<h3>Missing issues</h3>
<table>
<tr>
<td><b>Vendor<b></td>
<td><b>Title</b></td>
<td><b>Issue number</b></td>
<td><b>Missing since</b></td>
</tr>
[% FOREACH missingissue IN missingissues %]
<tr>
<td>
[% missingissue.name %]
</td>
<td>
[% missingissue.Title |html %]
</td>
<td>
[% missingissue.serialseq %]
</td>
<td>
[% missingissue.planneddate %]
</td>
</tr>
[% END %]
</table>
[% END %]
<p class="noprint"><a href="#" onclick="window.print(); return false;">Print</a> &nbsp; <a href="#" class="close">Close</a></p>
[% END %]
</div>
</div>
[% UNLESS ( preview ) %]
<div class="yui-b">
[% INCLUDE 'serials-menu.inc' %]
</div>
[% END %]
</div>
[% INCLUDE 'intranet-bottom.inc' %]

View File

@ -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,