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 48-54 Link Here
48
48
49
[% INCLUDE 'members-toolbar.inc' %]
49
[% INCLUDE 'members-toolbar.inc' %]
50
<h1>Account for [% INCLUDE 'patron-title.inc' %]</h1>
50
<h1>Account for [% INCLUDE 'patron-title.inc' %]</h1>
51
<form action="/cgi-bin/koha/members/boraccount.pl" method="get"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" /></form>
51
<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>
52
52
53
<!-- The manual invoice and credit buttons -->
53
<!-- The manual invoice and credit buttons -->
54
<div class="toptabs">
54
<div class="toptabs">
Lines 128-141 Link Here
128
        [% END %]
128
        [% END %]
129
        <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>
129
        <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>
130
        [% IF account.is_debit && account.amountoutstanding > 0 %]
130
        [% IF account.is_debit && account.amountoutstanding > 0 %]
131
            <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>
131
            <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>
132
        [% END %]
132
        [% END %]
133
        [% IF account.is_credit && account.status != 'VOID' %]
133
        [% IF account.is_credit && account.status != 'VOID' %]
134
          <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>
134
          <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>
135
        [% END %]
135
        [% END %]
136
        [% IF account.is_debit && account.amount == account.amountoutstanding && account.status != 'CANCELLED' && !(account.debit_type_code == 'PAYOUT') %]
136
        [% IF account.is_debit && account.amount == account.amountoutstanding && account.status != 'CANCELLED' && !(account.debit_type_code == 'PAYOUT') %]
137
          <form method="post" action="/cgi-bin/koha/members/cancel-charge.pl">
137
          <form method="post" action="/cgi-bin/koha/members/cancel-charge.pl">
138
            <input type="hidden" name="csrf_token" value="[% csrf_token | html %]">
138
            [% INCLUDE 'csrf-token.inc' %]
139
            <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]">
139
            <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]">
140
            <input type="hidden" name="accountlines_id" value="[% account.accountlines_id | html %]">
140
            <input type="hidden" name="accountlines_id" value="[% account.accountlines_id | html %]">
141
            <button type="submit" class="btn btn-default btn-xs cancel-action">
141
            <button type="submit" class="btn btn-default btn-xs cancel-action">
Lines 191-196 Link Here
191
    <!-- Issue payout modal -->
191
    <!-- Issue payout modal -->
192
    <div class="modal" id="issuePayoutModal" tabindex="-1" role="dialog" aria-labelledby="issuePayoutLabel">
192
    <div class="modal" id="issuePayoutModal" tabindex="-1" role="dialog" aria-labelledby="issuePayoutLabel">
193
        <form  id="payout_form" action="/cgi-bin/koha/members/boraccount.pl" method="get" enctype="multipart/form-data" class="validated">
193
        <form  id="payout_form" action="/cgi-bin/koha/members/boraccount.pl" method="get" enctype="multipart/form-data" class="validated">
194
            [% INCLUDE 'csrf-token.inc' %]
194
            <input type="hidden" name="accountlines_id" value="" id="payoutline">
195
            <input type="hidden" name="accountlines_id" value="" id="payoutline">
195
            <input type="hidden" name="action" value="payout">
196
            <input type="hidden" name="action" value="payout">
196
            <input type="hidden" name="borrowernumber" value="[% account.borrowernumber | html %]">
197
            <input type="hidden" name="borrowernumber" value="[% account.borrowernumber | html %]">
Lines 245-250 Link Here
245
    <!-- Issue refund modal -->
246
    <!-- Issue refund modal -->
246
    <div class="modal" id="issueRefundModal" tabindex="-1" role="dialog" aria-labelledby="issueRefundLabel">
247
    <div class="modal" id="issueRefundModal" tabindex="-1" role="dialog" aria-labelledby="issueRefundLabel">
247
        <form  id="refund_form" action="/cgi-bin/koha/members/boraccount.pl" method="get" enctype="multipart/form-data" class="validated">
248
        <form  id="refund_form" action="/cgi-bin/koha/members/boraccount.pl" method="get" enctype="multipart/form-data" class="validated">
249
            [% INCLUDE 'csrf-token.inc' %]
248
            <input type="hidden" name="accountlines_id" value="" id="refundline">
250
            <input type="hidden" name="accountlines_id" value="" id="refundline">
249
            <input type="hidden" name="action" value="refund">
251
            <input type="hidden" name="action" value="refund">
