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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/addbybiblionumber.tt (-14 / +7 lines)
Lines 36-66 Link Here
36
[% UNLESS ( shelfnumber ) %]
36
[% UNLESS ( shelfnumber ) %]
37
37
38
[% UNLESS ( newshelf ) %]
38
[% UNLESS ( newshelf ) %]
39
    [% IF private_shelves.count OR public_shelves.count OR private_shelves_shared_with_me.count %]
39
    [% IF add_to_some_public_shelves.count OR add_to_some_private_shelves %]
40
     <fieldset class="rows">
40
     <fieldset class="rows">
41
    <legend>Select an existing list</legend>
41
    <legend>Select an existing list</legend>
42
    <ol>
42
    <ol>
43
        <li>
43
        <li>
44
            <label>Choose list</label>
44
            <label>Choose list</label>
45
            <select name="shelfnumber" id="shelfnumber">
45
            <select name="shelfnumber" id="shelfnumber">
46
                [% IF private_shelves.count %]
46
                [% IF add_to_some_private_shelves.count %]
47
                    <optgroup label="Private lists">
47
                    <optgroup label="Private lists">
48
                        [% FOREACH private_shelf IN private_shelves %]
48
                        [% FOREACH s IN add_to_some_private_shelves %]
49
                            <option value="[% private_shelf.shelfnumber | html %]">[% private_shelf.shelfname | html %]</option>
49
                            <option value="[% s.shelfnumber | html %]">[% s.shelfname | html %]</option>
50
                        [% END %]
50
                        [% END %]
51
                    </optgroup>
51
                    </optgroup>
52
                [% END %]
52
                [% END %]
53
                [% IF private_shelves_shared_with_me.count %]
53
                [% IF add_to_some_public_shelves.count %]
54
                    <optgroup label="Private lists shared with me">
55
                        [% FOREACH private_shelf IN private_shelves_shared_with_me %]
56
                            <option value="[% private_shelf.shelfnumber | html %]">[% private_shelf.shelfname | html %]</option>
57
                        [% END %]
58
                    </optgroup>
59
                [% END %]
60
                [% IF public_shelves.count %]
61
                    <optgroup label="Public lists">
54
                    <optgroup label="Public lists">
62
                        [% FOREACH public_shelf IN public_shelves %]
55
                        [% FOREACH s IN add_to_some_public_shelves %]
63
                            <option value="[% public_shelf.shelfnumber | html %]">[% public_shelf.shelfname | html %]</option>
56
                            <option value="[% s.shelfnumber | html %]">[% s.shelfname | html %]</option>
64
                        [% END %]
57
                        [% END %]
65
                    </optgroup>
58
                    </optgroup>
66
                [% END %]
59
                [% END %]
(-)a/virtualshelves/addbybiblionumber.pl (-29 / +16 lines)
Lines 148-185 if ($newvirtualshelf) { Link Here
148
    }
148
    }
149
149
150
} else {
150
} else {
151
    my $private_shelves = Koha::Virtualshelves->search(
151
    my $some_private_shelves = Koha::Virtualshelves->get_some_shelves(
152
        {   public                  => 0,
152
        {
153
            owner                   => $loggedinuser,
153
            borrowernumber => $loggedinuser,
154
            allow_change_from_owner => 1,
154
            add_allowed    => 1,
155
        },
155
            public         => 0,
156
        { order_by => 'shelfname' }
156
        }
157
    );
158
    my $shelves_shared_with_me = Koha::Virtualshelves->search(
159
        {   public                              => 0,
160
            'virtualshelfshares.borrowernumber' => $loggedinuser,
161
            allow_change_from_others            => 1,
162
        },
163
        { join => 'virtualshelfshares', }
164
    );
157
    );
165
    my $public_shelves = Koha::Virtualshelves->search(
158
    my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
166
        {   public   => 1,
159
        {
167
            -or      => [
160
            borrowernumber => $loggedinuser,
168
                -and => {
161
            add_allowed    => 1,
169
                    allow_change_from_owner => 1,
162
            public         => 1,
170
                    owner     => $loggedinuser,
163
        }
171
                },
172
                allow_change_from_others => 1,
173
            ],
174
        },
175
        { order_by => 'shelfname' }
176
    );
164
    );
165
166
177
    $template->param(
167
    $template->param(
178
        private_shelves                => $private_shelves,
168
        add_to_some_private_shelves => $some_private_shelves,
179
        private_shelves_shared_with_me => $shelves_shared_with_me,
169
        add_to_some_public_shelves  => $some_public_shelves,
180
        public_shelves                 => $public_shelves,
181
    );
170
    );
182
183
}
171
}
184
172
185
my @biblios;
173
my @biblios;
186
- 

Return to bug 33722