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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt (-2 / +4 lines)
Lines 111-120 Link Here
111
        [% END %]
111
        [% END %]
112
        <a href="accountline-details.pl?accountlines_id=[% account.accountlines_id | uri %]" class="btn btn-default btn-xs"><i class="fa fa-list"></i> Details</a>
112
        <a href="accountline-details.pl?accountlines_id=[% account.accountlines_id | uri %]" class="btn btn-default btn-xs"><i class="fa fa-list"></i> Details</a>
113
        [% IF account.is_debit && account.amountoutstanding > 0 %]
113
        [% IF account.is_debit && account.amountoutstanding > 0 %]
114
            <a class="btn btn-default btn-xs" 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>
114
            <a class="btn btn-default btn-xs" 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>
115
        [% END %]
115
        [% END %]
116
        [% IF account.is_credit && account.status != 'VOID' %]
116
        [% IF account.is_credit && account.status != 'VOID' %]
117
          <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"><i class="fa fa-ban"></i> Void payment</a>
117
          <a href="boraccount.pl?action=void&amp;accountlines_id=[% account.accountlines_id | uri %]&amp;borrowernumber=[% account.borrowernumber | uri %]&amp;csrf_token=[% csrf_token | html %]" class="btn btn-default btn-xs void"><i class="fa fa-ban"></i> Void payment</a>
118
        [% END %]
118
        [% END %]
119
        [% IF account.is_debit && account.amount == account.amountoutstanding && account.status != 'CANCELLED' && !(account.debit_type_code == 'PAYOUT') %]
119
        [% IF account.is_debit && account.amount == account.amountoutstanding && account.status != 'CANCELLED' && !(account.debit_type_code == 'PAYOUT') %]
120
          <form method="post" action="/cgi-bin/koha/members/cancel-charge.pl">
120
          <form method="post" action="/cgi-bin/koha/members/cancel-charge.pl">
Lines 176-181 Link Here
176
            <input type="hidden" name="accountlines_id" value="" id="payoutline">
176
            <input type="hidden" name="accountlines_id" value="" id="payoutline">
177
            <input type="hidden" name="action" value="payout">
177
            <input type="hidden" name="action" value="payout">
178
            <input type="hidden" name="borrowernumber" value="[% account.borrowernumber | html %]">
178
            <input type="hidden" name="borrowernumber" value="[% account.borrowernumber | html %]">
179
            [% INCLUDE 'csrf-token.inc' %]
179
            <div class="modal-dialog" role="document">
180
            <div class="modal-dialog" role="document">
180
                <div class="modal-content">
181
                <div class="modal-content">
181
                    <div class="modal-header">
182
                    <div class="modal-header">
Lines 230-235 Link Here
230
            <input type="hidden" name="accountlines_id" value="" id="refundline">
231
            <input type="hidden" name="accountlines_id" value="" id="refundline">
231
            <input type="hidden" name="action" value="refund">
232
            <input type="hidden" name="action" value="refund">
232
            <input type="hidden" name="borrowernumber" value="[% account.borrowernumber | html %]">
233
            <input type="hidden" name="borrowernumber" value="[% account.borrowernumber | html %]">
234
            [% INCLUDE 'csrf-token.inc' %]
233
            <div class="modal-dialog" role="document">
235
            <div class="modal-dialog" role="document">
234
                <div class="modal-content">
236
                <div class="modal-content">
235
                    <div class="modal-header">
237
                    <div class="modal-header">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt (+1 lines)
Lines 54-59 Link Here
54
[% IF ( accounts ) %]
54
[% IF ( accounts ) %]
55
    <form action="/cgi-bin/koha/members/pay.pl" method="post" id="pay-fines-form">
55
    <form action="/cgi-bin/koha/members/pay.pl" method="post" id="pay-fines-form">
56
    <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
56
    <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
57
    [% INCLUDE 'csrf-token.inc' %]
57
<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>
58
<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>
58
<table id="finest">
59
<table id="finest">
59
<thead>
60
<thead>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt (-2 / +5 lines)
Lines 103-108 Link Here
103
            [% END %]
103
            [% END %]
104
        </ol>
104
        </ol>
105
    </nav> <!-- /.breadcrumbs -->
105
    </nav> <!-- /.breadcrumbs -->
106
    [% INCLUDE 'blocking_errors.inc' %]
106
107
107
    [% IF ( op == 'show' ) %]
108
    [% IF ( op == 'show' ) %]
108
        <div class="main container-fluid">
109
        <div class="main container-fluid">
