Replaced CGI dropdown box call wich is deprecated
authorJean-André Santoni <jeanandre.santoni@biblibre.com>
Mon, 22 Feb 2010 10:54:10 +0000 (11:54 +0100)
committerColin Campbell <colin.campbell@ptfs-europe.com>
Wed, 15 Dec 2010 12:00:13 +0000 (12:00 +0000)
Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>

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

index 20068b8..0600283 100644 (file)
      <!-- /TMPL_IF -->
 <!-- TMPL_UNLESS NAME="letter" --><div class="dialog alert">No claims notice defined. <a href="/cgi-bin/koha/tools/letter.pl">Please define one</a>.</div><!-- /TMPL_UNLESS -->
     <form id="claims" name="claims" action="claims.pl" method="post">
-    <fieldset><label for="supplierid">View: </label>
-        <select id="supplierid" size="1" name="supplierid">
-        <!-- TMPL_LOOP NAME="supplier_loop" -->
-          <option value="<!-- TMPL_VAR NAME="id" -->"<!--  TMPL_IF NAME="selected" --> selected="yes" <!-- /TMPL_IF -->><!-- TMPL_VAR NAME="name" -->       
-          </option>
-        <!-- /TMPL_LOOP -->
-        </select>
+    <fieldset>
+           <label for="supplierid">Supplier: </label>
+           <select id="supplierid" name="supplierid">
+               <!-- TMPL_LOOP name="suploop"-->
+                   <!-- TMPL_IF name="selected" -->
+                   <option value="<!-- TMPL_VAR name="id" -->" selected="selected" >
+                   <!-- TMPL_ELSE -->
+                   <option value="<!-- TMPL_VAR name="id" -->">
+                   <!-- /TMPL_IF -->
+                       <!-- TMPL_VAR name="name" -->
+                       (<!-- TMPL_VAR name="count" -->)
+                   </option>
+               <!-- /TMPL_LOOP -->
+           </select>
         <input type="submit" value="OK" />
         <!-- TMPL_IF name="phone" -->Phone: <!-- TMPL_VAR name="phone" --><!-- /TMPL_IF -->
         <!-- TMPL_IF name="booksellerfax" -->Fax: <!-- TMPL_VAR name="booksellerfax" --><!-- /TMPL_IF -->
index b723136..0a0375e 100755 (executable)
@@ -53,6 +53,16 @@ my ($template, $loggedinuser, $cookie)
             debug => 1,
             });
 
+my @suploop;
+for ( sort {$supplierlist{$a} cmp $supplierlist{$b} } keys %supplierlist ) {
+    my ($count, @dummy) = GetLateOrMissingIssues($_, "", $order);
+    push @suploop, {
+        id       => $_,
+        name     => $supplierlist{$_},
+        count    => $count,
+        selected => $_ == $supplierid,
+    };
+}
 
 my $letters = GetLetters('claimissues');
 my @letters;
@@ -82,7 +92,7 @@ if($op && $op eq 'preview'){
 $template->param('letters'=>\@letters,'letter'=>$letter);
 $template->param(
         order =>$order,
-        supplier_loop => $supplierlist,
+        suploop => \@suploop,
         phone => $supplierinfo[0]->{phone},
         booksellerfax => $supplierinfo[0]->{booksellerfax},
         bookselleremail => $supplierinfo[0]->{bookselleremail},