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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt (+3 lines)
Lines 188-193 Link Here
188
    [% IF itemsloop %]
188
    [% IF itemsloop %]
189
    <div class="pages">[% pagination_bar | $raw %]</div>
189
    <div class="pages">[% pagination_bar | $raw %]</div>
190
    <form action="/cgi-bin/koha/virtualshelves/shelves.pl" id="listform" method="post">
190
    <form action="/cgi-bin/koha/virtualshelves/shelves.pl" id="listform" method="post">
191
        [% INCLUDE 'csrf-token.inc' %]
191
        <input type="hidden" name="op" value="remove_biblios" />
192
        <input type="hidden" name="op" value="remove_biblios" />
192
        <input type="hidden" name="referer" value="view" />
193
        <input type="hidden" name="referer" value="view" />
193
        <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
194
        <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
Lines 316-321 Link Here
316
[% IF op == 'add_form' OR op == 'edit_form' %]
317
[% IF op == 'add_form' OR op == 'edit_form' %]
317
318
318
    <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl" class="validated">
319
    <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl" class="validated">
320
        [% INCLUDE 'csrf-token.inc' %]
319
        <fieldset class="rows">
321
        <fieldset class="rows">
320
322
321
        [% IF op == 'add_form' %]
323
        [% IF op == 'add_form' %]
Lines 449-454 Link Here
449
    <div class="modal" id="addToList" tabindex="-1" role="dialog" aria-labelledby="addToListLabel">
451
    <div class="modal" id="addToList" tabindex="-1" role="dialog" aria-labelledby="addToListLabel">
450
        <div class="modal-dialog" role="document">
452
        <div class="modal-dialog" role="document">
451
            <form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
453
            <form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
454
                [% INCLUDE 'csrf-token.inc' %]
452
                <div class="modal-content">
455
                <div class="modal-content">
453
                    <div class="modal-header">
456
                    <div class="modal-header">
454
                        <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
457
                        <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt (+2 lines)
Lines 39-44 Link Here
39
    [%~ public      = public | html ~%]
39
    [%~ public      = public | html ~%]
40
    [%~ IF can_manage_shelf ~%]
40
    [%~ IF can_manage_shelf ~%]
41
        [%~ action_block =                '<form action="shelves.pl" method="get">' ~%]
41
        [%~ action_block =                '<form action="shelves.pl" method="get">' ~%]
42
        [%~ action_block = action_block _ '[% INCLUDE 'csrf-token.inc' %]' ~%]
42
        [%~ action_block = action_block _ '<input type="hidden" name="shelfnumber" value="' _ shelfnumber  _ '" />' ~%]
43
        [%~ action_block = action_block _ '<input type="hidden" name="shelfnumber" value="' _ shelfnumber  _ '" />' ~%]
43
        [%~ action_block = action_block _ '<input type="hidden" name="op" value="edit_form" />' ~%]
44
        [%~ action_block = action_block _ '<input type="hidden" name="op" value="edit_form" />' ~%]
44
        [%~ action_block = action_block _ '<input type="hidden" name="public" value="' _ public _ '" />' ~%]
45
        [%~ action_block = action_block _ '<input type="hidden" name="public" value="' _ public _ '" />' ~%]
Lines 48-53 Link Here
48
    [%~ END ~%]
49
    [%~ END ~%]
49
    [%~ IF can_manage_shelf OR can_delete_shelf ~%]
50
    [%~ IF can_manage_shelf OR can_delete_shelf ~%]
50
        [%~ action_block = action_block _ ' <form action="shelves.pl" method="post">' ~%]
51
        [%~ action_block = action_block _ ' <form action="shelves.pl" method="post">' ~%]
52
        [%~ action_block = action_block _ '[% INCLUDE 'csrf-token.inc' %]' ~%]
51
        [%~ action_block = action_block _ '<input type="hidden" name="shelves" value="1" />' ~%]
53
        [%~ action_block = action_block _ '<input type="hidden" name="shelves" value="1" />' ~%]
52
        [%~ action_block = action_block _ '<input type="hidden" name="op" value="delete" />' ~%]
54
        [%~ action_block = action_block _ '<input type="hidden" name="op" value="delete" />' ~%]
