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 55-61 Link Here
55
55
56
[% INCLUDE 'members-toolbar.inc' %]
56
[% INCLUDE 'members-toolbar.inc' %]
57
<h1>Account for [% INCLUDE 'patron-title.inc' %]</h1>
57
<h1>Account for [% INCLUDE 'patron-title.inc' %]</h1>
58
<form action="/cgi-bin/koha/members/boraccount.pl" method="get"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" /></form>
58
<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>
59
59
60
<!-- The manual invoice and credit buttons -->
60
<!-- The manual invoice and credit buttons -->
61
<div class="toptabs">
61
<div class="toptabs">
Lines 147-160 Link Here
147
        [% END %]
147
        [% END %]
148
        <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>
148
        <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>
149
        [% IF account.is_debit && account.amountoutstanding > 0 %]
149
        [% IF account.is_debit && account.amountoutstanding > 0 %]
150
            <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-solid fa-money-bill-1"></i> Pay</a>
150
            <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-solid fa-money-bill-1"></i> Pay</a>
151
        [% END %]
151
        [% END %]
152
        [% IF account.is_credit && account.status != 'VOID' %]
152
        [% IF account.is_credit && account.status != 'VOID' %]
153
          <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>
153
          <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>
154
        [% END %]
154
        [% END %]
155
        [% IF account.is_debit && account.amount == account.amountoutstanding && account.status != 'CANCELLED' && !(account.debit_type_code == 'PAYOUT') %]
155
        [% IF account.is_debit && account.amount == account.amountoutstanding && account.status != 'CANCELLED' && !(account.debit_type_code == 'PAYOUT') %]
156
          <form method="post" action="/cgi-bin/koha/members/cancel-charge.pl">
156
          <form method="post" action="/cgi-bin/koha/members/cancel-charge.pl">
157
            <input type="hidden" name="csrf_token" value="[% csrf_token | html %]">
157
            [% INCLUDE 'csrf-token.inc' %]
158
            <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]">
158
            <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]">
159
            <input type="hidden" name="accountlines_id" value="[% account.accountlines_id | html %]">
159
            <input type="hidden" name="accountlines_id" value="[% account.accountlines_id | html %]">
160
            <button type="submit" class="btn btn-default btn-xs cancel-action">
160
            <button type="submit" class="btn btn-default btn-xs cancel-action">
Lines 210-215 Link Here
210
    <!-- Issue payout modal -->
210
    <!-- Issue payout modal -->
211
    <div class="modal" id="issuePayoutModal" tabindex="-1" role="dialog" aria-labelledby="issuePayoutLabel">
211
    <div class="modal" id="issuePayoutModal" tabindex="-1" role="dialog" aria-labelledby="issuePayoutLabel">
212
        <form  id="payout_form" action="/cgi-bin/koha/members/boraccount.pl" method="get" enctype="multipart/form-data" class="validated">
212
        <form  id="payout_form" action="/cgi-bin/koha/members/boraccount.pl" method="get" enctype="multipart/form-data" class="validated">
213
            [% INCLUDE 'csrf-token.inc' %]
213
            <input type="hidden" name="accountlines_id" value="" id="payoutline">
214
            <input type="hidden" name="accountlines_id" value="" id="payoutline">
214
            <input type="hidden" name="action" value="payout">
215
            <input type="hidden" name="action" value="payout">
215
            <input type="hidden" name="borrowernumber" value="[% account.borrowernumber | html %]">
216
            <input type="hidden" name="borrowernumber" value="[% account.borrowernumber | html %]">
Lines 264-269 Link Here
264
    <!-- Issue refund modal -->
265
    <!-- Issue refund modal -->
265
    <div class="modal" id="issueRefundModal" tabindex="-1" role="dialog" aria-labelledby="issueRefundLabel">
266
    <div class="modal" id="issueRefundModal" tabindex="-1" role="dialog" aria-labelledby="issueRefundLabel">
266
        <form  id="refund_form" action="/cgi-bin/koha/members/boraccount.pl" method="get" enctype="multipart/form-data" class="validated">
267
        <form  id="refund_form" action="/cgi-bin/koha/members/boraccount.pl" method="get" enctype="multipart/form-data" class="validated">
268
            [% INCLUDE 'csrf-token.inc' %]
267
            <input type="hidden" name="accountlines_id" value="" id="refundline">
269
            <input type="hidden" name="accountlines_id" value="" id="refundline">
268
            <input type="hidden" name="action" value="refund">
270
            <input type="hidden" name="action" value="refund">
269
            <input type="hidden" name="borrowernumber" value="[% account.borrowernumber | html %]">
271
            <input type="hidden" name="borrowernumber" value="[% account.borrowernumber | html %]">
Lines 321-326 Link Here
321
    <!-- Apply discount modal -->
323
    <!-- Apply discount modal -->
