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

(-)a/acqui/booksellers.pl (+3 lines)
Lines 92-97 if ( $supplier_count == 1 ) { Link Here
92
        supplier_name => $suppliers[0]->name,
92
        supplier_name => $suppliers[0]->name,
93
        booksellerid  => $suppliers[0]->id,
93
        booksellerid  => $suppliers[0]->id,
94
        basketcount   => $suppliers[0]->baskets->count,
94
        basketcount   => $suppliers[0]->baskets->count,
95
        subscriptionscount => $suppliers[0]->subscriptions->count,
95
        active        => $suppliers[0]->active,
96
        active        => $suppliers[0]->active,
96
    );
97
    );
97
}
98
}
Lines 149-154 for my $vendor (@suppliers) { Link Here
149
        booksellerid  => $vendor->id,
150
        booksellerid  => $vendor->id,
150
        name        => $vendor->name,
151
        name        => $vendor->name,
151
        active      => $vendor->active,
152
        active      => $vendor->active,
153
        basketcount   => $vendor->baskets->count,
154
        subscriptioncount => $vendor->subscriptions->count,
152
      };
155
      };
153
156
154
}
157
}
(-)a/acqui/supplier.pl (-2 / +2 lines)
Lines 89-96 if ( $op eq 'display' ) { Link Here
89
    );
89
    );
90
} elsif ( $op eq 'delete' ) {
90
} elsif ( $op eq 'delete' ) {
91
    # no further message needed for the user
91
    # no further message needed for the user
92
    # the DELETE button only appears in the template if basketcount == 0
92
    # the DELETE button only appears in the template if basketcount == 0 AND subscriptioncount == 0
93
    if ( $supplier->baskets->count == 0 ) {
93
    if ( $supplier->baskets->count == 0 && $supplier->subscriptions->count == 0) {
94
        Koha::Acquisition::Booksellers->find($booksellerid)->delete;
94
        Koha::Acquisition::Booksellers->find($booksellerid)->delete;
95
    }
95
    }
96
    print $query->redirect('/cgi-bin/koha/acqui/acqui-home.pl');
96
    print $query->redirect('/cgi-bin/koha/acqui/acqui-home.pl');
(-)a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss (-18 / +13 lines)
Lines 2712-2739 td { Link Here
2712
}
2712
}
2713
2713
2714
#acqui_order_supplierlist {
2714
#acqui_order_supplierlist {
2715
    > div {
2715
    .supplier {
2716
        &.supplier {
2716
        &+.supplier {
2717
            border: 1px solid #EEEEEE;
2717
            border-top: 1px solid #EEEEEE;
2718
            margin: .5em;
2718
            margin-top: 1em;
2719
            padding: 1em;
2720
        }
2719
        }
2720
    }
2721
2721
2722
        > div {
2722
    .suppliername {
2723
            > .baskets {
2723
        display: inline-block;
2724
                margin-top: .5em;
2724
        margin: .5em 1em .5em 0;
2725
            }
2726
        }
2727
2725
2728
        > span {
2726
        &.inactive {
2729
            &.action {
2727
            color: #888;
2730
                margin-left: 5em;
2731
            }
2732
2728
2733
            &.suppliername {
2729
            a:link,
2734
                display: inline;
2730
            a:visited {
2735
                font-size: 1.7em;
2731
                color: #888;
2736
                margin-bottom: .5em;
2737
            }
2732
            }
2738
        }
2733
        }
2739
    }
2734
    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc (-10 / +11 lines)
Lines 1-12 Link Here
1
[% INCLUDE 'blocking_errors.inc' %]
1
[% INCLUDE 'blocking_errors.inc' %]
2
<!-- acquisitions-toolbar.inc -->
2
<!-- acquisitions-toolbar.inc -->
3
<script>
4
    function confirm_deletion() {
5
        if (confirm(_("Are you sure you want to delete this vendor?"))) {
6
            window.location="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]&op=delete";
7
        }
8
    }
9
</script>
10
<div id="toolbar" class="btn-toolbar">
3
<div id="toolbar" class="btn-toolbar">
11
    [% IF ( booksellerid ) %]
4
    [% IF ( booksellerid ) %]
12
        <div class="btn-group">
5
        <div class="btn-group">
Lines 26-37 Link Here
26
        </ul>
19
        </ul>
27
        </div>
20
        </div>
28
            [% IF ( CAN_user_acquisition_vendors_manage ) %]
21
            [% IF ( CAN_user_acquisition_vendors_manage ) %]
29
                <div class="btn-group"><a class="btn btn-default" id="editsupplier" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]&amp;op=enter"><i class="fa fa-pencil"></i> Edit vendor</a></div>
