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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt (+4 lines)
Lines 204-209 Link Here
204
                <h1>Transfer ownership of public list [% shelf.shelfname | html %]</h1>
204
                <h1>Transfer ownership of public list [% shelf.shelfname | html %]</h1>
205
205
206
                <form action="/cgi-bin/koha/virtualshelves/shelves.pl" id="transferform" method="post">
206
                <form action="/cgi-bin/koha/virtualshelves/shelves.pl" id="transferform" method="post">
207
                    [% INCLUDE 'csrf-token.inc' %]
207
                    <fieldset>
208
                    <fieldset>
208
                        <input type="hidden" name="op" value="transfer" />
209
                        <input type="hidden" name="op" value="transfer" />
209
                        <input type="hidden" name="public" value="1" />
210
                        <input type="hidden" name="public" value="1" />
Lines 238-243 Link Here
238
                    [% IF ( contents.count ) %]<p>This list contains [% contents.count | html %] titles</p>[% END %]
239
                    [% IF ( contents.count ) %]<p>This list contains [% contents.count | html %] titles</p>[% END %]
239
                    <div class="pages">[% pagination_bar | $raw %]</div>
240
                    <div class="pages">[% pagination_bar | $raw %]</div>
240
                    <form action="/cgi-bin/koha/virtualshelves/shelves.pl" id="listform" method="post">
241
                    <form action="/cgi-bin/koha/virtualshelves/shelves.pl" id="listform" method="post">
242
                        [% INCLUDE 'csrf-token.inc' %]
241
                        <input type="hidden" name="op" value="remove_biblios" />
243
                        <input type="hidden" name="op" value="remove_biblios" />
242
                        <input type="hidden" name="referer" value="view" />
244
                        <input type="hidden" name="referer" value="view" />
243
                        <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
245
                        <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
Lines 389-394 Link Here
389
            [% IF op == 'add_form' OR op == 'edit_form' %]
391
            [% IF op == 'add_form' OR op == 'edit_form' %]
390
392
391
                <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl" class="validated">
393
                <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl" class="validated">
394
                    [% INCLUDE 'csrf-token.inc' %]
392
                    <fieldset class="rows">
395
                    <fieldset class="rows">
393
                        [% IF op == 'add_form' %]
396
                        [% IF op == 'add_form' %]
394
                            <legend><h1>Create a new list</h1></legend>
397
                            <legend><h1>Create a new list</h1></legend>
Lines 546-551 Link Here
546
    <div class="modal" id="addToList" tabindex="-1" role="dialog" aria-labelledby="addToListLabel">
549
    <div class="modal" id="addToList" tabindex="-1" role="dialog" aria-labelledby="addToListLabel">
547
        <div class="modal-dialog" role="document">
550
        <div class="modal-dialog" role="document">
548
            <form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
551
            <form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
552
                [% INCLUDE 'csrf-token.inc' %]
549
                <div class="modal-content">
553
                <div class="modal-content">
550
                    <div class="modal-header">
554
                    <div class="modal-header">
551
                        <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
555
                        <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_delete_shelf ~%]
50
    [%~ IF 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
    GetNormalizedUPC
29
    GetNormalizedUPC
30
);
30
);
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 64-69 if ( $op eq 'add_form' ) { Link Here
64
    # Only pass default
64
    # Only pass default
65
    $shelf = { allow_change_from_owner => 1 };
65
    $shelf = { allow_change_from_owner => 1 };
66
} elsif ( $op eq 'edit_form' ) {
66
} elsif ( $op eq 'edit_form' ) {
67
    output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' });
67
    $shelfnumber = $query->param('shelfnumber');
68
    $shelfnumber = $query->param('shelfnumber');
68
    $shelf       = Koha::Virtualshelves->find($shelfnumber);
69
    $shelf       = Koha::Virtualshelves->find($shelfnumber);
69
70
Lines 79-84 if ( $op eq 'add_form' ) { Link Here
79
        push @messages, { type => 'alert', code => 'does_not_exist' };
80
        push @messages, { type => 'alert', code => 'does_not_exist' };
80
    }
81
    }
81
} elsif ( $op eq 'add' ) {
82
} elsif ( $op eq 'add' ) {
83
    output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' });
82
    my $allow_changes_from = $query->param('allow_changes_from');
84
    my $allow_changes_from = $query->param('allow_changes_from');
83
    eval {
85
    eval {
84
        $shelf = Koha::Virtualshelf->new(
86
        $shelf = Koha::Virtualshelf->new(
Lines 105-110 if ( $op eq 'add_form' ) { Link Here
105
        $op = 'view';
107
        $op = 'view';
106
    }
108
    }
107
} elsif ( $op eq 'edit' ) {
109
} elsif ( $op eq 'edit' ) {
110
    output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' });
108
    $shelfnumber = $query->param('shelfnumber');
111
    $shelfnumber = $query->param('shelfnumber');
109
    $shelf       = Koha::Virtualshelves->find($shelfnumber);
112
    $shelf       = Koha::Virtualshelves->find($shelfnumber);
110
113
Lines 136-141 if ( $op eq 'add_form' ) { Link Here
136
        push @messages, { type => 'alert', code => 'does_not_exist' };
139
        push @messages, { type => 'alert', code => 'does_not_exist' };
137
    }
140
    }
138
} elsif ( $op eq 'delete' ) {
141
} elsif ( $op eq 'delete' ) {
142
    output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' });
139
    $shelfnumber = $query->param('shelfnumber');
143
    $shelfnumber = $query->param('shelfnumber');
140
    $shelf       = Koha::Virtualshelves->find($shelfnumber);
144
    $shelf       = Koha::Virtualshelves->find($shelfnumber);
141
    if ($shelf) {
145
    if ($shelf) {
Lines 154-159 if ( $op eq 'add_form' ) { Link Here
154
    }
158
    }
155
    $op = 'list';
159
    $op = 'list';
156
} elsif ( $op eq 'add_biblio' ) {
160
} elsif ( $op eq 'add_biblio' ) {
161
    output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' });
157
    $shelfnumber = $query->param('shelfnumber');
162
    $shelfnumber = $query->param('shelfnumber');
158
    $shelf = Koha::Virtualshelves->find($shelfnumber);
163
    $shelf = Koha::Virtualshelves->find($shelfnumber);
159
    if ($shelf) {
164
    if ($shelf) {
Lines 210-215 if ( $op eq 'add_form' ) { Link Here
210
    }
215
    }
211
    $op = $referer;
216
    $op = $referer;
212
} elsif ( $op eq 'remove_biblios' ) {
217
} elsif ( $op eq 'remove_biblios' ) {
218
    output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' });
213
    $shelfnumber = $query->param('shelfnumber');
219
    $shelfnumber = $query->param('shelfnumber');
214
    $shelf = Koha::Virtualshelves->find($shelfnumber);
220
    $shelf = Koha::Virtualshelves->find($shelfnumber);
215
    my @biblionumbers = $query->multi_param('biblionumber');
221
    my @biblionumbers = $query->multi_param('biblionumber');
216
- 

Return to bug 22990