3 $(document).ready(function() {
4 function mana_increment(mana_id, resource, fieldvalue, stepvalue = 1) {
7 url: "/cgi-bin/koha/svc/mana/increment",
8 data: {id: mana_id, resource: resource, field: fieldvalue, step: stepvalue},
13 function mana_comment( target_id, manamsg, resource_type ) {
16 url: "/cgi-bin/koha/svc/mana/share",
17 data: {message: manamsg, resource: resource_type , resource_id: target_id},
22 $(document).on('click', 'ul li.mana-comment', function() {
23 id = $(this).attr('data-id');
24 mana_increment(id, 'resource_comment', 'nb');
27 $(document).on('click', 'ul li.mana-other-comment', function() {
28 $('#mana-comment-box').modal('show');
31 $(document).on('click', '#mana-send-comment', function() {
32 var resource_type = $('#mana-resource').val();
33 var resource_id = $('#mana-resource-id').val();
34 var comment = $("#mana-comment").val();
35 mana_comment(resource_id, comment, resource_type);
36 $("#mana-comment-box").modal("hide");
39 $(document).on('click', '#mana-comment-close', function() {
40 $("#mana-comment-box").modal("hide");