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

(-)a/C4/Bookseller.pm (+3 lines)
Lines 84-89 sub GetBookSellerFromId { Link Here
84
        ( $vendor->{basketcount} ) = $dbh->selectrow_array(
84
        ( $vendor->{basketcount} ) = $dbh->selectrow_array(
85
            'SELECT count(*) FROM aqbasket where booksellerid = ?',
85
            'SELECT count(*) FROM aqbasket where booksellerid = ?',
86
            {}, $id );
86
            {}, $id );
87
        ( $vendor->{subscriptioncount} ) = $dbh->selectrow_array(
88
            'SELECT count(*) FROM subscription WHERE aqbooksellerid = ?',
89
            {}, $id );
87
    }
90
    }
88
    return $vendor;
91
    return $vendor;
89
}
92
}
(-)a/acqui/supplier.pl (-1 / +6 lines)
Lines 114-123 if ( $op eq 'display' ) { Link Here
114
        GST           => $tax_rate,
114
        GST           => $tax_rate,
115
        default_tax   => defined($seller_gstrate),
115
        default_tax   => defined($seller_gstrate),
116
        basketcount   => $supplier->{'basketcount'},
116
        basketcount   => $supplier->{'basketcount'},
117
        subscriptioncount   => $supplier->{'subscriptioncount'},
117
        contracts     => $contracts,
118
        contracts     => $contracts,
118
    );
119
    );
119
} elsif ( $op eq 'delete' ) {
120
} elsif ( $op eq 'delete' ) {
120
    DelBookseller($booksellerid);
121
    # no further message needed for the user
122
    # the DELETE button only appears in the template if basketcount == 0
123
    if ( $supplier->{'basketcount'} == 0 ) {
124
        DelBookseller($booksellerid);
125
    }
121
    print $query->redirect('/cgi-bin/koha/acqui/acqui-home.pl');
126
    print $query->redirect('/cgi-bin/koha/acqui/acqui-home.pl');
122
    exit;
127
    exit;
123
} else {
128
} else {
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc (-1 / +4 lines)
Lines 16-21 Link Here
16
        new YAHOO.widget.Button("newsupplier");
16
        new YAHOO.widget.Button("newsupplier");
17
        new YAHOO.widget.Button("newbasket");
17
        new YAHOO.widget.Button("newbasket");
18
        new YAHOO.widget.Button("editsupplier");
18
        new YAHOO.widget.Button("editsupplier");
19
        new YAHOO.widget.Button("deletesupplier");
19
        new YAHOO.widget.Button("receive");
20
        new YAHOO.widget.Button("receive");
20
        new YAHOO.widget.Button("newcontract");
21
        new YAHOO.widget.Button("newcontract");
21
        new YAHOO.widget.Button("editcontracts");
22
        new YAHOO.widget.Button("editcontracts");
Lines 46-51 Link Here
46
        [% IF ( booksellerid ) %]
47
        [% IF ( booksellerid ) %]
47
            [% IF ( CAN_user_acquisition_vendors_manage ) %]
48
            [% IF ( CAN_user_acquisition_vendors_manage ) %]
48
                <li><a id="editsupplier" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]&amp;op=enter">Edit</a></li>
49
                <li><a id="editsupplier" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]&amp;op=enter">Edit</a></li>
50
                [% UNLESS ( basketcount OR subscriptioncount ) %]
51
                    <li><a id="deletesupplier" href="javascript:confirm_deletion()">Delete</a></li>
52
                [% END %]
49
                <li><a id="newcontract" href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&booksellerid=[% booksellerid %]">New Contract</a></li>
53
                <li><a id="newcontract" href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&booksellerid=[% booksellerid %]">New Contract</a></li>
50
                <li><a id="editcontracts" href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% booksellerid %]">Contracts</a></li>
54
                <li><a id="editcontracts" href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% booksellerid %]">Contracts</a></li>
51
                [% UNLESS ( basketcount ) %]
55
                [% UNLESS ( basketcount ) %]
52
- 

Return to bug 4969