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

(-)a/Koha/REST/V1/Acquisitions/Baskets.pm (-3 / +16 lines)
Lines 18-26 package Koha::REST::V1::Acquisitions::Baskets; Link Here
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Mojo::Base 'Mojolicious::Controller';
20
use Mojo::Base 'Mojolicious::Controller';
21
22
use Try::Tiny qw( catch try );
21
use Try::Tiny qw( catch try );
23
22
23
use C4::Acquisition qw( CanUserManageBasket );
24
24
=head1 NAME
25
=head1 NAME
25
26
26
Koha::REST::V1::Acquisitions::Baskets
27
Koha::REST::V1::Acquisitions::Baskets
Lines 65-77 Return a list of baskets Link Here
65
=cut
66
=cut
66
67
67
sub list {
68
sub list {
68
    my $c = shift->openapi->valid_input or return;
69
    my $c      = shift->openapi->valid_input or return;
70
    my $patron = $c->stash('koha.user');
69
71
70
    return try {
72
    return try {
71
73
74
        my $baskets_rs = Koha::Acquisition::Baskets->new;
75
        my $baskets    = $c->objects->search($baskets_rs);
76
77
        my $userflags = C4::Auth::getuserflags( $patron->flags, $patron->userid );
78
79
        my @user_baskets;
80
        foreach my $basket (@$baskets) {
81
            my $success = CanUserManageBasket( $patron->unblessed, $basket, $userflags );
82
            push @user_baskets, $basket if $success;
83
        }
84
72
        return $c->render(
85
        return $c->render(
73
            status  => 200,
86
            status  => 200,
74
            openapi => $c->objects->search( Koha::Acquisition::Baskets->new ),
87
            openapi => \@user_baskets
75
        );
88
        );
76
    } catch {
89
    } catch {
77
        $c->unhandled_exception($_);
90
        $c->unhandled_exception($_);
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/vendors.tt (-2 / +1 lines)
Lines 32-39 Link Here
32
        const userPermissions = [% To.json(user_permissions) | $raw %];
32
        const userPermissions = [% To.json(user_permissions) | $raw %];
33
        const currencies = [% To.json(currencies) | $raw %];
33
        const currencies = [% To.json(currencies) | $raw %];
34
        const gstValues = [% To.json(gst_values) | $raw %];
34
        const gstValues = [% To.json(gst_values) | $raw %];
35
        const edifact = [% To.json(edifact) | $raw %]
35
        const edifact = [% To.json(edifact) | $raw %];
36
        const viewBaskets = [% To.json(viewbaskets) | $raw %]
37
    </script>
36
    </script>
38
37
39
38
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/Main.vue (-1 / +1 lines)
Lines 95-100 export default { Link Here
95
        fetchConfig().then(() => {
95
        fetchConfig().then(() => {
96
            this.loaded()
96
            this.loaded()
97
            this.userPermissions = userPermissions
97
            this.userPermissions = userPermissions
98
            this.config.settings.edifact = edifact
98
            this.vendorStore.currencies = currencies
99
            this.vendorStore.currencies = currencies
99
            this.vendorStore.gstValues = gstValues.map(gv => {
100
            this.vendorStore.gstValues = gstValues.map(gv => {
100
                return {
101
                return {
101
- 

Return to bug 38010