Koha/koha-tmpl/intranet-tmpl/prog/en/modules/tools/overduerules.tt
Owen Leonard 26d3520ed7
Bug 33927: Improve translation of title tags: Tools
This patch modifies tools templates so that title tags can be
more easily translated. The patch also makes some modifications to
titles, breadcrumb navigation, and page headers in order to make them
more consistent with each other and with other similar pages.

To test, apply the patch and go to Tools. Test each of the following
pages and each variation of the page to confirm that titles,
breadcrumbs, and page headers look correct.

- Tools home page
- Import patrons
  - Import results
- Notices and slips
  - Main page
    - Main page filtered by library
    - New notice
    - Edit notice
      - Preview notice: With a CHECKIN, CHECKOUT, or HOLD_SLIP notice,
        fill in the "Data for preview" box in the "Email" section.
        Although the template loads in a modal window which doesn't show
        the page title, you can confirm that there are no errors.
- Overdue notice/status triggers
- Batch patron deletion
  - Confirmation page
- Batch patron modification
- Batch extend due dates
- Upload patron images

Print notices: With useDischarge enabled, log into the OPAC as a
user with no checkouts. Go to the "Ask for a discharge" tab and click
"Ask for a discharge."

Locate the patron's record in the staff interface and click "Discharges"
in the left-hand sidebar menu. Click "Generate discharge." Open the
resulting PDF file in a browser. The page title should be "Print notices
for [date]."

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-22 10:52:49 -03:00

195 lines
12 KiB
Text

