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" |
294 |
name="note" |
295 |
data-issue_id="[% ISSUE.issue_id%]" |
296 |
data-origvalue="[% ISSUE.note %]" |
297 |
value="[% ISSUE.note %]"> |
298 |
</input> |
299 |
<a class="btn" |
300 |
name="submitnote" |
301 |
id="save_[% ISSUE.issue_id %]" |
302 |
style="display:none;">Submit note</a> |
303 |
</td> |
304 |
[% END %] |
286 |
</tr> |
305 |
</tr> |
287 |
[% END # /FOREACH ISSUES %] |
306 |
[% END # /FOREACH ISSUES %] |
288 |
</tbody> |
307 |
</tbody> |
Lines 883-888
Using this account is not recommended because some parts of Koha will not functi
Link Here
|
883 |
[% END %] |
902 |
[% END %] |
884 |
[% END %] |
903 |
[% END %] |
885 |
|
904 |
|
|
|
905 |
[% IF ( AllowIssueNotes ) %] |
906 |
$("input[name='note']").keyup(function(e){ |
907 |
/* prevent submitting of renewselected form */ |
908 |
if(e.which == 13) |
909 |
e.preventDefault(); |
910 |
|
911 |
var $btn_save = $('#save_'+$(this).data('issue_id')); |
912 |
var origvalue = $(this).data('origvalue'); |
913 |
var value = $(this).val(); |
914 |
|
915 |
if(origvalue != value) { |
916 |
if(origvalue != "") |
917 |
$btn_save.text('Submit changes'); |
918 |
else |
919 |
$btn_save.text('Submit note'); |
920 |
$btn_save.show(); |
921 |
} else { |
922 |
$btn_save.hide(); |
923 |
} |
924 |
}); |
925 |
|
926 |
$("a[name='submitnote']").click(function(e){ |
927 |
var $self = $(this); |
928 |
var title = $(this).parent().siblings('.title').html(); |
929 |
var $noteinput = $(this).siblings('input[name="note"]').first(); |
930 |
|
931 |
var ajaxData = { |
932 |
'action': 'issuenote', |
933 |
'issue_id': $noteinput.data('issue_id'), |
934 |
'note': $noteinput.val(), |
935 |
}; |
936 |
|
937 |
$.ajax({ |
938 |
url: '/cgi-bin/koha/svc/patron_notes/', |
939 |
type: 'POST', |
940 |
dataType: 'json', |
941 |
data: ajaxData, |
942 |
}) |
943 |
.done(function(data) { |
944 |
var message = ""; |
945 |
if(data.status == 'saved') { |
946 |
$("#notesaved").removeClass("alert-error"); |
947 |
$("#notesaved").addClass("alert-info"); |
948 |
$noteinput.data('origvalue', data.note); |
949 |
$noteinput.val(data.note); |
950 |
message = "<p>Your note about " + title + " has been saved and sent to the library.</p>"; |
951 |
$self.hide(); |
952 |
} else if(data.status == 'removed') { |
953 |
$("#notesaved").removeClass("alert-error"); |
954 |
$("#notesaved").addClass("alert-info"); |
955 |
$noteinput.data('origvalue', ""); |
956 |
$noteinput.val(""); |
957 |
message = "<p>Your note about " + title + " was removed.</p>"; |
958 |
$self.hide(); |
959 |
} else { |
960 |
$("#notesaved").removeClass("alert-info"); |
961 |
$("#notesaved").addClass("alert-error"); |
962 |
message = "<p>Your note about " + title + " could not be saved.</p>" + |
963 |
"<p style=\"font-weight:bold;\">" + data.error + "</p>"; |
964 |
} |
965 |
|
966 |
message += "<p style=\"font-style:italic;\">" + data.note + "</p>"; |
967 |
$("#notesaved").html(message); |
968 |
}) |
969 |
.fail(function(data) { |
970 |
$("#notesaved").removeClass("alert-info"); |
971 |
$("#notesaved").addClass("alert-error"); |
972 |
var message = "<p>Your note about " + title + " could not be saved.</p>" + |
973 |
"<p style=\"font-weight:bold;\">Ajax request has failed.</p>"; |
974 |
$("#notesaved").html(message); |
975 |
}) |
976 |
.always(function() { |
977 |
$("#notesaved").show(); |
978 |
}); |
979 |
}); |
980 |
[% END %] |
981 |
|
886 |
$( ".suspend-until" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future |
982 |
$( ".suspend-until" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future |
887 |
}); |
983 |
}); |
888 |
//]]> |
984 |
//]]> |