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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (-23 / +51 lines)
Lines 273-279 Link Here
273
                                                    <th class="nosort">Links</th>
273
                                                    <th class="nosort">Links</th>
274
                                                [% END %]
274
                                                [% END %]
275
                                                [% IF ( Koha.Preference('AllowCheckoutNotes') ) %]
275
                                                [% IF ( Koha.Preference('AllowCheckoutNotes') ) %]
276
                                                    <th id="checkout-notes" class="nosort" title="Use this to report any problems with your currently checked out items">Report a problem</th>
276
                                                    <th class="hidden">Checkout note</th>
277
                                                    <th id="checkout-notes" class="nosort noExport" title="Use this to report any problems with your currently checked out items">Report a problem</th>
277
                                                [% END %]
278
                                                [% END %]
278
                                            </tr>
279
                                            </tr>
279
                                        </thead>
280
                                        </thead>
Lines 452-467 Link Here
452
                                                    <td class="links">[% ISSUE.MySummaryHTML | $raw %]</td>
453
                                                    <td class="links">[% ISSUE.MySummaryHTML | $raw %]</td>
453
                                                [% END %]
454
                                                [% END %]
454
                                                [% IF ( Koha.Preference('AllowCheckoutNotes') ) %]
455
                                                [% IF ( Koha.Preference('AllowCheckoutNotes') ) %]
456
                                                    <td>
457
                                                        [% ISSUE.note | html %]
458
                                                    </td>
455
                                                    <td class="note">
459
                                                    <td class="note">
456
                                                        [% IF ( ISSUE.note ) -%]
460
                                                        <div id="viewnote_[% ISSUE.issue_id | html %]">
457
                                                           [% SET note_action = "Edit note" %]
461
                                                            [% ISSUE.note | html %]
458
                                                        [% ELSE -%]
462
                                                        </div>
459
                                                           [% SET note_action = "Add note" %]
463
                                                        <a id="save_[% ISSUE.issue_id | html %]" href="/cgi-bin/koha/opac-issue-note.pl?issue_id=[% ISSUE.issue_id | html %]" class="btn btn-primary btn-sm btn-add-note noprint" data-title="[% ISSUE.title | html %] [% FOREACH subtitle IN ISSUE.subtitle.split(' \| ') %][% IF Koha.Preference('marcflavour')=='UNIMARC' %],[% END %][% subtitle | html %][% END %]" data-issueid="[% ISSUE.issue_id | html %]" id="save_[% ISSUE.issue_id | html %]">
460
                                                        [% END %]
464
                                                            [% IF ( ISSUE.note ) -%]
461
                                                        <a id="save_[% ISSUE.issue_id | html %]" href="/cgi-bin/koha/opac-issue-note.pl?issue_id=[% ISSUE.issue_id | html %]" class="btn btn-primary btn-sm btn-add-note" data-title="[% ISSUE.title | html %] [% FOREACH subtitle IN ISSUE.subtitle.split(' \| ') %][% IF Koha.Preference('marcflavour')=='UNIMARC' %],[% END %][% subtitle | html %][% END %]" data-issueid="[% ISSUE.issue_id | html %]" id="save_[% ISSUE.issue_id | html %]" data-note="[% ISSUE.note | html %]" data-origvalue="[% ISSUE.note | html %]">
465
                                                                <span>Edit note</span>
462
                                                            [% note_action | html %]
466
                                                            [% ELSE -%]
463
                                                        </button>
467
                                                                <span>Add note</span>
464
                                                        <input type="hidden" name="note" value="[% ISSUE.note | html %]" data-origvalue="[% ISSUE.note | html %]" />
468
                                                            [% END %]
469
                                                        </a>
470
                                                        <input type="hidden" id="note_[% ISSUE.issue_id | html %]" name="note" value="[% ISSUE.note | html %]" data-origvalue="[% ISSUE.note | html %]" />
465
                                                    </td>
471
                                                    </td>
466
                                                [% END %]
472
                                                [% END %]
467
                                            </tr>
473
                                            </tr>
Lines 960-972 Link Here
960
                    "dom": '<"top"<"table_entries"><"table_controls"fB>>t',
966
                    "dom": '<"top"<"table_entries"><"table_controls"fB>>t',
961
                    "columnDefs": [
967
                    "columnDefs": [
962
                        { "targets": [ "nosort" ],"sortable": false,"searchable": false },
968
                        { "targets": [ "nosort" ],"sortable": false,"searchable": false },
963
                        { "type": "anti-the", "targets" : [ "anti-the" ] }
969
                        { "type": "anti-the", "targets" : [ "anti-the" ] },
970
                        { "visible": false, "targets" : [ "hidden" ] }
964
                    ],
971
                    ],
965
                    "language": {
972
                    "language": {
966
                        "search": "_INPUT_",
973
                        "search": "_INPUT_",
967
                        "searchPlaceholder": _("Search")
974
                        "searchPlaceholder": _("Search")
968
                    },
975
                    },
969
                    "autoWidth": false
976
                    "autoWidth": false,
977
                    buttons: [
978
                        /* Override default button set so that we can extend the options of print and csv */
979
                        'clearFilter', 'copy',
980
                        {
981
                            extend: "print",
982
                            exportOptions: {
983
                                /* Print view should show all columns (even invisible ones) unless they are .noExport */
984
                                columns: ":not(.noExport)"
985
                            }
986
                        },
987
                        {
988
                            extend: "csv",
989
                            exportOptions: {
990
                                /* CSV export should include all columns (even invisible ones) unless they are .noExport */
991
                                columns: ":not(.noExport)"
992
                            }
993
                        }
994
                    ]
970
                }));
995
                }));
971
            });
996
            });