Lines 345-350 Link Here
345
            [% END %]
346
            [% END %]
346
347
347
            <form id="add_edit" action="suggestion.pl" method="post" class="validated">
348
            <form id="add_edit" action="suggestion.pl" method="post" class="validated">
349
                [% INCLUDE 'csrf-token.inc' %]
348
                <input type="hidden" name="redirect" id="redirect" value="[% redirect | html %]" />
350
                <input type="hidden" name="redirect" id="redirect" value="[% redirect | html %]" />
349
                <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber | html %]" />
351
                <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber | html %]" />
350
                [% IF ( suggestionid ) %]
352
                [% IF ( suggestionid ) %]
Lines 716-721 Link Here
716
            [% FOREACH suggestion IN suggestions %]
718
            [% FOREACH suggestion IN suggestions %]
717
                <div id="[% suggestion.suggestiontype | html %]">
719
                <div id="[% suggestion.suggestiontype | html %]">
718
                    <form class="update_suggestions" name="f" method="post" action="/cgi-bin/koha/suggestion/suggestion.pl#[% suggestion.suggestiontype| uri %]">
720
                    <form class="update_suggestions" name="f" method="post" action="/cgi-bin/koha/suggestion/suggestion.pl#[% suggestion.suggestiontype| uri %]">
721
                        [% INCLUDE 'csrf-token.inc' %]
719
722
720
                        [% IF ( suggestion.suggestions_loop ) %]
723
                        [% IF ( suggestion.suggestions_loop ) %]
721
                            <p>
724
                            <p>
Lines 831-839 Link Here
831
                                            </td>
834
                                            </td>
832
                                            <td class="actions">
835
                                            <td class="actions">
833
                                                <div class="btn-group dropup">
836
                                                <div class="btn-group dropup">
834
                                                    <a class="btn btn-default btn-xs" role="button" href="suggestion.pl?suggestionid=[% suggestions_loo.suggestionid | html %]&amp;op=edit"><i class="fa fa-pencil"></i> Edit</a><a class="btn btn-default btn-xs dropdown-toggle" id="more_actions_[% suggestions_loo.suggestionid | html %]" role="button" data-toggle="dropdown" href="#"><b class="caret"></b></a>
837
                                                    <a class="btn btn-default btn-xs" role="button" href="suggestion.pl?suggestionid=[% suggestions_loo.suggestionid | html %]&amp;csrf_token=[% csrf_token | html %]&amp;op=edit"><i class="fa fa-pencil"></i> Edit</a><a class="btn btn-default btn-xs dropdown-toggle" id="more_actions_[% suggestions_loo.suggestionid | html %]" role="button" data-toggle="dropdown" href="#"><b class="caret"></b></a>
835
                                                    <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="more_actions_[% suggestions_loo.suggestionid | html %]">
838
                                                    <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="more_actions_[% suggestions_loo.suggestionid | html %]">
836
                                                        <li><a class="deletesuggestion" href="suggestion.pl?op=delete&amp;suggestionid=[% suggestions_loo.suggestionid | html %]"><i class="fa fa-trash"></i> Delete</a></li>
839
                                                        <li><a class="deletesuggestion" href="suggestion.pl?op=delete&amp;suggestionid=[% suggestions_loo.suggestionid | html %]&amp;csrf_token=[% csrf_token | html %]"><i class="fa fa-trash"></i> Delete</a></li>
837
                                                        [% UNLESS suggestions_loo.archived %]
840
                                                        [% UNLESS suggestions_loo.archived %]
838
                                                            <li><a class="archivesuggestion" href="suggestion.pl?op=archive&amp;suggestionid=[% suggestions_loo.suggestionid | html %]"><i class="fa fa-archive"></i> Archive</a></li>
841
                                                            <li><a class="archivesuggestion" href="suggestion.pl?op=archive&amp;suggestionid=[% suggestions_loo.suggestionid | html %]"><i class="fa fa-archive"></i> Archive</a></li>
839
                                                        [% ELSE %]
842
                                                        [% ELSE %]
