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

(-)a/circ/checkout-notes.pl (-2 / +2 lines)
Lines 38-48 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
38
);
38
);
39
39
40
my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count;
40
my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count;
41
my @notes = Koha::Checkouts->search({ 'me.note' => { '!=', undef } }, { prefetch => [ 'borrower', { item => 'biblionumber' } ] });
42
41
43
$template->param(
42
$template->param(
44
    pending_checkout_notes => $pending_checkout_notes,
43
    pending_checkout_notes => $pending_checkout_notes,
45
    notes                  => \@notes,
46
);
44
);
47
45
48
my $action;
46
my $action;
Lines 65-73 if ( $action eq 'seen' ) { Link Here
65
    }
63
    }
66
}
64
}
67
65
66
my $notes = Koha::Checkouts->search({ 'me.note' => { '!=', undef } }, { prefetch => [ 'borrower', { item => 'biblionumber' } ] });
68
$template->param(
67
$template->param(
69
    selected_count => scalar(@issue_ids),
68
    selected_count => scalar(@issue_ids),
70
    action         => $action,
69
    action         => $action,
70
    notes          => $notes,
71
);
71
);
72
72
73
output_html_with_http_headers $query, $cookie, $template->output;
73
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/installer/data/mysql/atomicupdate/bug-17698_add-permission-to-manage-checkout-notes.sql (-1 / +1 lines)
Line 1 Link Here
1
INSERT INTO permissions (module_bit, code, description) VALUES ( 1, 'manage_checkout_notes', 'Mark checkout notes as seen/not seen');
1
INSERT IGNORE INTO permissions (module_bit, code, description) VALUES ( 1, 'manage_checkout_notes', 'Mark checkout notes as seen/not seen');
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/checkout-notes.tt (-58 / +56 lines)
Lines 28-99 Link Here
28
            [% IF ( selected_count ) %]
28
            [% IF ( selected_count ) %]
29
                <div class="dialog message">
29
                <div class="dialog message">
30
                    [% IF ( action == 'seen' ) %]
30
                    [% IF ( action == 'seen' ) %]
31
                        [% selected_count %] note(s) marked as seen.
31
                        <span>[% selected_count %] note(s) marked as seen.</span>
32
                    [% ELSIF ( action == 'notseen' ) %]
32
                    [% ELSIF ( action == 'notseen' ) %]
33
                        [% selected_count %] note(s) marked as not seen.
33
                        <span>[% selected_count %] note(s) marked as not seen.</span>
34
                    [% ELSE %]
34
                    [% ELSE %]
35
                        Failed to change the status of [% selected_count %] item(s).
35
                        <span>Failed to change the status of [% selected_count %] item(s).</span>
36
                    [% END %]
36
                    [% END %]
37
                </div>
37
                </div>
38
                <a href="/cgi-bin/koha/circ/checkout-notes.pl" class="btn btn-default btn-sm"><i class="fa fa-left"></i> Return to checkout notes</a>
38
            [% END %]
39
            [% ELSE %]
39
40
            [% IF ( notes.count ) %]
41
                <fieldset class="action">
42
                    <a class="SelectAll"><i class="fa fa-check"></i> Select all</a> | <a class="ClearAll"><i class="fa fa-remove"></i> Clear all</a>
43
                </fieldset>
44
45
                <form id="mark_selected" method="post" action="/cgi-bin/koha/circ/checkout-notes.pl">
46
47
                    <table id="notestable">
48
                        <thead>
49
                            <tr>
50
                                <th>&nbsp;</th>
51
                                <th>Title</th>
52
                                <th>Note</th>
53
                                <th>Date</th>
54
                                <th>Set by</th>
55
                                <th>Status</th>
56
                                <th>Actions</th>
57
                            </tr>
58
                        </thead>
59
                        <tbody>
60
                            [% FOREACH note IN notes %]
61
                                <tr>
62
                                    <td><input type="checkbox" name="issue_ids" value="[% note.issue_id %]"></td>
63
                                    <td>[% note.item.biblio.title %] - [% note.item.biblio.author %] (<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% note.item.biblionumber %]">[% note.item.barcode %]</a>)</td>
64
                                    <td>[% note.note | html %]</td>
65
                                    <td>[% note.notedate | $KohaDates %]</td>
66
                                    <td>[% INCLUDE 'patron-title.inc' patron => note.patron hide_patron_infos_if_needed=1 %]</td>
67
                                    <td>
68
                                        [% IF ( note.noteseen == 0 ) %]
69
                                            <span id="status_[% note.issue_id %]">Not seen</span>
70
                                        [% ELSIF ( note.noteseen == 1 ) %]
71
                                            <span id="status_[% note.issue_id %]">Seen</span>
72
                                        [% END %]
73
                                    </td>
74
                                    <td class="actions">
75
                                        [% IF ( note.noteseen == 1 ) %]
