|
Lines 30-69
Link Here
|
| 30 |
} |
30 |
} |
| 31 |
function printBiblio() {window.print(); } |
31 |
function printBiblio() {window.print(); } |
| 32 |
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %] |
32 |
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %] |
| 33 |
function confirm_deletion() { |
33 |
function confirm_deletion() { |
| 34 |
var count = [% count %]; |
34 |
var count = [% count %]; |
|
|
35 |
var holdcount = [% holdcount %]; |
| 36 |
|
| 35 |
var is_confirmed; |
37 |
var is_confirmed; |
| 36 |
if (count>0){ |
38 |
if (count > 0){ |
| 37 |
is_confirmed= alert(count + " " +_("item(s) are attached to this record.\nYou must delete all items before deleting this record.")); |
39 |
is_confirmed = alert( count + " " +_("item(s) are attached to this record.\nYou must delete all items before deleting this record.") ); |
| 38 |
} else{ |
40 |
} else if ( holdcount > 0 ) { |
| 39 |
is_confirmed= confirm(_("Are you sure you want to delete this record? ")); |
41 |
is_confirmed = confirm( holdcount + " " + _("holds(s) for this record \n Are you sure you want to delete this record?")); |
| 40 |
} |
42 |
} else { |
|
|
43 |
is_confirmed = confirm(_('Are you sure you want to delete this record? ')); |
| 44 |
} |
| 41 |
|
45 |
|
| 42 |
if (is_confirmed) { |
46 |
if (is_confirmed) { |
| 43 |
if (count>0){ |
47 |
if ( count > 0 || holdcount > 0 ){ |
| 44 |
// window.location="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]"; |
48 |
return false; |
| 45 |
} else { |
49 |
} else { |
| 46 |
window.location="/cgi-bin/koha/cataloguing/addbiblio.pl?op=delete&biblionumber=[% biblionumber %]"; |
50 |
window.location="/cgi-bin/koha/cataloguing/addbiblio.pl?op=delete&biblionumber=[% biblionumber %]"; |
| 47 |
} |
51 |
} |
| 48 |
} else { |
52 |
} else { |
| 49 |
return false; |
53 |
return false; |
| 50 |
} |
54 |
} |
| 51 |
} |
55 |
} |
| 52 |
[% END %] |
56 |
[% END %] |
|
|
57 |
|
| 53 |
[% IF ( CAN_user_editcatalogue_edit_items ) %] |
58 |
[% IF ( CAN_user_editcatalogue_edit_items ) %] |
| 54 |
function confirm_items_deletion() { |
59 |
function confirm_items_deletion() { |
| 55 |
var count = [% count %]; |
60 |
var count = [% count %]; |
| 56 |
if(count > 0){ |
61 |
var holdcount = [% holdcount %]; |
| 57 |
if(confirm(_("Are you sure you want to delete the") + " " + count + " " + _("attached items?"))){ |
62 |
|
|
|
63 |
if ( holdcount > 0 ) { |
| 64 |
alert( holdcount + " " + _("holds(s) for this record \n You must delete all holds before deleting all items.") ); |
| 65 |
} else if ( count > 0 ) { |
| 66 |
if( confirm( _("Are you sure you want to delete the") + " " + count + " " + _("attached items?") ) ) { |
| 58 |
window.location="/cgi-bin/koha/cataloguing/additem.pl?op=delallitems&biblionumber=[% biblionumber %]"; |
67 |
window.location="/cgi-bin/koha/cataloguing/additem.pl?op=delallitems&biblionumber=[% biblionumber %]"; |
| 59 |
}else{ |
68 |
} else { |
| 60 |
return false; |
69 |
return false; |
| 61 |
} |
70 |
} |
| 62 |
} else { |
71 |
} else { |
| 63 |
alert(_("This record has no items.")); |
72 |
alert(_("This record has no items.")); |
| 64 |
return false; |
73 |
return false; |
| 65 |
} |
74 |
} |
| 66 |
} |
75 |
} |
| 67 |
[% END %] |
76 |
[% END %] |
| 68 |
// prepare DOM for YUI Toolbar |
77 |
// prepare DOM for YUI Toolbar |
| 69 |
|
78 |
|
|
Lines 121-128
function confirm_items_deletion() {
Link Here
|
| 121 |
[% IF ( LocalCoverImages || OPACLocalCoverImages) %][% IF ( CAN_user_tools_upload_local_cover_images ) %]{ text: _("Upload image"), url: "/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber %]&filetype=image" },[% END %][% END %] |
130 |
[% IF ( LocalCoverImages || OPACLocalCoverImages) %][% IF ( CAN_user_tools_upload_local_cover_images ) %]{ text: _("Upload image"), url: "/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber %]&filetype=image" },[% END %][% END %] |
| 122 |
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Edit as new (duplicate)"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]&frameworkcode=&op=duplicate" },[% END %] |
131 |
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Edit as new (duplicate)"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]&frameworkcode=&op=duplicate" },[% END %] |
| 123 |
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Replace record via Z39.50"), onclick: {fn: PopupZ3950 } },[% END %] |
132 |
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Replace record via Z39.50"), onclick: {fn: PopupZ3950 } },[% END %] |
| 124 |
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Delete record"), onclick: {fn: confirm_deletion }[% IF ( count ) %],id:'disabled'[% END %] },[% END %] |
133 |
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Delete record"), onclick: {fn: confirm_deletion }[% IF ( count || holdcount ) %],id:'disabled'[% END %] },[% END %] |
| 125 |
[% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Delete all items"), onclick: {fn: confirm_items_deletion }[% UNLESS ( count ) %],id:'disabled'[% END %] }[% END %] |
134 |
[% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Delete all items"), onclick: {fn: confirm_items_deletion }[% IF ( count < 1 || holdcount ) %],id:'disabled2'[% END %] },[% END %] |
| 126 |
]; |
135 |
]; |
| 127 |
if(editmenu.length){ |
136 |
if(editmenu.length){ |
| 128 |
new YAHOO.widget.Button({ |
137 |
new YAHOO.widget.Button({ |
| 129 |
- |
|
|