|
Lines 1-3
Link Here
|
|
|
1 |
/* global __ biblionumber count holdcount countorders countdeletedorders searchid addRecord */ |
| 2 |
/* exported GetZ3950Terms PopupZ3950Confirmed */ |
| 1 |
/* IF ( CAN_user_editcatalogue_edit_catalogue ) */ |
3 |
/* IF ( CAN_user_editcatalogue_edit_catalogue ) */ |
| 2 |
/* this function open a popup to search on z3950 server. */ |
4 |
/* this function open a popup to search on z3950 server. */ |
| 3 |
function PopupZ3950() { |
5 |
function PopupZ3950() { |
|
Lines 7-13
Link Here
|
| 7 |
} |
9 |
} |
| 8 |
} |
10 |
} |
| 9 |
function PopupZ3950Confirmed() { |
11 |
function PopupZ3950Confirmed() { |
| 10 |
if (confirm( MSG_REPLACE_RECORD )){ |
12 |
if (confirm( __("Please note that this external search could replace the current record.") )) { |
| 11 |
PopupZ3950(); |
13 |
PopupZ3950(); |
| 12 |
} |
14 |
} |
| 13 |
} |
15 |
} |
|
Lines 24-46
function confirm_deletion(link) {
Link Here
|
| 24 |
var order_manage_permission = $(link).data("order-manage"); |
26 |
var order_manage_permission = $(link).data("order-manage"); |
| 25 |
var is_confirmed; |
27 |
var is_confirmed; |
| 26 |
if (count > 0){ |
28 |
if (count > 0){ |
| 27 |
is_confirmed = alert( MSG_DELETE_ALL_ITEMS.format(count) ); |
29 |
is_confirmed = alert(__("%s item(s) are attached to this record. You must delete all items before deleting this record.").format(count)); |
| 28 |
} else if (countorders > 0){ |
30 |
} else if (countorders > 0){ |
| 29 |
if( order_manage_permission ){ |
31 |
if( order_manage_permission ){ |
| 30 |
is_confirmed = confirm( CONFIRM_RECORD_USED_IN_ORDERS.format(countorders) ); |
32 |
is_confirmed = confirm(__("Warning: This record is used in %s order(s). Deleting it could cause serious issues on acquisition module. Are you sure you want to delete this record?").format(countorders)); |
| 31 |
} else { |
33 |
} else { |
| 32 |
is_confirmed = alert( MSG_RECORD_USED_IN_ORDERS.format(countorders) ); |
34 |
is_confirmed = alert(__("%s order(s) are using this record. You need order managing permissions to delete this record.").format(countorders)); |
| 33 |
} |
35 |
} |
| 34 |
} else if (countdeletedorders > 0){ |
36 |
} else if (countdeletedorders > 0){ |
| 35 |
if( order_manage_permission ){ |
37 |
if( order_manage_permission ){ |
| 36 |
is_confirmed = confirm( CONFIRM_IN_DELETED_ORDERS.format(countdeletedorders) ); |
38 |
is_confirmed = confirm(__("%s deleted order(s) are using this record. Are you sure you want to delete this record?").format(countdeletedorders)); |
| 37 |
} else { |
39 |
} else { |
| 38 |
is_confirmed = alert( MSG_IN_DELETED_ORDERS.format(countdeletedorders) ); |
40 |
is_confirmed = alert(__("%s deleted order(s) are using this record. You need order managing permissions to delete this record.").format(countdeletedorders)); |
| 39 |
} |
41 |
} |
| 40 |
} else if ( holdcount > 0 ) { |
42 |
} else if ( holdcount > 0 ) { |
| 41 |
is_confirmed = confirm( CONFIRM_DELETION_HOLDS.format(holdcount) ); |
43 |
is_confirmed = confirm( __("%s holds(s) for this record. Are you sure you want to delete this record?").format(holdcount)); |
| 42 |
} else { |
44 |
} else { |
| 43 |
is_confirmed = confirm( CONFIRM_RECORD_DELETION ); |
45 |
is_confirmed = confirm( __("Are you sure you want to delete this record?") ); |
| 44 |
} |
46 |
} |
| 45 |
if (is_confirmed) { |
47 |
if (is_confirmed) { |
| 46 |
$("#deletebiblio").unbind('click'); |
48 |
$("#deletebiblio").unbind('click'); |
|
Lines 56-64
function confirm_deletion(link) {
Link Here
|
| 56 |
|
58 |
|
| 57 |
function confirm_items_deletion() { |
59 |
function confirm_items_deletion() { |
| 58 |
if ( holdcount > 0 ) { |
60 |
if ( holdcount > 0 ) { |
| 59 |
alert( MSG_DELETE_ALL_HOLDS.format(holdcount) ); |
61 |
alert(__("%s hold(s) on this record. You must delete all holds before deleting all items.").format(holdcount)); |
| 60 |
} else if ( count > 0 ) { |
62 |
} else if ( count > 0 ) { |
| 61 |
if( confirm( CONFIRM_DELETE_ITEMS.format(count) ) ) { |
63 |
if (confirm(__("Are you sure you want to delete the %s attached items?").format(count))) { |
| 62 |
window.location="/cgi-bin/koha/cataloguing/additem.pl?op=delallitems&biblionumber=" + biblionumber + (searchid ? "&searchid="+searchid : ""); |
64 |
window.location="/cgi-bin/koha/cataloguing/additem.pl?op=delallitems&biblionumber=" + biblionumber + (searchid ? "&searchid="+searchid : ""); |
| 63 |
} else { |
65 |
} else { |
| 64 |
return false; |
66 |
return false; |
|
Lines 70-76
function confirm_items_deletion() {
Link Here
|
| 70 |
} |
72 |
} |
| 71 |
|
73 |
|
| 72 |
function alertNoItems(){ |
74 |
function alertNoItems(){ |
| 73 |
alert( MSG_NO_ITEMS ); |
75 |
alert( __("This record has no items.") ); |
| 74 |
} |
76 |
} |
| 75 |
|
77 |
|
| 76 |
/* END IF CAN_user_editcatalogue_edit_items or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) */ |
78 |
/* END IF CAN_user_editcatalogue_edit_items or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) */ |
|
Lines 110-113
$(document).ready(function() {
Link Here
|
| 110 |
alertNoItems(); |
112 |
alertNoItems(); |
| 111 |
}) |
113 |
}) |
| 112 |
.tooltip(); |
114 |
.tooltip(); |
| 113 |
}); |
115 |
}); |
| 114 |
- |
|
|