22
                <div class="btn-group">
23
                    <a class="btn btn-default" id="editsupplier" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]&amp;op=enter"><i class="fa fa-pencil"></i> Edit vendor</a>
24
                </div>
30
                [% UNLESS ( basketcount OR subscriptioncount ) %]
25
                [% UNLESS ( basketcount OR subscriptioncount ) %]
31
                    <div class="btn-group"><a class="btn btn-default" id="deletesupplier" href="javascript:confirm_deletion()"><i class="fa fa-trash"></i> Delete vendor</a></div>
26
                    <div class="btn-group">
27
                        <form action="/cgi-bin/koha/acqui/supplier.pl" method="post">
28
                            <input type="hidden" name="op" value="delete" />
29
                            <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
30
                            <button class="btn btn-default" id="deletesupplier" type="submit"><i class="fa fa-trash"></i> Delete vendor</button>
31
                        </form>
32
                    </div>
32
                [% END %]
33
                [% END %]
33
            [% END %]
34
            [% END %]
34
            [% IF CAN_user_acquisition_order_receive && basketcount %]
35
            [% IF CAN_user_acquisition_order_receive && basketcount && active %]
35
                <div class="btn-group"><a class="btn btn-default" id="receive" href="/cgi-bin/koha/acqui/parcels.pl?booksellerid=[% booksellerid | html %]"><i class="fa fa-inbox"></i> Receive shipments</a></div>
36
                <div class="btn-group"><a class="btn btn-default" id="receive" href="/cgi-bin/koha/acqui/parcels.pl?booksellerid=[% booksellerid | html %]"><i class="fa fa-inbox"></i> Receive shipments</a></div>
36
            [% END %]
37
            [% END %]
37
        [% ELSE %]
38
        [% ELSE %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt (-21 / +51 lines)
Lines 57-67 Link Here
57
            [% END %]
57
            [% END %]
58
        </select>
58
        </select>
59
        </p>
59
        </p>
60
    [% END %]
60
        [% IF ( allbaskets ) %]
61
    [% IF ( allbaskets ) %]
61
            <a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier | uri %]&amp;booksellerid=[% booksellerid | uri %]">Show active baskets only</a>
62
        <a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier | uri %]&amp;booksellerid=[% booksellerid | uri %]">Show active baskets only</a>
62
        [% ELSE %]
63
    [% ELSE %]
63
            <a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier | uri %]&amp;booksellerid=[% booksellerid | uri %]&amp;allbaskets=1">Show all baskets</a>
64
        <a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier | uri %]&amp;booksellerid=[% booksellerid | uri %]&amp;allbaskets=1">Show all baskets</a>
64
        [% END %]
65
    [% END %]
65
    [% END %]
66
    [% UNLESS booksellerid %]
66
    [% UNLESS booksellerid %]
67
        | <a href="#" id="show_active_vendors">Show active vendors only</a><a href="#" id="show_all_vendors">Show all vendors</a>
67
        | <a href="#" id="show_active_vendors">Show active vendors only</a><a href="#" id="show_all_vendors">Show all vendors</a>
Lines 73-97 Link Here
73
            [% ELSE %]
73
            [% ELSE %]
74
                <div class="supplier inactive">
74
                <div class="supplier inactive">
75
            [% END %]
