Lines 1-4
Link Here
|
1 |
[% INCLUDE 'blocking_errors.inc' %] |
1 |
[% INCLUDE 'blocking_errors.inc' %] |
|
|
2 |
[% INCLUDE 'mana.inc' %] |
2 |
<div id="toolbar" class="btn-toolbar"> |
3 |
<div id="toolbar" class="btn-toolbar"> |
3 |
[% IF ( CAN_user_reports_create_reports ) %] |
4 |
[% IF ( CAN_user_reports_create_reports ) %] |
4 |
<div class="btn-group"> |
5 |
<div class="btn-group"> |
Lines 50-55
Link Here
|
50 |
</div> |
51 |
</div> |
51 |
[% END %] |
52 |
[% END %] |
52 |
|
53 |
|
|
|
54 |
[% IF ( mana_id && Koha.Preference('Mana') == 1 ) %] |
55 |
<div class="btn-group"> |
56 |
<button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"> Report mistake <span class="caret"></span></button> |
57 |
<ul class="dropdown-menu"> |
58 |
[% FOREACH c IN mana_comments %] |
59 |
<li class="mana-comment" data-id="[% c.id %]"> |
60 |
<a href="#">[% c.message %] ([% c.nb %])</a> |
61 |
</li> |
62 |
[% END %] |
63 |
<li role="separator" class="divider"></li> |
64 |
<li class="mana-other-comment"><a href="#">Other</a> </li> |
65 |
</ul> |
66 |
</div> |
67 |
|
68 |
<div id="mana-comment-box" class="modal" tabindex="-1" role="dialog" aria-labelledby="mana_search_result_label" style="display: none;"> |
69 |
<div class="modal-dialog modal-lg" style="width: 30%"> |
70 |
<div class="modal-content" style=""> |
71 |
<div class="modal-header"> |
72 |
<button type="button" id="mana-comment-close" class="closebtn" aria-hidden="true">×</button> |
73 |
<h3 id="mana_submit_comment"> Please enter a new commment (max 35 caracters)</h3> |
74 |
</div> |
75 |
<div class="modal-body"> |
76 |
<input hidden id="mana-resource" value="report"> |
77 |
<input hidden id="mana-resource-id" value="[% mana_id %]"> |
78 |
<div> |
79 |
<input type="text" maxlength="35" size="35" id="mana-comment"> |
80 |
</div> |
81 |
<button id="mana-send-comment"> Comment </button> |
82 |
</div> |
83 |
</div> |
84 |
</div> |
85 |
</div> |
86 |
[% END %] |
87 |
|
53 |
[% IF ( execute ) %] |
88 |
[% IF ( execute ) %] |
54 |
[% BLOCK params %] |
89 |
[% BLOCK params %] |
55 |
[%- FOREACH param IN sql_params %]&sql_params=[% param %][% END %] |
90 |
[%- FOREACH param IN sql_params %]&sql_params=[% param %][% END %] |
Lines 102-122
Link Here
|
102 |
}); |
137 |
}); |
103 |
}); |
138 |
}); |
104 |
|
139 |
|
105 |
$('#search_form').on( "submit", function(event) { |
|
|
106 |
event.preventDefault(); |
107 |
mana_search($(this).children("#mana_search_field").val()); |
108 |
}); |
109 |
|
110 |
function mana_increment(mana_id, resourcename, fieldvalue, stepvalue = 1){ |
111 |
$.ajax( { |
112 |
type: "POST", |
113 |
url: "/cgi-bin/koha/svc/mana/increment", |
114 |
data: {id: mana_id, field: fieldvalue, resource: resourcename, step: stepvalue}, |
115 |
datatype: "json", |
116 |
}).done( function() { |
117 |
}).fail( function(){ alert("") }); |
118 |
} |
119 |
|
120 |
function mana_use( mana_id ){ |
140 |
function mana_use( mana_id ){ |
121 |
$.ajax( { |
141 |
$.ajax( { |
122 |
type:"POST", |
142 |
type:"POST", |
Lines 164-176
Link Here
|
164 |
|
184 |
|
165 |
$( "select[class='actionreport1']" ).show(); |
185 |
$( "select[class='actionreport1']" ).show(); |
166 |
$( "button[class='actionreport2']" ).hide(); |
186 |
$( "button[class='actionreport2']" ).hide(); |
167 |
$("#CommentButton").on("click", function(){ |
|
|
168 |
var resource_type = "report"; |
169 |
var target_id = $("#selected_id").val(); |
170 |
var manamsg = $("#manamsg").val(); |
171 |
mana_comment(target_id, manamsg, resource_type); |
172 |
$("#comment_box").modal("hide"); |
173 |
}); |
174 |
|
187 |
|
175 |
$(".showbutton").on("click", function(){ |
188 |
$(".showbutton").on("click", function(){ |
176 |
$(this).parent().hide(); |
189 |
$(this).parent().hide(); |
Lines 200-212
Link Here
|
200 |
}).fail( function( result ){ |
213 |
}).fail( function( result ){ |
201 |
}); |
214 |
}); |
202 |
} |
215 |
} |
203 |
|
|
|
204 |
function mana_comment( target_id, manamsg, resource_type ){ |
205 |
$.ajax( { |
206 |
type: "POST", |
207 |
url: "/cgi-bin/koha/svc/mana/share", |
208 |
data: {message: manamsg, resource: resource_type , resource_id: target_id}, |
209 |
datatype: "json", |
210 |
}) |
211 |
} |
212 |
</script> |
216 |
</script> |