(-)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 (+7 lines)
Lines 78-96 $user ||= q{}; Link Here
78
our $branch = C4::Context->userenv->{'branch'};
78
our $branch = C4::Context->userenv->{'branch'};
79
79
80
if ( $input->param('paycollect') ) {
80
if ( $input->param('paycollect') ) {
81
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
81
    print $input->redirect(
82
    print $input->redirect(
82
        "/cgi-bin/koha/members/paycollect.pl?borrowernumber=$borrowernumber&change_given=$change_given");
83
        "/cgi-bin/koha/members/paycollect.pl?borrowernumber=$borrowernumber&change_given=$change_given");
83
}
84
}
84
elsif ( $input->param('payselected') ) {
85
elsif ( $input->param('payselected') ) {
86
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
85
    payselected({ params => \@names });
87
    payselected({ params => \@names });
86
}
88
}
87
elsif ( $input->param('writeoff_selected') ) {
89
elsif ( $input->param('writeoff_selected') ) {
90
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
88
    payselected({ params => \@names, type => 'WRITEOFF' });
91
    payselected({ params => \@names, type => 'WRITEOFF' });
89
}
92
}
90
elsif ( $input->param('woall') ) {
93
elsif ( $input->param('woall') ) {
94
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
91
    writeoff_all(@names);
95
    writeoff_all(@names);
92
}
96
}
93
elsif ( $input->param('apply_credits') ) {
97
elsif ( $input->param('apply_credits') ) {
98
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
94
    apply_credits({ patron => $patron, cgi => $input });
99
    apply_credits({ patron => $patron, cgi => $input });
95
}
100
}
96
elsif ( $input->param('confirm_writeoff') ) {
101
elsif ( $input->param('confirm_writeoff') ) {
Lines 130-138 elsif ( $input->param('confirm_writeoff') ) { Link Here
130
135
131
for (@names) {
136
for (@names) {
132
    if (/^pay_indiv_(\d+)$/) {
137
    if (/^pay_indiv_(\d+)$/) {
138
        output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
133
        my $line_no = $1;
139
        my $line_no = $1;
134
        redirect_to_paycollect( 'pay_individual', $line_no );
140
        redirect_to_paycollect( 'pay_individual', $line_no );
135
    } elsif (/^wo_indiv_(\d+)$/) {
141
    } elsif (/^wo_indiv_(\d+)$/) {
142
        output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
136
        my $line_no = $1;
143
        my $line_no = $1;
137
        redirect_to_paycollect( 'writeoff_individual', $line_no );
144
        redirect_to_paycollect( 'writeoff_individual', $line_no );
138
    }
145
    }
(-)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 128-133 my $branchfilter = $input->param('branchcode') || C4::Context->userenv->{'branch Link Here
128
##
128
##
129
129
130
if ( $op =~ /save/i ) {
130
if ( $op =~ /save/i ) {
131
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
131
    my @messages;
132
    my @messages;
132
    my $biblio = MarcRecordFromNewSuggestion({
133
    my $biblio = MarcRecordFromNewSuggestion({
133
            title => $suggestion_only->{title},
134
            title => $suggestion_only->{title},
Lines 245-251 elsif ($op=~/add/) { Link Here
245
    $op ='save';
246
    $op ='save';
246
}
247
}
247
elsif ($op=~/edit/) {
248
elsif ($op=~/edit/) {
248
    #Edit suggestion  
249
    #Edit suggestion
250
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
249
    $suggestion_ref=&GetSuggestion($$suggestion_ref{'suggestionid'});
251
    $suggestion_ref=&GetSuggestion($$suggestion_ref{'suggestionid'});
250
    $suggestion_ref->{reasonsloop} = $reasonsloop;
252
    $suggestion_ref->{reasonsloop} = $reasonsloop;
251
    my $other_reason = 1;
253
    my $other_reason = 1;
Lines 260-266 elsif ($op=~/edit/) { Link Here
260
    $op ='save';
262
    $op ='save';
261
}  
263
}  
262
elsif ($op eq "update_status" ) {
264
elsif ($op eq "update_status" ) {
263
265
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
264
    my $suggestion;
266
    my $suggestion;
265
    # set accepted/rejected/managed informations if applicable
267
    # set accepted/rejected/managed informations if applicable
266
    # ie= if the librarian has chosen some action on the suggestions
268
    # ie= if the librarian has chosen some action on the suggestions
Lines 297-302 elsif ($op eq "update_status" ) { Link Here
297
    }
299
    }
298
    redirect_with_params($input);
300
    redirect_with_params($input);
299
}elsif ($op eq "delete" ) {
301
}elsif ($op eq "delete" ) {
302
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
300
    foreach my $delete_field (@editsuggestions) {
303
    foreach my $delete_field (@editsuggestions) {
301
        &DelSuggestion( $borrowernumber, $delete_field,'intranet' );
304
        &DelSuggestion( $borrowernumber, $delete_field,'intranet' );
302
    }
305
    }
303
- 

Return to bug 22990