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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt (-4 / +7 lines)
Lines 45-51 Link Here
45
45
46
[% INCLUDE 'members-toolbar.inc' %]
46
[% INCLUDE 'members-toolbar.inc' %]
47
<h1>Account for [% INCLUDE 'patron-title.inc' %]</h1>
47
<h1>Account for [% INCLUDE 'patron-title.inc' %]</h1>
48
<form action="/cgi-bin/koha/members/boraccount.pl" method="get"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" /></form>
48
<form action="/cgi-bin/koha/members/boraccount.pl" method="get">[% INCLUDE 'csrf-token.inc' %]<input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" /></form>
49
49
50
<!-- The manual invoice and credit buttons -->
50
<!-- The manual invoice and credit buttons -->
51
<div class="statictabs">
51
<div class="statictabs">
Lines 112-125 Link Here
112
        [% END %]
112
        [% END %]
113
        <a href="accountline-details.pl?accountlines_id=[% account.accountlines_id | uri %]" class="btn btn-default btn-xs details-action"><i class="fa fa-list"></i> Details</a>
113
        <a href="accountline-details.pl?accountlines_id=[% account.accountlines_id | uri %]" class="btn btn-default btn-xs details-action"><i class="fa fa-list"></i> Details</a>
114
        [% IF account.is_debit && account.amountoutstanding > 0 %]
114
        [% IF account.is_debit && account.amountoutstanding > 0 %]
115
            <a class="btn btn-default btn-xs pay-action" href="/cgi-bin/koha/members/paycollect.pl?borrowernumber=[% account.borrowernumber | html %]&pay_individual=1&debit_type_code=[% account.debit_type_code | html %]&amount=[% account.amount | html %]&amountoutstanding=[% account.amountoutstanding | html %]&description=[% account.description | html %]&itemnumber=[% account.itemnumber | html %]&accountlines_id=[% account.accountlines_id | html %]"><i class="fa fa-money"></i> Pay</a>
115
            <a class="btn btn-default btn-xs pay-action" href="/cgi-bin/koha/members/paycollect.pl?borrowernumber=[% account.borrowernumber | html %]&pay_individual=1&debit_type_code=[% account.debit_type_code | html %]&amount=[% account.amount | html %]&amountoutstanding=[% account.amountoutstanding | html %]&description=[% account.description | html %]&itemnumber=[% account.itemnumber | html %]&accountlines_id=[% account.accountlines_id | html %]&amp;csrf_token=[% csrf_token | html %]"><i class="fa fa-money"></i> Pay</a>
116
        [% END %]
116
        [% END %]
117
        [% IF account.is_credit && account.status != 'VOID' %]
117
        [% IF account.is_credit && account.status != 'VOID' %]
118
          <a href="boraccount.pl?action=void&amp;accountlines_id=[% account.accountlines_id | uri %]&amp;borrowernumber=[% account.borrowernumber | uri %]" class="btn btn-default btn-xs void-action"><i class="fa fa-ban"></i> Void payment</a>
118
          <a href="boraccount.pl?action=void&amp;accountlines_id=[% account.accountlines_id | uri %]&amp;borrowernumber=[% account.borrowernumber | uri %]&amp;csrf_token=[% csrf_token | uri %]" class="btn btn-default btn-xs void-action"><i class="fa fa-ban"></i> Void payment</a>
119
        [% END %]
119
        [% END %]
120
        [% IF account.is_debit && account.amount == account.amountoutstanding && account.status != 'CANCELLED' && !(account.debit_type_code == 'PAYOUT') %]
120
        [% IF account.is_debit && account.amount == account.amountoutstanding && account.status != 'CANCELLED' && !(account.debit_type_code == 'PAYOUT') %]
121
          <form method="post" action="/cgi-bin/koha/members/cancel-charge.pl">
121
          <form method="post" action="/cgi-bin/koha/members/cancel-charge.pl">
122
            <input type="hidden" name="csrf_token" value="[% csrf_token | html %]">
122
            [% INCLUDE 'csrf-token.inc' %]
123
            <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]">
123
            <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]">
124
            <input type="hidden" name="accountlines_id" value="[% account.accountlines_id | html %]">