75
            [% END %]
76
                <span class="suppliername">
76
                [% IF ( supplier.active ) %]
77
                    [% IF (supplier.name) %]
77
                    <h2 class="suppliername">
78
                        <a name="[% supplier.booksellerid | html %]" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% supplier.booksellerid | uri %]">[% supplier.name | html %]</a>
78
                [% ELSE %]
79
                    <h2 class="suppliername inactive">
80
                [% END %]
81
                        <a name="[% supplier.booksellerid | html %]" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% supplier.booksellerid | uri %]">
82
                            [% IF (supplier.name) %]
83
                                [% supplier.name | html %]
84
                            [% ELSE %]
85
                                NO NAME
86
                            [% END %]
87
                        </a>
88
                        <a name="[% supplier.booksellerid | html %]" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% supplier.booksellerid | uri %]"></a>
89
                    [% IF ( !supplier.active ) %]<span class="vendor_inactive">(inactive)</span>[% END %]
90
                </h2>
91
                <span class="basketcounts">
92
                    [% IF ( count > 1 ) %]
93
                        <a href="/cgi-bin/koha/acqui/booksellers.pl?booksellerid=[% supplier.booksellerid | uri %]">[% supplier.basketcount | html %] [% tn('basket', 'baskets', supplier.basketcount) | $raw %]</a>,
79
                    [% ELSE %]
94
                    [% ELSE %]
80
                        <a name="[% supplier.booksellerid | html %]" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% supplier.booksellerid | uri %]">NO NAME</a>
95
                        [% supplier.basketcount | html %] [% tn('basket', 'baskets', supplier.basketcount) | $raw %],
81
                    [% END %]
96
                    [% END %]
82
                </span>
97
                    [% IF supplier.subscriptioncount > 0 %]
83
                <span class="action">
98
                        <a href="/cgi-bin/koha/serials/serials-search.pl?bookseller_filter=[% supplier.name | uri %]&searched=1">
84
                    [% IF ( CAN_user_acquisition_order_manage ) %]
99
                            [% supplier.subscriptioncount | html %] [% tn('subscription', 'subscriptions', supplier.subscriptioncount) | $raw %]
85
                        [% IF ( supplier.active ) %]
100
                        </a>
86
                            <a class="btn btn-default btn-sm" href="/cgi-bin/koha/acqui/basketheader.pl?booksellerid=[% supplier.booksellerid | uri %]&amp;op=add_form"><i class="fa fa-plus"></i> New basket</a>
101
                    [% ELSE %]
87
                        [% ELSE %]
102
                        [% supplier.subscriptioncount | html %] [% tn('subscription', 'subscriptions', supplier.subscriptioncount) | $raw %]
88
                            (inactive)
89
                        [% END %]
90
                    [% END %]
103
                    [% END %]
91
                        [% IF ( supplier.loop_basket.size ) %]
92
                    <a class="btn btn-default btn-sm" href="/cgi-bin/koha/acqui/parcels.pl?booksellerid=[% supplier.booksellerid | uri %]"><i class="fa fa-inbox"></i> Receive shipment</a>
93
                        [% END %]
94
                </span>
104
                </span>
105
                [% IF ( count == 1 ) %]
106
                    [% IF ( supplier.basketcount > 0 ) %]
107
                        <div>
108
                            [% IF ( allbaskets ) %]
109
                                <a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier.booksellerid | uri %]&amp;booksellerid=[% booksellerid | uri %]">Show active baskets only</a>
110
                            [% ELSE %]
111
                                <a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier.booksellerid | uri %]&amp;booksellerid=[% booksellerid | uri %]&amp;allbaskets=1">Show all baskets</a>
112
                            [% END %]
113
                        </div>
114
                    [% END %]
115
                [% ELSE %]
116
                    [% INCLUDE "acquisitions-toolbar.inc" booksellerid=supplier.booksellerid active=supplier.active basketcount=supplier.loop_basket.size basketcount=supplier.basketcount subscriptioncount=supplier.subscriptioncount %]
