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

(-)a/catalogue/detail.pl (-1 / +33 lines)
Lines 42-47 use C4::Images; Link Here
42
use Koha::DateUtils;
42
use Koha::DateUtils;
43
use C4::HTML5Media;
43
use C4::HTML5Media;
44
use C4::CourseReserves qw(GetItemCourseReservesInfo);
44
use C4::CourseReserves qw(GetItemCourseReservesInfo);
45
use C4::Acquisition qw(GetOrdersByBiblionumber);
45
46
46
# use Smart::Comments;
47
# use Smart::Comments;
47
48
Lines 412-415 if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->pref Link Here
412
my ( $holdcount, $holds ) = C4::Reserves::GetReservesFromBiblionumber($biblionumber,1);
413
my ( $holdcount, $holds ) = C4::Reserves::GetReservesFromBiblionumber($biblionumber,1);
413
$template->param( holdcount => $holdcount, holds => $holds );
414
$template->param( holdcount => $holdcount, holds => $holds );
414
415
415
output_html_with_http_headers $query, $cookie, $template->output;
416
my @allorders_using_biblio = GetOrdersByBiblionumber ($biblionumber);
417
my @deletedorders_using_biblio;
418
my @orders_using_biblio;
419
my @baskets_orders;
420
my @baskets_deletedorders;
421
422
foreach my $myorder (@allorders_using_biblio) {
423
    my $basket = $myorder->{'basketno'};
424
    if ((defined $myorder->{'datecancellationprinted'}) and  ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
425
        push @deletedorders_using_biblio, $myorder;
426
        unless (grep(/^$basket$/, @baskets_deletedorders)){
427
            push @baskets_deletedorders,$myorder->{'basketno'};
428
        }
429
    }
430
    else {
431
        push @orders_using_biblio, $myorder;
432
        unless (grep(/^$basket$/, @baskets_orders)){
433
            push @baskets_orders,$myorder->{'basketno'};
434
            }
435
    }
436
}
437
438
my $count_orders_using_biblio = scalar @orders_using_biblio ;
439
$template->param (countorders => $count_orders_using_biblio);
440
441
my $count_deletedorders_using_biblio = scalar @deletedorders_using_biblio ;
442
$template->param (countdeletedorders => $count_deletedorders_using_biblio);
443
444
$template->param (basketsorders => \@baskets_orders);
445
$template->param (basketsdeletedorders => \@baskets_deletedorders);
446
447
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (-5 / +19 lines)
Lines 31-46 Link Here
31
    function confirm_deletion() {
31
    function confirm_deletion() {
32
        var count = [% count %];
32
        var count = [% count %];
33
        var holdcount = [% holdcount %];
33
        var holdcount = [% holdcount %];
34
34
        var countorders = [% countorders %];
35
        var countdeletedorders = [% countdeletedorders %];
35
        var is_confirmed;
36
        var is_confirmed;
36
	if (count > 0){
37
	if (count > 0){
37
            is_confirmed = alert( count + " " +_("item(s) are attached to this record. You must delete all items before deleting this record.") );
38
            is_confirmed = alert( count + " " +_("item(s) are attached to this record. You must delete all items before deleting this record.") );
38
        } else if ( holdcount > 0 ) {
39
         }
39
            is_confirmed = confirm( holdcount + " " + _("hold(s) on this record. Are you sure you want to delete this record?."));
40
        else if (countorders > 0){
41
            [% IF ( CAN_user_acquisition_order_manage ) %]
42
                is_confirmed = confirm( _("Warning: This record is used in")+" "+ countorders + " " +_("order(s). Deleting it could cause serious issues on acquisition module.\nAre you sure you want to delete this record?") );
43
            [% ELSE %]
44
                is_confirmed = alert( countorders + " " +_("order(s) are using this record.\nYou need order managing permissions to delete this record.") );
45
            [% END %]
46
        }
47
        else if (countdeletedorders > 0){
48
             [% IF ( CAN_user_acquisition_order_manage ) %]
49
                 is_confirmed = confirm( countdeletedorders + " " +_("deleted order(s) are using this record.\nAre you sure you want to delete this record?") );
50
             [% ELSE %]
51
                 is_confirmed = alert( countdeletedorders + " " +_("deleted order(s) are using this record.\nYou need order managing permissions to delete this record.") );
52
             [% END %]
53
        }
54
        else if ( holdcount > 0 ) {
55
            is_confirmed = confirm( holdcount + " " + _("holds(s) for this record.\nAre you sure you want to delete this record?"));
40
        } else {
56
        } else {
41
            is_confirmed = confirm(_("Are you sure you want to delete this record?"));
57
            is_confirmed = confirm(_("Are you sure you want to delete this record?"));
42
        }
58
        }
43
44
        if (is_confirmed) {
59
        if (is_confirmed) {
45
            if ( count > 0 || holdcount > 0 ){
60
            if ( count > 0 || holdcount > 0 ){
46
                return false;
61
                return false;
47
- 

Return to bug 9780