[% USE raw %]
[% USE Asset %]
[% USE Koha %]
[% USE Branches %]
[% PROCESS 'i18n.inc' %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% FILTER collapse %]
[% t("Overdue notice/status triggers") | html %] &rsaquo;
[% t("Tools") | html %] &rsaquo;
[% t("Koha") | html %]
[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="tools_overduerules" class="tools">
[% WRAPPER 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
[% END %]
[% WRAPPER 'sub-header.inc' %]
[% WRAPPER breadcrumbs %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Overdue notice/status triggers</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>
<h1>Defining [% IF ( branch ) %]overdue actions for [% Branches.GetName( branch ) | html %][% ELSE %]default overdue actions[% END %]</h1>
<div class="help">
<p>Delay is the number of days after a checkout is due before an action is triggered. </p>
<p>If you want Koha to trigger an action (send a letter or restrict a member), a delay value is required.</p>
<p>Columns must be filled left to right: if the first column is blank, other columns will be ignored. </p>
</div>
<form method="post" action="/cgi-bin/koha/tools/overduerules.pl" id="selectlibrary">
<label for="branch">Select a library:</label>
<select id="branch" name="branch">
<option value="">Default</option>
[% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %]
</select>
<input type="submit" class="btn btn-primary" value="Select" />
</form>
[% IF ( ERROR ) %]
<div class="dialog alert">
<h3>Data error</h3>
<p>The following errors were found. Please correct them and submit again:</p>
<ul>
[% IF ( ERRORDELAY ) %]
<li>Delay [% ERRORDELAY | html %] for [% BORERR | html %] patron category has some unexpected characters. There should be only numerical characters. </li>
[% END %]
[% IF ( ERRORUSELESSDELAY ) %]
<li>No letter or restriction action specified for delay [% ERRORUSELESSDELAY | html %] for [% BORERR | html %] patron category. If a delay is supplied, either a letter, restrict action, or both should be specified.</li>
[% END %]
[% IF ( ERRORORDER ) %]
<li>The first notice's delay should be less than the second, which should be less than the third for the <strong>[% BORERR | html %]</strong> patron category </li>
[% END %]
</ul>
</div>
[% END %]
[% IF ( table ) %]
<form method="post" action="/cgi-bin/koha/tools/overduerules.pl">
<input type="hidden" name="op" value="save" />
<input type="hidden" name="branch" value="[% branch | html %]" />
<h3>Rules for overdue actions: [% IF ( branch ) %][% Branches.GetName( branch ) | html %][% ELSE %] default library [% END %]</h3>
[% IF ( datasaved ) %]<div class="dialog message">Changes saved.</div> [% END %]
[% WRAPPER tabs id= "rulestabs" %]
[% WRAPPER tabs_nav %]
[% FOR tab IN tabs %]
[% WRAPPER tab_item tabname= tab.id %][% END %]
[% END %]
[% END # /WRAPPER tabs_nav %]
[% WRAPPER tab_panels %]
[% FOR tab IN tabs %]
[% WRAPPER tab_panel tabname=tab.id %]
<table>
<thead>
<tr>
<th>&nbsp;</th>
<th scope="col">Delay</th>
<th scope="col">Letter</th>
<th scope="col">Restrict</th>
[% FOREACH mtt IN message_transport_types %]
[% NEXT IF mtt == 'itiva' AND !Koha.Preference('TalkingTechItivaPhoneNotification') %]
[% NEXT IF mtt == 'phone' AND !Koha.Preference('PhoneNotification') %]
<th scope="col">
[% SWITCH mtt %]
[% CASE 'email' %]<span>Email</span>
[% CASE 'print' %]<span>[% tp('Message transport type', 'Print') | html %]</span>
[% CASE 'sms' %]<span>SMS</span>
[% CASE 'feed' %]<span>Feed</span>
[% CASE 'itiva' %]<span>Phone (i-tiva)</span>
[% CASE 'phone' %]<span>Phone</span>
[% CASE %]<span>[% mtt | html %]</span>
[% END %]
</th>
[% END %]
</tr>
</thead>
<tbody>
[% FOREACH value IN tab.values %]
<tr>
<th scope="row">[% value.line | html %]</th>
<td>
<input type="text" inputmode="numeric" pattern="[0-9]*" name="delay[% tab.number | html %]-[% value.overduename | html %]" value="[% value.delay | html %]" />
</td>
<td>
<select name="letter[% tab.number | html %]-[% value.overduename | html %]">
<option value="">No notice</option>
[% FOREACH letter IN letters %]
[% IF letter.code == value.selected_lettercode %]
<option value="[% letter.code | html %]" selected="selected">[% letter.name | html %] ( [% letter.code | html %] )</option>
[% ELSE %]
<option value="[% letter.code | html %]">[% letter.name | html %] ( [% letter.code | html %] )</option>
[% END %]
[% END %]
</select>
</td>
<td>
[% IF ( value.debarred ) %]
<input type="checkbox" name="debarred[% tab.number | html %]-[% value.overduename | html %]" checked="checked" value="1" />
[% ELSE %]
<input type="checkbox" name="debarred[% tab.number | html %]-[% value.overduename | html %]" value="1" />
[% END %]
</td>
[% FOREACH mtt IN value.message_transport_types %]
[% NEXT IF mtt.value == 'itiva' AND !Koha.Preference('TalkingTechItivaPhoneNotification') %]
[% NEXT IF mtt.value == 'phone' AND !Koha.Preference('PhoneNotification') %]
<td>
[% IF mtt.selected %]
<input type="checkbox" name="mtt[% tab.number | html %]-[% value.overduename | html %]" value="[% mtt.value | html %]" checked="checked" />
[% ELSE %]
[% IF mtt.value == "sms" and not Koha.Preference("SMSSendDriver") %]
<input type="checkbox" name="mtt[% tab.number | html %]-[% value.overduename | html %]" value="[% mtt.value | html %]" disabled="disabled" />
[% ELSE %]
<input type="checkbox" name="mtt[% tab.number | html %]-[% value.overduename | html %]" value="[% mtt.value | html %]" />
[% END %]
[% END %]
</td>
[% END # /FOREACH mtt %]
</tr>
[% END # /FOREACH value %]
</tbody>
</table>
[% END # /tab_panel# %]
[% END %]
[% END # /WRAPPER tab_panels %]
[% END # /WRAPPER tabs %]
<fieldset class="action"><input type="submit" class="btn btn-primary" value="Save changes" /></fieldset>
</form>
[% ELSE %]
<div class="warning">You don't have patron categories defined, or the patron categories are not set to receive overdue notices.</div>
<div class="warning">If this is not what you were expecting, go to <a href="../admin/categories.pl">patron categories</p></div>
[% END %]
</main>
</div> <!-- /.col-sm-10.col-sm-push-2 -->
<div class="col-sm-2 col-sm-pull-10">
<aside>
[% INCLUDE 'tools-menu.inc' %]
</aside>
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
</div> <!-- /.row -->
[% MACRO jsinclude BLOCK %]
[% Asset.js("js/tools-menu.js") | $raw %]
<script>
var tab_map = { "0" : _("First"), "1" : _("Second"), "2" : _("Third")};
$(document).ready(function() {
$('#selectlibrary').find("input:submit").hide();
$('#branch').change(function() {
$('#selectlibrary').submit();
});
$("#rulestabs li > a").each( function( i ){
$(this).html(tab_map[ i ]);
});
if( $("#rulestabs .tab-pane.active").length < 1 ){
$("#rulestabs a:first").tab("show");
}
});
</script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]