Bugzilla – Attachment 147994 Details for
Bug 33177
Use include file for subfield constraints in both authority and bibliographic frameworks
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33177: Use include file for subfield constraints in both authority and bibliographic frameworks
Bug-33177-Use-include-file-for-subfield-constraint.patch (text/plain), 61.38 KB, created by
Owen Leonard
on 2023-03-09 12:17:29 UTC
(
hide
)
Description:
Bug 33177: Use include file for subfield constraints in both authority and bibliographic frameworks
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2023-03-09 12:17:29 UTC
Size:
61.38 KB
patch
obsolete
>From 65560a0ec0fd3ac9e629bb5a5a52e3105e5f76db Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 9 Mar 2023 11:53:37 +0000 >Subject: [PATCH] Bug 33177: Use include file for subfield constraints in both > authority and bibliographic frameworks > >This patch creates a new include file, subfields-structure-form.inc, >which can be used by both auth_subfields_structure.tt and >marc_subfields_structure.tt. Conditional logic in the template handles >the small differences between the two systems. > >To test, apply the patch and restart Koha services. > >- Go to Administration -> MARC bibliograhpic framework > - In the "Actions" menu for one of your frameworks, choose "MARC > structure." > - In the "Actions" menu for one of the tags, choose "Edit subfields" > - Test the subfield constraints entry form by making multiple changes > and confirming that the changes are saved correctly. > - Try making multiple changes under multiple tabs. > - Try creating a new subfield under the "New" tab. > >Perform the same tests under Administration -> Authority types. Note the >differences between the two versions: > > - The biblio version has "Important," "Max length," checkboxes for > "Visibility," and a text input for "Link." > - The authority version has a dropdown for "Visibility" and "Koha > link." >--- > admin/auth_subfields_structure.pl | 40 +-- > .../en/includes/subfields-structure-form.inc | 263 ++++++++++++++++++ > .../modules/admin/auth_subfields_structure.tt | 180 +----------- > .../modules/admin/marc_subfields_structure.tt | 206 +------------- > 4 files changed, 280 insertions(+), 409 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/subfields-structure-form.inc > >diff --git a/admin/auth_subfields_structure.pl b/admin/auth_subfields_structure.pl >index 2198561752..9b18097851 100755 >--- a/admin/auth_subfields_structure.pl >+++ b/admin/auth_subfields_structure.pl >@@ -122,7 +122,6 @@ if ($op eq 'add_form') { > $row_data{tagsubfield} = ""; > $row_data{liblibrarian} = ""; > $row_data{libopac} = ""; >- $row_data{seealso} = ""; > $row_data{hidden} = "000"; > $row_data{repeatable} = 0; > $row_data{mandatory} = 0; >@@ -148,36 +147,26 @@ if ($op eq 'add_form') { > } elsif ($op eq 'add_validate') { > $template->param(tagfield => "$input->param('tagfield')"); > my @tagsubfield = $input->multi_param('tagsubfield'); >- my @liblibrarian = $input->multi_param('liblibrarian'); >- my @libopac = $input->multi_param('libopac'); > my @kohafield = ''.$input->param('kohafield'); >- my @tab = $input->multi_param('tab'); >- my @seealso = $input->multi_param('seealso'); >- my @ohidden = $input->multi_param('ohidden'); >- my @authorised_value_categories = $input->multi_param('authorised_value'); > my $authtypecode = $input->param('authtypecode'); > my @frameworkcodes = $input->multi_param('frameworkcode'); >- my @value_builder =$input->multi_param('value_builder'); >- my @defaultvalue = $input->multi_param('defaultvalue'); > > my $display_order; > for (my $i=0; $i<= $#tagsubfield ; $i++) { >- my $tagfield =$input->param('tagfield'); >- my $tagsubfield =$tagsubfield[$i]; >- $tagsubfield="@" unless $tagsubfield ne ''; >- my $liblibrarian =$liblibrarian[$i]; >- my $libopac =$libopac[$i]; >- my $repeatable =$input->param("repeatable$i")?1:0; >- my $mandatory =$input->param("mandatory$i")?1:0; >- my $kohafield =$kohafield[$i]; >- my $tab =$tab[$i]; >- my $seealso =$seealso[$i]; >- my $authorised_value = $authorised_value_categories[$i]; >- my $frameworkcode =$frameworkcodes[$i]; >- my $value_builder=$value_builder[$i]; >- my $defaultvalue = $defaultvalue[$i]; >- my $hidden = $ohidden[$i]; #collate from 3 hiddens; >- my $isurl = $input->param("isurl$i")?1:0; >+ my $tagfield = $input->param('tagfield'); >+ my $tagsubfield = $tagsubfield[$i]; >+ my $liblibrarian = $input->param("liblibrarian_$i"); >+ my $libopac = $input->param("libopac_$i"); >+ my $repeatable = $input->param("repeatable_$i") ? 1 : 0; >+ my $mandatory = $input->param("mandatory_$i") ? 1 : 0; >+ my $kohafield = $input->param("kohafield_$i"); >+ my $tab = $input->param("tab_$i"); >+ my $defaultvalue = $input->param("defaultvalue_$i"); >+ my $authorised_value = $input->param("authorised_value_$i"); >+ my $frameworkcode = $frameworkcodes[$i]; >+ my $value_builder = $input->param("value_builder_$i"); >+ my $hidden = $input->param("hidden_$i"); >+ my $isurl = $input->param("isurl_$i") ? 1 : 0; > if ($liblibrarian) { > my $ass = Koha::Authority::Subfields->find( > { >@@ -193,7 +182,6 @@ if ($op eq 'add_form') { > mandatory => $mandatory, > kohafield => $kohafield, > tab => $tab, >- seealso => $seealso, > authorised_value => $authorised_value, > frameworkcode => $frameworkcode, > value_builder => $value_builder, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/subfields-structure-form.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/subfields-structure-form.inc >new file mode 100644 >index 0000000000..1474bc6bde >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/subfields-structure-form.inc >@@ -0,0 +1,263 @@ >+[% BLOCK setsubfield %][% FILTER collapse %] >+ [% IF ( loo.tagsubfield ) %] >+ [% SET subfield = loo.tagsubfield %] >+ [% ELSE %] >+ [% SET subfield = loo.subfieldcode %] >+ [% END %] >+[% END %][% END %] >+ >+<div id="subfieldtabs" class="toptabs numbered"> >+ <ul class="nav nav-tabs" role="tablist"> >+ [% FOREACH loo IN loop %] >+ [% PROCESS setsubfield %] >+ <li id="tab_subfield_[%- PROCESS outputsubfield subfieldanchor = subfield -%]" class="tab-item" role="presentation"> >+ [% IF ( loo.new_subfield ) %] >+ <a href="#sub[%- PROCESS outputsubfield subfieldanchor = subfield -%]field" aria-controls="sub[%- PROCESS outputsubfield subfieldanchor = subfield -%]field" role="tab" data-toggle="tab" title="[% loo.liblibrarian | html_entity %]">New</a> >+ [% ELSE %] >+ <a href="#sub[%- PROCESS outputsubfield subfieldanchor = subfield -%]field" aria-controls="sub[%- PROCESS outputsubfield subfieldanchor = subfield -%]field" role="tab" data-toggle="tab" title="[% loo.liblibrarian | html_entity %]"> >+ [% subfield | html %] >+ </a> >+ [% END %] >+ </li> >+ [% END %] >+ </ul> >+ >+ <div class="tab-content"> >+ >+ [% FOREACH loo IN loop %] >+ [% PROCESS setsubfield %] >+ <div class="constraints tab-pane" role="tabpanel" id="sub[%- PROCESS outputsubfield subfieldanchor = subfield -%]field"> >+ <input type="hidden" name="tab_id" value="[% loo.row | html %]" /> >+ <div id="basic[%- PROCESS outputsubfield subfieldanchor = subfield -%]field" class="constraints"> >+ <fieldset class="rows"> >+ <legend>Basic constraints</legend> >+ <ol> >+ [% IF ( subfield == 0 || subfield ) %] >+ <li> >+ <span class="label">Subfield code:</span> >+ [% subfield | html %] >+ <input type="hidden" name="tagsubfield" value="[% subfield | html %]" /> >+ </li> >+ [% ELSE %] >+ <li> >+ <label for="tagsubfield[% loo.row | html %]">Subfield code:</label> >+ <input type="text" id="tagsubfield[% loo.row | html %]" name="tagsubfield" value="[% subfield | html %]" /> >+ </li> >+ [% END %] >+ <li> >+ <label for="liblibrarian[% loo.row | html %]">Text for librarian: </label> >+ <input id="liblibrarian[% loo.row | html %]" type="text" name="liblibrarian_[% loo.row | html %]" value="[% loo.liblibrarian | html_entity %]" size="40" maxlength="80" /> >+ </li> >+ <li> >+ <label for="libopac_[% loo.row | html %]">Text for OPAC: </label> >+ <input type="text" id="libopac_[% loo.row | html %]" name="libopac_[% loo.row | html %]" value="[% loo.libopac | html_entity %]" size="40" maxlength="80" /> >+ </li> >+ <li> >+ <label for="repeatable[% loo.row | html %]">Repeatable: </label> >+ [% IF loo.repeatable %] >+ <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable_[% loo.row | html %]" checked="checked" value="1" /> >+ [% ELSE %] >+ <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable_[% loo.row | html %]" value="1" /> >+ [% END %] >+ </li> >+ <li> >+ <label for="mandatory[% loo.row | html %]">Mandatory: </label> >+ [% IF loo.mandatory %] >+ <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory_[% loo.row | html %]" checked="checked" value="1" /> >+ [% ELSE %] >+ <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory_[% loo.row | html %]" value="1" /> >+ [% END %] >+ </li> >+ [% IF ( biblioframework ) %] >+ <li> >+ <label for="important[% loo.row | html %]">Important: </label> >+ [% IF loo.important %] >+ <input type="checkbox" id="important[% loo.row | html %]" name="important_[% loo.row | html %]" checked="checked" value="1" /> >+ [% ELSE %] >+ <input type="checkbox" id="important[% loo.row | html %]" name="important_[% loo.row | html %]" value="1" /> >+ [% END %] >+ </li> >+ [% END %] >+ <li> >+ <label for="tab[% loo.row | html %]">Managed in tab: </label> >+ <select name="tab_[% loo.row | html %]" id="tab[% loo.row | html %]"> >+ [%- IF ( loo.tab == -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 == t ) -%] >+ <option value="[%- t | html -%]" selected="selected">[%- t | html -%]</option> >+ [%- ELSE -%] >+ <option value="[%- t | html -%]">[%- t | html -%]</option> >+ [%- END -%] >+ [%- END -%] >+ [%- IF ( biblioframework ) %] >+ [% SET tabten = t("Items (10)") %] >+ [% ELSE %] >+ [% SET tabten = "10" %] >+ [% END %] >+ [%- IF ( loo.tab == 10 ) -%] >+ <option value="10" selected="selected">[% tabten | html %]</option> >+ [%- ELSE -%] >+ <option value="10">[% tabten | html %]</option> >+ [%- END -%] >+ </select> >+ <div class="hint"><i class="fa fa-warning"></i> <span>Ignore means that the subfield does not display in the record editor and that its value, if any, is deleted from the record</span></div> >+ </li> >+ </ol> >+ </fieldset><!-- /.rows --> >+ </div> <!-- /#basic[%- PROCESS outputsubfield subfieldanchor = subfieldcode -%] --> >+ >+ <div id="advanced[%- PROCESS outputsubfield subfieldanchor = subfield -%]" class="constraints"> >+ <fieldset class="rows"> >+ <legend>Advanced constraints</legend> >+ <ol> >+ <li> >+ <label for="defaultvalue[% loo.row | html %]">Default value:</label> >+ <input type="text" name="defaultvalue_[% loo.row | html %]" id="defaultvalue[% loo.row | html %]" value="[% loo.defaultvalue | html %]" /> >+ </li> >+ [% IF ( biblioframework ) %] >+ <li> >+ <label for="maxlength[% loo.row | html %]">Max length:</label> >+ <input type="text" id="maxlength[% loo.row | html %]" name="maxlength_[% loo.row | html %]" value="[% loo.maxlength | html %]" size="4" /> >+ </li> >+ [% END %] >+ <li> >+ <label for="hidden[% loo.row | html %]">Visibility:</label> >+ [% IF ( biblioframework ) %] >+ [% IF loo.hidden_protected %] >+ <input type="hidden" id="hidden-[% loo.row | html %]" name="hidden_[% loo.row | html %]" value="[% loo.hidden | html %]" data-koha-protected="1" /> >+ [% ELSE %] >+ <input type="hidden" id="hidden-[% loo.row | html %]" name="hidden_[% loo.row | html %]" value="[% loo.hidden | html %]" /> >+ [% END %] >+ <input type="checkbox" id="hidden_opac_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_opac_[% loo.row | html %]"/> >+ <label for="hidden_opac_[% loo.row | html %]" style="float: none;">OPAC</label> >+ <input type="checkbox" id="hidden_intranet_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_intranet_[% loo.row | html %]"/> >+ <label for="hidden_intranet_[% loo.row | html %]" style="float: none;">Staff interface</label> >+ <input type="checkbox" id="hidden_editor_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_editor_[% loo.row | html %]"/> >+ <label for="hidden_editor_[% loo.row | html %]" style="float: none;">Editor</label> >+ <input type="checkbox" id="hidden_collapsed_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_collapsed_[% loo.row | html %]"/> >+ <label for="hidden_collapsed_[% loo.row | html %]" style="float: none;">Collapsed</label> >+ <input type="checkbox" id="hidden_flagged_[% loo.row | html %]" name="flagged_[% loo.row | html %]"/> >+ <label for="hidden_flagged_[% loo.row | html %]" style="float: none;">Flagged</label> >+ [% ELSE %] >+ <select name="hidden_[% loo.row | html %]" id="hidden_[% loo.row | html %]"> >+ [%- IF ( loo.hidden == 0 ) -%] >+ <option value= "0" selected="selected">Show all</option> >+ <option value="1">Hide all</option> >+ [%- ELSE -%] >+ [%# All other non-zero values mean: Hide %] >+ <option value= "0">Show all</option> >+ <option value="1" selected="selected">Hide all</option> >+ [%- END -%] >+ </select> >+ [% END %] >+ </li> >+ <li> >+ <label for="isurl[% loo.row | html %]">Is a URL:</label> >+ [% IF loo.isurl %] >+ <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl_[% loo.row | html %]" checked="checked" value="1" /> >+ [% ELSE %] >+ <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl_[% loo.row | html %]" value="1" /> >+ [% END %] >+ <span class="hint">If checked, it means that the subfield is a URL and can be clicked</span> >+ </li> >+ [% IF ( biblioframework ) %] >+ <li> >+ <label for="link[% loo.row | html %]">Link:</label> >+ <input type="text" id="link[% loo.row | html %]" name="link_[% loo.row | html %]" value="[% loo.link | html %]" size="10" maxlength="80" /> >+ <div class="hint">An index name, e.g. title or Local-Number</div> >+ </li> >+ [% END %] >+ [% UNLESS ( biblioframework ) %] >+ <li> >+ <label for="kohafield[% loo.row | html %]">Koha link:</label> >+ <select name="kohafield_[% loo.row | html %]" id="kohafield[% loo.row | html %]"> >+ [%- FOREACH value IN loo.kohafields %] >+ [% IF ( value == loo.kohafield && value.length>0 ) -%] >+ <option value="[% value | html %]" selected="selected">[% value | html %]</option> >+ [%- ELSIF ( value == loo.kohafield ) -%] >+ <option value="[% value | html %]" selected="selected"> </option> >+ [%- ELSIF ( value.length==0 ) -%] >+ <option value="[% value | html %]"> </option> >+ [%- ELSE -%] >+ <option value="[% value | html %]">[% value | html %]</option> >+ [%- END -%] >+ [%- END %] >+ </select> >+ </li> >+ [% END %] >+ </ol> >+ [% IF ( biblioframework ) %] >+ <input type="hidden" name="kohafield_[% loo.row | html %]" value="[% loo.kohafield | html %]"/> >+ [% END %] >+ </fieldset> >+ </div> <!-- /#advanced[%- PROCESS outputsubfield subfieldanchor = subfieldcode -%] --> >+ >+ <div id="oth[%- PROCESS outputsubfield subfieldanchor = subfield -%]" class="constraints"> >+ <fieldset class="rows"> >+ <legend>Other options (choose one)</legend> >+ <ol> >+ <li> >+ <label for="authorised_value[% loo.row | html %]">Authorized value:</label> >+ <select name="authorised_value_[% loo.row | html %]" id="authorised_value[% loo.row | html %]"> >+ <option value=""></option> >+ [% FOREACH value IN loo.authorised_values %] >+ [% IF ( value == loo.authorised_value ) %] >+ <option value="[% value | html %]" selected="selected">[% value | html %]</option> >+ [% ELSE %] >+ <option value="[% value | html %]">[% value | html %]</option> >+ [% END %] >+ [% END %] >+ </select> >+ </li> >+ <li> >+ [% IF ( biblioframework ) %] >+ <label for="authtypecode[% loo.row | html %]">Thesaurus:</label> >+ <select name="authtypecode_[% loo.row | html %]" id="authtypecode[% loo.row | html %]"> >+ [% FOREACH value IN loo.authtypes %] >+ [% IF ( value == loo.authtypecode ) %] >+ <option value="[% value | html %]" selected="selected">[% value | html %]</option> >+ [% ELSE %] >+ <option value="[% value | html %]">[% value | html %]</option> >+ [% END %] >+ [% END %] >+ </select> >+ [% ELSE %] >+ <label for="frameworkcode[% loo.row | html %]">Thesaurus:</label> >+ <select name="frameworkcode" id="frameworkcode[% loo.row | html %]"> >+ [%- FOREACH value IN loo.frameworkcodes %] >+ [% IF ( value == loo.frameworkcode && value.length>0 ) -%] >+ <option value="[% value | html %]" selected="selected">[% value | html %]</option> >+ [%- ELSIF ( value == loo.frameworkcode ) -%] >+ <option value="[% value | html %]" selected="selected"> </option> >+ [%- ELSIF ( value.length==0 ) -%] >+ <option value="[% value | html %]"> </option> >+ [%- ELSE -%] >+ <option value="[% value | html %]">[% value | html %]</option> >+ [%- END -%] >+ [%- END %] >+ </select> >+ [% END %] >+ </li> >+ <li> >+ <label for="value_builder[% loo.row | html %]">Plugin:</label> >+ <select name="value_builder_[% loo.row | html %]" id="value_builder[% loo.row | html %]"> >+ [% FOREACH value IN loo.value_builders %] >+ [% IF ( value == loo.value_builder ) %] >+ <option value="[% value | html %]" selected="selected">[% value | html %]</option> >+ [% ELSE %] >+ <option value="[% value | html %]">[% value | html %]</option> >+ [% END %] >+ [% END %] >+ </select> >+ </li> >+ </ol> >+ </fieldset> <!-- /.rows --> >+ </div> <!-- /#oth[%- PROCESS outputsubfield subfieldanchor = subfieldcode -%] --> >+ </div><!-- /constraints --> >+ [% END # /FOREACH loo %] >+ </div> <!-- /.tab-content --> >+</div><!-- /subfieldtabs --> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt >index 9db4d0c8b7..8867881cf1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt >@@ -89,7 +89,6 @@ > <input type="hidden" name="op" value="add_validate" /> > <input type="hidden" name="tagfield" value="[% tagfield | html %]" /> > <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" /> >- <fieldset class="action"><input type="submit" class="btn btn-primary" value="Save changes" /> <a class="cancel" href="/cgi-bin/koha/admin/auth_subfields_structure.pl?tagfield=[% tagfield | uri %]&authtypecode=[% authtypecode | uri %]">Cancel</a></fieldset> > > [% BLOCK outputsubfield %][% FILTER collapse %] > [% SWITCH ( subfieldanchor ) %] >@@ -102,184 +101,9 @@ > [% END %] > [% END %][% END %] > >- <div id="subfieldtabs" class="toptabs numbered"> >- <ul class="nav nav-tabs" role="tablist"> >- [% FOREACH loo IN loop %] >- <li role="presentation" id="tab_subfield_[%- PROCESS outputsubfield subfieldanchor = loo.tagsubfield -%]"> >- [% IF ( loo.new_subfield ) %] >- <a href="#sub[%- PROCESS outputsubfield subfieldanchor = loo.tagsubfield -%]field" aria-controls="sub[%- PROCESS outputsubfield subfieldanchor = loo.tagsubfield -%]field" role="tab" data-toggle="tab" title="[% loo.liblibrarian | html %]">New</a> >- [% ELSE %] >- <a href="#sub[%- PROCESS outputsubfield subfieldanchor = loo.tagsubfield -%]field" aria-controls="sub[%- PROCESS outputsubfield subfieldanchor = loo.tagsubfield -%]field" role="tab" data-toggle="tab" title="[% loo.liblibrarian | html %]">[% loo.tagsubfield | html %]</a> >- [% END %] >- </li> >- [% END %] >- </ul> >- <div class="tab-content"> >- [% FOREACH loo IN loop %] >- <div role="tabpanel" class="tab-pane" id="sub[%- PROCESS outputsubfield subfieldanchor = loo.tagsubfield -%]field"> >- <fieldset class="rows"><ol> >+ [% INCLUDE "subfields-structure-form.inc" %] > >- [% IF ( loo.new_subfield ) %] >- <li> >- <label for="tagsubfieldinput[% loo.row | html %]">Subfield code: </label> >- <input type="text" name="tagsubfield" value="[% loo.tagsubfield | html %]" size="1" id="tagsubfield" maxlength="1" /> >- </li> >- [% ELSE %] >- <li> >- <input type="hidden" name="tagsubfield" value="[% loo.tagsubfield | html %]" /> >- </li> >- [% END %] >- <li> >- <label for="repeatable[% loo.row | html %]">Repeatable: </label> >- [% IF loo.repeatable %] >- <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" checked="checked" value="1" /> >- [% ELSE %] >- <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" value="1" /> >- [% END %] >- </li> >- <li> >- <label for="mandatory[% loo.row | html %]">Mandatory: </label> >- [% IF loo.mandatory %] >- <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" checked="checked" value="1" /> >- [% ELSE %] >- <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" value="1" /> >- [% END %] >- </li> >- <li><label for="liblibrarian[% loo.row | html %]">Text for librarian: </label><input id="liblibrarian[% loo.row | html %]" type="text" name="liblibrarian" value="[% loo.liblibrarian | html_entity %]" size="40" maxlength="80" /></li> >- <li><label for="libopac[% loo.row | html %]">Text for OPAC: </label><input type="text" id="libopac[% loo.row | html %]" name="libopac" value="[% loo.libopac | html_entity %]" size="40" maxlength="80" /></li> >- <li><label for="tab[% loo.row | html %]">Managed in tab: </label> >- <select name="tab" id="tab[% loo.row | html %]"> >- [%- IF ( loo.tab == -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', '10'] -%] >- [%- IF ( loo.tab == t && t.length>0 ) -%] >- <option value="[%- t | html -%]" selected="selected">[%- t | html -%]</option> >- [%- ELSIF ( loo.tab == t ) -%] >- <option value="[%- t | html -%]" selected="selected"> </option> >- [%- ELSE -%] >- <option value="[%- t | html -%]">[%- t | html -%]</option> >- [%- END -%] >- [%- END -%] >- </select> >- <div class="hint"><i class="fa fa-warning"></i> <span>Ignore means that the subfield does not display in the record editor and that its value, if any, is deleted from the record</span></div> >- </li> >- <li> >- <fieldset> >- <legend>Display</legend> >- <ol> >- <li><label for="ohidden[% loo.row | html %]">Select to display or not:</label> >- <select name="ohidden" id="ohidden[% loo.row | html %]"> >- [%- IF ( loo.hidden == 0 ) -%] >- <option value= "0" selected="selected">Show all</option> >- <option value="1">Hide all</option> >- [%- ELSE -%] >- [%# All other non-zero values mean: Hide %] >- <option value= "0">Show all</option> >- <option value="1" selected="selected">Hide all</option> >- [%- END -%] >- </select> >- </li> >- </ol> >- </fieldset> >- </li> >- <li> >- <fieldset class="rows"> >- <legend>Advanced constraints:</legend> >- <ol> >- <li> >- <label for="isurl[% loo.row | html %]">Is a URL:</label> >- [% IF loo.isurl %] >- <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" checked="checked" value="1" /> >- [% ELSE %] >- <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" value="1" /> >- [% END %] >- <span class="hint">If checked, it means that the subfield is a URL and can be clicked.</span> >- </li> >- <li> >- <label for="defaultvalue[% loo.row | html %]">Default value:</label> >- <input type="text" name="defaultvalue" id="defaultvalue[% loo.row | html %]" value="[% loo.defaultvalue | html %]" /> >- </li> >- </ol> >- </fieldset> >- </li> >- <li> >- <fieldset><legend>Help input</legend> >- <ol> >- <li> >- <label for="kohafield[% loo.row | html %]">Koha field:</label> >- <select name="kohafield" id="kohafield[% loo.row | html %]"> >- [%- FOREACH value IN loo.kohafields %] >- [% IF ( value == loo.kohafield && value.length>0 ) -%] >- <option value="[% value | html %]" selected="selected">[% value | html %]</option> >- [%- ELSIF ( value == loo.kohafield ) -%] >- <option value="[% value | html %]" selected="selected"> </option> >- [%- ELSIF ( value.length==0 ) -%] >- <option value="[% value | html %]"> </option> >- [%- ELSE -%] >- <option value="[% value | html %]">[% value | html %]</option> >- [%- END -%] >- [%- END %] >- </select> >- </li> >- <li> >- <label for="authorised_value[% loo.row | html %]">Authorized value:</label> >- <select name="authorised_value" id="authorised_value[% loo.row | html %]"> >- [%- FOREACH value IN loo.authorised_values %] >- [% IF ( value == loo.authorised_value && value.length>0 ) -%] >- <option value="[% value | html %]" selected="selected">[% value | html %]</option> >- [%- ELSIF ( value == loo.authorised_value ) -%] >- <option value="[% value | html %]" selected> </option> >- [%- ELSIF ( value.length==0 ) -%] >- <option value="[% value | html %]"> </option> >- [%- ELSE -%] >- <option value="[% value | html %]">[% value | html %]</option> >- [%- END -%] >- [%- END %] >- </select> >- </li> >- <li> >- <label for="frameworkcode[% loo.row | html %]">Thesaurus:</label> >- <select name="frameworkcode" id="frameworkcode[% loo.row | html %]"> >- [%- FOREACH value IN loo.frameworkcodes %] >- [% IF ( value == loo.frameworkcode && value.length>0 ) -%] >- <option value="[% value | html %]" selected="selected">[% value | html %]</option> >- [%- ELSIF ( value == loo.frameworkcode ) -%] >- <option value="[% value | html %]" selected="selected"> </option> >- [%- ELSIF ( value.length==0 ) -%] >- <option value="[% value | html %]"> </option> >- [%- ELSE -%] >- <option value="[% value | html %]">[% value | html %]</option> >- [%- END -%] >- [%- END %] >- </select> >- </li> >- <li> >- <label for="value_builder[% loo.row | html %]">Plugin:</label> >- <select name="value_builder" id="value_builder[% loo.row | html %]"> >- [%- FOREACH value IN loo.value_builders %] >- [% IF ( value == loo.value_builder && value.length>0 ) -%] >- <option value="[% value | html %]" selected="selected">[% value | html %]</option> >- [%- ELSIF ( value == loo.value_builder ) -%] >- <option value="[% value | html %]" selected="selected"> </option> >- [%- ELSIF ( value.length==0 ) -%] >- <option value="[% value | html %]"> </option> >- [%- ELSE -%] >- <option value="[% value | html %]">[% value | html %]</option> >- [%- END -%] >- [%- END %] >- </select> >- </li> >- </ol> >- </fieldset> >- </li> >- </ol></fieldset><br class="clear" /> >- </div> >- [% END %] >- </div> <!-- /.tab-content --> >- </div> >+ <fieldset class="action"><input type="submit" class="btn btn-primary" value="Save changes" /> <a class="cancel" href="/cgi-bin/koha/admin/auth_subfields_structure.pl?tagfield=[% tagfield | uri %]&authtypecode=[% authtypecode | uri %]">Cancel</a></fieldset> > </form> > [% END %] > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt >index 95df1dbfd6..69a6667a29 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt >@@ -138,211 +138,7 @@ > [% END %] > [% END %][% END %] > >- <div id="subfieldtabs" class="toptabs numbered"> >- <ul class="nav nav-tabs" role="tablist"> >- [% FOREACH loo IN loop %] >- <li id="tab_subfield_[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]" class="tab-item" role="presentation"> >- [% IF ( loo.new_subfield ) %] >- <a href="#sub[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]field" aria-controls="sub[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]field" role="tab" data-toggle="tab" title="[% loo.liblibrarian | html_entity %]">New</a> >- [% ELSE %] >- <a href="#sub[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]field" aria-controls="sub[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]field" role="tab" data-toggle="tab" title="[% loo.liblibrarian | html_entity %]"> >- [% loo.subfieldcode | html %] >- </a> >- [% END %] >- </li> >- [% END %] >- </ul> >- >- <div class="tab-content"> >- >- [% FOREACH loo IN loop %] >- <div class="constraints tab-pane" role="tabpanel" id="sub[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]field"> >- <input type="hidden" name="tab_id" value="[% loo.row | html %]" /> >- <div id="basic[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]" class="contraints"> >- <fieldset class="rows"> >- <legend>Basic constraints</legend> >- <ol> >- [% IF ( loo.subfieldcode == 0 || loo.subfieldcode ) %] >- <li> >- <span class="label">Subfield code:</span> >- [% loo.subfieldcode | html %] >- <input type="hidden" id="tagsubfield[% loo.row | html %]" name="tagsubfield" value="[% loo.subfieldcode | html %]" /> >- </li> >- [% ELSE %] >- <li> >- <label for="tagsubfield[% loo.row | html %]">Subfield code:</label> >- <input type="text" id="tagsubfield[% loo.row | html %]" name="tagsubfield" value="[% loo.subfieldcode | html %]" /> >- </li> >- [% END %] >- <li> >- <label for="liblibrarian[% loo.row | html %]">Text for librarian: </label> >- <input id="liblibrarian[% loo.row | html %]" type="text" name="liblibrarian_[% loo.row | html %]" value="[% loo.liblibrarian | html_entity %]" size="40" maxlength="80" /> >- </li> >- <li> >- <label for="libopac[% loo.row | html %]">Text for OPAC: </label> >- <input type="text" id="libopac[% loo.row | html %]" name="libopac_[% loo.row | html %]" value="[% loo.libopac | html_entity %]" size="40" maxlength="80" /> >- </li> >- <li> >- <label for="repeatable[% loo.row | html %]">Repeatable: </label> >- [% IF loo.repeatable %] >- <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable_[% loo.row | html %]" checked="checked" value="1" /> >- [% ELSE %] >- <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable_[% loo.row | html %]" value="1" /> >- [% END %] >- </li> >- <li> >- <label for="mandatory[% loo.row | html %]">Mandatory: </label> >- [% IF loo.mandatory %] >- <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory_[% loo.row | html %]" checked="checked" value="1" /> >- [% ELSE %] >- <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory_[% loo.row | html %]" value="1" /> >- [% END %] >- </li> >- <li> >- <label for="important[% loo.row | html %]">Important: </label> >- [% IF loo.important %] >- <input type="checkbox" id="important[% loo.row | html %]" name="important_[% loo.row | html %]" checked="checked" value="1" /> >- [% ELSE %] >- <input type="checkbox" id="important[% loo.row | html %]" name="important_[% loo.row | html %]" value="1" /> >- [% END %] >- </li> >- <li><label for="tab[% loo.row | html %]">Managed in tab: </label> >- <select name="tab_[% loo.row | html %]" tabindex="" id="tab[% loo.row | html %]"> >- [%- IF ( loo.tab == -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 == t ) -%] >- <option value="[%- t | html -%]" selected="selected">[%- t | html -%]</option> >- [%- ELSE -%] >- <option value="[%- t | html -%]">[%- t | html -%]</option> >- [%- END -%] >- [%- END -%] >- [%- IF ( loo.tab == 10 ) -%] >- <option value="10" selected="selected">items (10)</option> >- [%- ELSE -%] >- <option value="10">items (10)</option> >- [%- END -%] >- </select> >- <div class="hint"><i class="fa fa-warning"></i> <span>Ignore means that the subfield does not display in the record editor and that its value, if any, is deleted from the record</span></div> >- </li> >- </ol> >- </fieldset> <!-- /.rows --> >- </div> <!-- /#basic[%- PROCESS outputsubfield subfieldanchor = subfieldcode -%] --> >- >- <div id="advanced[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]" class="contraints"> >- <fieldset class="rows"> >- <legend>Advanced constraints</legend> >- <ol> >- <li> >- <label for="defaultvalue[% loo.row | html %]">Default value:</label> >- <input type="text" name="defaultvalue_[% loo.row | html %]" id="defaultvalue[% loo.row | html %]" value="[% loo.defaultvalue | html %]" /> >- </li> >- <li> >- <label for="maxlength[% loo.row | html %]">Max length:</label> >- <input type="text" id="maxlength[% loo.row | html %]" name="maxlength_[% loo.row | html %]" value="[% loo.maxlength | html %]" size="4" /> >- </li> >- <li> >- [% IF loo.hidden_protected %] >- <input type="hidden" id="hidden-[% loo.row | html %]" name="hidden_[% loo.row | html %]" value="[% loo.hidden | html %]" data-koha-protected="1" /> >- [% ELSE %] >- <input type="hidden" id="hidden-[% loo.row | html %]" name="hidden_[% loo.row | html %]" value="[% loo.hidden | html %]" /> >- [% END %] >- <label for="hidden[% loo.row | html %]">Visibility: </label> >- <input type="checkbox" id="hidden_opac_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_opac_[% loo.row | html %]"/> >- <label for="hidden_opac_[% loo.row | html %]" style="float: none;">OPAC</label> >- <input type="checkbox" id="hidden_intranet_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_intranet_[% loo.row | html %]"/> >- <label for="hidden_intranet_[% loo.row | html %]" style="float: none;">Staff interface</label> >- <input type="checkbox" id="hidden_editor_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_editor_[% loo.row | html %]"/> >- <label for="hidden_editor_[% loo.row | html %]" style="float: none;">Editor</label> >- <input type="checkbox" id="hidden_collapsed_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_collapsed_[% loo.row | html %]"/> >- <label for="hidden_collapsed_[% loo.row | html %]" style="float: none;">Collapsed</label> >- <input type="checkbox" id="hidden_flagged_[% loo.row | html %]" name="flagged_[% loo.row | html %]"/> >- <label for="hidden_flagged_[% loo.row | html %]" style="float: none;">Flagged</label> >- </li> >- <li> >- <label for="isurl[% loo.row | html %]">Is a URL:</label> >- [% IF loo.isurl %] >- <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl_[% loo.row | html %]" checked="checked" value="1" /> >- [% ELSE %] >- <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl_[% loo.row | html %]" value="1" /> >- [% END %] >- <span class="hint">If checked, it means that the subfield is a URL and can be clicked</span> >- </li> >- <li> >- <label for="link[% loo.row | html %]">Link:</label> >- <input type="text" id="link[% loo.row | html %]" name="link_[% loo.row | html %]" value="[% loo.link | html %]" size="10" maxlength="80" /> >- <div class="hint">An index name, e.g. title or Local-Number</div> >- </li> >- <li> >- <label for="kohafield[% loo.row | html %]">Koha link:</label> >- <!-- This select should be DISABLED; value is submitted by the following hidden input --> >- <select name="kohafield_[% loo.row | html %]" id="kohafield[% loo.row | html %]" disabled> >- [% FOREACH value IN loo.kohafields %] >- [% IF ( value == loo.kohafield ) %] >- <option value="[% value | html %]" selected="selected">[% value | html %]</option> >- [% ELSE %] >- <option value="[% value | html %]">[% value | html %]</option> >- [% END %] >- [% END %] >- </select> >- <!-- Do NOT remove this next hidden input! We need it to save kohafield. --> >- <input type="hidden" name="kohafield_[% loo.row | html %]" value="[% loo.kohafield | html %]"/> >- </li> >- </ol> >- </fieldset> <!-- /.rows --> >- </div> <!-- /#advanced[%- PROCESS outputsubfield subfieldanchor = subfieldcode -%] --> >- >- <div id="oth[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]" class="constraints"> >- <fieldset class="rows"> >- <legend>Other options (choose one)</legend> >- <ol> >- <li> >- <label for="authorised_value[% loo.row | html %]">Authorized value:</label> >- <select name="authorised_value_[% loo.row | html %]" id="authorised_value[% loo.row | html %]"> >- <option value=""></option> >- [% FOREACH value IN loo.authorised_values %] >- [% IF ( value == loo.authorised_value ) %] >- <option value="[% value | html %]" selected="selected">[% value | html %]</option> >- [% ELSE %] >- <option value="[% value | html %]">[% value | html %]</option> >- [% END %] >- [% END %] >- </select> >- </li> >- <li> >- <label for="authtypecode[% loo.row | html %]">Thesaurus:</label> >- <select name="authtypecode_[% loo.row | html %]" id="authtypecode[% loo.row | html %]"> >- [% FOREACH value IN loo.authtypes %] >- [% IF ( value == loo.authtypecode ) %] >- <option value="[% value | html %]" selected="selected">[% value | html %]</option> >- [% ELSE %] >- <option value="[% value | html %]">[% value | html %]</option> >- [% END %] >- [% END %] >- </select> >- </li> >- <li> >- <label for="value_builder[% loo.row | html %]">Plugin:</label> >- <select name="value_builder_[% loo.row | html %]" id="value_builder[% loo.row | html %]"> >- [% FOREACH value IN loo.value_builders %] >- [% IF ( value == loo.value_builder ) %] >- <option value="[% value | html %]" selected="selected">[% value | html %]</option> >- [% ELSE %] >- <option value="[% value | html %]">[% value | html %]</option> >- [% END %] >- [% END %] >- </select> >- </li> >- </ol> >- </fieldset> <!-- /.rows --> >- </div> <!-- /#oth[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%] --> >- </div><!-- /constraints --> >- [% END # /FOREACH loo %] >- </div> <!-- /.tab-content --> >- </div><!-- /subfieldtabs --> >+ [% INCLUDE "subfields-structure-form.inc" biblioframework = 1 %] > > <fieldset class="action"> > <input type="submit" class="btn btn-primary" value="Save changes" /> <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield | uri %]&frameworkcode=[% frameworkcode | uri %]" class="cancel">Cancel</a> >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33177
:
147994
|
150189