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 | uri %][% END %] |
90 |
[%- FOREACH param IN sql_params %]&sql_params=[% param | uri %][% END %] |
Lines 110-130
Link Here
|
110 |
}); |
145 |
}); |
111 |
}); |
146 |
}); |
112 |
|
147 |
|
113 |
$('#search_form').on( "submit", function(event) { |
|
|
114 |
event.preventDefault(); |
115 |
mana_search($(this).children("#mana_search_field").val()); |
116 |
}); |
117 |
|
118 |
function mana_increment(mana_id, resourcename, fieldvalue, stepvalue = 1){ |
119 |
$.ajax( { |
120 |
type: "POST", |
121 |
url: "/cgi-bin/koha/svc/mana/increment", |
122 |
data: {id: mana_id, field: fieldvalue, resource: resourcename, step: stepvalue}, |
123 |
datatype: "json", |
124 |
}).done( function() { |
125 |
}).fail( function(){ alert("") }); |
126 |
} |
127 |
|
128 |
function mana_use( mana_id ){ |
148 |
function mana_use( mana_id ){ |
129 |
$.ajax( { |
149 |
$.ajax( { |
130 |
type:"POST", |
150 |
type:"POST", |
Lines 172-184
Link Here
|
172 |
|
192 |
|
173 |
$( "select[class='actionreport1']" ).show(); |
193 |
$( "select[class='actionreport1']" ).show(); |
174 |
$( "button[class='actionreport2']" ).hide(); |
194 |
$( "button[class='actionreport2']" ).hide(); |
175 |
$("#CommentButton").on("click", function(){ |
|
|
176 |
var resource_type = "report"; |
177 |
var target_id = $("#selected_id").val(); |
178 |
var manamsg = $("#manamsg").val(); |
179 |
mana_comment(target_id, manamsg, resource_type); |
180 |
$("#comment_box").modal("hide"); |
181 |
}); |
182 |
|
195 |
|
183 |
$(".showbutton").on("click", function(){ |
196 |
$(".showbutton").on("click", function(){ |
184 |
$(this).parent().hide(); |
197 |
$(this).parent().hide(); |
Lines 208-220
Link Here
|
208 |
}).fail( function( result ){ |
221 |
}).fail( function( result ){ |
209 |
}); |
222 |
}); |
210 |
} |
223 |
} |
211 |
|
|
|
212 |
function mana_comment( target_id, manamsg, resource_type ){ |
213 |
$.ajax( { |
214 |
type: "POST", |
215 |
url: "/cgi-bin/koha/svc/mana/share", |
216 |
data: {message: manamsg, resource: resource_type , resource_id: target_id}, |
217 |
datatype: "json", |
218 |
}) |
219 |
} |
220 |
</script> |
224 |
</script> |