322
    <div class="modal" id="applyDiscountModal" tabindex="-1" role="dialog" aria-labelledby="applyDiscountLabel">
324
    <div class="modal" id="applyDiscountModal" tabindex="-1" role="dialog" aria-labelledby="applyDiscountLabel">
323
        <form  id="discount_form" action="/cgi-bin/koha/members/boraccount.pl" method="get" enctype="multipart/form-data" class="validated">
325
        <form  id="discount_form" action="/cgi-bin/koha/members/boraccount.pl" method="get" enctype="multipart/form-data" class="validated">
326
            [% INCLUDE 'csrf-token.inc' %]
324
            <input type="hidden" name="accountlines_id" value="" id="discountline">
327
            <input type="hidden" name="accountlines_id" value="" id="discountline">
325
            <input type="hidden" name="action" value="discount">
328
            <input type="hidden" name="action" value="discount">
326
            <input type="hidden" name="borrowernumber" value="[% account.borrowernumber | html %]">
329
            <input type="hidden" name="borrowernumber" value="[% account.borrowernumber | html %]">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt (+1 lines)
Lines 70-75 Link Here
70
[% IF ( accounts ) %]
70
[% IF ( accounts ) %]
71
    <form action="/cgi-bin/koha/members/pay.pl" method="post" id="pay-fines-form">
71
    <form action="/cgi-bin/koha/members/pay.pl" method="post" id="pay-fines-form">
72
    <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
72
    <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
73
    [% INCLUDE 'csrf-token.inc' %]
