Lines 2-7
Link Here
|
2 |
[% USE Asset %] |
2 |
[% USE Asset %] |
3 |
[% USE KohaDates %] |
3 |
[% USE KohaDates %] |
4 |
[% USE Branches %] |
4 |
[% USE Branches %] |
|
|
5 |
[% SET footerjs = 1 %] |
5 |
[% INCLUDE 'doc-head-open.inc' %] |
6 |
[% INCLUDE 'doc-head-open.inc' %] |
6 |
<title>Koha › Acquisitions › Order staged MARC records |
7 |
<title>Koha › Acquisitions › Order staged MARC records |
7 |
[% IF ( batch_details ) %] |
8 |
[% IF ( batch_details ) %] |
Lines 12-119
Link Here
|
12 |
</title> |
13 |
</title> |
13 |
<style>#dataPreview { width : 80%; } @media (max-width: 767px) { #dataPreview { margin: 0; width : auto; } }</style> |
14 |
<style>#dataPreview { width : 80%; } @media (max-width: 767px) { #dataPreview { margin: 0; width : auto; } }</style> |
14 |
[% INCLUDE 'doc-head-close.inc' %] |
15 |
[% INCLUDE 'doc-head-close.inc' %] |
15 |
[% Asset.js("js/acquisitions-menu.js") | $raw %] |
|
|
16 |
[% INCLUDE 'datatables.inc' %] |
17 |
[% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %] |
18 |
[% Asset.js("js/acq.js") | $raw %] |
19 |
[% Asset.js("js/funds_sorts.js") | $raw %] |
20 |
<script> |
21 |
$(document).ready(function() { |
22 |
$("#files").dataTable($.extend(true, {}, dataTablesDefaults, { |
23 |
"aoColumnDefs": [ |
24 |
{ "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, |
25 |
{ "sType": "anti-the", "aTargets" : [ "anti-the" ] }, |
26 |
{ "sType": "title-string", "aTargets" : [ "title-string" ] } |
27 |
], |
28 |
"sPaginationType": "four_button", |
29 |
"aaSorting": [] |
30 |
} ) ); |
31 |
|
32 |
$("#records_to_import fieldset.rows div").hide(); |
33 |
$('input:checkbox[name="import_record_id"]').change(function(){ |
34 |
var container = $(this).parents("fieldset"); |
35 |
if ( $(this).is(':checked') ) { |
36 |
$(container).addClass("selected"); |
37 |
$(container).removeClass("unselected"); |
38 |
$(container).find("div").toggle(true); |
39 |
} else { |
40 |
$(container).addClass("unselected"); |
41 |
$(container).removeClass("selected"); |
42 |
$(container).find("div").toggle(false); |
43 |
} |
44 |
} ); |
45 |
|
46 |
$("input:checkbox").prop("checked", false); |
47 |
$("div.biblio.unselected select").prop('disabled', false); |
48 |
$("div.biblio.unselected input").prop('disabled', false); |
49 |
|
50 |
$("#checkAll").click(function(){ |
51 |
$("#Aform").checkCheckboxes(); |
52 |
$("input:checkbox[name='import_record_id']").change(); |
53 |
return false; |
54 |
}); |
55 |
$("#unCheckAll").click(function(){ |
56 |
$("#Aform").unCheckCheckboxes(); |
57 |
$("input:checkbox[name='import_record_id']").change(); |
58 |
return false; |
59 |
}); |
60 |
|
61 |
$("#Aform").on("submit", function(){ |
62 |
if ( $("input:checkbox[name='import_record_id']:checked").length < 1 ) { |
63 |
alert(_("There is no record selected")); |
64 |
return false; |
65 |
} |
66 |
|
67 |
var error = 0; |
68 |
$("input:checkbox[name='import_record_id']:checked").parents('fieldset').find('input[name="quantity"]').each(function(){ |
69 |
if ( $(this).val().length < 1 || isNaN( $(this).val() ) ) { |
70 |
error++; |
71 |
} |
72 |
}); |
73 |
if ( error > 0 ) { |
74 |
alert(error + " " + _("quantity values are not filled in or are not numbers")); |
75 |
return false; |
76 |
|
77 |
} |
78 |
|
79 |
if (! $("#all_budget_id").val() ) { |
80 |
// If there is no default fund |
81 |
var error = 0; |
82 |
$(".selected [name='budget_id']").each(function(){ |
83 |
if (!$(this).val()) { |
84 |
error++; |
85 |
} |
86 |
}); |
87 |
if ( error > 0 ) { |
88 |
alert(_("Some budgets are not defined in item records")); |
89 |
return false; |
90 |
} |
91 |
} |
92 |
|
93 |
return disableUnchecked($(this)); |
94 |
}); |
95 |
$('#tabs').tabs(); |
96 |
$(".previewData").on("click", function(e){ |
97 |
e.preventDefault(); |
98 |
var ltitle = $(this).text(); |
99 |
var page = $(this).attr("href"); |
100 |
$("#dataPreviewLabel").text(ltitle); |
101 |
$("#dataPreview .modal-body").load(page + " div"); |
102 |
$('#dataPreview').modal({show:true}); |
103 |
}); |
104 |
$("#dataPreview").on("hidden.bs.modal", function(){ |
105 |
$("#dataPreviewLabel").html(""); |
106 |
$("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); |
107 |
}); |
108 |
}); |
109 |
|
110 |
function disableUnchecked(form){ |
111 |
$("fieldset.biblio.unselected").each(function(){ |
112 |
$(this).remove(); |
113 |
}); |
114 |
return 1; |
115 |
} |
116 |
</script> |
117 |
</head> |
16 |
</head> |
118 |
|
17 |
|
119 |
<body id="acq_addorderiso2709" class="acq"> |
18 |
<body id="acq_addorderiso2709" class="acq"> |
Lines 211-217
Link Here
|
211 |
</li> |
110 |
</li> |
212 |
<li class="quantity"> |
111 |
<li class="quantity"> |
213 |
<label for="quantity_record_[% biblio.import_record_id | html %]" class="required">Quantity: </label> |
112 |
<label for="quantity_record_[% biblio.import_record_id | html %]" class="required">Quantity: </label> |
214 |
<input id="quantity_record_[% biblio.import_record_id | html %]" type="text" value="[% biblio.quantity.length ? biblio.quantity : 1 | html %]" name="quantity" /> |
113 |
<input id="quantity_record_[% biblio.import_record_id | html %]" type="text" pattern="[0-9]+" value="[% biblio.quantity.length ? biblio.quantity : 1 | html %]" name="quantity" /> |
|
|
114 |
<span class="required">Required</span> |
215 |
</li> |
115 |
</li> |
216 |
<li class="price"> |
116 |
<li class="price"> |
217 |
<label for="price_record_[% biblio.import_record_id | html %]">Price: </label> |
117 |
<label for="price_record_[% biblio.import_record_id | html %]">Price: </label> |
Lines 220-233
Link Here
|
220 |
<li class="discount"> |
120 |
<li class="discount"> |
221 |
<label for="discount_record_[% biblio.import_record_id | html %]">Discount: </label> |
121 |
<label for="discount_record_[% biblio.import_record_id | html %]">Discount: </label> |
222 |
<input id="discount_record_[% biblio.import_record_id | html %]" type="text" value="[% biblio.discount | html %]" name="discount" size="6" /> % |
122 |
<input id="discount_record_[% biblio.import_record_id | html %]" type="text" value="[% biblio.discount | html %]" name="discount" size="6" /> % |
223 |
(If empty, discount rate from vendor will be used) |
123 |
<div class="hint">If empty, discount rate from vendor will be used</div> |
224 |
</li> |
124 |
</li> |
225 |
<li class="budget"> |
125 |
<li class="fund"> |
226 |
<label for="fund_record_[% biblio.import_record_id | html %]">Fund: </label> |
|
|
227 |
[% IF ( close ) %] |
126 |
[% IF ( close ) %] |
228 |
<input type="hidden" size="20" name="budget_id" value="[% budget_id | html %]" />[% Budget_name | html %] |
127 |
<label for="fund_record_[% biblio.import_record_id | html %]">Fund: </label> |
|
|
128 |
<input type="hidden" size="20" name="budget_id" value="[% budget_id | html %]" />[% Budget_name | html %] |
229 |
[% ELSE %] |
129 |
[% ELSE %] |
230 |
<select id="fund_record_[% biblio.import_record_id | html %]" size="1" name="budget_id"> |
130 |
<label for="fund_record_[% biblio.import_record_id | html %]">Fund: </label> |
|
|
131 |
<select id="fund_record_[% biblio.import_record_id | html %]" size="1" name="budget_id"> |
231 |
<option value="">Select a fund</option> |
132 |
<option value="">Select a fund</option> |
232 |
[% FOREACH budget IN budget_loop %] |
133 |
[% FOREACH budget IN budget_loop %] |
233 |
[% IF ( budget.b_id == biblio.budget_id ) %] |
134 |
[% IF ( budget.b_id == biblio.budget_id ) %] |
Lines 243-248
Link Here
|
243 |
[% END %] |
144 |
[% END %] |
244 |
[% END %] |
145 |
[% END %] |
245 |
</select> |
146 |
</select> |
|
|
147 |
<span class="required" style="display:none">Required</span> |
246 |
[% END %] |
148 |
[% END %] |
247 |
</li> |
149 |
</li> |
248 |
<li class="sort1"> |
150 |
<li class="sort1"> |
Lines 525-528
Link Here
|
525 |
</div> [% # /div.col-sm-6 %] |
427 |
</div> [% # /div.col-sm-6 %] |
526 |
</div> [% # /div.row %] |
428 |
</div> [% # /div.row %] |
527 |
|
429 |
|
|
|
430 |
|
431 |
[% MACRO jsinclude BLOCK %] |
432 |
[% Asset.js("js/acquisitions-menu.js") | $raw %] |
433 |
[% INCLUDE 'datatables.inc' %] |
434 |
[% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %] |
435 |
[% Asset.js("js/acq.js") | $raw %] |
436 |
[% Asset.js("js/funds_sorts.js") | $raw %] |
437 |
[% Asset.js("js/addorderiso2709.js") | $raw %] |
438 |
<script> |
439 |
var ERR_NO_RECORD_SELECTED = _("There is no record selected"); |
440 |
var ERR_INVALID_QUANTITY = _("quantity values are not filled in or are not numbers"); |
441 |
var ERR_FUNDS_MISSING = _("Some budgets are not defined in item records"); |
442 |
var MSG_LOADING = _("Loading"); |
443 |
</script> |
444 |
[% END %] |
445 |
|
528 |
[% INCLUDE 'intranet-bottom.inc' %] |
446 |
[% INCLUDE 'intranet-bottom.inc' %] |