Lines 138-145
Link Here
|
138 |
<span title="0000-00-00"></span> |
138 |
<span title="0000-00-00"></span> |
139 |
[% END %] |
139 |
[% END %] |
140 |
</td> |
140 |
</td> |
141 |
<td><input name="internalnote" id="internalnote" type="text" value="[% lateorder.internalnote | html %]"></td> |
141 |
<td> |
142 |
<td><input name="vendornote" id="vendornote" type="text" value="[% lateorder.vendornote | html %]"></td> |
142 |
[% IF ( lateorder.internalnote ) %] |
|
|
143 |
<p class="ordernote"> |
144 |
<span id="internal-note-[% lateorder.ordernumber | html %]">[% lateorder.internalnote | html %]</span> |
145 |
<a class="edit_note" data-ordernumber="[% lateorder.ordernumber | html %]" data-note_type="internal" href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% lateorder.ordernumber | html %]&type=internal" title="Edit internal note"> |
146 |
<i class="fa fa-pencil"></i> Edit internal note |
147 |
</a> |
148 |
</p> |
149 |
[% ELSE %] |
150 |
<a class="edit_note" data-ordernumber="[% lateorder.ordernumber | html %]" data-note_type="internal" href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% lateorder.ordernumber | html %]&type=internal" title="Add internal note"> |
151 |
<i class="fa fa-plus"></i> Add internal note |
152 |
</a> |
153 |
[% END %] |
154 |
</td> |
155 |
<td> |
156 |
[% IF ( lateorder.vendornote ) %] |
157 |
<p class="ordernote"> |
158 |
<span id="vendor-note-[% lateorder.ordernumber | html %]">[% lateorder.vendornote | html %]</span> |
159 |
<a class="edit_note" data-ordernumber="[% lateorder.ordernumber | html %]" data-note_type="vendor" href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% lateorder.ordernumber | html %]&type=vendor" title="Edit vendor note"> |
160 |
<i class="fa fa-pencil"></i> Edit vendor note |
161 |
</a> |
162 |
</p> |
163 |
[% ELSE %] |
164 |
<a class="edit_note" data-ordernumber="[% lateorder.ordernumber | html %]" data-note_type="vendor" href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% lateorder.ordernumber | html %]&type=vendor" title="Add vendor note"> |
165 |
<i class="fa fa-plus"></i> Add vendor note |
166 |
</a> |
167 |
[% END %] |
168 |
</td> |
143 |
<td>[% lateorder.isbn | $raw %]</td> |
169 |
<td>[% lateorder.isbn | $raw %]</td> |
144 |
</tr> |
170 |
</tr> |
145 |
[% END %] |
171 |
[% END %] |
Lines 204-209
Link Here
|
204 |
</div> <!-- /.col-sm-2.col-sm-pull-10 --> |
230 |
</div> <!-- /.col-sm-2.col-sm-pull-10 --> |
205 |
</div> |
231 |
</div> |
206 |
|
232 |
|
|
|
233 |
<!-- Modal for editing vendor and internal notes --> |
234 |
<div class="modal" id="noteEditor" tabindex="-1" role="dialog" aria-labelledby="noteEditorLabel"> |
235 |
<div class="modal-dialog" role="document"> |
236 |
<form id="modify_order_notes" action="/cgi-bin/koha/acqui/modordernotes.pl" method="post"> |
237 |
<div class="modal-content"> |
238 |
<div class="modal-header"> |
239 |
<button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
240 |
<h4 class="modal-title" id="noteEditorLabel">Order note</h4> |
241 |
</div> |
242 |
<div class="modal-body"> |
243 |
<textarea id="ordernotes" name="ordernotes" rows="3" cols="30" class="focus">[% ordernotes | html %]</textarea> |
244 |
<input type="hidden" id="ordernumber" name="ordernumber" value="" /> |
245 |
<input type="hidden" name="op" value="save" /> |
246 |
<input type="hidden" id="type" name="type" value="" /> |
247 |
</div> |
248 |
<div class="modal-footer"> |
249 |
<button type="submit" class="btn btn-default">Save</button> |
250 |
<button type="button" class="btn btn-link cancel" data-dismiss="modal">Cancel</button> |
251 |
</div> |
252 |
</div> |
253 |
</form> |
254 |
</div> |
255 |
</div> |
256 |
|
207 |
[% MACRO jsinclude BLOCK %] |
257 |
[% MACRO jsinclude BLOCK %] |
208 |
[% Asset.js("js/acquisitions-menu.js") | $raw %] |
258 |
[% Asset.js("js/acquisitions-menu.js") | $raw %] |
209 |
[% INCLUDE 'datatables.inc' %] |
259 |
[% INCLUDE 'datatables.inc' %] |
Lines 263-299
Link Here
|
263 |
location.href = url; |
313 |
location.href = url; |
264 |
return false; |
314 |
return false; |
265 |
}); |
315 |
}); |
266 |
// Update all notes |
|
|
267 |
$("#savenotes").click(function(){ |
268 |
$("#savenotes").after("<span id=\"loading\" style=\"margin:4px;\"><img src=\"[% interface | html %]/[% theme | html %]/img/loading-small.gif\" alt=\"\" /> "+_("Loading")+"</span>"); |
269 |
var all_nodes = $(late_orderst.fnGetNodes()); |
270 |
var req = new XMLHttpRequest(); |
271 |
var url = '/cgi-bin/koha/acqui/lateorders.pl'; |
272 |
var data = new FormData(); |
273 |
data.append("op","save"); |
274 |
for (var i = 0; i < all_nodes.length; i++) { |
275 |
var order = $(all_nodes[i]).find("input[name='ordernumber']"); |
276 |
var internalnote = $(all_nodes[i]).find("input[name='internalnote']")[0].value; |
277 |
var vendornote = $(all_nodes[i]).find("input[name='vendornote']")[0].value; |
278 |
var internalnote_key = order[0].value + "_i"; |
279 |
var vendornote_key = order[0].value + "_v"; |
280 |
data.append(internalnote_key, internalnote); |
281 |
data.append(vendornote_key, vendornote); |
282 |
} |
283 |
|
316 |
|
284 |
req.open("POST",url); |
317 |
$(".edit_note").on("click", function(e) { |
285 |
req.send(data); |
318 |
e.preventDefault(); |
286 |
req.onreadystatechange = function () { |
319 |
var ordernumber = $(this).data("ordernumber"); |
287 |
$("#loading").remove(); |
320 |
var note_type = $(this).data("note_type"); |
288 |
if (req.readyState == '4' ){ |
321 |
var modalTitle = $(this).attr("title") + " (order number " + ordernumber + ")"; |
289 |
if ( req.status == 200 ){ |
322 |
var note_text = $( "#" + note_type + "-note-" + ordernumber ).html(); |
290 |
alert(_("Notes successfully saved")); |
323 |
$("#noteEditor .modal-title").text(modalTitle); |
291 |
} |
324 |
$("#ordernumber").val( ordernumber ); |
292 |
else { |
325 |
$("#ordernotes").html( note_text ); |
293 |
alert(_("Error while saving the notes. Please try again")); |
326 |
$("#type").val( note_type ); |
294 |
} |
327 |
$("#noteEditor").modal("show"); |
295 |
} |
328 |
$("#ordernotes").focus(); |
296 |
} |
329 |
}); |
|
|
330 |
|
331 |
$("#noteEditor").on('hidden.bs.modal', function (e) { |
332 |
$("#noteEditorLabel").html(""); |
333 |
$("#noteEditor .modal-title").text(""); |
334 |
$("#ordernotes").html( "" ); |
335 |
$("#ordernumber").val(""); |
336 |
$("#type").val(""); |
297 |
}); |
337 |
}); |
298 |
}); |
338 |
}); |
299 |
</script> |
339 |
</script> |
300 |
- |
|
|