|
Lines 118-135
if ($newvirtualshelf) {
Link Here
|
| 118 |
}, |
118 |
}, |
| 119 |
{ join => 'virtualshelfshares', } |
119 |
{ join => 'virtualshelfshares', } |
| 120 |
); |
120 |
); |
| 121 |
my $public_shelves = Koha::Virtualshelves->search( |
121 |
my $public_shelves; |
| 122 |
{ category => 2, |
122 |
my $logged_in_patron = Koha::Patrons->find( $loggedinuser ); |
| 123 |
-or => [ |
123 |
if ( haspermission( $logged_in_patron->userid, {'catalogue' => 1})) { |
| 124 |
-and => { |
124 |
$public_shelves = Koha::Virtualshelves->search( |
| 125 |
allow_change_from_owner => 1, |
125 |
{ category => 2, |
| 126 |
owner => $loggedinuser, |
126 |
-or => [ |
| 127 |
}, |
127 |
-and => { |
| 128 |
allow_change_from_others => 1, |
128 |
allow_change_from_owner => 1, |
| 129 |
], |
129 |
owner => $loggedinuser, |
| 130 |
}, |
130 |
}, |
| 131 |
{ order_by => 'shelfname' } |
131 |
allow_change_from_others => 1, |
| 132 |
); |
132 |
allow_change_from_staff => 1 |
|
|
133 |
], |
| 134 |
}, |
| 135 |
{ order_by => 'shelfname' } |
| 136 |
); |
| 137 |
} else { |
| 138 |
$public_shelves = Koha::Virtualshelves->search( |
| 139 |
{ category => 2, |
| 140 |
-or => [ |
| 141 |
-and => { |
| 142 |
allow_change_from_owner => 1, |
| 143 |
owner => $loggedinuser, |
| 144 |
}, |
| 145 |
allow_change_from_others => 1, |
| 146 |
], |
| 147 |
}, |
| 148 |
{order_by => 'shelfname' } |
| 149 |
); |
| 150 |
} |
| 151 |
|
| 133 |
$template->param( |
152 |
$template->param( |
| 134 |
private_shelves => $private_shelves, |
153 |
private_shelves => $private_shelves, |
| 135 |
private_shelves_shared_with_me => $shelves_shared_with_me, |
154 |
private_shelves_shared_with_me => $shelves_shared_with_me, |