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

(-)a/C4/Auth.pm (-4 / +4 lines)
Lines 287-298 sub get_template_and_user { Link Here
287
            my $some_private_shelves = Koha::Virtualshelves->get_some_shelves(
287
            my $some_private_shelves = Koha::Virtualshelves->get_some_shelves(
288
                {
288
                {
289
                    borrowernumber => $borrowernumber,
289
                    borrowernumber => $borrowernumber,
290
                    category       => 1,
290
                    public         => 0,
291
                }
291
                }
292
            );
292
            );
293
            my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
293
            my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
294
                {
294
                {
295
                    category       => 2,
295
                    public => 1,
296
                }
296
                }
297
            );
297
            );
298
            $template->param(
298
            $template->param(
Lines 431-437 sub get_template_and_user { Link Here
431
            require Koha::Virtualshelves;
431
            require Koha::Virtualshelves;
432
            my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
432
            my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
433
                {
433
                {
434
                    category       => 2,
434
                    public => 1,
435
                }
435
                }
436
            );
436
            );
437
            $template->param(
437
            $template->param(
Lines 1356-1362 sub checkauth { Link Here
1356
        require Koha::Virtualshelves;
1356
        require Koha::Virtualshelves;
1357
        my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
1357
        my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
1358
            {
1358
            {
1359
                category       => 2,
1359
                public => 1,
1360
            }
1360
            }
1361
        );
1361
        );
1362
        $template->param(
1362
        $template->param(
(-)a/admin/background_jobs.pl (-2 / +2 lines)
Lines 54-61 if ( $op eq 'view' ) { Link Here
54
            $template->param(
54
            $template->param(
55
                lists => scalar Koha::Virtualshelves->search(
55
                lists => scalar Koha::Virtualshelves->search(
56
                    [
56
                    [
57
                        { category => 1, owner => $loggedinuser },
57
                        { public => 0, owner => $loggedinuser },
58
                        { category => 2 }
58
                        { public => 1 }
59
                    ]
59
                    ]
60
                )
60
                )
61
            ) if $job->type eq 'batch_biblio_record_modification';
61
            ) if $job->type eq 'batch_biblio_record_modification';
(-)a/catalogue/ISBDdetail.pl (-2 / +2 lines)
Lines 152-165 my $some_private_shelves = Koha::Virtualshelves->get_some_shelves( Link Here
152
    {
152
    {
153
        borrowernumber => $loggedinuser,
153
        borrowernumber => $loggedinuser,
154
        add_allowed    => 1,
154
        add_allowed    => 1,
155
        category       => 1,
155
        public         => 0,
156
    }
156
    }
157
);
157
);
158
my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
158
my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
159
    {
159
    {
160
        borrowernumber => $loggedinuser,
160
        borrowernumber => $loggedinuser,
161
        add_allowed    => 1,
161
        add_allowed    => 1,
162
        category       => 2,
162
        public         => 1,
163
    }
163
    }
164
);
164
);
165
165
(-)a/catalogue/MARCdetail.pl (-2 / +2 lines)
Lines 344-357 my $some_private_shelves = Koha::Virtualshelves->get_some_shelves( Link Here
344
    {
344
    {
345
        borrowernumber => $loggedinuser,
345
        borrowernumber => $loggedinuser,
346
        add_allowed    => 1,
346
        add_allowed    => 1,
347
        category       => 1,
347
        public         => 0,
348
    }
348
    }
349
);
349
);
350
my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
350
my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
351
    {
351
    {
352
        borrowernumber => $loggedinuser,
352
        borrowernumber => $loggedinuser,
353
        add_allowed    => 1,
353
        add_allowed    => 1,
354
        category       => 2,
354
        public         => 1,
355
    }
355
    }
356
);
356
);
357
357
(-)a/catalogue/detail.pl (-2 / +2 lines)
Lines 426-439 my $some_private_shelves = Koha::Virtualshelves->get_some_shelves( Link Here
426
    {
426
    {
427
        borrowernumber => $borrowernumber,
427
        borrowernumber => $borrowernumber,
428
        add_allowed    => 1,
428
        add_allowed    => 1,
429
        category       => 1,
429
        public         => 0,
430
    }
430
    }
431
);
431
);
432
my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
432
my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
433
    {
433
    {
434
        borrowernumber => $borrowernumber,
434
        borrowernumber => $borrowernumber,
435
        add_allowed    => 1,
435
        add_allowed    => 1,
436
        category       => 2,
436
        public         => 1,
437
    }
437
    }
