Lines 29-35
use C4::Koha qw(
Link Here
|
29 |
); |
29 |
); |
30 |
use C4::Items qw( GetItemsLocationInfo ); |
30 |
use C4::Items qw( GetItemsLocationInfo ); |
31 |
use C4::Members; |
31 |
use C4::Members; |
32 |
use C4::Output qw( pagination_bar output_html_with_http_headers ); |
32 |
use C4::Output qw( pagination_bar output_html_with_http_headers output_and_exit_if_error ); |
33 |
use C4::XSLT qw( XSLTParse4Display ); |
33 |
use C4::XSLT qw( XSLTParse4Display ); |
34 |
|
34 |
|
35 |
use Koha::Biblios; |
35 |
use Koha::Biblios; |
Lines 61-66
if ( $op eq 'add_form' ) {
Link Here
|
61 |
# Only pass default |
61 |
# Only pass default |
62 |
$shelf = { allow_change_from_owner => 1 }; |
62 |
$shelf = { allow_change_from_owner => 1 }; |
63 |
} elsif ( $op eq 'edit_form' ) { |
63 |
} elsif ( $op eq 'edit_form' ) { |
|
|
64 |
output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' }); |
64 |
$shelfnumber = $query->param('shelfnumber'); |
65 |
$shelfnumber = $query->param('shelfnumber'); |
65 |
$shelf = Koha::Virtualshelves->find($shelfnumber); |
66 |
$shelf = Koha::Virtualshelves->find($shelfnumber); |
66 |
|
67 |
|
Lines 76-81
if ( $op eq 'add_form' ) {
Link Here
|
76 |
push @messages, { type => 'alert', code => 'does_not_exist' }; |
77 |
push @messages, { type => 'alert', code => 'does_not_exist' }; |
77 |
} |
78 |
} |
78 |
} elsif ( $op eq 'add' ) { |
79 |
} elsif ( $op eq 'add' ) { |
|
|
80 |
output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' }); |
79 |
my $allow_changes_from = $query->param('allow_changes_from'); |
81 |
my $allow_changes_from = $query->param('allow_changes_from'); |
80 |
eval { |
82 |
eval { |
81 |
$shelf = Koha::Virtualshelf->new( |
83 |
$shelf = Koha::Virtualshelf->new( |
Lines 100-105
if ( $op eq 'add_form' ) {
Link Here
|
100 |
$op = 'view'; |
102 |
$op = 'view'; |
101 |
} |
103 |
} |
102 |
} elsif ( $op eq 'edit' ) { |
104 |
} elsif ( $op eq 'edit' ) { |
|
|
105 |
output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' }); |
103 |
$shelfnumber = $query->param('shelfnumber'); |
106 |
$shelfnumber = $query->param('shelfnumber'); |
104 |
$shelf = Koha::Virtualshelves->find($shelfnumber); |
107 |
$shelf = Koha::Virtualshelves->find($shelfnumber); |
105 |
|
108 |
|
Lines 129-134
if ( $op eq 'add_form' ) {
Link Here
|
129 |
push @messages, { type => 'alert', code => 'does_not_exist' }; |
132 |
push @messages, { type => 'alert', code => 'does_not_exist' }; |
130 |
} |
133 |
} |
131 |
} elsif ( $op eq 'delete' ) { |
134 |
} elsif ( $op eq 'delete' ) { |
|
|
135 |
output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' }); |
132 |
$shelfnumber = $query->param('shelfnumber'); |
136 |
$shelfnumber = $query->param('shelfnumber'); |
133 |
$shelf = Koha::Virtualshelves->find($shelfnumber); |
137 |
$shelf = Koha::Virtualshelves->find($shelfnumber); |
134 |
if ($shelf) { |
138 |
if ($shelf) { |
Lines 147-152
if ( $op eq 'add_form' ) {
Link Here
|
147 |
} |
151 |
} |
148 |
$op = 'list'; |
152 |
$op = 'list'; |
149 |
} elsif ( $op eq 'add_biblio' ) { |
153 |
} elsif ( $op eq 'add_biblio' ) { |
|
|
154 |
output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' }); |
150 |
$shelfnumber = $query->param('shelfnumber'); |
155 |
$shelfnumber = $query->param('shelfnumber'); |
151 |
$shelf = Koha::Virtualshelves->find($shelfnumber); |
156 |
$shelf = Koha::Virtualshelves->find($shelfnumber); |
152 |
if ($shelf) { |
157 |
if ($shelf) { |
Lines 203-208
if ( $op eq 'add_form' ) {
Link Here
|
203 |
} |
208 |
} |
204 |
$op = $referer; |
209 |
$op = $referer; |
205 |
} elsif ( $op eq 'remove_biblios' ) { |
210 |
} elsif ( $op eq 'remove_biblios' ) { |
|
|
211 |
output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' }); |
206 |
$shelfnumber = $query->param('shelfnumber'); |
212 |
$shelfnumber = $query->param('shelfnumber'); |
207 |
$shelf = Koha::Virtualshelves->find($shelfnumber); |
213 |
$shelf = Koha::Virtualshelves->find($shelfnumber); |
208 |
my @biblionumbers = $query->multi_param('biblionumber'); |
214 |
my @biblionumbers = $query->multi_param('biblionumber'); |
209 |
- |
|
|