Lines 24-64
Link Here
|
24 |
function addToShelf() { window.open('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?biblionumber=[% biblionumber %]','Add_to_virtualshelf','width=500,height=400,toolbar=false,scrollbars=yes'); |
24 |
function addToShelf() { window.open('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?biblionumber=[% biblionumber %]','Add_to_virtualshelf','width=500,height=400,toolbar=false,scrollbars=yes'); |
25 |
} |
25 |
} |
26 |
function printBiblio() {window.print(); } |
26 |
function printBiblio() {window.print(); } |
|
|
27 |
|
27 |
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %] |
28 |
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %] |
28 |
function confirm_deletion() { |
29 |
function confirm_deletion() { |
29 |
var count = [% count %]; |
30 |
var count = [% count %]; |
|
|
31 |
var holdcount = [% holdcount %]; |
32 |
|
30 |
var is_confirmed; |
33 |
var is_confirmed; |
31 |
if (count>0){ |
34 |
if (count>0){ |
32 |
is_confirmed= alert(_('There are [ '+ count +' ] item(s) attached to this record \n You must delete all items before deleting this record.')); |
35 |
is_confirmed = alert(_('There are [ '+ count +' ] item(s) attached to this record \n You must delete all items before deleting this record.')); |
33 |
} else{ |
36 |
} else if ( holdcount > 0 ) { |
34 |
is_confirmed= confirm(_('Are you sure you want to delete this record? ')); |
37 |
is_confirmed = confirm(_('There are [ '+ holdcount +' ] holds(s) for this record \n Are you sure you want to delete this record?.')); |
35 |
} |
38 |
} else { |
36 |
|
39 |
is_confirmed = confirm(_('Are you sure you want to delete this record? ')); |
37 |
if (is_confirmed) { |
40 |
} |
38 |
if (count>0){ |
41 |
|
39 |
// window.location="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]"; |
42 |
if (is_confirmed) { |
40 |
} else { |
43 |
if ( count > 0 || holdcount > 0 ){ |
41 |
window.location="/cgi-bin/koha/cataloguing/addbiblio.pl?op=delete&biblionumber=[% biblionumber %]"; |
44 |
return false; |
42 |
} |
45 |
} else { |
|
|
46 |
window.location="/cgi-bin/koha/cataloguing/addbiblio.pl?op=delete&biblionumber=[% biblionumber %]"; |
47 |
} |
43 |
} else { |
48 |
} else { |
44 |
return false; |
49 |
return false; |
45 |
} |
50 |
} |
46 |
} |
51 |
} |
47 |
[% END %] |
52 |
[% END %] |
|
|
53 |
|
48 |
[% IF ( CAN_user_editcatalogue_edit_items ) %] |
54 |
[% IF ( CAN_user_editcatalogue_edit_items ) %] |
49 |
function confirm_items_deletion() { |
55 |
function confirm_items_deletion() { |
50 |
var count = [% count %]; |
56 |
var count = [% count %]; |
51 |
if(count > 0){ |
57 |
var holdcount = [% holdcount %]; |
52 |
if(confirm(_('Are you sure you want to delete the ' + count + ' attached items? '))){ |
58 |
|
|
|
59 |
if ( holdcount > 0 ) { |
60 |
alert( _('There are [ '+ holdcount +' ] holds(s) for this record \n You must delete all holds before deleting all items.') ); |
61 |
} else if ( count > 0 ) { |
62 |
if( confirm( _('Are you sure you want to delete the ' + count + ' attached items? ') ) ) { |
53 |
window.location="/cgi-bin/koha/cataloguing/additem.pl?op=delallitems&biblionumber=[% biblionumber %]"; |
63 |
window.location="/cgi-bin/koha/cataloguing/additem.pl?op=delallitems&biblionumber=[% biblionumber %]"; |
54 |
}else{ |
64 |
} else { |
55 |
return false; |
65 |
return false; |
56 |
} |
66 |
} |
57 |
} else { |
67 |
} else { |
58 |
alert(_("This record has no items.")); |
68 |
alert(_("This record has no items.")); |
59 |
return false; |
69 |
return false; |
60 |
} |
70 |
} |
61 |
} |
71 |
} |
62 |
[% END %] |
72 |
[% END %] |
63 |
// prepare DOM for YUI Toolbar |
73 |
// prepare DOM for YUI Toolbar |
64 |
|
74 |
|
Lines 116-123
function confirm_items_deletion() {
Link Here
|
116 |
[% 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 %] |
126 |
[% 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 %] |
117 |
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Edit as new (duplicate)"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]&frameworkcode=&op=duplicate" },[% END %] |
127 |
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Edit as new (duplicate)"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]&frameworkcode=&op=duplicate" },[% END %] |
118 |
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Replace record via Z39.50"), onclick: {fn: PopupZ3950 } },[% END %] |
128 |
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Replace record via Z39.50"), onclick: {fn: PopupZ3950 } },[% END %] |
119 |
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Delete record"), onclick: {fn: confirm_deletion }[% IF ( count ) %],id:'disabled'[% END %] },[% END %] |
129 |
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Delete record"), onclick: {fn: confirm_deletion }[% IF ( count || holdcount ) %],id:'disabled'[% END %] },[% END %] |
120 |
[% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Delete all items"), onclick: {fn: confirm_items_deletion }[% UNLESS ( count ) %],id:'disabled'[% END %] }[% END %] |
130 |
[% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Delete all items"), onclick: {fn: confirm_items_deletion }[% IF ( count < 1 || holdcount ) %],id:'disabled2'[% END %] },[% END %] |
121 |
]; |
131 |
]; |
122 |
if(editmenu.length){ |
132 |
if(editmenu.length){ |
123 |
new YAHOO.widget.Button({ |
133 |
new YAHOO.widget.Button({ |
124 |
- |
|
|