76
                                            <button name="seen" data-issue_id="[% note.issue_id %]" class="seen btn btn-default btn-xs" disabled="disabled"><i class="fa fa-eye"></i> Mark seen</button> <button name="notseen" data-issue_id="[% note.issue_id %]" class="notseen btn btn-default btn-xs"><i class="fa fa-eye-slash"></i> Mark not seen</button>
77
                                        [% ELSIF ( note.noteseen == 0 ) %]
78
                                            <button name="seen" data-issue_id="[% note.issue_id %]" class="seen btn btn-default btn-xs"><i class="fa fa-eye"></i> Mark seen</button> <button name="notseen" data-issue_id="[% note.issue_id %]" class="notseen btn btn-default btn-xs" disabled="disabled"><i class="fa fa-eye-slash"></i> Mark not seen</button>
79
                                        [% END %]
80
                                    </td>
81
                                </tr>
82
                            [% END %]
83
                        </tbody>
84
                    </table>
40
85
41
                [% IF ( notes ) %]
42
                    <fieldset class="action">
86
                    <fieldset class="action">
43
                        <a class="SelectAll"><i class="fa fa-check"></i> Select all</a> | <a class="ClearAll"><i class="fa fa-remove"></i> Clear all</a>
87
                        <button type="submit" class="btn btn-default btn-sm" name="mark_selected-seen" value="seen" disabled="disabled"><i class="fa fa-eye"></i> Mark seen</button>
88
                        <button type="submit" class="btn btn-default btn-sm" name="mark_selected-notseen" value="notseen" disabled="disabled"><i class="fa fa-eye-slash"></i> Mark not seen</button>
44
                    </fieldset>
89
                    </fieldset>
45
90
46
                    <form id="mark_selected" method="post" action="/cgi-bin/koha/circ/checkout-notes.pl">
91
                </form>
47
92
48
                        <table id="notestable">
93
            [% ELSE %]
49
                            <thead>
94
                <span>There are currently no checkout notes.</span>
50
                                <tr>
95
            [% END %] <!-- notes -->
51
                                    <th>&nbsp;</th>
52
                                    <th>Title</th>
53
                                    <th>Note</th>
54
                                    <th>Date</th>
55
                                    <th>Set by</th>
56
                                    <th>Status</th>
57
                                    <th>Actions</th>
58
                                </tr>
59
                            </thead>
60
                            <tbody>
61
                                [% FOREACH note IN notes %]
62
                                    <tr>
63
                                        <td><input type="checkbox" name="issue_ids" value="[% note.issue_id %]"></td>
64
                                        <td>[% note.item.biblio.title %] - [% note.item.biblio.author %] (<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% note.item.biblionumber %]">[% note.item.barcode %]</a>)</td>
65
                                        <td>[% note.note %]</td>
66
                                        <td>[% note.notedate | $KohaDates %]</td>
67
                                        <td>[% IF note.patron.title %][% note.patron.title %] [% END %][% note.patron.firstname %] [% note.patron.surname %] (<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% note.patron.borrowernumber %]">[% note.patron.cardnumber %]</a>)</td>
68
                                        <td>
69
                                            [% IF ( note.noteseen == 0 ) %]
70
                                                <span id="status_[% note.issue_id %]">Not seen</span>
71
                                            [% ELSIF ( note.noteseen == 1 ) %]
72
                                                <span id="status_[% note.issue_id %]">Seen</span>
73
                                            [% END %]
74
                                        </td>
75
                                        <td class="actions">
76
                                            [% IF ( note.noteseen == 1 ) %]
77
                                                <button name="seen" data-issue_id="[% note.issue_id %]" class="seen btn btn-default btn-xs" disabled="disabled"><i class="fa fa-eye"></i> Mark seen</button> <button name="notseen" data-issue_id="[% note.issue_id %]" class="notseen btn btn-default btn-xs"><i class="fa fa-eye-slash"></i> Mark not seen</button>
78
                                            [% ELSIF ( note.noteseen == 0 ) %]
79
                                                <button name="seen" data-issue_id="[% note.issue_id %]" class="seen btn btn-default btn-xs"><i class="fa fa-eye"></i> Mark seen</button> <button name="notseen" data-issue_id="[% note.issue_id %]" class="notseen btn btn-default btn-xs" disabled="disabled"><i class="fa fa-eye-slash"></i> Mark not seen</button>
80
                                            [% END %]
81
                                        </td>
82
                                    </tr>
83
                                [% END %]
84
                            </tbody>
85
                        </table>
86
87
                        <fieldset class="action">
88
                            <button type="submit" class="btn btn-default btn-sm" name="mark_selected-seen" value="seen" disabled="disabled"><i class="fa fa-eye"></i> Mark seen</button>
89
                            <button type="submit" class="btn btn-default btn-sm" name="mark_selected-notseen" value="notseen" disabled="disabled"><i class="fa fa-eye-slash"></i> Mark not seen</button>
90
                        </fieldset>
91
92
                    </form>
93
94
                [% END %] <!-- notes -->
95
96
            [% END %] <!-- selected_count -->
97
96
98
        </div> <!-- yui-main -->
97
        </div> <!-- yui-main -->
99
98
100
- 

Return to bug 17698