Lines 1-3
Link Here
|
|
|
1 |
[% INCLUDE 'mana.inc' %] |
1 |
<div id="toolbar" class="btn-toolbar"> |
2 |
<div id="toolbar" class="btn-toolbar"> |
2 |
[% IF ( CAN_user_reports_create_reports ) %] |
3 |
[% IF ( CAN_user_reports_create_reports ) %] |
3 |
<div class="btn-group"> |
4 |
<div class="btn-group"> |
Lines 49-54
Link Here
|
49 |
</div> |
50 |
</div> |
50 |
[% END %] |
51 |
[% END %] |
51 |
|
52 |
|
|
|
53 |
[% IF ( mana_id && Koha.Preference('Mana') == 1 ) %] |
54 |
<div class="btn-group"> |
55 |
<button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"> Report mistake <span class="caret"></span></button> |
56 |
<ul class="dropdown-menu"> |
57 |
[% FOREACH c IN mana_comments %] |
58 |
<li class="mana-comment" data-id="[% c.id %]"> |
59 |
<a href="#">[% c.message %] ([% c.nb %])</a> |
60 |
</li> |
61 |
[% END %] |
62 |
<li role="separator" class="divider"></li> |
63 |
<li class="mana-other-comment"><a href="#">Other</a> </li> |
64 |
</ul> |
65 |
</div> |
66 |
|
67 |
<div id="mana-comment-box" class="modal" tabindex="-1" role="dialog" aria-labelledby="mana_search_result_label" style="display: none;"> |
68 |
<div class="modal-dialog modal-lg" style="width: 30%"> |
69 |
<div class="modal-content" style=""> |
70 |
<div class="modal-header"> |
71 |
<button type="button" id="mana-comment-close" class="closebtn" aria-hidden="true">×</button> |
72 |
<h3 id="mana_submit_comment"> Please enter a new commment (max 35 caracters)</h3> |
73 |
</div> |
74 |
<div class="modal-body"> |
75 |
<input hidden id="mana-resource" value="report"> |
76 |
<input hidden id="mana-resource-id" value="[% mana_id %]"> |
77 |
<div> |
78 |
<input type="text" maxlength="35" size="35" id="mana-comment"> |
79 |
</div> |
80 |
<button id="mana-send-comment"> Comment </button> |
81 |
</div> |
82 |
</div> |
83 |
</div> |
84 |
</div> |
85 |
[% END %] |
86 |
|
52 |
[% IF ( execute ) %] |
87 |
[% IF ( execute ) %] |
53 |
<div class="btn-group"> |
88 |
<div class="btn-group"> |
54 |
<button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" id="format"><i class="fa fa-upload"></i> Download <span class="caret"></span></button> |
89 |
<button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" id="format"><i class="fa fa-upload"></i> Download <span class="caret"></span></button> |
Lines 96-116
Link Here
|
96 |
}); |
131 |
}); |
97 |
}); |
132 |
}); |
98 |
|
133 |
|
99 |
$('#search_form').on( "submit", function(event) { |
|
|
100 |
event.preventDefault(); |
101 |
mana_search($(this).children("#mana_search_field").val()); |
102 |
}); |
103 |
|
104 |
function mana_increment(mana_id, resourcename, fieldvalue, stepvalue = 1){ |
105 |
$.ajax( { |
106 |
type: "POST", |
107 |
url: "/cgi-bin/koha/svc/mana/increment", |
108 |
data: {id: mana_id, field: fieldvalue, resource: resourcename, step: stepvalue}, |
109 |
datatype: "json", |
110 |
}).done( function() { |
111 |
}).fail( function(){ alert("") }); |
112 |
} |
113 |
|
114 |
function mana_use( mana_id ){ |
134 |
function mana_use( mana_id ){ |
115 |
$.ajax( { |
135 |
$.ajax( { |
116 |
type:"POST", |
136 |
type:"POST", |
Lines 158-170
Link Here
|
158 |
|
178 |
|
159 |
$( "select[class='actionreport1']" ).show(); |
179 |
$( "select[class='actionreport1']" ).show(); |
160 |
$( "button[class='actionreport2']" ).hide(); |
180 |
$( "button[class='actionreport2']" ).hide(); |
161 |
$("#CommentButton").on("click", function(){ |
|
|
162 |
var resource_type = "report"; |
163 |
var target_id = $("#selected_id").val(); |
164 |
var manamsg = $("#manamsg").val(); |
165 |
mana_comment(target_id, manamsg, resource_type); |
166 |
$("#comment_box").modal("hide"); |
167 |
}); |
168 |
|
181 |
|
169 |
$(".showbutton").on("click", function(){ |
182 |
$(".showbutton").on("click", function(){ |
170 |
$(this).parent().hide(); |
183 |
$(this).parent().hide(); |
Lines 194-206
Link Here
|
194 |
}).fail( function( result ){ |
207 |
}).fail( function( result ){ |
195 |
}); |
208 |
}); |
196 |
} |
209 |
} |
197 |
|
|
|
198 |
function mana_comment( target_id, manamsg, resource_type ){ |
199 |
$.ajax( { |
200 |
type: "POST", |
201 |
url: "/cgi-bin/koha/svc/mana/share", |
202 |
data: {message: manamsg, resource: resource_type , resource_id: target_id}, |
203 |
datatype: "json", |
204 |
}) |
205 |
} |
206 |
</script> |
210 |
</script> |