my %row_data; # get a fresh hash for the row data
$row_data{defaultvalue} = $data->{defaultvalue};
$row_data{maxlength} = $data->{maxlength};
- $row_data{tab} = CGI::scrolling_list(
- -name => 'tab',
- -id => "tab$i",
- -values =>
- [ '-1', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10' ],
- -labels => {
- '-1' => 'ignore',
- '0' => '0',
- '1' => '1',
- '2' => '2',
- '3' => '3',
- '4' => '4',
- '5' => '5',
- '6' => '6',
- '7' => '7',
- '8' => '8',
- '9' => '9',
- '10' => 'items (10)',
- },
- -default => $data->{'tab'},
- -size => 1,
- -multiple => 0,
- );
+ $row_data{tab} = {
+ id => "tab$i",
+ default => $data->{'tab'},
+ };
+
$row_data{tagsubfield} =
$data->{'tagsubfield'}
. "<input type=\"hidden\" name=\"tagsubfield\" value=\""
$row_data{liblibrarian} = CGI::escapeHTML( $data->{'liblibrarian'} );
$row_data{libopac} = CGI::escapeHTML( $data->{'libopac'} );
$row_data{seealso} = CGI::escapeHTML( $data->{'seealso'} );
- $row_data{kohafield} = CGI::scrolling_list(
- -name => "kohafield",
- -id => "kohafield$i",
- -values => \@kohafields,
- -default => "$data->{'kohafield'}",
- -size => 1,
- -multiple => 0,
- );
- $row_data{authorised_value} = CGI::scrolling_list(
- -name => "authorised_value",
- -id => "authorised_value$i",
- -values => \@authorised_values,
- -default => $data->{'authorised_value'},
- -size => 1,
- -multiple => 0,
- );
- $row_data{value_builder} = CGI::scrolling_list(
- -name => "value_builder",
- -id => "value_builder$i",
- -values => \@value_builder,
- -default => $data->{'value_builder'},
- -size => 1,
- -multiple => 0,
- );
- $row_data{authtypes} = CGI::scrolling_list(
- -name => "authtypecode",
- -id => "authtypecode$i",
- -values => \@authtypes,
- -default => $data->{'authtypecode'},
- -size => 1,
- -multiple => 0,
- );
+ $row_data{kohafield} = {
+ id => "kohafield$i",
+ values => \@kohafields,
+ default => "$data->{'kohafield'}",
+ };
+ $row_data{authorised_value} = {
+ id => "authorised_value$i",
+ values => \@authorised_values,
+ default => $data->{'authorised_value'},
+ };
+ $row_data{value_builder} = {
+ id => "value_builder$i",
+ values => \@value_builder,
+ default => $data->{'value_builder'},
+ };
+ $row_data{authtypes} = {
+ id => "authtypecode$i",
+ values => \@authtypes,
+ default => $data->{'authtypecode'},
+ };
$row_data{repeatable} = CGI::checkbox(
-name => "repeatable$i",
-checked => $data->{'repeatable'} ? 'checked' : '',
$row_data{'subfieldcode'} = '';
$row_data{'maxlength'} = 9999;
- $row_data{tab} = CGI::scrolling_list(
- -name => 'tab',
- -id => "tab$i",
- -values =>
- [ '-1', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10' ],
- -labels => {
- '-1' => 'ignore',
- '0' => '0',
- '1' => '1',
- '2' => '2',
- '3' => '3',
- '4' => '4',
- '5' => '5',
- '6' => '6',
- '7' => '7',
- '8' => '8',
- '9' => '9',
- '10' => 'items (10)',
- },
- -default => "",
- -size => 1,
- -multiple => 0,
- );
+ $row_data{tab} = {
+ id => "tab$i",
+ default => $data->{'tab'},
+ };
$row_data{tagsubfield} =
"<input type=\"text\" name=\"tagsubfield\" value=\""
. $data->{'tagsubfield'}
$row_data{liblibrarian} = "";
$row_data{libopac} = "";
$row_data{seealso} = "";
- $row_data{kohafield} = CGI::scrolling_list(
- -name => 'kohafield',
- -id => "kohafield$i",
- -values => \@kohafields,
- -default => "",
- -size => 1,
- -multiple => 0,
- );
+ $row_data{kohafield} = {
+ id => "kohafield$i",
+ values => \@kohafields,
+ default => "$data->{'kohafield'}",
+ };
$row_data{hidden} = "";
$row_data{repeatable} = CGI::checkbox(
-name => "repeatable$i",
-value => 1,
-label => ''
);
- $row_data{value_builder} = CGI::scrolling_list(
- -name => "value_builder",
- -id => "value_builder$i",
- -values => \@value_builder,
- -default => $data->{'value_builder'},
- -size => 1,
- -multiple => 0,
- );
- $row_data{authorised_value} = CGI::scrolling_list(
- -name => "authorised_value",
- -id => "authorised_value$i",
- -values => \@authorised_values,
- -size => 1,
- -multiple => 0,
- );
- $row_data{authtypes} = CGI::scrolling_list(
- -name => "authtypecode",
- -id => "authtypecode$i",
- -values => \@authtypes,
- -size => 1,
- -multiple => 0,
- );
+ $row_data{value_builder} = {
+ id => "value_builder$i",
+ values => \@value_builder,
+ default => $data->{'value_builder'},
+ };
+ $row_data{authorised_value} = {
+ id => "authorised_value$i",
+ values => \@authorised_values,
+ default => $data->{'authorised_value'},
+ };
+ $row_data{authtypes} = {
+ id => "authtypecode$i",
+ values => \@authtypes,
+ default => $data->{'authtypecode'},
+ };
$row_data{link} = CGI::escapeHTML( $data->{'link'} );
$row_data{row} = $i;
push( @loop_data, \%row_data );
<li><label for="libopac[% loo.row %]">Text for OPAC: </label><input type="text" id="libopac[% loo.row %]" name="libopac" value="[% loo.libopac %]" size="40" maxlength="80" /></li>
<li><label for="repeatable[% loo.row %]">Repeatable: </label>[% loo.repeatable %]</li>
<li><label for="mandatory[% loo.row %]">Mandatory: </label>[% loo.mandatory %]</li>
- <li><label for="tab[% loo.row %]">Managed in tab: </label>[% loo.tab %] (ignore means that the subfield does not display in the record editor)</li>
+ <li><label for="tab[% loo.row %]">Managed in tab: </label>
+ <select name="tab" tabindex="" size="1" id="[% loo.tab.id %]">
+ [%- IF ( loo.tab.default == -1 ) -%]
+ <option value="-1" selected="selected">ignore</option>
+ [%- ELSE -%]
+ <option value="-1">ignore</option>
+ [%- END -%]
+ [%- FOREACH t IN [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] -%]
+ [%- IF ( loo.tab.default == t ) -%]
+ <option value="[%- t -%]" selected="selected">[%- t -%]</option>
+ [%- ELSE -%]
+ <option value="[%- t -%]">[%- t -%]</option>
+ [%- END -%]
+ [%- END -%]
+ [%- IF ( loo.tab.default == 10 ) -%]
+ <option value="10" selected="selected">items (10)</option>
+ [%- ELSE -%]
+ <option value="10">items (10)</option>
+ [%- END -%]
+ </select>
+ (ignore means that the subfield does not display in the record editor)
+ </li>
</ol>
</fieldset>
</div>
</li>
<li><label for="isurl[% loo.row %]">Is a URL:</label>[% loo.isurl %] (if checked, it means that the subfield is a URL and can be clicked)</li>
<li><label for="link[% loo.row %]">Link:</label><input type="text" id="link[% loo.row %]" name="link" value="[% loo.link %]" size="10" maxlength="80" /> (e.g., Title or Local-Number) <span class="error"><em>NOTE: If you change this value you must ask your administrator to run misc/batchRebuildBiblioTables.pl.</em></span></li>
- <li><label for="kohafield[% loo.row %]">Koha link:</label>[% loo.kohafield %]</li>
+ <li>
+ <label for="kohafield[% loo.row %]">Koha link:</label>
+ <select name="kohafield" id="[% loo.kohafield.id %]" size="1">
+ [% FOREACH value IN loo.kohafield.values %]
+ [% IF ( value == loo.kohafield.default ) %]
+ <option value="[% value %]" selected>[% value %]</option>
+ [% ELSE %]
+ <option value="[% value %]">[% value %]</option>
+ [% END %]
+ [% END %]
+ </select>
+ </li>
</ol>
</fieldset>
</div>
<div id="oth[% loo.urisubfieldcode %]">
<fieldset class="rows">
<ol>
- <li><label for="authorised_value[% loo.row %]">Authorized value:</label>[% loo.authorised_value %]</li>
- <li><label for="authtypecode[% loo.row %]">Thesaurus:</label>[% loo.authtypes %]</li>
- <li><label for="value_builder[% loo.row %]">Plugin:</label>[% loo.value_builder %]</li>
+ <li>
+ <label for="authorised_value[% loo.row %]">Authorized value:</label>
+ <select name="authorised_value" id="[% loo.authorised_value.id %]" size="1">
+ [% FOREACH value IN loo.authorised_value.values %]
+ [% IF ( value == loo.authorised_value.default ) %]
+ <option value="[% value %]" selected>[% value %]</option>
+ [% ELSE %]
+ <option value="[% value %]">[% value %]</option>
+ [% END %]
+ [% END %]
+ </select>
+ </li>
+ <li>
+ <label for="authtypecode[% loo.row %]">Thesaurus:</label>
+ <select name="authtypecode" id="[% loo.authtypes.id %]" size="1">
+ [% FOREACH value IN loo.authtypes.values %]
+ [% IF ( value == loo.authtypes.default ) %]
+ <option value="[% value %]" selected>[% value %]</option>
+ [% ELSE %]
+ <option value="[% value %]">[% value %]</option>
+ [% END %]
+ [% END %]
+ </select>
+ </li>
+ <li>
+ <label for="value_builder[% loo.row %]">Plugin:</label>
+ <select name="value_builder" id="[% loo.value_builder.id %]" size="1">
+ [% FOREACH value IN loo.value_builder.values %]
+ [% IF ( value == loo.value_builder.default ) %]
+ <option value="[% value %]" selected>[% value %]</option>
+ [% ELSE %]
+ <option value="[% value %]">[% value %]</option>
+ [% END %]
+ [% END %]
+ </select>
+ </li>
</ol>
</fieldset>
</div>