438
);
438
);
439
439
(-)a/catalogue/labeledMARCdetail.pl (-2 / +2 lines)
Lines 138-151 my $some_private_shelves = Koha::Virtualshelves->get_some_shelves( Link Here
138
    {
138
    {
139
        borrowernumber => $loggedinuser,
139
        borrowernumber => $loggedinuser,
140
        add_allowed    => 1,
140
        add_allowed    => 1,
141
        category       => 1,
141
        public         => 0,
142
    }
142
    }
143
);
143
);
144
my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
144
my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
145
    {
145
    {
146
        borrowernumber => $loggedinuser,
146
        borrowernumber => $loggedinuser,
147
        add_allowed    => 1,
147
        add_allowed    => 1,
148
        category       => 2,
148
        public         => 1,
149
    }
149
    }
150
);
150
);
151
151
(-)a/catalogue/moredetail.pl (-2 / +2 lines)
Lines 278-291 my $some_private_shelves = Koha::Virtualshelves->get_some_shelves( Link Here
278
    {
278
    {
279
        borrowernumber => $loggedinuser,
279
        borrowernumber => $loggedinuser,
280
        add_allowed    => 1,
280
        add_allowed    => 1,
281
        category       => 1,
281
        public         => 0,
282
    }
282
    }
283
);
283
);
284
my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
284
my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
285
    {
285
    {
286
        borrowernumber => $loggedinuser,
286
        borrowernumber => $loggedinuser,
287
        add_allowed    => 1,
287
        add_allowed    => 1,
288
        category       => 2,
288
        public         => 1,
289
    }
289
    }
290
);
290
);
291
291
(-)a/catalogue/search.pl (-2 / +2 lines)
Lines 719-732 my $some_private_shelves = Koha::Virtualshelves->get_some_shelves( Link Here
719
    {
719
    {
720
        borrowernumber => $borrowernumber,
720
        borrowernumber => $borrowernumber,
721
        add_allowed    => 1,
721
        add_allowed    => 1,
722
        category       => 1,
722
        public         => 0,
723
    }
723
    }
724
);
724
);
725
my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
725
my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
726
    {
726
    {
727
        borrowernumber => $borrowernumber,
727
        borrowernumber => $borrowernumber,
728
        add_allowed    => 1,
728
        add_allowed    => 1,
729
        category       => 2,
729
        public         => 1,
730
    }
730
    }
