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 189-194 Link Here
189
    <h3>Contents of <em>[% shelf.shelfname | html %]</em></h3>
189
    <h3>Contents of <em>[% shelf.shelfname | html %]</em></h3>
190
    <div class="pages">[% pagination_bar | $raw %]</div>
190
    <div class="pages">[% pagination_bar | $raw %]</div>
191
    <form action="/cgi-bin/koha/virtualshelves/shelves.pl" id="listform" method="post">
191
    <form action="/cgi-bin/koha/virtualshelves/shelves.pl" id="listform" method="post">
192
        [% INCLUDE 'csrf-token.inc' %]
192
        <input type="hidden" name="op" value="remove_biblios" />
193
        <input type="hidden" name="op" value="remove_biblios" />
193
        <input type="hidden" name="referer" value="view" />
194
        <input type="hidden" name="referer" value="view" />
194
        <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
195
        <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
Lines 317-322 Link Here
317
[% IF op == 'add_form' OR op == 'edit_form' %]
318
[% IF op == 'add_form' OR op == 'edit_form' %]
318
319
319
    <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl" class="validated">
320
    <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl" class="validated">
321
        [% INCLUDE 'csrf-token.inc' %]
320
        <fieldset class="rows">
322
        <fieldset class="rows">
321
323
322
        [% IF op == 'add_form' %]
324
        [% 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
    [%~ public      = public | html ~%]
38
    [%~ public      = public | 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="public" value="' _ public _ '" />' ~%]
44
        [%~ action_block = action_block _ '<input type="hidden" name="public" value="' _ public _ '" />' ~%]
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 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