250
            <input type="hidden" name="borrowernumber" value="[% account.borrowernumber | html %]">
252
            <input type="hidden" name="borrowernumber" value="[% account.borrowernumber | html %]">
Lines 302-307 Link Here
302
    <!-- Apply discount modal -->
304
    <!-- Apply discount modal -->
303
    <div class="modal" id="applyDiscountModal" tabindex="-1" role="dialog" aria-labelledby="applyDiscountLabel">
305
    <div class="modal" id="applyDiscountModal" tabindex="-1" role="dialog" aria-labelledby="applyDiscountLabel">
304
        <form  id="discount_form" action="/cgi-bin/koha/members/boraccount.pl" method="get" enctype="multipart/form-data" class="validated">
306
        <form  id="discount_form" action="/cgi-bin/koha/members/boraccount.pl" method="get" enctype="multipart/form-data" class="validated">
307
            [% INCLUDE 'csrf-token.inc' %]
305
            <input type="hidden" name="accountlines_id" value="" id="discountline">
308
            <input type="hidden" name="accountlines_id" value="" id="discountline">
306
            <input type="hidden" name="action" value="discount">
309
            <input type="hidden" name="action" value="discount">
307
            <input type="hidden" name="borrowernumber" value="[% account.borrowernumber | html %]">
310
            <input type="hidden" name="borrowernumber" value="[% account.borrowernumber | html %]">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt (+1 lines)
Lines 72-77 Link Here
72
[% IF ( accounts ) %]
72
[% IF ( accounts ) %]
73
    <form action="/cgi-bin/koha/members/pay.pl" method="post" id="pay-fines-form">
73
    <form action="/cgi-bin/koha/members/pay.pl" method="post" id="pay-fines-form">
74
    <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
74
    <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
75
    [% INCLUDE 'csrf-token.inc' %]
75
<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>
76
<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>
76
<table id="finest">
77
<table id="finest">
77
<thead>
78
<thead>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt (+5 lines)
Lines 107-112 Link Here
107
    </nav> <!-- /.breadcrumbs -->
107
    </nav> <!-- /.breadcrumbs -->
108
    [% END %]
108
    [% END %]
109
109
110
    [% INCLUDE 'blocking_errors.inc' %]
111
110
    [% IF ( op == 'show' ) %]
112
    [% IF ( op == 'show' ) %]
111
        <div class="main container-fluid">
113
        <div class="main container-fluid">
112
            <div class="row">
114
            <div class="row">
Lines 354-359 Link Here
354
            [% END %]
356
            [% END %]
355
357
356
            <form id="add_edit" action="suggestion.pl" method="post" class="validated">
358
            <form id="add_edit" action="suggestion.pl" method="post" class="validated">
359
                [% INCLUDE 'csrf-token.inc' %]
357
                <input type="hidden" name="redirect" id="redirect" value="[% redirect | html %]" />
360
                <input type="hidden" name="redirect" id="redirect" value="[% redirect | html %]" />
358
                <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber | html %]" />
361
                <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber | html %]" />
359
                [% IF ( suggestionid ) %]
362
                [% IF ( suggestionid ) %]
Lines 735-740 Link Here
735
                    <div id="[% suggestion.suggestiontype | html %]">
738
                    <div id="[% suggestion.suggestiontype | html %]">
736
                    [% END %]
739
                    [% END %]
737
                        <form class="update_suggestions" name="f" method="post" action="/cgi-bin/koha/suggestion/suggestion.pl#[% suggestion.suggestiontype| uri %]">
740
                        <form class="update_suggestions" name="f" method="post" action="/cgi-bin/koha/suggestion/suggestion.pl#[% suggestion.suggestiontype| uri %]">
741
                        [% INCLUDE 'csrf-token.inc' %]
738
742
739
                            [% IF suggestion.suggestions.size %]
743
                            [% IF suggestion.suggestions.size %]
740
                                <p>
744
                                <p>
Lines 1009-1014 Link Here
1009
                <div class="col-sm-2 col-sm-pull-10">
1013
                <div class="col-sm-2 col-sm-pull-10">
1010
                    <aside>
1014
                    <aside>
1011
                        <form name="suggestionfilter" action="suggestion.pl" method="get">
1015
                        <form name="suggestionfilter" action="suggestion.pl" method="get">
1016
                            [% INCLUDE 'csrf-token.inc' %]
1012
                            <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
1017
                            <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
1013
                            <fieldset class="brief">
1018
                            <fieldset class="brief">