73
<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-times"></i> Clear all</a></span></p>
74
<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-times"></i> Clear all</a></span></p>
74
<table id="finest">
75
<table id="finest">
75
<thead>
76
<thead>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt (+5 lines)
Lines 90-95 Link Here
90
        [% END #/ WRAPPER breadcrumbs %]
90
        [% END #/ WRAPPER breadcrumbs %]
91
    [% END #/ WRAPPER sub-header.inc %]
91
    [% END #/ WRAPPER sub-header.inc %]
92
92
93
    [% INCLUDE 'blocking_errors.inc' %]
94
93
    [% IF ( op == 'show' ) %]
95
    [% IF ( op == 'show' ) %]
94
        <div class="main container-fluid">
96
        <div class="main container-fluid">
95
            <div class="row">
97
            <div class="row">
Lines 337-342 Link Here
337
            [% END %]
339
            [% END %]
338
340
339
            <form id="add_edit" action="suggestion.pl" method="post" class="validated">
341
            <form id="add_edit" action="suggestion.pl" method="post" class="validated">
342
                [% INCLUDE 'csrf-token.inc' %]
340
                <input type="hidden" name="redirect" id="redirect" value="[% redirect | html %]" />
343
                <input type="hidden" name="redirect" id="redirect" value="[% redirect | html %]" />
341
                <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber | html %]" />
344
                <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber | html %]" />
342
                [% IF ( suggestionid ) %]
345
                [% IF ( suggestionid ) %]
Lines 709-714 Link Here
709
                    [% FOREACH suggestion IN suggestions %]
712
                    [% FOREACH suggestion IN suggestions %]
710
                        [% WRAPPER tab_panel tabname= suggestion.suggestiontype %]
713
                        [% WRAPPER tab_panel tabname= suggestion.suggestiontype %]
711
                            <form class="update_suggestions" name="f" method="post" action="/cgi-bin/koha/suggestion/suggestion.pl#[% suggestion.suggestiontype| uri %]">
714
                            <form class="update_suggestions" name="f" method="post" action="/cgi-bin/koha/suggestion/suggestion.pl#[% suggestion.suggestiontype| uri %]">
715
                            [% INCLUDE 'csrf-token.inc' %]
712
716
713
                                [% IF suggestion.suggestions.size %]
717
                                [% IF suggestion.suggestions.size %]
714
                                    <p>
718
                                    <p>
Lines 995-1000 Link Here
995
                <div class="col-sm-2 col-sm-pull-10">
999
                <div class="col-sm-2 col-sm-pull-10">
996
                    <aside>
1000
                    <aside>
997
                        <form name="suggestionfilter" action="suggestion.pl" method="get">
1001
                        <form name="suggestionfilter" action="suggestion.pl" method="get">
1002
                            [% INCLUDE 'csrf-token.inc' %]
998
                            <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
1003
                            <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
999
                            <fieldset class="brief">
1004
                            <fieldset class="brief">
1000
                                <h4>Organize by:</h4>
1005
                                <h4>Organize by:</h4>
(-)a/members/boraccount.pl (-5 / +10 lines)
Lines 70-75 output_and_exit_if_error( $input, $cookie, $template, { module => 'members', log Link Here
70
my $registerid = $input->param('registerid');
70
my $registerid = $input->param('registerid');
71
71
72
if ( $action eq 'void' ) {
72
if ( $action eq 'void' ) {
73
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
73
    my $payment_id = scalar $input->param('accountlines_id');
74
    my $payment_id = scalar $input->param('accountlines_id');
74
    my $payment    = Koha::Account::Lines->find( $payment_id );
75
    my $payment    = Koha::Account::Lines->find( $payment_id );
75
    $payment->void(
76
    $payment->void(
Lines 82-89 if ( $action eq 'void' ) { Link Here
82
}
83
}
83
84
84
if ( $action eq 'payout' ) {
85
if ( $action eq 'payout' ) {
85
    my $payment_id       = scalar $input->param('accountlines_id');
86
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
86
    my $amount           = scalar $input->param('amount');
87
    my $payment_id  = scalar $input->param('accountlines_id');
88
    my $payment     = Koha::Account::Lines->find($payment_id);
89
    my $amount      = scalar $input->param('amount');
87
    my $payout_type = scalar $input->param('payout_type');
90
    my $payout_type = scalar $input->param('payout_type');
88
    if ( $payment_id eq "" ) {
91
    if ( $payment_id eq "" ) {
89
        $schema->txn_do(
92
        $schema->txn_do(
Lines 120-128 if ( $action eq 'payout' ) { Link Here
120
}
123
}
121
124
122
if ( $action eq 'refund' ) {
125
if ( $action eq 'refund' ) {
123
    my $charge_id        = scalar $input->param('accountlines_id');
126
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
124
    my $charge           = Koha::Account::Lines->find($charge_id);
127
    my $charge_id   = scalar $input->param('accountlines_id');
125
    my $amount           = scalar $input->param('amount');
128
    my $charge      = Koha::Account::Lines->find($charge_id);
129
    my $amount      = scalar $input->param('amount');
126
    my $refund_type = scalar $input->param('refund_type');
130
    my $refund_type = scalar $input->param('refund_type');
127
    $schema->txn_do(
131
    $schema->txn_do(
128
        sub {
132
        sub {
Lines 153-158 if ( $action eq 'refund' ) { Link Here
153
}
157
}
154
158
155
if ( $action eq 'discount' ) {
159
if ( $action eq 'discount' ) {
160
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
156
    my $charge_id        = scalar $input->param('accountlines_id');
161
    my $charge_id        = scalar $input->param('accountlines_id');
157
    my $charge           = Koha::Account::Lines->find($charge_id);
162
    my $charge           = Koha::Account::Lines->find($charge_id);
158
    my $amount           = scalar $input->param('amount');
163
    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 (-4 / +6 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 134-139 my $branchfilter = $input->param('branchcode') || C4::Context->userenv->{'branch Link Here
134
##
134
##
135
135
136
if ( $op =~ /save/i ) {
136
if ( $op =~ /save/i ) {
137
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
137
    my @messages;
138
    my @messages;
138
    my $biblio = MarcRecordFromNewSuggestion({
139
    my $biblio = MarcRecordFromNewSuggestion({
139
            title => $suggestion_only->{title},
140
            title => $suggestion_only->{title},
Lines 251-257 elsif ($op=~/add/) { Link Here
251
    $op ='save';
252
    $op ='save';
252
}
253
}
253
elsif ($op=~/edit/) {
254
elsif ($op=~/edit/) {
254
    #Edit suggestion  
255
    #Edit suggestion
256
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
255
    $suggestion_ref=&GetSuggestion($$suggestion_ref{'suggestionid'});
257
    $suggestion_ref=&GetSuggestion($$suggestion_ref{'suggestionid'});
256
    $suggestion_ref->{reasonsloop} = $reasonsloop;
258
    $suggestion_ref->{reasonsloop} = $reasonsloop;
257
    my $other_reason = 1;
259
    my $other_reason = 1;
Lines 266-272 elsif ($op=~/edit/) { Link Here
266
    $op ='save';
268
    $op ='save';
267
}  
269
}  
268
elsif ($op eq "update_status" ) {
270
elsif ($op eq "update_status" ) {
269
271
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
270
    my $suggestion;
272
    my $suggestion;
271
    # set accepted/rejected/managed informations if applicable
273
    # set accepted/rejected/managed informations if applicable
272
    # ie= if the librarian has chosen some action on the suggestions
274
    # ie= if the librarian has chosen some action on the suggestions
Lines 303-308 elsif ($op eq "update_status" ) { Link Here
303
    }
305
    }
304
    redirect_with_params($input);
306
    redirect_with_params($input);
305
}elsif ($op eq "delete" ) {
307
}elsif ($op eq "delete" ) {
308
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
306
    foreach my $delete_field (@editsuggestions) {
309
    foreach my $delete_field (@editsuggestions) {
307
        &DelSuggestion( $borrowernumber, $delete_field,'intranet' );
310
        &DelSuggestion( $borrowernumber, $delete_field,'intranet' );
308
    }
311
    }
309
- 

Return to bug 22990