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 / +3 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 129-134 if ( $op eq 'add_form' ) { Link Here
129
        push @messages, { type => 'alert', code => 'does_not_exist' };
130
        push @messages, { type => 'alert', code => 'does_not_exist' };
130
    }
131
    }
131
} elsif ( $op eq 'delete' ) {
132
} elsif ( $op eq 'delete' ) {
133
    output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' });
132
    $shelfnumber = $query->param('shelfnumber');
134
    $shelfnumber = $query->param('shelfnumber');
133
    $shelf       = Koha::Virtualshelves->find($shelfnumber);
135
    $shelf       = Koha::Virtualshelves->find($shelfnumber);
134
    if ($shelf) {
136
    if ($shelf) {
135
- 

Return to bug 22990