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
    <h3>Contents of <em>[% shelf.shelfname | html %]</em></h3>
188
    <h3>Contents of <em>[% shelf.shelfname | html %]</em></h3>
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 450-455 Link Here
450
    <div class="modal" id="addToList" tabindex="-1" role="dialog" aria-labelledby="addToListLabel">
452
    <div class="modal" id="addToList" tabindex="-1" role="dialog" aria-labelledby="addToListLabel">
451
        <div class="modal-dialog" role="document">
453
        <div class="modal-dialog" role="document">
452
            <form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
454
            <form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
455
                [% INCLUDE 'csrf-token.inc' %]
453
                <div class="modal-content">
456
                <div class="modal-content">
454
                    <div class="modal-header">
457
                    <div class="modal-header">
455
                        <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
458
                        <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 38-43 Link Here
38
    [%~ type        = type | html ~%]
38
    [%~ type        = type | html ~%]
39
    [%~ IF can_manage_shelf ~%]
39
    [%~ IF can_manage_shelf ~%]
40
        [%~ action_block =                '<form action="shelves.pl" method="get">' ~%]
40
        [%~ action_block =                '<form action="shelves.pl" method="get">' ~%]
41
        [%~ action_block = action_block _ '[% INCLUDE 'csrf-token.inc' %]' ~%]
41
        [%~ action_block = action_block _ '<input type="hidden" name="shelfnumber" value="' _ shelfnumber  _ '" />' ~%]
42
        [%~ action_block = action_block _ '<input type="hidden" name="shelfnumber" value="' _ shelfnumber  _ '" />' ~%]
42
        [%~ action_block = action_block _ '<input type="hidden" name="op" value="edit_form" />' ~%]
43
        [%~ action_block = action_block _ '<input type="hidden" name="op" value="edit_form" />' ~%]
43
        [%~ action_block = action_block _ '<input type="hidden" name="category" value="' _ type _ '" />' ~%]
44
        [%~ action_block = action_block _ '<input type="hidden" name="category" value="' _ type _ '" />' ~%]
Lines 47-52 Link Here
47
    [%~ END ~%]
48
    [%~ END ~%]
48
    [%~ IF can_manage_shelf OR can_delete_shelf ~%]
49
    [%~ IF can_manage_shelf OR can_delete_shelf ~%]
49
        [%~ action_block = action_block _ ' <form action="shelves.pl" method="post">' ~%]
50
        [%~ action_block = action_block _ ' <form action="shelves.pl" method="post">' ~%]
51
        [%~ action_block = action_block _ '[% INCLUDE 'csrf-token.inc' %]' ~%]
50
        [%~ action_block = action_block _ '<input type="hidden" name="shelves" value="1" />' ~%]
52
        [%~ action_block = action_block _ '<input type="hidden" name="shelves" value="1" />' ~%]
51
        [%~ action_block = action_block _ '<input type="hidden" name="op" value="delete" />' ~%]
53
        [%~ action_block = action_block _ '<input type="hidden" name="op" value="delete" />' ~%]
52
        [%~ action_block = action_block _ '<input type="hidden" name="shelfnumber" value="' _ shelfnumber  _ '" />' ~%]
54
        [%~ 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 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
- 

Return to bug 22990