Main Koha release repository https://koha-community.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

268 lines
14 KiB

[% USE raw %]
[% USE Asset %]
[% USE AuthorisedValues %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Administration &rsaquo;
[% IF ( add_form ) %]MARC frameworks &rsaquo; [% IF heading_add_tag_p %]Add tag[% ELSE %]Modify tag[% END %] [% searchfield | html %][% END %]
[% IF ( delete_confirm ) %]MARC frameworks &rsaquo; Confirm deletion of tag '[% searchfield | html %]'[% END %]
[% IF ( delete_confirmed ) %]MARC frameworks &rsaquo; Data deleted[% END %]
[% IF ( else ) %]MARC frameworks[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="admin_marctagstructure" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'prefs-admin-search.inc' %]
<div id="breadcrumbs">
<a href="/cgi-bin/koha/mainpage.pl">Home</a>
&rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
&rsaquo; <a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC frameworks</a>
[% IF ( add_form ) %]
&rsaquo; <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% framework.frameworkcode | uri %]">[% IF framework %][% framework.frameworktext | html %] ([% framework.frameworkcode | html %])[% ELSE %]Default MARC framework[% END%]</a>
&rsaquo; [% IF heading_add_tag_p %]Add tag[% ELSE %]Modify tag[% END %] [% searchfield | html %]
[% ELSIF ( else ) %]
&rsaquo; <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% framework.frameworkcode | uri %]">[% IF framework %][% framework.frameworktext | html %] ([% framework.frameworkcode | html %])[% ELSE %]Default MARC framework[% END %]</a>
[% ELSIF ( delete_confirm ) %]
&rsaquo; <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% framework.frameworkcode | uri %]">[% IF framework %][% framework.frameworktext | html %] ([% framework.frameworkcode | html %])[% ELSE %]Default MARC framework[% END %]</a>
&rsaquo; Confirm deletion of tag '[% searchfield | html %]'
[% ELSIF ( delete_confirmed ) %]
&rsaquo; <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% framework.frameworkcode | uri %]">[% IF framework %][% framework.frameworktext | html %] ([% framework.frameworkcode | html %])[% ELSE %]Default MARC framework[% END %]</a>
&rsaquo; Data deleted
[% END %]
</div>
<div class="main container-fluid">
<div class="row">
<div class="col-sm-10 col-sm-push-2">
<main>
[% IF ( else ) %]
<div id="toolbar" class="btn-toolbar">
<a class="btn btn-default" id="addtag" href="/cgi-bin/koha/admin/marctagstructure.pl?op=add_form&amp;frameworkcode=[% framework.frameworkcode | uri %]"><i class="fa fa-plus"></i> New tag</a>
</div>[% END %]
<h1>MARC Framework for [% IF framework %][% framework.frameworktext | html %] ([% framework.frameworkcode | html %])[% ELSE %]default MARC framework[% END %]</h1>
[% IF ( add_form ) %]
<form action="[% script_name | html %]" name="Aform" method="post" class="validated">
<fieldset class="rows">
<legend>
[% IF heading_add_tag_p %]
Add tag
[% ELSE %]
Modify tag <input type="hidden" name="modif" value="1" />[% searchfield | html %]
[% END %]
</legend>
<input type="hidden" name="op" value="add_validate" />
<input type="hidden" name="frameworkcode" value="[% framework.frameworkcode | html %]" />
<ol>
<li>
[% IF ( heading_modify_tag_p ) %]
<input type="hidden" name="tagfield" value="[% searchfield | html %]" />
<span class="label">Tag:</span>
[% searchfield | html %]
[% ELSE %]
<label for="tagfield" class="required">Tag: </label>
<input id="tagfield" type="text" name="tagfield" value="[% searchfield | html %]" maxlength="3" size="3" required="required" class="required" />
<span class="required">Required</span>
[% END %]
</li>
<li><label for="liblibrarian">Label for lib: </label><input type="text" id="liblibrarian" name="liblibrarian" value="[% liblibrarian | html %]" size="40" maxlength="100" /></li>
<li><label for="libopac">Label for opac: </label><input type="text" id="libopac" name="libopac" value="[% libopac | html %]" size="40" maxlength="100" /></li>
<li><label for="repeatable">Repeatable: </label>
[% IF ( repeatable ) %]
<input type="checkbox" name="repeatable" id="repeatable" value="1" checked="checked" />
[% ELSE %]
<input type="checkbox" name="repeatable" id="repeatable" value="1" />
[% END %]
</li>
<li><label for="mandatory">Mandatory: </label>
[% IF ( mandatory ) %]
<input type="checkbox" name="mandatory" id="mandatory" value="1" checked="checked" />
[% ELSE %]
<input type="checkbox" name="mandatory" id="mandatory" value="1" />
[% END %]
</li>
<li><label for="important">Important: </label>
[% IF ( important ) %]
<input type="checkbox" name="important" id="important" value="1" checked="checked" />
[% ELSE %]
<input type="checkbox" name="important" id="important" value="1" />
[% END %]
</li>
<li><label for="ind1_defaultvalue">First indicator default value: </label>
<input id="ind1_defaultvalue" type="text" name="ind1_defaultvalue" value="[% ind1_defaultvalue | html %]" maxlength="1" size="1" />
</li>
<li><label for="ind2_defaultvalue">Second indicator default value: </label>
<input id="ind2_defaultvalue" type="text" name="ind2_defaultvalue" value="[% ind2_defaultvalue | html %]" maxlength="1" size="1" />
</li>
<li><label for="authorised_value">Authorized value: </label>
<select name="authorised_value" id="authorised_value" size="1">
<option value=""></option>
[% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => authorised_value ) %]
</select>
(if you select a value here, the indicators will be limited to the authorized value list)</li>
</ol></fieldset>
<fieldset class="action">
<input type="submit" value="Save changes" />
<a class="cancel" href="[% script_name | url %]?frameworkcode=[% framework.frameworkcode | uri %]">Cancel</a>
</fieldset>
</form>
[% END %]
[% IF ( delete_confirm ) %]
<div class="dialog alert">
<h3>Confirm deletion of tag <span class="ex">'[% searchfield | html %]'</span>?</h3>
<p>Tag: [% searchfield | html %]</p>
<p>Description: [% liblibrarian | html %]</p>
<form action="[% script_name | html %]" method="post">
<input type="hidden" name="op" value="delete_confirmed" />
<input type="hidden" name="searchfield" value="[% searchfield | html %]" />
<input type="hidden" name="frameworkcode" value="[% framework.frameworkcode | html %]" />
<button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this tag</button>
</form>
<form action="[% script_name | html %]" method="get"><input type="hidden" name="frameworkcode" value="[% framework.frameworkcode | html %]" />
<button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
</form>
</div>
[% END %]
[% IF ( delete_confirmed ) %]
<div class="dialog message"><h3>Tag deleted</h3>
<form action="[% script_name | html %]" method="post"><input type="hidden" name="frameworkcode" value="[% framework.frameworkcode | html %]" />
<button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button>
</form></div>
[% END %]
[% IF ( framework_create ) %]
<form action="[% script_name | html %]" method="post">
<input type="hidden" name="op" value="framework_create_confirm" />
<input type="hidden" name="frameworkcode" value="[% framework.frameworkcode | html %]" />
Create framework for [% framework.frameworkcode | html %] ([% framework.frameworktext | html %]) using
<select name="existingframeworkcode">
<option value="">Default</option>
[% FOREACH existingframeworkloo IN existingframeworkloop %]
<option value="[% existingframeworkloo.value | html %]">[% existingframeworkloo.frameworktext | html %]</option>
[% END %]
</select>
<input type="submit" value="OK" />
</form>
[% END %]
[% IF ( else ) %]
<form name="f" action="[% script_name | html %]" method="post">
<fieldset style="padding:.5em;">
<label for="tag_search"><strong>Search for tag:</strong> </label>
<input type="text" name="searchfield" id="tag_search" size="4" value="[% searchfield | html %]" />
<label for="frameworkcode"><strong>In framework:</strong> </label>
<select id="frameworkcode" name="frameworkcode">
<option value="">Default</option>
[% FOREACH f IN frameworks %]
[% IF f.frameworkcode == framework.frameworkcode %]
<option value="[% f.frameworkcode | html %]" selected="selected">[% f.frameworktext | html %]</option>
[% ELSE %]
<option value="[% f.frameworkcode | html %]">[% f.frameworktext | html %]</option>
[% END %]
[% END %]
</select>
<input type="submit" value="Search" />
<p> <label for="select_display">Display only used tags/subfields</label>
[% IF ( select_display ) %]
<input type="checkbox" name="select_display" id="select_display" value="True" checked="checked" />
[% ELSE %]
<input type="checkbox" name="select_display" id="select_display" value="True" />
[% END %]</p>
</fieldset>
</form>
<table id="table_marctagstructure">
<thead>
<tr>
<th>Tag</th>
<th>Lib</th>
<th>Repeatable</th>
<th>Mandatory</th>
<th>Important</th>
<th>Auth value</th>
<th>Indicator 1</th>
<th>Indicator 2</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
[% FOREACH loo IN loop %]
<tr>
<td>[% loo.tagfield | html %]</td>
<td>
[% loo.liblibrarian | html %]
[% IF ( select_display ) %]
[% FOREACH subfield IN loo.subfields %]
<p>
Tab:[% subfield.tab | html %] | $[% subfield.tagsubfield | html %]
[% subfield.liblibrarian | html %] [% IF ( subfield.kohafield ) %][% subfield.kohafield | html %][% END %][% IF ( subfield.repeatable ) %], repeatable[% END %][% IF ( subfield.mandatory ) %], Mandatory[% END %][% IF ( subfield.seealso ) %], See [% subfield.seealso | html %][% END %][% IF ( subfield.authorised_value ) %], [% subfield.authorised_value | html %][% END %][% IF ( subfield.authtypecode ) %], [% subfield.authtypecode | html %][% END %][% IF ( subfield.value_builder ) %], [% subfield.value_builder | html %][% END %]
</p>
[% END %]
[% END %]
</td>
<td>[% IF ( loo.repeatable ) %]Yes[% ELSE %]No[% END %]</td>
<td>[% IF ( loo.mandatory ) %]Yes[% ELSE %]No[% END %]</td>
<td>[% IF ( loo.important ) %]Yes[% ELSE %]No[% END %]</td>
<td>[% loo.authorised_value | html %]</td>
<td>[% loo.ind1_defaultvalue | html %]</td>
<td>[% loo.ind2_defaultvalue | html %]</td>
<td>
<div class="btn-group dropup">
<a class="btn btn-default btn-xs dropdown-toggle" id="marctagactions[% loo.tagfield | html %]" role="button" data-toggle="dropdown" href="#">
Actions <b class="caret"></b></a>
<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="marctagactions[% loo.tagfield | html %]">
<li><a href="?op=add_form&amp;searchfield=[% loo.tagfield | uri %]&amp;frameworkcode=[% framework.frameworkcode | uri %]"><i class="fa fa-pencil"></i> Edit tag</a></li>
<li><a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% loo.tagfield | uri %]&amp;frameworkcode=[% framework.frameworkcode | uri %]"><i class="fa fa-eye"></i> View subfields</a></li>
<li><a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?op=add_form&amp;tagfield=[% loo.tagfield | uri %]&amp;frameworkcode=[% framework.frameworkcode | uri %]"><i class="fa fa-pencil"></i> Edit subfields</a></li>
<li><a href="?op=delete_confirm&amp;searchfield=[% loo.tagfield | uri %]&amp;frameworkcode=[% framework.frameworkcode | uri %]"><i class="fa fa-trash"></i> Delete</a></li>
</ul>
</div>
</td>
</tr>
[% END %]
</tbody>
</table>
[% END %]
</main>
</div> <!-- /.col-sm-10.col-sm-push-2 -->
<div class="col-sm-2 col-sm-pull-10">
<aside>
[% INCLUDE 'admin-menu.inc' %]
</aside>
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
</div> <!-- /.row -->
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'datatables.inc' %]
[% Asset.js("js/admin-menu.js") | $raw %]
<script>
$(document).ready(function() {
$("#table_marctagstructure").dataTable($.extend(true, {}, dataTablesDefaults, {
"aoColumnDefs": [
{ "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
],
"sPaginationType": "full"
}));
$("#select_display").on("change",function(){
var checked = $(this).prop("checked") ? 1: 0;
Cookies.set("marctagstructure_selectdisplay", checked);
this.form.submit();
});
});
</script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]