Lines 53-68
Link Here
|
53 |
[% ELSE %] |
53 |
[% ELSE %] |
54 |
[% IF ( success ) %] |
54 |
[% IF ( success ) %] |
55 |
[% IF from_biblio.items.count == 0 %] |
55 |
[% IF from_biblio.items.count == 0 %] |
56 |
<div class="dialog alert"> |
56 |
<div class="dialog alert" id="del-bib-alert"> |
57 |
The record <em>[% from_biblio.title | html %]</em> has [% from_biblio.items.count | html %] attached items. |
57 |
<div id="del-bib-action"> |
58 |
<p> |
58 |
The record <em><a class="title" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% from_biblio.id | html %]">[% from_biblio.title | html %]</a></em> has [% from_biblio.items.count | html %] attached items. |
59 |
<button id="delete-biblio-btn" data-biblionumber="[% from_biblio.id | html %]"><i id="del-bib-spn" class="fa fa-spinner fa-pulse fa-fw" style="display:none"></i><i class="fa fa-fw fa-trash"></i> Delete record |
59 |
<p><button id="delete-biblio-btn" data-biblionumber="[% from_biblio.id | html %]"><i id="del-bib-spn" class="fa fa-spinner fa-pulse fa-fw" style="display:none"></i><i class="fa fa-fw fa-trash"></i> Delete record |
60 |
</button> |
60 |
</button></p> |
61 |
<span id="del-bib-success" style="display:none">Record deleted</span> |
61 |
</div> |
62 |
<span id="del-bib-failure" style="display:none">Attempt to delete record failed.</span> |
62 |
<p id="del-bib-result"> |
|
|
63 |
<span id="del-bib-success" style="display:none"><i class="fa fa-check success"></i> Record deleted</span> |
64 |
<span id="del-bib-failure" style="display:none"><i class="fa fa-warning"></i> Attempt to delete record failed.</span> |
63 |
</p> |
65 |
</p> |
64 |
</div> |
66 |
</div> |
65 |
<br/> |
|
|
66 |
[% END %] |
67 |
[% END %] |
67 |
|
68 |
|
68 |
<div class="dialog message">The item has successfully been attached to [% INCLUDE 'biblio-default-view.inc' %]<i>[% bibliotitle | html %]</i></a>. |
69 |
<div class="dialog message">The item has successfully been attached to [% INCLUDE 'biblio-default-view.inc' %]<i>[% bibliotitle | html %]</i></a>. |
Lines 116-133
Link Here
|
116 |
<script> |
117 |
<script> |
117 |
$("#delete-biblio-btn").on("click", function(){ |
118 |
$("#delete-biblio-btn").on("click", function(){ |
118 |
if ( confirm(_("Are you sure you want to delete this record?")) ) { |
119 |
if ( confirm(_("Are you sure you want to delete this record?")) ) { |
119 |
let btn = $(this); |
|
|
120 |
$("#del-bib-spn").show(); |
120 |
$("#del-bib-spn").show(); |
121 |
let biblionumber = $(this).data('biblionumber'); |
121 |
let biblionumber = $(this).data('biblionumber'); |
122 |
$.ajax({ |
122 |
$.ajax({ |
123 |
url: '/api/v1/biblios/' + biblionumber, |
123 |
url: '/api/v1/biblios/' + biblionumber, |
124 |
type: 'DELETE', |
124 |
type: 'DELETE', |
125 |
success: function(result) { |
125 |
success: function(result) { |
126 |
btn.hide(); |
126 |
$("#del-bib-action").hide(); |
127 |
$('#del-bib-success').show(); |
127 |
$('#del-bib-success').show(); |
|
|
128 |
$("#del-bib-alert").attr("class","dialog message") |
128 |
}, |
129 |
}, |
129 |
error: function(result) { |
130 |
error: function(result) { |
130 |
btn.hide(); |
131 |
$("#delete-biblio-btn").hide(); |
131 |
$('#del-bib-failure').show(); |
132 |
$('#del-bib-failure').show(); |
132 |
} |
133 |
} |
133 |
}); |
134 |
}); |
134 |
- |
|
|