Bug 12613: Remove CGI::scrolling_list from koha2marclinks.pl

This patch removes all (2) instances from koha2marclinks.pl.
Also changes dropdowns width on mapping editor, from an
ugly ragged right to a fixed width view.

To test:
1. Apply the patch
2. Go to Administration > Koha to MARC mapping
3. Pulldown in this view has been replaced, check
for regressions: change table type and press Ok,
verify you get Koha fields and tag/subfield appropriate
for each table.
4. Now press 'Edit' on any field, go into mapping editor
5. Check that all pulldowns show tag/subtags relevant
for each group ( 000s ... 900s )
6. Check that current mapping is displayed correctly
7. Check for regressions: unmap, remap, press Ok,
verify, change again.
8. If you can, check display of mapping editor on several
browsers, just in case.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
I have tested with Firefox/Iceweasel only.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Also tested in Chromium.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
Bernardo Gonzalez Kriegel 2014-07-19 16:44:11 -03:00 committed by Tomas Cohen Arazi
parent 0d5541d1c8
commit 9db4eb85f3
2 changed files with 46 additions and 119 deletions

View file

@ -85,14 +85,10 @@ if ( $op eq 'add_form' ) {
{
push @marcarray, "$field $tagsubfield - $liblibrarian";
}
my $marclist = CGI::scrolling_list(
-name => 'marc',
-values => \@marcarray,
-default =>
"$defaulttagfield $defaulttagsubfield - $defaultliblibrarian",
-size => 1,
-multiple => 0,
);
my $marclist = {
values => \@marcarray,
default => "$defaulttagfield $defaulttagsubfield - $defaultliblibrarian",
};
$template->param( "marclist$i" => $marclist );
}
$template->param(
@ -154,19 +150,13 @@ q|select tagfield,tagsubfield,liblibrarian,kohafield from marc_subfield_structur
"$script_name?op=add_form&amp;tablename=$tablename&amp;kohafield=$field";
push( @loop_data, \%row_data );
}
my $tablenames = {
values => [ 'biblio', 'biblioitems', 'items' ],
default => $tablename,
};
$template->param(
loop => \@loop_data,
tablename => CGI::scrolling_list(
-name => 'tablename',
-values => [
'biblio',
'biblioitems',
'items',
],
-default => $tablename,
-size => 1,
-multiple => 0
)
tablename => $tablenames,
);
} #---- END $OP eq DEFAULT
output_html_with_http_headers $input, $cookie, $template->output;

View file

@ -28,105 +28,31 @@
[% IF ( add_form ) %]
<h1>Connect [% tablename %].[% kohafield %] to a MARC subfield</h1>
<p>Choose and validate 1 MARC subfield for <strong>[% tablename %].[% kohafield %]</strong>. That will modify <b>all frameworks</b> which is usually what you need, but you have been warned.</p>
<fieldset class="rows"><ol>
<li><form action="[% script_name %]" method="post"> <input type="hidden" name="op" value="add_validate" />
<input type="hidden" name="tablename" value="[% tablename %]" />
<input type="hidden" name="kohafield" value="[% kohafield %]" />
<label>000s</label>
[% marclist0 %] <input type="submit" value="OK" /></form>
</li>
<fieldset class="rows">
<ol>
[% FOR i IN [ 0 .. 9 ] %]
[% marclist = "marclist$i" %]
<li>
<form action="[% script_name %]" method="post">
<input type="hidden" name="op" value="add_validate" />
<input type="hidden" name="tablename" value="[% tablename %]" />
<label>100s</label>
[% marclist1 %]
<input type="hidden" name="kohafield" value="[% kohafield %]" /><input type="submit" value="OK" /> </form>
</li>
<li>
<form action="[% script_name %]" method="post"><input type="hidden" name="op" value="add_validate" />
<input type="hidden" name="tablename" value="[% tablename %]" />
<input type="hidden" name="kohafield" value="[% kohafield %]" />
<label>200s</label>
[% marclist2 %] <input type="submit" value="OK" /></form>
</li>
<li>
<form action="[% script_name %]" method="post">
<input type="hidden" name="op" value="add_validate" />
<input type="hidden" name="tablename" value="[% tablename %]" />
<input type="hidden" name="kohafield" value="[% kohafield %]" />
<label>300s</label>
[% marclist3 %] <input type="submit" value="OK" /> </form>
<label>[% i %]00s</label>
<select name="marc" id="marc" size="1" width="570" style="width: 570px;">
[% FOREACH value IN $marclist.values %]
[% IF ( value == $marclist.default ) %]
<option value="[% value %]" selected>[% value %]</option>
[% ELSE %]
<option value="[% value %]">[% value %]</option>
[% END %]
[% END %]
</select>
<input type="submit" value="OK" />
</form>
</li>
<li>
<form action="[% script_name %]" method="post">
<input type="hidden" name="op" value="add_validate" />
<input type="hidden" name="tablename" value="[% tablename %]" />
<input type="hidden" name="kohafield" value="[% kohafield %]" />
<label>400s</label>
[% marclist4 %] <input type="submit" value="OK" /></form>
</li>
<li>
<form action="[% script_name %]" method="post">
<input type="hidden" name="op" value="add_validate" />
<input type="hidden" name="tablename" value="[% tablename %]" />
<input type="hidden" name="kohafield" value="[% kohafield %]" />
<label>500s</label>
[% marclist5 %] <input type="submit" value="OK" /></form>
</li>
<li>
<form action="[% script_name %]" method="post">
<input type="hidden" name="op" value="add_validate" />
<input type="hidden" name="tablename" value="[% tablename %]" />
<input type="hidden" name="kohafield" value="[% kohafield %]" />
<label>600s</label>
[% marclist6 %] <input type="submit" value="OK" /></form>
</li>
<li>
<form action="[% script_name %]" method="post">
<input type="hidden" name="op" value="add_validate" />
<input type="hidden" name="tablename" value="[% tablename %]" />
<input type="hidden" name="kohafield" value="[% kohafield %]" />
<label>700s</label>
[% marclist7 %] <input type="submit" value="OK" /></form>
</li>
<li>
<form action="[% script_name %]" method="post">
<input type="hidden" name="op" value="add_validate" />
<input type="hidden" name="tablename" value="[% tablename %]" />
<input type="hidden" name="kohafield" value="[% kohafield %]" />
<label>800s</label>
[% marclist8 %] <input type="submit" value="OK" /></form>
</li>
<li>
<form action="[% script_name %]" method="post">
<input type="hidden" name="op" value="add_validate" />
<input type="hidden" name="tablename" value="[% tablename %]" />
<input type="hidden" name="kohafield" value="[% kohafield %]" />
<label>900s</label>
[% marclist9 %] <input type="submit" value="OK" /></form>
</li>
</ol></fieldset>
[% END %]
</ol>
</fieldset>
<fieldset class="action">
<form action="[% script_name %]" name="Aform" method="post">
<input type="hidden" name="op" value="add_validate" />
@ -144,7 +70,18 @@
<h1>Koha to MARC mapping [% tagfield %]</h1>
<form action="[% script_name %]" method="post">
<p>[% tablename %] <input type="submit" value="OK" /></p>
<p>
<select name="tablename" id="tablename" size="1">
[% FOREACH value IN tablename.values %]
[% IF ( value == tablename.default ) %]
<option value=[% value %] selected>[% value %]</option>
[% ELSE %]
<option value=[% value %]>[% value %]</option>
[% END %]
[% END %]
</select>
<input type="submit" value="OK" />
</p>
</form>
<table>
<tr>