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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reviews/reviewswaiting.tt (-1 / +18 lines)
Lines 97-106 Link Here
97
            [% review.review | html %]
97
            [% review.review | html %]
98
        </td>
98
        </td>
99
        <td class="actions">
99
        <td class="actions">
100
            [% IF ( status ) %]<a href="/cgi-bin/koha/reviews/reviewswaiting.pl?op=unapprove&amp;reviewid=[% review.reviewid | uri %]" class="btn btn-default btn-xs"><i class="fa fa-times"></i> Unapprove</a>[% ELSE %]<a href="/cgi-bin/koha/reviews/reviewswaiting.pl?op=approve&amp;reviewid=[% review.reviewid | uri %]" class="btn btn-default btn-xs"><i class="fa fa-check"></i> Approve</a>[% END %]
100
            [% IF ( review.approved ) %]
101
                <form action="/cgi-bin/koha/reviews/reviewswaiting.pl" method="post">
102
                    [% INCLUDE 'csrf-token.inc' %]
103
                    <input type="hidden" name="op" value="cud-unapprove" />
104
                    <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
105
                    <input type="hidden" name="reviewid" value="[% review.reviewid | html %]" />
106
                    <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-times" aria-hidden="true"></i> Unapprove</button>
107
                </form>
108
            [% ELSE %]
109
                <form action="/cgi-bin/koha/reviews/reviewswaiting.pl" method="post">
110
                    [% INCLUDE 'csrf-token.inc' %]
111
                    <input type="hidden" name="op" value="cud-approve" />
112
                    <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
113
                    <input type="hidden" name="reviewid" value="[% review.reviewid | html %]" />
114
                    <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-check" aria-hidden="true"></i> Approve</button>
115
                </form>
116
            [% END %]
101
            <form action="/cgi-bin/koha/reviews/reviewswaiting.pl" method="post">
117
            <form action="/cgi-bin/koha/reviews/reviewswaiting.pl" method="post">
102
                [% INCLUDE 'csrf-token.inc' %]
118
                [% INCLUDE 'csrf-token.inc' %]
103
                <input type="hidden" name="op" value="cud-delete" />
119
                <input type="hidden" name="op" value="cud-delete" />
120
                <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
104
                <input type="hidden" name="reviewid" value="[% review.reviewid | html %]" />
121
                <input type="hidden" name="reviewid" value="[% review.reviewid | html %]" />
105
                <button type="submit" class="btn btn-default btn-xs delete-comment"><i class="fa fa-trash-can" aria-hidden="true"></i> Delete</button>
122
                <button type="submit" class="btn btn-default btn-xs delete-comment"><i class="fa fa-trash-can" aria-hidden="true"></i> Delete</button>
106
            </form>
123
            </form>
(-)a/reviews/reviewswaiting.pl (-3 / +2 lines)
Lines 42-52 my $page = $query->param('page') || 1; Link Here
42
my $count    = C4::Context->preference('numSearchResults') || 20;
42
my $count    = C4::Context->preference('numSearchResults') || 20;
43
my $total    = Koha::Reviews->search_limited({ approved => $status })->count;
43
my $total    = Koha::Reviews->search_limited({ approved => $status })->count;
44
44
45
if ( $op eq 'approve' ) {
45
if ( $op eq 'cud-approve' ) {
46
    my $review = Koha::Reviews->find( $reviewid );
46
    my $review = Koha::Reviews->find( $reviewid );
47
    $review->approve if $review;
47
    $review->approve if $review;
48
}
48
}
49
elsif ( $op eq 'unapprove' ) {
49
elsif ( $op eq 'cud-unapprove' ) {
50
    my $review = Koha::Reviews->find( $reviewid );
50
    my $review = Koha::Reviews->find( $reviewid );
51
    $review->unapprove if $review;
51
    $review->unapprove if $review;
52
}
52
}
53
- 

Return to bug 37074