124
            <input type="hidden" name="accountlines_id" value="[% account.accountlines_id | html %]">
125
            <button type="submit" class="btn btn-default btn-xs cancel-action">
125
            <button type="submit" class="btn btn-default btn-xs cancel-action">
Lines 174-179 Link Here
174
    <!-- Issue payout modal -->
174
    <!-- Issue payout modal -->
175
    <div class="modal" id="issuePayoutModal" tabindex="-1" role="dialog" aria-labelledby="issuePayoutLabel">
175
    <div class="modal" id="issuePayoutModal" tabindex="-1" role="dialog" aria-labelledby="issuePayoutLabel">
176
        <form  id="payout_form" action="/cgi-bin/koha/members/boraccount.pl" method="get" enctype="multipart/form-data" class="validated">
176
        <form  id="payout_form" action="/cgi-bin/koha/members/boraccount.pl" method="get" enctype="multipart/form-data" class="validated">
177
            [% INCLUDE 'csrf-token.inc' %]
177
            <input type="hidden" name="accountlines_id" value="" id="payoutline">
178
            <input type="hidden" name="accountlines_id" value="" id="payoutline">
178
            <input type="hidden" name="action" value="payout">
179
            <input type="hidden" name="action" value="payout">
179
            <input type="hidden" name="borrowernumber" value="[% account.borrowernumber | html %]">
180
            <input type="hidden" name="borrowernumber" value="[% account.borrowernumber | html %]">
Lines 228-233 Link Here
228
    <!-- Issue refund modal -->
229
    <!-- Issue refund modal -->
229
    <div class="modal" id="issueRefundModal" tabindex="-1" role="dialog" aria-labelledby="issueRefundLabel">
230
    <div class="modal" id="issueRefundModal" tabindex="-1" role="dialog" aria-labelledby="issueRefundLabel">
230
        <form  id="refund_form" action="/cgi-bin/koha/members/boraccount.pl" method="get" enctype="multipart/form-data" class="validated">
231
        <form  id="refund_form" action="/cgi-bin/koha/members/boraccount.pl" method="get" enctype="multipart/form-data" class="validated">
232
            [% INCLUDE 'csrf-token.inc' %]
231
            <input type="hidden" name="accountlines_id" value="" id="refundline">
233
            <input type="hidden" name="accountlines_id" value="" id="refundline">
232
            <input type="hidden" name="action" value="refund">
234
            <input type="hidden" name="action" value="refund">
233
            <input type="hidden" name="borrowernumber" value="[% account.borrowernumber | html %]">
235
            <input type="hidden" name="borrowernumber" value="[% account.borrowernumber | html %]">
Lines 285-290 Link Here
285
    <!-- Apply discount modal -->
287
    <!-- Apply discount modal -->
286
    <div class="modal" id="applyDiscountModal" tabindex="-1" role="dialog" aria-labelledby="applyDiscountLabel">
288
    <div class="modal" id="applyDiscountModal" tabindex="-1" role="dialog" aria-labelledby="applyDiscountLabel">
287
        <form  id="discount_form" action="/cgi-bin/koha/members/boraccount.pl" method="get" enctype="multipart/form-data" class="validated">
289
        <form  id="discount_form" action="/cgi-bin/koha/members/boraccount.pl" method="get" enctype="multipart/form-data" class="validated">
290
            [% INCLUDE 'csrf-token.inc' %]
288
            <input type="hidden" name="accountlines_id" value="" id="discountline">
291
            <input type="hidden" name="accountlines_id" value="" id="discountline">
289
            <input type="hidden" name="action" value="discount">
292
            <input type="hidden" name="action" value="discount">
290
            <input type="hidden" name="borrowernumber" value="[% account.borrowernumber | html %]">
293
            <input type="hidden" name="borrowernumber" value="[% account.borrowernumber | html %]">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt (+1 lines)
Lines 56-61 Link Here
56
[% IF ( accounts ) %]
56
[% IF ( accounts ) %]
57
    <form action="/cgi-bin/koha/members/pay.pl" method="post" id="pay-fines-form">
57
    <form action="/cgi-bin/koha/members/pay.pl" method="post" id="pay-fines-form">
58
    <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
58
    <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
59
    [% INCLUDE 'csrf-token.inc' %]
