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 164-169
Using this account is not recommended because some parts of Koha will not functi
Link Here
|
164 |
[% IF ( OPACMySummaryHTML ) %] |
166 |
[% IF ( OPACMySummaryHTML ) %] |
165 |
<th class="nosort">Links</th> |
167 |
<th class="nosort">Links</th> |
166 |
[% END %] |
168 |
[% END %] |
|
|
169 |
[% IF ( AllowIssueNotes ) %] |
170 |
<th class="nosort">Note</th> |
171 |
[% END %] |
167 |
</tr> |
172 |
</tr> |
168 |
</thead> |
173 |
</thead> |
169 |
<tbody> |
174 |
<tbody> |
Lines 280-285
Using this account is not recommended because some parts of Koha will not functi
Link Here
|
280 |
[% IF ( OPACMySummaryHTML ) %] |
285 |
[% IF ( OPACMySummaryHTML ) %] |
281 |
<td class="links">[% ISSUE.MySummaryHTML %]</td> |
286 |
<td class="links">[% ISSUE.MySummaryHTML %]</td> |
282 |
[% END %] |
287 |
[% END %] |
|
|
288 |
[% IF ( AllowIssueNotes ) %] |
289 |
<td class="note"> |
290 |
<input type="text" |
291 |
name="note" |
292 |
data-issue_id="[% ISSUE.issue_id%]" |
293 |
data-origvalue="[% ISSUE.note %]" |
294 |
value="[% ISSUE.note %]"> |
295 |
</input> |
296 |
<a class="btn" |
297 |
name="submitnote" |
298 |
id="save_[% ISSUE.issue_id %]" |
299 |
style="display:none;">Submit note</a> |
300 |
</td> |
301 |
[% END %] |
283 |
</tr> |
302 |
</tr> |
284 |
[% END # /FOREACH ISSUES %] |
303 |
[% END # /FOREACH ISSUES %] |
285 |
</tbody> |
304 |
</tbody> |
Lines 782-787
Using this account is not recommended because some parts of Koha will not functi
Link Here
|
782 |
[% END %] |
801 |
[% END %] |
783 |
[% END %] |
802 |
[% END %] |
784 |
|
803 |
|
|
|
804 |
[% IF ( AllowIssueNotes ) %] |
805 |
$("input[name='note']").keyup(function(e){ |
806 |
/* prevent submitting of renewselected form */ |
807 |
if(e.which == 13) |
808 |
e.preventDefault(); |
809 |
|
810 |
var $btn_save = $('#save_'+$(this).data('issue_id')); |
811 |
var origvalue = $(this).data('origvalue'); |
812 |
var value = $(this).val(); |
813 |
|
814 |
if(origvalue != value) { |
815 |
if(origvalue != "") |
816 |
$btn_save.text('Submit changes'); |
817 |
else |
818 |
$btn_save.text('Submit note'); |
819 |
$btn_save.show(); |
820 |
} else { |
821 |
$btn_save.hide(); |
822 |
} |
823 |
}); |
824 |
|
825 |
$("a[name='submitnote']").click(function(e){ |
826 |
var $self = $(this); |
827 |
var title = $(this).parent().siblings('.title').html(); |
828 |
var $noteinput = $(this).siblings('input[name="note"]').first(); |
829 |
|
830 |
var ajaxData = { |
831 |
'action': 'issuenote', |
832 |
'issue_id': $noteinput.data('issue_id'), |
833 |
'note': $noteinput.val(), |
834 |
}; |
835 |
|
836 |
$.ajax({ |
837 |
url: '/cgi-bin/koha/svc/patron_notes/', |
838 |
type: 'POST', |
839 |
dataType: 'json', |
840 |
data: ajaxData, |
841 |
}) |
842 |
.done(function(data) { |
843 |
var message = ""; |
844 |
if(data.status == 'saved') { |
845 |
$("#notesaved").removeClass("alert-error"); |
846 |
$("#notesaved").addClass("alert-info"); |
847 |
$noteinput.data('origvalue', data.note); |
848 |
$noteinput.val(data.note); |
849 |
message = "<p>Your note about " + title + " has been saved and sent to the library.</p>"; |
850 |
$self.hide(); |
851 |
} else if(data.status == 'removed') { |
852 |
$("#notesaved").removeClass("alert-error"); |
853 |
$("#notesaved").addClass("alert-info"); |
854 |
$noteinput.data('origvalue', ""); |
855 |
$noteinput.val(""); |
856 |
message = "<p>Your note about " + title + " was removed.</p>"; |
857 |
$self.hide(); |
858 |
} else { |
859 |
$("#notesaved").removeClass("alert-info"); |
860 |
$("#notesaved").addClass("alert-error"); |
861 |
message = "<p>Your note about " + title + " could not be saved.</p>" + |
862 |
"<p style=\"font-weight:bold;\">" + data.error + "</p>"; |
863 |
} |
864 |
|
865 |
message += "<p style=\"font-style:italic;\">" + data.note + "</p>"; |
866 |
$("#notesaved").html(message); |
867 |
}) |
868 |
.fail(function(data) { |
869 |
$("#notesaved").removeClass("alert-info"); |
870 |
$("#notesaved").addClass("alert-error"); |
871 |
var message = "<p>Your note about " + title + " could not be saved.</p>" + |
872 |
"<p style=\"font-weight:bold;\">Ajax request has failed.</p>"; |
873 |
$("#notesaved").html(message); |
874 |
}) |
875 |
.always(function() { |
876 |
$("#notesaved").show(); |
877 |
}); |
878 |
}); |
879 |
[% END %] |
880 |
|
785 |
$( ".suspend-until" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future |
881 |
$( ".suspend-until" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future |
786 |
}); |
882 |
}); |
787 |
//]]> |
883 |
//]]> |