117
                [% END %]
118
95
                <div class="baskets">
119
                <div class="baskets">
96
                    [% IF ( supplier.loop_basket.size ) %]
120
                    [% IF ( supplier.loop_basket.size ) %]
97
                        <table class="baskets">
121
                        <table class="baskets">
Lines 195-201 Link Here
195
                        </table>
219
                        </table>
196
220
197
                    [% ELSE %]
221
                    [% ELSE %]
198
                        <p>No pending baskets</p>
222
                        <p>
223
                            No pending baskets.
224
                            [% IF ( supplier.basketcount > 0 && count > 1 ) %]
225
                                <a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=1&booksellerid=[% supplier.booksellerid | uri %]&allbaskets=1">View all baskets</a>.
226
                            [% END %]
227
                        </p>
228
199
                    [% END %][%# IF ( supplier.loop_basket.size ) %]
229
                    [% END %][%# IF ( supplier.loop_basket.size ) %]
200
                </div>
230
                </div>
201
            </div>
231
            </div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt (+1 lines)
Lines 431-436 Link Here
431
[% MACRO jsinclude BLOCK %]
431
[% MACRO jsinclude BLOCK %]
432
    [% Asset.js("js/acquisitions-menu.js") | $raw %]
432
    [% Asset.js("js/acquisitions-menu.js") | $raw %]
433
    [% Asset.js("lib/hc-sticky.js") | $raw %]
433
    [% Asset.js("lib/hc-sticky.js") | $raw %]
434
    [% Asset.js("js/acq.js") | $raw %]
434
    [% INCLUDE 'datatables.inc' %]
435
    [% INCLUDE 'datatables.inc' %]
435
    <script>
436
    <script>
436
        function confirm_deletion() {
437
        function confirm_deletion() {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt (+1 lines)
Lines 166-171 Link Here
166
166
167
[% MACRO jsinclude BLOCK %]
167
[% MACRO jsinclude BLOCK %]
168
    [% Asset.js("js/acquisitions-menu.js") | $raw %]
168
    [% Asset.js("js/acquisitions-menu.js") | $raw %]
169
    [% Asset.js("js/acq.js") | $raw %]
169
    [% INCLUDE 'datatables.inc' %]
170
    [% INCLUDE 'datatables.inc' %]
170
    <script>
171
    <script>
171
        $(document).ready(function() {
172
        $(document).ready(function() {
(-)a/koha-tmpl/intranet-tmpl/prog/js/acq.js (-1 / +9 lines)
Lines 1-3 Link Here
1
/* global confirmDelete */
2
/* exported uncheckbox isNotNull isNull isNum log calcTotalRow autoFillRow messenger updateCosts calcNewsuggTotal getAuthValueDropbox totalExceedsBudget budgetExceedsParent checkBudgetParent hideColumn showColumn showAllColumns hideAllColumns */
3
1
//=======================================================================
4
//=======================================================================
2
//input validation:
5
//input validation:
3
// acqui/uncertainprice.tmpl uses this
6
// acqui/uncertainprice.tmpl uses this
Lines 380-382 function hideAllColumns(){ Link Here
380
    $("#plan td:nth-child(2),#plan th:nth-child(2)").nextUntil("th:nth-child("+(allCols-1)+"),td:nth-child("+(allCols-1)+")").hide(); // hide all but the last two columns
383
    $("#plan td:nth-child(2),#plan th:nth-child(2)").nextUntil("th:nth-child("+(allCols-1)+"),td:nth-child("+(allCols-1)+")").hide(); // hide all but the last two columns
381
    $("#hideall").prop("checked", true).parent().addClass("selected");
384
    $("#hideall").prop("checked", true).parent().addClass("selected");
382
}
385
}
383
- 
386
387
$(document).ready(function(){
388
    $("#deletesupplier").on("click", function(){
389
        confirmDelete(__("Are you sure you want to delete this vendor?") );
390
    });
391
});

Return to bug 28082