Koha/koha-tmpl/intranet-tmpl/prog/en/modules/admin/items_search_fields.tt
Owen Leonard d10ce467f5
Bug 34401: Fix inconsistencies in Item search fields page titles, breadcrumbs, and headers
This patch fixes some inconsistencies in the item search fields
administration page, making sure the page title, breadcrumb navigation,
and page headers are consistent with each other.

The patch makes some changes to the way new item search fields are added
in order to keep the display consistent with other similar interfaces:
The "add" form is no longer shown dynamically from the page listing item
search fields. Clicking the "New search field" toolbar button will now
take you to the same template used for editing existing search fields.
This allows us to put the correct context into page title, breadcrumbs,
and headings.

To test, apply the patch and go to Administration -> Item search fields.
Test the process of adding a new search field and editing an existing
search field.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-17 14:45:29 -03:00

123 lines
5.6 KiB
Text

[% USE raw %]
[% USE Asset %]
[% PROCESS 'i18n.inc' %]
[% SET footerjs = 1 %]
[% USE AuthorisedValues %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% FILTER collapse %]
[% t("Item search fields") | html %] &rsaquo;
[% t("Administration") | html %] &rsaquo;
[% t("Koha") | html %]
[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="admin_itemssearchfields" class="admin">
[% WRAPPER 'header.inc' %]
[% INCLUDE 'prefs-admin-search.inc' %]
[% END %]
[% WRAPPER 'sub-header.inc' %]
[% WRAPPER breadcrumbs %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Item search fields</span>
[% END %]
[% END #/ WRAPPER breadcrumbs %]
[% END #/ WRAPPER sub-header.inc %]
<div class="main container-fluid">
<div class="row">
<div class="col-sm-10 col-sm-push-2">
<main>
<div id="toolbar" class="btn-toolbar">
<a class="btn btn-default" href="/cgi-bin/koha/admin/items_search_field.pl"><i class="fa fa-plus"></i> New search field</a>
</div>
[% IF field_added %]
<div class="dialog message">
Field successfully added
</div>
[% ELSIF field_not_added %]
<div class="dialog alert">
<p>Failed to add field. Please make sure the field name doesn't already exist.</p>
<p>Check logs for more details.</p>
</div>
[% ELSIF field_deleted %]
<div class="dialog message">
Field successfully deleted.
</div>
[% ELSIF field_not_deleted %]
<div class="dialog alert">
<p>Failed to delete field.</p>
<p>Check logs for more details.</p>
</div>
[% ELSIF field_updated %]
<div class="dialog message">
Field successfully updated
</div>
[% ELSIF field_not_updated %]
<div class="dialog alert">
<p>Failed to update field.</p>
<p>Check logs for more details.</p>
</div>
[% END %]
[% IF fields.size %]
<div id="search_fields_list">
<h1>Item search fields</h1>
<div class="page-section">
<table id="search_fields_table">
<thead>
<tr>
<th>Name</th>
<th>Label</th>
<th>MARC field</th>
<th>MARC subfield</th>
<th>Authorised values category</th>
<th class="noExport">Actions</th>
</tr>
</thead>
<tbody>
[% FOREACH field IN fields %]
<tr>
<td>[% field.name | html %]</td>
<td>[% field.label | html %]</td>
<td>[% field.tagfield | html %]</td>
<td>[% field.tagsubfield | html %]</td>
<td>[% field.authorised_values_category | html %]</td>
<td>
<a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/items_search_field.pl?name=[% field.name | html %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
<a class="field-delete btn btn-default btn-xs" href="/cgi-bin/koha/admin/items_search_fields.pl?op=del&name=[% field.name | html %]"><i class="fa fa-trash-can"></i> Delete</a>
</td>
</tr>
[% END %]
</tbody>
</table>
</div> <!-- /.page-section -->
</div> <!-- /#search_fields_list -->
[% ELSE %]
<h1>Item search fields</h1>
<div class="dialog message">
There are no item search fields defined.
</div>
[% 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 %]
[% Asset.js("js/admin-menu.js") | $raw %]
[% Asset.js("js/item_search_fields.js") | $raw %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]