1014
                                <h4>Organize by:</h4>
1019
                                <h4>Organize by:</h4>
(-)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 (+7 lines)
Lines 77-95 $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') ) {
Lines 129-137 elsif ( $input->param('confirm_writeoff') ) { Link Here
129
134
130
for (@names) {
135
for (@names) {
131
    if (/^pay_indiv_(\d+)$/) {
136
    if (/^pay_indiv_(\d+)$/) {
137
        output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
132
        my $line_no = $1;
138
        my $line_no = $1;
133
        redirect_to_paycollect( 'pay_individual', $line_no );
139
        redirect_to_paycollect( 'pay_individual', $line_no );
134
    } elsif (/^wo_indiv_(\d+)$/) {
140
    } elsif (/^wo_indiv_(\d+)$/) {
141
        output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
135
        my $line_no = $1;
142
        my $line_no = $1;
136
        redirect_to_paycollect( 'writeoff_individual', $line_no );
143
        redirect_to_paycollect( 'writeoff_individual', $line_no );
137
    }
144
    }
(-)a/members/setstatus.pl (+1 lines)
Lines 53-58 my $patron = Koha::Patrons->find( $borrowernumber ); Link Here
53
if ( $logged_in_user->can_see_patron_infos($patron) ) {
53
if ( $logged_in_user->can_see_patron_infos($patron) ) {
54
    if ( $reregistration eq 'y' ) {
54
    if ( $reregistration eq 'y' ) {
55
        # re-reregistration function to automatic calcul of date expiry
55
        # re-reregistration function to automatic calcul of date expiry
56
        output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
56
        $dateexpiry = $patron->renew_account;
57
        $dateexpiry = $patron->renew_account;
57
    } else {
58
    } else {
58
        my $sth = $dbh->prepare("UPDATE borrowers SET debarred = ?, debarredcomment = '' WHERE borrowernumber = ?");
59
        my $sth = $dbh->prepare("UPDATE borrowers SET debarred = ?, debarredcomment = '' WHERE borrowernumber = ?");
(-)a/suggestion/suggestion.pl (-3 / +5 lines)
Lines 133-138 my $branchfilter = $input->param('branchcode') || C4::Context->userenv->{'branch Link Here
133
##
133
##
134
134
135
if ( $op =~ /save/i ) {
135
if ( $op =~ /save/i ) {
136
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
136
    my @messages;
137
    my @messages;
137
    my $biblio = MarcRecordFromNewSuggestion({
138
    my $biblio = MarcRecordFromNewSuggestion({
138
            title => $suggestion_only->{title},
139
            title => $suggestion_only->{title},
Lines 250-256 elsif ($op=~/add/) { Link Here
250
    $op ='save';
251
    $op ='save';
251
}
252
}
252
elsif ($op=~/edit/) {
253
elsif ($op=~/edit/) {
253
    #Edit suggestion  
254
    #Edit suggestion
255
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
254
    $suggestion_ref=&GetSuggestion($$suggestion_ref{'suggestionid'});
256
    $suggestion_ref=&GetSuggestion($$suggestion_ref{'suggestionid'});
255
    $suggestion_ref->{reasonsloop} = $reasonsloop;
257
    $suggestion_ref->{reasonsloop} = $reasonsloop;
256
    my $other_reason = 1;
258
    my $other_reason = 1;
Lines 265-271 elsif ($op=~/edit/) { Link Here
265
    $op ='save';
267
    $op ='save';
266
}  
268
}  
267
elsif ($op eq "update_status" ) {
269
elsif ($op eq "update_status" ) {
268
270
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
269
    my $suggestion;
271
    my $suggestion;
270
    # set accepted/rejected/managed informations if applicable
272
    # set accepted/rejected/managed informations if applicable
271
    # ie= if the librarian has chosen some action on the suggestions
273
    # ie= if the librarian has chosen some action on the suggestions
Lines 302-307 elsif ($op eq "update_status" ) { Link Here
302
    }
304
    }
303
    redirect_with_params($input);
305
    redirect_with_params($input);
304
}elsif ($op eq "delete" ) {
306
}elsif ($op eq "delete" ) {
307
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
305
    foreach my $delete_field (@editsuggestions) {
308
    foreach my $delete_field (@editsuggestions) {
306
        &DelSuggestion( $borrowernumber, $delete_field,'intranet' );
309
        &DelSuggestion( $borrowernumber, $delete_field,'intranet' );
307
    }
310
    }
308
- 

Return to bug 22990