Skip to content

Commit

Permalink
BWS-PKG - Bug 37294: Add modal to generate next
Browse files Browse the repository at this point in the history
To test:
1. Serials -> Create or find a subscription
2. Receive the subscription
3. Save
4. Click 'Generate next'
5. Nothing happens
6. APPLY PATCH
7. Try again, now the "Generate next" button should work as expected.

Signed-off-by: Kelly <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>
  • Loading branch information
ricofreak authored and kylemhall committed Jul 18, 2024
1 parent 5938a6b commit c134da3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
21 changes: 21 additions & 0 deletions koha-tmpl/intranet-tmpl/prog/en/includes/modals/generate_next.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<div id="generate_next" class="modal" tabindex="-1" role="dialog" aria-labelledby="generate_next" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<form action="/cgi-bin/koha/serials/serials-collection.pl" method="post">
[% INCLUDE 'csrf-token.inc' %]
<div class="modal-body">
<fieldset class="rows">
<legend>Do you really want to generate next serial?</legend>
<input type="hidden" name="op" value="cud-gennext" />
<input type="hidden" name="subscriptionid" value="[% subscriptionidlist || subscriptionid | html %]" />
</fieldset>
</div>

<div class="modal-footer">
<a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
<input type="submit" class="btn btn-default approve" value="Yes" />
</div>
</form>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@

[% INCLUDE 'modals/serials_skip_issues.inc' %]

[% INCLUDE 'modals/generate_next.inc' %]


[% UNLESS ( popup ) %]
[% INCLUDE 'serials-toolbar.inc' %]

Expand Down Expand Up @@ -182,7 +185,7 @@
<div class="btn-group"><input type="submit" value="Edit serials" class="btn btn-primary btn-sm" /></div>
[% UNLESS subscription.closed %]
<div class="btn-group">
<input type="button" value="Generate next" data-subscriptionid="[% subscriptionidlist | html %]" class="btn btn-default btn-sm generatenext" />
<input type="button" value="Generate next" data-subscriptionid="[% subscriptionidlist | html %]" href="#generate_next" class="btn btn-default btn-sm" data-toggle="modal" />
</div>
<div class="btn-group">
<input type="button" value="Skip issues and generate next" data-subscriptionid="[% subscriptionidlist | html %]" href="#skip_issues" class="btn btn-default btn-sm" data-toggle="modal" />
Expand Down Expand Up @@ -352,12 +355,6 @@
}
}

function generateNext(subscriptionid) {
if(confirm(_("Do you really want to generate next serial?"))){
document.location = 'serials-collection.pl?op=gennext&subscriptionid='+subscriptionid;
}
}

$(document).ready(function() {
if( $("#subscription_years .tab-pane.active").length < 1 ){
$("#subscription_years a:first").tab("show");
Expand Down

0 comments on commit c134da3

Please sign in to comment.