731
);
731
);
732
732
(-)a/opac/opac-addbybiblionumber.pl (-7 / +7 lines)
Lines 33-39 my $selectedshelf = $query->param('selectedshelf'); Link Here
33
my $newshelf        = $query->param('newshelf');
33
my $newshelf        = $query->param('newshelf');
34
my $shelfnumber     = $query->param('shelfnumber');
34
my $shelfnumber     = $query->param('shelfnumber');
35
my $newvirtualshelf = $query->param('newvirtualshelf');
35
my $newvirtualshelf = $query->param('newvirtualshelf');
36
my $category        = $query->param('category');
36
my $public          = $query->param('public');
37
my ( $errcode, $authorized ) = ( 0, 1 );
37
my ( $errcode, $authorized ) = ( 0, 1 );
38
my @biblios;
38
my @biblios;
39
39
Lines 56-65 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
56
56
57
if ($newvirtualshelf) {
57
if ($newvirtualshelf) {
58
    if ($loggedinuser > 0
58
    if ($loggedinuser > 0
59
        and (  $category == 1
59
        and (  !$public
60
            or $category == 2 and $loggedinuser > 0 && C4::Context->preference('OpacAllowPublicListCreation') )
60
            or $public and $loggedinuser > 0 && C4::Context->preference('OpacAllowPublicListCreation') )
61
      ) {
61
      ) {
62
        my $shelf = eval { Koha::Virtualshelf->new( { shelfname => $newvirtualshelf, category => $category, owner => $loggedinuser, } )->store; };
62
        my $shelf = eval { Koha::Virtualshelf->new( { shelfname => $newvirtualshelf, public => $public, owner => $loggedinuser, } )->store; };
63
        if ( $@ or not $shelf ) {
63
        if ( $@ or not $shelf ) {
64
            $errcode    = 1;
64
            $errcode    = 1;
65
            $authorized = 0;
65
            $authorized = 0;
Lines 104-124 if ($newvirtualshelf) { Link Here
104
} else {
104
} else {
105
    if ( $loggedinuser > 0 ) {
105
    if ( $loggedinuser > 0 ) {
106
        my $private_shelves = Koha::Virtualshelves->search(
106
        my $private_shelves = Koha::Virtualshelves->search(
107
            {   category => 1,
107
            {   public   => 0,
108
                owner    => $loggedinuser,
108
                owner    => $loggedinuser,
109
                allow_change_from_owner => 1,
109
                allow_change_from_owner => 1,
110
            },
110
            },
111
            { order_by => 'shelfname' }
111
            { order_by => 'shelfname' }
112
        );
112
        );
113
        my $shelves_shared_with_me = Koha::Virtualshelves->search(
113
        my $shelves_shared_with_me = Koha::Virtualshelves->search(
114
            {   category                            => 1,
114
            {   public                              => 0,
115
                'virtualshelfshares.borrowernumber' => $loggedinuser,
115
                'virtualshelfshares.borrowernumber' => $loggedinuser,
116
                allow_change_from_others            => 1,
116
                allow_change_from_others            => 1,
117
            },
117
            },
118
            { join => 'virtualshelfshares', }
118
            { join => 'virtualshelfshares', }
119
        );
119
        );
120
        my $public_shelves = Koha::Virtualshelves->search(
120
        my $public_shelves = Koha::Virtualshelves->search(
121
            {   category => 2,
121
            {   public   => 1,
122
                -or      => [
122
                -or      => [
123
                    -and => {
123
                    -and => {
124
                        allow_change_from_owner => 1,
124
                        allow_change_from_owner => 1,
(-)a/opac/opac-detail.pl (-1 / +1 lines)
Lines 925-931 if (C4::Context->preference("virtualshelves") ) { Link Here
925
    my $shelves = Koha::Virtualshelves->search(
925
    my $shelves = Koha::Virtualshelves->search(
926
        {
926
        {
927
            biblionumber => $biblionumber,
927
            biblionumber => $biblionumber,
928
            category => 2,
928
            public       => 1,
929
        },
929
        },
930
        {
930
        {
931
            join => 'virtualshelfcontents',
931
            join => 'virtualshelfcontents',
(-)a/opac/opac-search.pl (-3 / +2 lines)
Lines 889-902 my $some_private_shelves = Koha::Virtualshelves->get_some_shelves( Link Here
889
    {
889
    {
890
        borrowernumber => $borrowernumber,
890
        borrowernumber => $borrowernumber,
891
        add_allowed    => 1,
891
        add_allowed    => 1,
892
        category       => 1,
892
        public         => 0,
893
    }
893
    }
894
);
894
);
895
my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
895
my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
896
    {
896
    {
897
        borrowernumber => $borrowernumber,
897
        borrowernumber => $borrowernumber,
898
        add_allowed    => 1,
898
        add_allowed    => 1,
899
        category       => 2,
899
        public         => 1,
900
    }
900
    }
901
);
901
);
902
902
903
- 

Return to bug 28959