View | Details | Raw Unified | Return to bug 5790
Collapse All | Expand All

(-)a/catalogue/ISBDdetail.pl (+4 lines)
Lines 111-115 $template->param ( Link Here
111
    C4::Search::enabled_staff_search_views,
111
    C4::Search::enabled_staff_search_views,
112
);
112
);
113
113
114
115
my ( $holdcount, $holds ) = C4::Reserves::GetReservesFromBiblionumber($biblionumber,1);
116
$template->param( holdcount => $holdcount, holds => $holds );
117
114
output_html_with_http_headers $query, $cookie, $template->output;
118
output_html_with_http_headers $query, $cookie, $template->output;
115
119
(-)a/catalogue/MARCdetail.pl (+3 lines)
Lines 335-338 $template->param ( Link Here
335
	C4::Search::enabled_staff_search_views,
335
	C4::Search::enabled_staff_search_views,
336
);
336
);
337
337
338
my ( $holdcount, $holds ) = C4::Reserves::GetReservesFromBiblionumber($biblionumber,1);
339
$template->param( holdcount => $holdcount, holds => $holds );
340
338
output_html_with_http_headers $query, $cookie, $template->output;
341
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/catalogue/detail.pl (-4 / +3 lines)
Lines 138-146 if (@hostitems){ Link Here
138
138
139
my $dat = &GetBiblioData($biblionumber);
139
my $dat = &GetBiblioData($biblionumber);
140
140
141
# get count of holds
142
my ( $holdcount, $holds ) = GetReservesFromBiblionumber($biblionumber,1);
143
144
#coping with subscriptions
141
#coping with subscriptions
145
my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
142
my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
146
my @subscriptions       = GetSubscriptions( $dat->{title}, $dat->{issn}, undef, $biblionumber );
143
my @subscriptions       = GetSubscriptions( $dat->{title}, $dat->{issn}, undef, $biblionumber );
Lines 301-307 $template->param( Link Here
301
	volinfo				=> $itemfields{enumchron},
298
	volinfo				=> $itemfields{enumchron},
302
    itemdata_itemnotes  => $itemfields{itemnotes},
299
    itemdata_itemnotes  => $itemfields{itemnotes},
303
	z3950_search_params	=> C4::Search::z3950_search_args($dat),
300
	z3950_search_params	=> C4::Search::z3950_search_args($dat),
304
    holdcount           => $holdcount,
305
        hostrecords         => $hostrecords,
301
        hostrecords         => $hostrecords,
306
	analytics_flag	=> $analytics_flag,
302
	analytics_flag	=> $analytics_flag,
307
	C4::Search::enabled_staff_search_views,
303
	C4::Search::enabled_staff_search_views,
Lines 399-402 if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->pref Link Here
399
                                'sort'=>'-weight', limit=>$tag_quantity}));
395
                                'sort'=>'-weight', limit=>$tag_quantity}));
400
}
396
}
401
397
398
my ( $holdcount, $holds ) = C4::Reserves::GetReservesFromBiblionumber($biblionumber,1);
399
$template->param( holdcount => $holdcount, holds => $holds );
400
402
output_html_with_http_headers $query, $cookie, $template->output;
401
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/catalogue/imageviewer.pl (+3 lines)
Lines 78-81 $template->{VARS}->{'norequests'} = $norequests; Link Here
78
$template->param(C4::Search::enabled_staff_search_views);
78
$template->param(C4::Search::enabled_staff_search_views);
79
$template->{VARS}->{'biblio'} = $biblio;
79
$template->{VARS}->{'biblio'} = $biblio;
80
80
81
my ( $holdcount, $holds ) = C4::Reserves::GetReservesFromBiblionumber($biblionumber,1);
82
$template->param( holdcount => $holdcount, holds => $holds );
83
81
output_html_with_http_headers $query, $cookie, $template->output;
84
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/catalogue/labeledMARCdetail.pl (+3 lines)
Lines 136-139 $template->param ( Link Here
136
	C4::Search::enabled_staff_search_views,
136
	C4::Search::enabled_staff_search_views,
137
);
137
);
138
138
139
my ( $holdcount, $holds ) = C4::Reserves::GetReservesFromBiblionumber($biblionumber,1);
140
$template->param( holdcount => $holdcount, holds => $holds );
141
139
output_html_with_http_headers $query, $cookie, $template->output;
142
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/catalogue/moredetail.pl (+4 lines)
Lines 214-218 $template->param( Link Here
214
);
214
);
215
$template->param(ONLY_ONE => 1) if ( $itemnumber && $showncount != @items );
215
$template->param(ONLY_ONE => 1) if ( $itemnumber && $showncount != @items );
216
216
217
218
my ( $holdcount, $holds ) = GetReservesFromBiblionumber($biblionumber,1);
219
$template->param( holdcount => $holdcount, holds => $holds );
220
217
output_html_with_http_headers $query, $cookie, $template->output;
221
output_html_with_http_headers $query, $cookie, $template->output;
218
222
(-)a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css (+3 lines)
Lines 425-430 ul.toolbar button { Link Here
425
a.yuimenuitemlabel-disabled, #disabled a {
425
a.yuimenuitemlabel-disabled, #disabled a {
426
	color: #999;
426
	color: #999;
427
}
427
}
428
a.yuimenuitemlabel-disabled, #disabled2 a {
429
 color: #999;
430
}
428
a.yuimenuitemlabel-disabled:hover, #disabled a:hover {
431
a.yuimenuitemlabel-disabled:hover, #disabled a:hover {
429
	color : #999;
432
	color : #999;
430
}
433
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (-27 / +35 lines)
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
- 

Return to bug 5790