59
<p><span class="checkall"><a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a></span> | <span class="clearall"><a id="CheckNone" href="#"><i class="fa fa-remove"></i> Clear all</a></span></p>
60
<p><span class="checkall"><a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a></span> | <span class="clearall"><a id="CheckNone" href="#"><i class="fa fa-remove"></i> Clear all</a></span></p>
60
<table id="finest">
61
<table id="finest">
61
<thead>
62
<thead>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt (-6 / +9 lines)
Lines 104-109 Link Here
104
        </ol>
104
        </ol>
105
    </nav> <!-- /.breadcrumbs -->
105
    </nav> <!-- /.breadcrumbs -->
106
106
107
    [% INCLUDE 'blocking_errors.inc' %]
108
107
    [% IF ( op == 'show' ) %]
109
    [% IF ( op == 'show' ) %]
108
        <div class="main container-fluid">
110
        <div class="main container-fluid">
109
            <div class="row">
111
            <div class="row">
Lines 345-350 Link Here
345
            [% END %]
347
            [% END %]
346
348
347
            <form id="add_edit" action="suggestion.pl" method="post" class="validated">
349
            <form id="add_edit" action="suggestion.pl" method="post" class="validated">
350
                [% INCLUDE 'csrf-token.inc' %]
348
                <input type="hidden" name="redirect" id="redirect" value="[% redirect | html %]" />
351
                <input type="hidden" name="redirect" id="redirect" value="[% redirect | html %]" />
349
                <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber | html %]" />
352
                <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber | html %]" />
350
                [% IF ( suggestionid ) %]
353
                [% IF ( suggestionid ) %]
Lines 707-723 Link Here
707
                                    <span>No name</span>
710
                                    <span>No name</span>
708
                                [% END %]
711
                                [% END %]
709
                            [% END %]
712
                            [% END %]
710
                            ([% suggestion.suggestions_loop.size | html %])
713
                            ([% suggestion.suggestions_loop.size | html %])</a></li>
711
                            </a>
712
                            </li>
