Koha/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-renew.tt
Jonathan Druart 62285d2de4 Bug 20351: Shortcut serials scripts if a blocking error appeared
The idea of output_and_exit_if_error (added by bug 18403) is to make sure
parameters are valid before executing the script.
If not (old or broken URLs), we shortcut everything coming next to display a
generic error ("object does not exist", "you do not have permission to do that", etc.)

This bug report fixes the scripts under serials/*.

Test plan:
Hit the script under the serials directory with an invalid subscriptionid parameter
and confirm you get an error instead of the normal view with empty values.

The goal is not to be exhaustive during the first iteration, but at least to fix
the most common views.

For instance:
/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=XXX
/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=XXX
/cgi-bin/koha/serials/routing.pl?subscriptionid=XXX&op=new
/cgi-bin/koha/serials/subscription-add.pl?op=modify&subscriptionid=XXx
/cgi-bin/koha/serials/subscription-add.pl?op=dup&subscriptionid=XXX

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-10-17 14:25:30 +00:00

62 lines
2.6 KiB
Text

[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
[% IF subscription %]
<title>Koha &rsaquo; Serials subscription renew #[% subscription.subscriptionid | html %]</title>
[% ELSE %]
<title>Koha &rsaquo; Serials subscription renew</title>
[% END %]
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="ser_subscription-renew" class="ser">
<div class="container-fluid">
[% INCLUDE 'blocking_errors.inc' %]
[% IF op == 'renew' OR op =='multi_renew' %]
[% IF op == 'renew' %]
<span>Subscription renewed.<span>
[% ELSE %]
<span>Subscriptions renewed.<span>
[% END %]
<div id="closewindow">
<a class="btn btn-default btn-default close" href="#">Close</a>
</div>
[% ELSE %]
<div id="bd">
<form name="f" action="/cgi-bin/koha/serials/subscription-renew.pl" method="post">
<input type="hidden" name="op" value="renew" />
<input type="hidden" name="subscriptionid" value="[% subscription.subscriptionid | html %]" />
<fieldset class="rows"><legend>Subscription renewal for [% subscription.bibliotitle | html %]</legend>
<ol>
<li>
<label for="startdate">Start date: </label>
<input type="text" size="10" id="startdate" name="startdate" value="[% startdate | html %]" class="datepicker"/>
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
</li>
<li><fieldset>
<legend>Subscription length:</legend>
<ol><li><label for="numberlength">Number of num:</label><input type="text" id="numberlength" name="numberlength" value="[% subscription.numberlength | html %]" /></li>
<li><label for="weeklength">Number of weeks: </label><input type="text" id="weeklength" name="weeklength" value="[% subscription.weeklength | html %]" /></li>
<li><label for="monthlength">Number of months: </label><input type="text" id="monthlength" name="monthlength" value="[% subscription.monthlength | html %]" /></li></ol></fieldset></li>
<li><label for="note">Note for the librarian that will manage your renewal request: </label>
<textarea name="note" id="note" rows="5" cols="50"></textarea></li></ol></fieldset>
<fieldset class="action"><input type="submit" value="Submit" class="button" /></fieldset>
</form>
[% END %]
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'calendar.inc' %]
<script type="text/javascript">
$(document).ready(function(){
$(".close").on("click", function(e){
e.preventDefault();
window.opener.location.reload(false);
self.close();
});
});
</script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' popup_window=1 %]