|
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 90-97
Link Here
|
| 90 |
</div> |
125 |
</div> |
| 91 |
[% END %] |
126 |
[% END %] |
| 92 |
|
127 |
|
| 93 |
|
|
|
| 94 |
|
| 95 |
<script type="text/javascript"> |
128 |
<script type="text/javascript"> |
| 96 |
var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this report? This cannot be undone."); |
129 |
var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this report? This cannot be undone."); |
| 97 |
$(document).ready(function(){ |
130 |
$(document).ready(function(){ |
|
Lines 108-128
$(document).ready(function(){
Link Here
|
| 108 |
}); |
141 |
}); |
| 109 |
}); |
142 |
}); |
| 110 |
|
143 |
|
| 111 |
$('#search_form').on( "submit", function(event) { |
|
|
| 112 |
event.preventDefault(); |
| 113 |
mana_search($(this).children("#mana_search_field").val()); |
| 114 |
}); |
| 115 |
|
| 116 |
function mana_increment(mana_id, resourcename, fieldvalue, stepvalue = 1){ |
| 117 |
$.ajax( { |
| 118 |
type: "POST", |
| 119 |
url: "/cgi-bin/koha/svc/mana/increment", |
| 120 |
data: {id: mana_id, field: fieldvalue, resource: resourcename, step: stepvalue}, |
| 121 |
datatype: "json", |
| 122 |
}).done( function() { |
| 123 |
}).fail( function(){ alert("") }); |
| 124 |
} |
| 125 |
|
| 126 |
function mana_use( mana_id ){ |
144 |
function mana_use( mana_id ){ |
| 127 |
$.ajax( { |
145 |
$.ajax( { |
| 128 |
type:"POST", |
146 |
type:"POST", |
|
Lines 170-182
$(document).ready(function(){
Link Here
|
| 170 |
|
188 |
|
| 171 |
$( "select[class='actionreport1']" ).show(); |
189 |
$( "select[class='actionreport1']" ).show(); |
| 172 |
$( "button[class='actionreport2']" ).hide(); |
190 |
$( "button[class='actionreport2']" ).hide(); |
| 173 |
$("#CommentButton").on("click", function(){ |
|
|
| 174 |
var resource_type = "report"; |
| 175 |
var target_id = $("#selected_id").val(); |
| 176 |
var manamsg = $("#manamsg").val(); |
| 177 |
mana_comment(target_id, manamsg, resource_type); |
| 178 |
$("#comment_box").modal("hide"); |
| 179 |
}); |
| 180 |
|
191 |
|
| 181 |
$(".showbutton").on("click", function(){ |
192 |
$(".showbutton").on("click", function(){ |
| 182 |
$(this).parent().hide(); |
193 |
$(this).parent().hide(); |
|
Lines 206-221
$(document).ready(function(){
Link Here
|
| 206 |
}).fail( function( result ){ |
217 |
}).fail( function( result ){ |
| 207 |
}); |
218 |
}); |
| 208 |
} |
219 |
} |
| 209 |
|
|
|
| 210 |
function mana_comment( target_id, manamsg, resource_type ){ |
| 211 |
$.ajax( { |
| 212 |
type: "POST", |
| 213 |
url: "/cgi-bin/koha/svc/mana/share", |
| 214 |
data: {message: manamsg, resource: resource_type , resource_id: target_id}, |
| 215 |
datatype: "json", |
| 216 |
}) |
| 217 |
} |
| 218 |
|
| 219 |
|
| 220 |
|
| 221 |
</script> |
220 |
</script> |