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 137-145 if (@hostitems){ Link Here
137
137
138
my $dat = &GetBiblioData($biblionumber);
138
my $dat = &GetBiblioData($biblionumber);
139
139
140
# get count of holds
141
my ( $holdcount, $holds ) = GetReservesFromBiblionumber($biblionumber,1);
142
143
#coping with subscriptions
140
#coping with subscriptions
144
my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
141
my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
145
my @subscriptions       = GetSubscriptions( $dat->{title}, $dat->{issn}, $biblionumber );
142
my @subscriptions       = GetSubscriptions( $dat->{title}, $dat->{issn}, $biblionumber );
Lines 280-286 $template->param( Link Here
280
	volinfo				=> $itemfields{enumchron},
277
	volinfo				=> $itemfields{enumchron},
281
    itemdata_itemnotes  => $itemfields{itemnotes},
278
    itemdata_itemnotes  => $itemfields{itemnotes},
282
	z3950_search_params	=> C4::Search::z3950_search_args($dat),
279
	z3950_search_params	=> C4::Search::z3950_search_args($dat),
283
    holdcount           => $holdcount,
284
        hostrecords         => $hostrecords,
280
        hostrecords         => $hostrecords,
285
	analytics_flag	=> $analytics_flag,
281
	analytics_flag	=> $analytics_flag,
286
	C4::Search::enabled_staff_search_views,
282
	C4::Search::enabled_staff_search_views,
Lines 410-413 if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->pref Link Here
410
                                'sort'=>'-weight', limit=>$tag_quantity}));
406
                                'sort'=>'-weight', limit=>$tag_quantity}));
411
}
407
}
412
408
409
my ( $holdcount, $holds ) = C4::Reserves::GetReservesFromBiblionumber($biblionumber,1);
410
$template->param( holdcount => $holdcount, holds => $holds );
411
413
output_html_with_http_headers $query, $cookie, $template->output;
412
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 203-207 $template->param( Link Here
203
);
203
);
204
$template->param(ONLY_ONE => 1) if ( $itemnumber && $showncount != @items );
204
$template->param(ONLY_ONE => 1) if ( $itemnumber && $showncount != @items );
205
205
206
207
my ( $holdcount, $holds ) = GetReservesFromBiblionumber($biblionumber,1);
208
$template->param( holdcount => $holdcount, holds => $holds );
209
206
output_html_with_http_headers $query, $cookie, $template->output;
210
output_html_with_http_headers $query, $cookie, $template->output;
207
211
(-)a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css (+3 lines)
Lines 485-490 ul.toolbar button { Link Here
485
a.yuimenuitemlabel-disabled, #disabled a {
485
a.yuimenuitemlabel-disabled, #disabled a {
486
	color: #999;
486
	color: #999;
487
}
487
}
488
a.yuimenuitemlabel-disabled, #disabled2 a {
489
 color: #999;
490
}
488
a.yuimenuitemlabel-disabled:hover, #disabled a:hover {
491
a.yuimenuitemlabel-disabled:hover, #disabled a:hover {
489
	color : #999;
492
	color : #999;
490
}
493
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (-27 / +35 lines)
Lines 26-65 Link Here
26
	function printBiblio() {window.open('/cgi-bin/koha/catalogue/detailprint.pl?biblionumber=[% biblionumber %]','Print_Biblio','width=700,height=500,toolbar=false,scrollbars=yes');
26
	function printBiblio() {window.open('/cgi-bin/koha/catalogue/detailprint.pl?biblionumber=[% biblionumber %]','Print_Biblio','width=700,height=500,toolbar=false,scrollbars=yes');
27
	}
27
	}
28
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
28
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
29
function confirm_deletion() {
29
    function confirm_deletion() {
30
		var count = [% count %];
30
        var count = [% count %];
31
        var holdcount = [% holdcount %];
32
31
        var is_confirmed;
33
        var is_confirmed;
32
	if (count>0){
34
	if (count>0){
33
		    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.'));
34
		    } else{
36
    } else if ( holdcount > 0 ) {
35
		    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?.'));
36
	}
38
        } else {
37
39
            is_confirmed = confirm(_('Are you sure you want to delete this record? '));
38
     if (is_confirmed) {
40
        }
39
        if (count>0){
41
40
	// 	window.location="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]";
42
        if (is_confirmed) {
41
		} else {
43
            if ( count > 0 || holdcount > 0 ){
42
			window.location="/cgi-bin/koha/cataloguing/addbiblio.pl?op=delete&biblionumber=[% biblionumber %]";
44
                return false;
43
		}
45
            } else {
46
                window.location="/cgi-bin/koha/cataloguing/addbiblio.pl?op=delete&biblionumber=[% biblionumber %]";
47
            }
44
	} else {
48
	} else {
45
		return false;
49
            return false;
46
	}
50
	}
47
}
51
    }
48
[% END %]
52
[% END %]
53
49
[% IF ( CAN_user_editcatalogue_edit_items ) %]
54
[% IF ( CAN_user_editcatalogue_edit_items ) %]
50
function confirm_items_deletion() {
55
    function confirm_items_deletion() {
51
        var count = [% count %];
56
        var count = [% count %];
52
        if(count > 0){
57
        var holdcount = [% holdcount %];
53
            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? ') ) ) {
54
                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 %]";
55
            }else{
64
            } else {
56
                return false;
65
                return false;
57
            }
66
            }
58
		} else {
67
        } else {
59
			alert(_("This record has no items."));
68
            alert(_("This record has no items."));
60
			return false;
69
            return false;
61
		}
70
        }
62
}
71
    }
63
[% END %]
72
[% END %]
64
	// prepare DOM for YUI Toolbar
73
	// prepare DOM for YUI Toolbar
65
74
Lines 115-122 function confirm_items_deletion() { Link Here
115
            [% 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 %]
124
            [% 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 %]
116
            [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Edit as new (duplicate)"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]&frameworkcode=&op=duplicate" },[% END %]
125
            [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Edit as new (duplicate)"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]&frameworkcode=&op=duplicate" },[% END %]
117
            [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Replace record via Z39.50"), onclick: {fn: PopupZ3950 } },[% END %]
126
            [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Replace record via Z39.50"), onclick: {fn: PopupZ3950 } },[% END %]
118
            [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Delete record"), onclick: {fn: confirm_deletion }[% IF ( count ) %],id:'disabled'[% END %] },[% END %]
127
            [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Delete record"), onclick: {fn: confirm_deletion }[% IF ( count || holdcount ) %],id:'disabled'[% END %] },[% END %]
119
            [% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Delete all items"), onclick: {fn: confirm_items_deletion }[% UNLESS ( count ) %],id:'disabled'[% END %] }[% END %]
128
            [% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Delete all items"), onclick: {fn: confirm_items_deletion }[% IF ( count < 1 || holdcount ) %],id:'disabled2'[% END %] },[% END %]
120
	    ];
129
	    ];
121
		if(editmenu.length){
130
		if(editmenu.length){
122
			new YAHOO.widget.Button({
131
			new YAHOO.widget.Button({
123
- 

Return to bug 5790