713
                        [% END # /FOREACH suggestion %]
714
                        [% END # /FOREACH suggestion %]
714
                    </ul> <!-- /.ui-tabs-nav -->
715
                    </ul> <!-- /.ui-tabs-nav -->
715
                    <div class="tab-content">
716
                    <div class="tab-content">
716
            [% END # /UNLESS notabs %]
717
            [% END # /UNLESS notabs %]
717
718
718
                [% FOREACH suggestion IN suggestions %]
719
            [% FOREACH suggestion IN suggestions %]
719
                    <div id="[% suggestion.suggestiontype | html %]" role="tabpanel" class="tab-pane">
720
                <div id="[% suggestion.suggestiontype | html %]">
720
                        <form class="update_suggestions" name="f" method="post" action="/cgi-bin/koha/suggestion/suggestion.pl#[% suggestion.suggestiontype| uri %]">
721
                    <form class="update_suggestions" name="f" method="post" action="/cgi-bin/koha/suggestion/suggestion.pl#[% suggestion.suggestiontype| uri %]">
722
                        [% INCLUDE 'csrf-token.inc' %]
721
723
722
                            [% IF ( suggestion.suggestions_loop ) %]
724
                            [% IF ( suggestion.suggestions_loop ) %]
723
                                <p>
725
                                <p>
Lines 991-996 Link Here
991
                <div class="col-sm-2 col-sm-pull-10">
993
                <div class="col-sm-2 col-sm-pull-10">
992
                    <aside>
994
                    <aside>
993
                        <form name="suggestionfilter" action="suggestion.pl" method="get">
995
                        <form name="suggestionfilter" action="suggestion.pl" method="get">
996
                            [% INCLUDE 'csrf-token.inc' %]
994
                            <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
997
                            <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
995
                            <fieldset class="brief">
998
                            <fieldset class="brief">
996
                                <ol style="display:block;">
999
                                <ol style="display:block;">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt (-1 / +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 203-209 Link Here
203
    <div id="searchheader" class="searchheader noprint">
204
    <div id="searchheader" class="searchheader noprint">
204
        <div id="selection_ops"><span class="checkall"></span> |
205
        <div id="selection_ops"><span class="checkall"></span> |
205
        <span class="clearall"></span>
206
        <span class="clearall"></span>
206
207
        <span class="addto">| </span>
207
        <span class="addto">| </span>
208
        &nbsp;
208
        &nbsp;
209
        [% IF CAN_user_reserveforothers && Koha.Preference('DisplayMultiPlaceHold') %]
209
        [% IF CAN_user_reserveforothers && Koha.Preference('DisplayMultiPlaceHold') %]
Lines 316-321 Link Here
316
[% IF op == 'add_form' OR op == 'edit_form' %]
316
[% IF op == 'add_form' OR op == 'edit_form' %]
317
317
318
    <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl" class="validated">
318
    <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl" class="validated">
319
        [% INCLUDE 'csrf-token.inc' %]
319
        <fieldset class="rows">
320
        <fieldset class="rows">
320
321
321
        [% IF op == 'add_form' %]
322
        [% IF op == 'add_form' %]
Lines 449-454 Link Here
449
    <div class="modal" id="addToList" tabindex="-1" role="dialog" aria-labelledby="addToListLabel">
450
    <div class="modal" id="addToList" tabindex="-1" role="dialog" aria-labelledby="addToListLabel">
450
        <div class="modal-dialog" role="document">
451
        <div class="modal-dialog" role="document">
451
            <form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
452
            <form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
453
                [% INCLUDE 'csrf-token.inc' %]
452
                <div class="modal-content">
454
                <div class="modal-content">
453
                    <div class="modal-header">
455
                    <div class="modal-header">
454
                        <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
456
                        <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 (+3 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 = BLOCK ~%][%~ action_block | $raw ~%][%~ INCLUDE 'csrf-token.inc' | trim ~%][%~ END ~%]
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 = BLOCK ~%][%~ action_block | $raw ~%][%~ INCLUDE 'csrf-token.inc' | trim ~%][%~ END ~%]
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  _ '" />' ~%]
Lines 60-63 Link Here
60
    [%~ SET action_block = 'None' ~%]
62
    [%~ SET action_block = 'None' ~%]
61
[%~ END ~%]
63
[%~ END ~%]
62
[%~ To.json(action_block) | $raw ~%]
64
[%~ To.json(action_block) | $raw ~%]
65
63
[%~ END ~%]
66
[%~ END ~%]
(-)a/members/boraccount.pl (-5 / +10 lines)
Lines 69-74 output_and_exit_if_error( $input, $cookie, $template, { module => 'members', log Link Here
69
my $registerid = $input->param('registerid');
69
my $registerid = $input->param('registerid');
70
70
71
if ( $action eq 'void' ) {
71
if ( $action eq 'void' ) {
72
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
72
    my $payment_id = scalar $input->param('accountlines_id');
73
    my $payment_id = scalar $input->param('accountlines_id');
73
    my $payment    = Koha::Account::Lines->find( $payment_id );
74
    my $payment    = Koha::Account::Lines->find( $payment_id );
74
    $payment->void(
75
    $payment->void(
Lines 81-88 if ( $action eq 'void' ) { Link Here
81
}
82
}
82
83
83
if ( $action eq 'payout' ) {
84
if ( $action eq 'payout' ) {
84
    my $payment_id       = scalar $input->param('accountlines_id');
85
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
85
    my $amount           = scalar $input->param('amount');
86
    my $payment_id  = scalar $input->param('accountlines_id');
87
    my $payment     = Koha::Account::Lines->find($payment_id);
88
    my $amount      = scalar $input->param('amount');
86
    my $payout_type = scalar $input->param('payout_type');
89
    my $payout_type = scalar $input->param('payout_type');
87
    if ( $payment_id eq "" ) {
90
    if ( $payment_id eq "" ) {
88
        $schema->txn_do(
91
        $schema->txn_do(
Lines 119-127 if ( $action eq 'payout' ) { Link Here
119
}
122
}
120
123
121
if ( $action eq 'refund' ) {
124
if ( $action eq 'refund' ) {
122
    my $charge_id        = scalar $input->param('accountlines_id');
125
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
123
    my $charge           = Koha::Account::Lines->find($charge_id);
126
    my $charge_id   = scalar $input->param('accountlines_id');
124
    my $amount           = scalar $input->param('amount');
127
    my $charge      = Koha::Account::Lines->find($charge_id);
128
    my $amount      = scalar $input->param('amount');
125
    my $refund_type = scalar $input->param('refund_type');
129
    my $refund_type = scalar $input->param('refund_type');
126
    $schema->txn_do(
130
    $schema->txn_do(
127
        sub {
131
        sub {
Lines 152-157 if ( $action eq 'refund' ) { Link Here
152
}
156
}
153
157
154
if ( $action eq 'discount' ) {
158
if ( $action eq 'discount' ) {
159
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
155
    my $charge_id        = scalar $input->param('accountlines_id');
160
    my $charge_id        = scalar $input->param('accountlines_id');
156
    my $charge           = Koha::Account::Lines->find($charge_id);
161
    my $charge           = Koha::Account::Lines->find($charge_id);
157
    my $amount           = scalar $input->param('amount');
162
    my $amount           = scalar $input->param('amount');
(-)a/members/pay.pl (+8 lines)
Lines 77-98 $user ||= q{}; Link Here
77
our $branch = C4::Context->userenv->{'branch'};
77
our $branch = C4::Context->userenv->{'branch'};
78
78
79
if ( $input->param('paycollect') ) {
79
if ( $input->param('paycollect') ) {
80
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
80
    print $input->redirect(
81
    print $input->redirect(
81
        "/cgi-bin/koha/members/paycollect.pl?borrowernumber=$borrowernumber&change_given=$change_given");
82
        "/cgi-bin/koha/members/paycollect.pl?borrowernumber=$borrowernumber&change_given=$change_given");
82
}
83
}
83
elsif ( $input->param('payselected') ) {
84
elsif ( $input->param('payselected') ) {
85
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
84
    payselected({ params => \@names });
86
    payselected({ params => \@names });
85
}
87
}
86
elsif ( $input->param('writeoff_selected') ) {
88
elsif ( $input->param('writeoff_selected') ) {
89
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
87
    payselected({ params => \@names, type => 'WRITEOFF' });
90
    payselected({ params => \@names, type => 'WRITEOFF' });
88
}
91
}
89
elsif ( $input->param('woall') ) {
92
elsif ( $input->param('woall') ) {
93
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
90
    writeoff_all(@names);
94
    writeoff_all(@names);
91
}
95
}
92
elsif ( $input->param('apply_credits') ) {
96
elsif ( $input->param('apply_credits') ) {
97
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
93
    apply_credits({ patron => $patron, cgi => $input });
98
    apply_credits({ patron => $patron, cgi => $input });
94
}
99
}
95
elsif ( $input->param('confirm_writeoff') ) {
100
elsif ( $input->param('confirm_writeoff') ) {
101
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
96
    my $item_id         = $input->param('itemnumber');
102
    my $item_id         = $input->param('itemnumber');
97
    my $accountlines_id = $input->param('accountlines_id');
103
    my $accountlines_id = $input->param('accountlines_id');
98
    my $amount          = $input->param('amountwrittenoff');
104
    my $amount          = $input->param('amountwrittenoff');
Lines 129-137 elsif ( $input->param('confirm_writeoff') ) { Link Here
129
135
130
for (@names) {
136
for (@names) {
131
    if (/^pay_indiv_(\d+)$/) {
137
    if (/^pay_indiv_(\d+)$/) {
138
        output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
132
        my $line_no = $1;
139
        my $line_no = $1;
133
        redirect_to_paycollect( 'pay_individual', $line_no );
140
        redirect_to_paycollect( 'pay_individual', $line_no );
134
    } elsif (/^wo_indiv_(\d+)$/) {
141
    } elsif (/^wo_indiv_(\d+)$/) {
142
        output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
135
        my $line_no = $1;
143
        my $line_no = $1;
136
        redirect_to_paycollect( 'writeoff_individual', $line_no );
144
        redirect_to_paycollect( 'writeoff_individual', $line_no );
137
    }
145
    }
(-)a/suggestion/suggestion.pl (-3 / +7 lines)
Lines 21-27 use Modern::Perl; Link Here
21
require Exporter;
21
require Exporter;
22
use CGI qw ( -utf8 );
22
use CGI qw ( -utf8 );
23
use C4::Auth qw( get_template_and_user );
23
use C4::Auth qw( get_template_and_user );
24
use C4::Output qw( output_html_with_http_headers );
24
use C4::Output qw( output_html_with_http_headers output_and_exit_if_error );
25
use C4::Suggestions;
25
use C4::Suggestions;
26
use C4::Koha qw( GetAuthorisedValues );
26
use C4::Koha qw( GetAuthorisedValues );
27
use C4::Budgets qw( GetBudget GetBudgets GetBudgetHierarchy CanUserUseBudget );
27
use C4::Budgets qw( GetBudget GetBudgets GetBudgetHierarchy CanUserUseBudget );
Lines 98-103 my $reasonsloop = GetAuthorisedValues("SUGGEST"); Link Here
98
98
99
# filter informations which are not suggestion related.
99
# filter informations which are not suggestion related.
100
my $suggestion_ref  = { %{$input->Vars} }; # Copying, otherwise $input will be modified
100
my $suggestion_ref  = { %{$input->Vars} }; # Copying, otherwise $input will be modified
101
delete $suggestion_ref->{csrf_token};
101
102
102
# get only the columns of Suggestion
103
# get only the columns of Suggestion
103
my $schema = Koha::Database->new()->schema;
104
my $schema = Koha::Database->new()->schema;
Lines 127-132 my $branchfilter = $input->param('branchcode') || C4::Context->userenv->{'branch Link Here
127
##
128
##
128
129
129
if ( $op =~ /save/i ) {
130
if ( $op =~ /save/i ) {
131
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
130
    my @messages;
132
    my @messages;
131
    my $biblio = MarcRecordFromNewSuggestion({
133
    my $biblio = MarcRecordFromNewSuggestion({
132
            title => $suggestion_only->{title},
134
            title => $suggestion_only->{title},
Lines 243-249 elsif ($op=~/add/) { Link Here
243
    $op ='save';
245
    $op ='save';
244
}
246
}
245
elsif ($op=~/edit/) {
247
elsif ($op=~/edit/) {
246
    #Edit suggestion  
248
    #Edit suggestion
249
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
247
    $suggestion_ref=&GetSuggestion($$suggestion_ref{'suggestionid'});
250
    $suggestion_ref=&GetSuggestion($$suggestion_ref{'suggestionid'});
248
    $suggestion_ref->{reasonsloop} = $reasonsloop;
251
    $suggestion_ref->{reasonsloop} = $reasonsloop;
249
    my $other_reason = 1;
252
    my $other_reason = 1;
Lines 258-264 elsif ($op=~/edit/) { Link Here
258
    $op ='save';
261
    $op ='save';
259
}  
262
}  
260
elsif ($op eq "update_status" ) {
263
elsif ($op eq "update_status" ) {
261
264
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
262
    my $suggestion;
265
    my $suggestion;
263
    # set accepted/rejected/managed informations if applicable
266
    # set accepted/rejected/managed informations if applicable
264
    # ie= if the librarian has chosen some action on the suggestions
267
    # ie= if the librarian has chosen some action on the suggestions
Lines 295-300 elsif ($op eq "update_status" ) { Link Here
295
    }
298
    }
296
    redirect_with_params($input);
299
    redirect_with_params($input);
297
}elsif ($op eq "delete" ) {
300
}elsif ($op eq "delete" ) {
301
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
298
    foreach my $delete_field (@editsuggestions) {
302
    foreach my $delete_field (@editsuggestions) {
299
        &DelSuggestion( $borrowernumber, $delete_field,'intranet' );
303
        &DelSuggestion( $borrowernumber, $delete_field,'intranet' );
300
    }
304
    }
(-)a/virtualshelves/shelves.pl (-2 / +7 lines)
Lines 30-36 use C4::Koha qw( Link Here
30
);
30
);
31
use C4::Items qw( GetItemsLocationInfo );
31
use C4::Items qw( GetItemsLocationInfo );
32
use C4::Members;
32
use C4::Members;
33
use C4::Output qw( pagination_bar output_html_with_http_headers );
33
use C4::Output qw( pagination_bar output_html_with_http_headers output_and_exit_if_error );
34
use C4::XSLT qw( XSLTParse4Display );
34
use C4::XSLT qw( XSLTParse4Display );
35
35
36
use Koha::Biblios;
36
use Koha::Biblios;
Lines 63-68 if ( $op eq 'add_form' ) { Link Here
63
    # Only pass default
63
    # Only pass default
64
    $shelf = { allow_change_from_owner => 1 };
64
    $shelf = { allow_change_from_owner => 1 };
65
} elsif ( $op eq 'edit_form' ) {
65
} elsif ( $op eq 'edit_form' ) {
66
    output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' });
66
    $shelfnumber = $query->param('shelfnumber');
67
    $shelfnumber = $query->param('shelfnumber');
67
    $shelf       = Koha::Virtualshelves->find($shelfnumber);
68
    $shelf       = Koha::Virtualshelves->find($shelfnumber);
68
69
Lines 78-83 if ( $op eq 'add_form' ) { Link Here
78
        push @messages, { type => 'alert', code => 'does_not_exist' };
79
        push @messages, { type => 'alert', code => 'does_not_exist' };
79
    }
80
    }
80
} elsif ( $op eq 'add' ) {
81
} elsif ( $op eq 'add' ) {
82
    output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' });
81
    my $allow_changes_from = $query->param('allow_changes_from');
83
    my $allow_changes_from = $query->param('allow_changes_from');
82
    eval {
84
    eval {
83
        $shelf = Koha::Virtualshelf->new(
85
        $shelf = Koha::Virtualshelf->new(
Lines 103-108 if ( $op eq 'add_form' ) { Link Here
103
        $op = 'view';
105
        $op = 'view';
104
    }
106
    }
105
} elsif ( $op eq 'edit' ) {
107
} elsif ( $op eq 'edit' ) {
108
    output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' });
106
    $shelfnumber = $query->param('shelfnumber');
109
    $shelfnumber = $query->param('shelfnumber');
107
    $shelf       = Koha::Virtualshelves->find($shelfnumber);
110
    $shelf       = Koha::Virtualshelves->find($shelfnumber);
108
111
Lines 133-138 if ( $op eq 'add_form' ) { Link Here
133
        push @messages, { type => 'alert', code => 'does_not_exist' };
136
        push @messages, { type => 'alert', code => 'does_not_exist' };
134
    }
137
    }
135
} elsif ( $op eq 'delete' ) {
138
} elsif ( $op eq 'delete' ) {
139
    output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' });
136
    $shelfnumber = $query->param('shelfnumber');
140
    $shelfnumber = $query->param('shelfnumber');
137
    $shelf       = Koha::Virtualshelves->find($shelfnumber);
141
    $shelf       = Koha::Virtualshelves->find($shelfnumber);
138
    if ($shelf) {
142
    if ($shelf) {
Lines 151-156 if ( $op eq 'add_form' ) { Link Here
151
    }
155
    }
152
    $op = 'list';
156
    $op = 'list';
153
} elsif ( $op eq 'add_biblio' ) {
157
} elsif ( $op eq 'add_biblio' ) {
158
    output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' });
154
    $shelfnumber = $query->param('shelfnumber');
159
    $shelfnumber = $query->param('shelfnumber');
155
    $shelf = Koha::Virtualshelves->find($shelfnumber);
160
    $shelf = Koha::Virtualshelves->find($shelfnumber);
156
    if ($shelf) {
161
    if ($shelf) {
Lines 207-212 if ( $op eq 'add_form' ) { Link Here
207
    }
212
    }
208
    $op = $referer;
213
    $op = $referer;
209
} elsif ( $op eq 'remove_biblios' ) {
214
} elsif ( $op eq 'remove_biblios' ) {
215
    output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' });
210
    $shelfnumber = $query->param('shelfnumber');
216
    $shelfnumber = $query->param('shelfnumber');
211
    $shelf = Koha::Virtualshelves->find($shelfnumber);
217
    $shelf = Koha::Virtualshelves->find($shelfnumber);
212
    my @biblionumbers = $query->multi_param('biblionumber');
218
    my @biblionumbers = $query->multi_param('biblionumber');
213
- 

Return to bug 22990