972
997
Lines 1055-1062 Link Here
1055
                e.preventDefault();
1080
                e.preventDefault();
1056
                var title = $(this).data("title");
1081
                var title = $(this).data("title");
1057
                var issue_id = $(this).data("issueid");
1082
                var issue_id = $(this).data("issueid");
1058
                var note = $(this).data("note");
1083
                var note = $("#note_" + issue_id ).val();
1059
                var origvalue = $(this).data("origvalue");
1084
                var origvalue = $("#note_" + issue_id ).data("origvalue");
1060
                $("#addNote").val( note );
1085
                $("#addNote").val( note );
1061
                $("#addNoteIssueId").val( issue_id );
1086
                $("#addNoteIssueId").val( issue_id );
1062
                $("#addNoteTitle").text( title );
1087
                $("#addNoteTitle").text( title );
Lines 1079-1085 Link Here
1079
1104
1080
        function submitNote( title, issue_id, note ){
1105
        function submitNote( title, issue_id, note ){
1081
            var self = $("#addNoteModal");
1106
            var self = $("#addNoteModal");
1082
            var noteinput = $("#save_" + issue_id );
1107
            var notebutton = $("#save_" + issue_id );
1108
            var noteinput = $("#note_" + issue_id );
1083
1109
1084
            var ajaxData = {
1110
            var ajaxData = {
1085
                'action': 'issuenote',
1111
                'action': 'issuenote',
Lines 1099-1125 Link Here
1099
                    $("#notesaved").removeClass("alert-error");
1125
                    $("#notesaved").removeClass("alert-error");
1100
                    $("#notesaved").addClass("alert-info");
1126
                    $("#notesaved").addClass("alert-info");
1101
                    noteinput.data('origvalue', data.note)
1127
                    noteinput.data('origvalue', data.note)
1102
                        .data('note', data.note)
1128
                        .val(data.note);
1103
                        .text( _("Edit note" ) );
1129
                    notebutton.text( _("Edit note" ) );
1130
                    $("#viewnote_" + issue_id ).text( data.note );
1104
                    message = "<p>" + _("Your note about %s has been saved and sent to the library.").format( em(title) ) + "</p>";
1131
                    message = "<p>" + _("Your note about %s has been saved and sent to the library.").format( em(title) ) + "</p>";
1105
                    message += "<p class=\"checkout_note\">" + data.note;
1132
                    message += "<p class=\"checkout_note\">" + data.note;
1106
                    message += "<a href=\"/cgi-bin/koha/opac-issue-note.pl?issue_id=" + issue_id + "\" class=\"btn btn-link btn-sm btn-add-note\" data-title=\"" + title + "\" data-issueid=\"" + issue_id + "\" data-note=\"" + data.note + "\" data-origvalue=\"" + data.note + "\"><i class=\"fa fa-pencil\" aria-hidden=\"true\"></i> " + _("Edit note") + "</a>";
1133
                    message += "<a href=\"/cgi-bin/koha/opac-issue-note.pl?issue_id=" + issue_id + "\" class=\"btn btn-link btn-sm btn-add-note\" data-title=\"" + title + "\" data-issueid=\"" + issue_id + "\"><i class=\"fa fa-pencil\" aria-hidden=\"true\"></i> " + _("Edit note") + "</a>";
1107
                    message += "</p>";
1134
                    message += "</p>";
1108
                } else if(data.status == 'removed') {
1135
                } else if(data.status == 'removed') {
1109
                    $("#notesaved").removeClass("alert-error");
1136
                    $("#notesaved").removeClass("alert-error");
1110
                    $("#notesaved").addClass("alert-info");
1137
                    $("#notesaved").addClass("alert-info");
1111
                    noteinput.data('origvalue', "")
1138
                    noteinput.data('origvalue', "")
1112
                        .data("note", "")
1139
                        .val("")
1113
                        .text( _("Add note") );
1140
                    notebutton.text( _("Add note") );
1141
                    $("#viewnote_" + issue_id ).text( data.note );
1114
                    message = "<p>" + _("Your note about %s was removed.").format( em(title) ) + "</p>";
1142
                    message = "<p>" + _("Your note about %s was removed.").format( em(title) ) + "</p>";
1115
                } else {
1143
                } else {
1116
                    $("#notesaved").removeClass("alert-info");
1144
                    $("#notesaved").removeClass("alert-info");
1117
                    $("#notesaved").addClass("alert-error");
1145
                    $("#notesaved").addClass("alert-error");
1118
                    message =  "<p>" + _("Your note about %s could not be saved.").format( em(title) ) + "</p>";
1146
                    message =  "<p>" + _("Your note about %s could not be saved.").format( em(title) ) + "</p>";
1119
                    noteinput.text( _("Add note") );
1147
                    notebutton.text( _("Add note") );
1148
                    $("#viewnote_" + issue_id ).text( data.note );
1120
                    message += "<p style=\"font-weight:bold;\">" + _("Something went wrong. The note has not been saved") + "</p>";
1149
                    message += "<p style=\"font-weight:bold;\">" + _("Something went wrong. The note has not been saved") + "</p>";
1121
                }
1150
                }
1122
                self.modal("hide");
1123
                $("#notesaved").html(message);
1151
                $("#notesaved").html(message);
1124
            })
1152
            })
1125
            .fail(function(data) {
1153
            .fail(function(data) {
Lines 1129-1134 Link Here
1129
                $("#notesaved").html(message);
1157
                $("#notesaved").html(message);
1130
            })
1158
            })
1131
            .always(function() {
1159
            .always(function() {
1160
                self.modal("hide");
1132
                $("#notesaved").show();
1161
                $("#notesaved").show();
1133
            });
1162
            });
1134
        }
1163
        }
1135
- 

Return to bug 28720