53
        [%~ action_block = action_block _ '<input type="hidden" name="shelfnumber" value="' _ shelfnumber  _ '" />' ~%]
55
        [%~ action_block = action_block _ '<input type="hidden" name="shelfnumber" value="' _ shelfnumber  _ '" />' ~%]
(-)a/virtualshelves/shelves.pl (-2 / +7 lines)
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 62-67 if ( $op eq 'add_form' ) { Link Here
62
    # Only pass default
62
    # Only pass default
63
    $shelf = { allow_change_from_owner => 1 };
63
    $shelf = { allow_change_from_owner => 1 };
64
} elsif ( $op eq 'edit_form' ) {
64
} elsif ( $op eq 'edit_form' ) {
65
    output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' });
65
    $shelfnumber = $query->param('shelfnumber');
66
    $shelfnumber = $query->param('shelfnumber');
66
    $shelf       = Koha::Virtualshelves->find($shelfnumber);
67
    $shelf       = Koha::Virtualshelves->find($shelfnumber);
67
68
Lines 77-82 if ( $op eq 'add_form' ) { Link Here
77
        push @messages, { type => 'alert', code => 'does_not_exist' };
78
        push @messages, { type => 'alert', code => 'does_not_exist' };
78
    }
79
    }
79
} elsif ( $op eq 'add' ) {
80
} elsif ( $op eq 'add' ) {
81
    output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' });
80
    my $allow_changes_from = $query->param('allow_changes_from');
82
    my $allow_changes_from = $query->param('allow_changes_from');
81
    eval {
83
    eval {
82
        $shelf = Koha::Virtualshelf->new(
84
        $shelf = Koha::Virtualshelf->new(
Lines 102-107 if ( $op eq 'add_form' ) { Link Here
102
        $op = 'view';
104
        $op = 'view';
103
    }
105
    }
104
} elsif ( $op eq 'edit' ) {
106
} elsif ( $op eq 'edit' ) {
107
    output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' });
105
    $shelfnumber = $query->param('shelfnumber');
108
    $shelfnumber = $query->param('shelfnumber');
106
    $shelf       = Koha::Virtualshelves->find($shelfnumber);
109
    $shelf       = Koha::Virtualshelves->find($shelfnumber);
107
110
Lines 132-137 if ( $op eq 'add_form' ) { Link Here
132
        push @messages, { type => 'alert', code => 'does_not_exist' };
135
        push @messages, { type => 'alert', code => 'does_not_exist' };
133
    }
136
    }
134
} elsif ( $op eq 'delete' ) {
137
} elsif ( $op eq 'delete' ) {
138
    output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' });
135
    $shelfnumber = $query->param('shelfnumber');
139
    $shelfnumber = $query->param('shelfnumber');
136
    $shelf       = Koha::Virtualshelves->find($shelfnumber);
140
    $shelf       = Koha::Virtualshelves->find($shelfnumber);
137
    if ($shelf) {
141
    if ($shelf) {
Lines 150-155 if ( $op eq 'add_form' ) { Link Here
150
    }
154
    }
151
    $op = 'list';
155
    $op = 'list';
152
} elsif ( $op eq 'add_biblio' ) {
156
} elsif ( $op eq 'add_biblio' ) {
157
    output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' });
153
    $shelfnumber = $query->param('shelfnumber');
158
    $shelfnumber = $query->param('shelfnumber');
154
    $shelf = Koha::Virtualshelves->find($shelfnumber);
159
    $shelf = Koha::Virtualshelves->find($shelfnumber);
155
    if ($shelf) {
160
    if ($shelf) {
Lines 206-211 if ( $op eq 'add_form' ) { Link Here
206
    }
211
    }
207
    $op = $referer;
212
    $op = $referer;
208
} elsif ( $op eq 'remove_biblios' ) {
213
} elsif ( $op eq 'remove_biblios' ) {
214
    output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' });
209
    $shelfnumber = $query->param('shelfnumber');
215
    $shelfnumber = $query->param('shelfnumber');
210
    $shelf = Koha::Virtualshelves->find($shelfnumber);
216
    $shelf = Koha::Virtualshelves->find($shelfnumber);
211
    my @biblionumbers = $query->multi_param('biblionumber');
217
    my @biblionumbers = $query->multi_param('biblionumber');
212
- 

Return to bug 22990