|
Lines 36-43
function cancel_edit() {
Link Here
|
| 36 |
|
36 |
|
| 37 |
} |
37 |
} |
| 38 |
|
38 |
|
| 39 |
function delete_provider( id ) { |
39 |
function delete_provider( id, users ) { |
| 40 |
if ( confirm( _("Are you sure you want to delete ") + $("#name_" + id).html() + _("?") ) ) { |
40 |
var c; |
|
|
41 |
if ( users ) { |
| 42 |
c = confirm( _("Are you sure you want to delete %s? %s patron(s) are using it!").format( $("#name_" + id).html(), users ) ); |
| 43 |
} else { |
| 44 |
c = confirm( _("Are you sure you want to delete %s?").format( $("#name_" + id).html() ) ); |
| 45 |
} |
| 46 |
|
| 47 |
if ( c ) { |
| 41 |
$("#op").val('delete'); |
48 |
$("#op").val('delete'); |
| 42 |
$("#id").val( id ); |
49 |
$("#id").val( id ); |
| 43 |
$("#sms_form").submit(); |
50 |
$("#sms_form").submit(); |
|
Lines 79-85
function delete_provider( id ) {
Link Here
|
| 79 |
</td> |
86 |
</td> |
| 80 |
<td> |
87 |
<td> |
| 81 |
[% IF p.patrons_using %] |
88 |
[% IF p.patrons_using %] |
| 82 |
<a class="btn btn-danger" href="#" id="delete_[% p.id %]" class="delete" onclick="delete_provider( [% p.id %] );"> |
89 |
<a class="btn btn-danger" href="#" id="delete_[% p.id %]" class="delete" onclick="delete_provider( [% p.id %], [% p.patrons_using %] );"> |
| 83 |
<span style="color:white"><i class="fa fa-trash"></i> Delete</span> |
90 |
<span style="color:white"><i class="fa fa-trash"></i> Delete</span> |
| 84 |
</a> |
91 |
</a> |
| 85 |
[% ELSE %] |
92 |
[% ELSE %] |
| 86 |
- |
|
|