(bug 3434) Fix generation of Serials Claims
authorColin Campbell <colin.campbell@ptfs-europe.com>
Wed, 22 Jul 2009 16:41:00 +0000 (17:41 +0100)
committerGalen Charlton <galen.charlton@liblime.com>
Fri, 31 Jul 2009 01:22:16 +0000 (21:22 -0400)
op was not being returned to claims.pl. It seems better logic
to use whether the there are ids the user has flagged for claims
to decide whether to generate the claims

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>

koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tmpl
serials/claims.pl

index e7d0b31..8ee9aed 100644 (file)
@@ -55,7 +55,6 @@
    <!-- TMPL_IF NAME="missingissues" -->       
     <form action="claims.pl" method="post">
         <input type="hidden" name="order" value="<!--TMPL_VAR Name="order"-->" />
-        <input type="hidden" name="op" value="" />
             <h3>Missing Issues</h3>
             <table id="claimst">
                 <thead><tr>
@@ -74,7 +73,7 @@
                     <tr>
                         <!--TMPL_IF NAME="letter" -->
                             <td>
-                    <input type="checkbox" name="serialid" value="<!-- TMPL_VAR NAME="serialid"-->" onclick="document.claims.op='send_alert';" />
+                    <input type="checkbox" name="serialid" value="<!-- TMPL_VAR NAME="serialid"-->" />
                             </td>
                         <!--/TMPL_IF-->
                         <td>
index b0a1e12..8fcea93 100755 (executable)
@@ -66,13 +66,13 @@ if($supplierid){
 my $preview=0;
 if($op eq 'preview'){
     $preview = 1;
-}
-
-if ($op eq "send_alert"){
-  my @serialnums=$input->param("serialid");
-  SendAlerts('claimissues',\@serialnums,$input->param("letter_code"));
-  my $cntupdate=UpdateClaimdateIssues(\@serialnums);
-  ### $cntupdate SHOULD be equal to scalar(@$serialnums)
+} else {
+    my @serialnums=$input->param('serialid');
+    if (@serialnums) { # i.e. they have been flagged to generate claims
+        SendAlerts('claimissues',\@serialnums,$input->param("letter_code"));
+        my $cntupdate=UpdateClaimdateIssues(\@serialnums);
+        ### $cntupdate SHOULD be equal to scalar(@$serialnums)  TODO so what do we do about it??
+    }
 }
 
 $template->param('letters'=>\@letters,'letter'=>$letter);