Bug 12704: Remove CGI::scrolling_list from unimarc_field_225a.pl
authorBernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Sun, 3 Aug 2014 00:40:35 +0000 (21:40 -0300)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Tue, 19 Aug 2014 15:44:03 +0000 (12:44 -0300)
This patch removes the only instance in this file

To test:
1. Apply the patch
2. If you have UNIMARC, search for a record, edit it,
and go to tag 225
If you don't, edit your framework and connect this
pluging to some tag/subtag
3. Clic on the plugin link. If you don't have any record
that correspond to the search, can remove the commented
line to have something to play
4. The collection pulldown was replaced, check that works,
select a value and press Ok

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes tests and QA script, tested according to test plan.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
cataloguing/value_builder/unimarc_field_225a.pl
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_225a.tt

index db3b4b8..0a0894b 100755 (executable)
@@ -142,14 +142,12 @@ sub plugin {
             
     } 
     @collections = sort @collections;
-    #  my @collections = ["test"];
-    my $collection = CGI::scrolling_list(
-        -name     => 'f1',
-        -values   => \@collections,
-        -default  => "$result",
-        -size     => 1,
-        -multiple => 0,
-    );
+    # my @collections = ( "test" );
+    my $collection = {
+            values  => \@collections,
+            default => "$result",
+    };
+
     $template->param(
         index      => $index,
         collection => $collection
index 0e234b2..e888db1 100644 (file)
@@ -7,7 +7,17 @@
     <div id="mainbloc">
         <form name="f_pop" onsubmit="report()" action="">
             <h2 class="authority">Collection</h2>
-            <p><label>Select a collection</label>[% collection %]</p>
+            <p><label>Select a collection</label>
+                <select name="f1" id="f1" size="1">
+                [% FOREACH value IN collection.values %]
+                  [% IF ( value == collection.default ) %]
+                    <option value="[% value %]" selected="selected">[% value %]</option>
+                  [% ELSE %]
+                    <option value="[% value %]">[% value %]</option>
+                  [% END %]
+                [% END %]
+                </select>
+            </p>
             OR new collection: <input type="text" value="" name="f2"/>
             <br/>
             <input type="submit" value="OK" class="button authority" />