|
Lines 120-125
Using this account is not recommended because some parts of Koha will not functi
Link Here
|
| 120 |
</div> |
120 |
</div> |
| 121 |
[% END # / IF patron_flagged %] |
121 |
[% END # / IF patron_flagged %] |
| 122 |
|
122 |
|
|
|
123 |
<div class="alert alert-info" id="notesaved" style="display:none;"></div> |
| 124 |
|
| 123 |
[% SET OPACMySummaryNote = Koha.Preference('OPACMySummaryNote') %] |
125 |
[% SET OPACMySummaryNote = Koha.Preference('OPACMySummaryNote') %] |
| 124 |
[% IF OPACMySummaryNote %][% OPACMySummaryNote %][% END %] |
126 |
[% IF OPACMySummaryNote %][% OPACMySummaryNote %][% END %] |
| 125 |
|
127 |
|
|
Lines 165-170
Using this account is not recommended because some parts of Koha will not functi
Link Here
|
| 165 |
[% IF ( OPACMySummaryHTML ) %] |
167 |
[% IF ( OPACMySummaryHTML ) %] |
| 166 |
<th class="nosort">Links</th> |
168 |
<th class="nosort">Links</th> |
| 167 |
[% END %] |
169 |
[% END %] |
|
|
170 |
[% IF ( AllowIssueNotes ) %] |
| 171 |
<th class="nosort">Note</th> |
| 172 |
[% END %] |
| 168 |
</tr> |
173 |
</tr> |
| 169 |
</thead> |
174 |
</thead> |
| 170 |
<tbody> |
175 |
<tbody> |
|
Lines 283-288
Using this account is not recommended because some parts of Koha will not functi
Link Here
|
| 283 |
[% IF ( OPACMySummaryHTML ) %] |
288 |
[% IF ( OPACMySummaryHTML ) %] |
| 284 |
<td class="links">[% ISSUE.MySummaryHTML %]</td> |
289 |
<td class="links">[% ISSUE.MySummaryHTML %]</td> |
| 285 |
[% END %] |
290 |
[% END %] |
|
|
291 |
[% IF ( AllowIssueNotes ) %] |
| 292 |
<td class="note"> |
| 293 |
<input type="text" name="note" data-issue_id="[% ISSUE.issue_id %]" data-origvalue="[% ISSUE.note %]" value="[% ISSUE.note %]" readonly> |
| 294 |
<a class="btn" name="js_submitnote" id="save_[% ISSUE.issue_id %]" style="display:none;">Submit note</a> |
| 295 |
<a class="btn" name="nonjs_submitnote" href="/cgi-bin/koha/opac-issue-note.pl?issue_id=[% ISSUE.issue_id | url %]">Edit / Create note</a> |
| 296 |
</td> |
| 297 |
[% END %] |
| 286 |
</tr> |
298 |
</tr> |
| 287 |
[% END # /FOREACH ISSUES %] |
299 |
[% END # /FOREACH ISSUES %] |
| 288 |
</tbody> |
300 |
</tbody> |
|
Lines 883-888
Using this account is not recommended because some parts of Koha will not functi
Link Here
|
| 883 |
[% END %] |
895 |
[% END %] |
| 884 |
[% END %] |
896 |
[% END %] |
| 885 |
|
897 |
|
|
|
898 |
[% IF ( AllowIssueNotes ) %] |
| 899 |
|
| 900 |
/* If JS enabled, show button, otherwise show link to redirect to a page where note can be submitted */ |
| 901 |
$("a[name='nonjs_submitnote']").hide(); |
| 902 |
|
| 903 |
$("input[name='note']").prop('readonly', false); |
| 904 |
$("input[name='note']").keyup(function(e){ |
| 905 |
/* prevent submitting of renewselected form */ |
| 906 |
if(e.which == 13) |
| 907 |
e.preventDefault(); |
| 908 |
|
| 909 |
var $btn_save = $('#save_'+$(this).data('issue_id')); |
| 910 |
var origvalue = $(this).data('origvalue'); |
| 911 |
var value = $(this).val(); |
| 912 |
|
| 913 |
if(origvalue != value) { |
| 914 |
if(origvalue != "") |
| 915 |
$btn_save.text('Submit changes'); |
| 916 |
else |
| 917 |
$btn_save.text('Submit note'); |
| 918 |
$btn_save.show(); |
| 919 |
} else { |
| 920 |
$btn_save.hide(); |
| 921 |
} |
| 922 |
}); |
| 923 |
|
| 924 |
$("a[name='js_submitnote']").click(function(e){ |
| 925 |
var $self = $(this); |
| 926 |
var title = $(this).parent().siblings('.title').html(); |
| 927 |
var $noteinput = $(this).siblings('input[name="note"]').first(); |
| 928 |
|
| 929 |
var ajaxData = { |
| 930 |
'action': 'issuenote', |
| 931 |
'issue_id': $noteinput.data('issue_id'), |
| 932 |
'note': $noteinput.val(), |
| 933 |
}; |
| 934 |
|
| 935 |
$.ajax({ |
| 936 |
url: '/cgi-bin/koha/svc/patron_notes/', |
| 937 |
type: 'POST', |
| 938 |
dataType: 'json', |
| 939 |
data: ajaxData, |
| 940 |
}) |
| 941 |
.done(function(data) { |
| 942 |
var message = ""; |
| 943 |
if(data.status == 'saved') { |
| 944 |
$("#notesaved").removeClass("alert-error"); |
| 945 |
$("#notesaved").addClass("alert-info"); |
| 946 |
$noteinput.data('origvalue', data.note); |
| 947 |
$noteinput.val(data.note); |
| 948 |
message = "<p>Your note about " + title + " has been saved and sent to the library.</p>"; |
| 949 |
$self.hide(); |
| 950 |
} else if(data.status == 'removed') { |
| 951 |
$("#notesaved").removeClass("alert-error"); |
| 952 |
$("#notesaved").addClass("alert-info"); |
| 953 |
$noteinput.data('origvalue', ""); |
| 954 |
$noteinput.val(""); |
| 955 |
message = "<p>Your note about " + title + " was removed.</p>"; |
| 956 |
$self.hide(); |
| 957 |
} else { |
| 958 |
$("#notesaved").removeClass("alert-info"); |
| 959 |
$("#notesaved").addClass("alert-error"); |
| 960 |
message = "<p>Your note about " + title + " could not be saved.</p>" + |
| 961 |
"<p style=\"font-weight:bold;\">" + data.error + "</p>"; |
| 962 |
} |
| 963 |
|
| 964 |
message += "<p style=\"font-style:italic;\">" + data.note + "</p>"; |
| 965 |
$("#notesaved").html(message); |
| 966 |
}) |
| 967 |
.fail(function(data) { |
| 968 |
$("#notesaved").removeClass("alert-info"); |
| 969 |
$("#notesaved").addClass("alert-error"); |
| 970 |
var message = "<p>Your note about " + title + " could not be saved.</p>" + |
| 971 |
"<p style=\"font-weight:bold;\">Ajax request has failed.</p>"; |
| 972 |
$("#notesaved").html(message); |
| 973 |
}) |
| 974 |
.always(function() { |
| 975 |
$("#notesaved").show(); |
| 976 |
}); |
| 977 |
}); |
| 978 |
[% END %] |
| 979 |
|
| 886 |
$( ".suspend-until" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future |
980 |
$( ".suspend-until" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future |
| 887 |
}); |
981 |
}); |
| 888 |
//]]> |
982 |
//]]> |