Lines 1-5
Link Here
|
1 |
[% USE KohaDates %] |
1 |
[% USE KohaDates %] |
2 |
[% USE Branches %] |
2 |
[% USE Branches %] |
|
|
3 |
[% SET footerjs = 1 %] |
3 |
[% INCLUDE 'doc-head-open.inc' %] |
4 |
[% INCLUDE 'doc-head-open.inc' %] |
4 |
<title>Koha › Acquisitions › Order staged MARC records |
5 |
<title>Koha › Acquisitions › Order staged MARC records |
5 |
[% IF ( batch_details ) %] |
6 |
[% IF ( batch_details ) %] |
Lines 11-179
Link Here
|
11 |
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> |
12 |
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> |
12 |
<style type="text/css">#dataPreview { width : 80%; } @media (max-width: 767px) { #dataPreview { margin: 0; width : auto; } }</style> |
13 |
<style type="text/css">#dataPreview { width : 80%; } @media (max-width: 767px) { #dataPreview { margin: 0; width : auto; } }</style> |
13 |
[% INCLUDE 'doc-head-close.inc' %] |
14 |
[% INCLUDE 'doc-head-close.inc' %] |
14 |
[% INCLUDE 'datatables.inc' %] |
|
|
15 |
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script> |
16 |
<script type="text/javascript" src="[% interface %]/[% theme %]/js/acq.js"></script> |
17 |
<script type="text/JavaScript"> |
18 |
//<![CDATA[ |
19 |
$(document).ready(function() { |
20 |
$("#files").dataTable($.extend(true, {}, dataTablesDefaults, { |
21 |
"aoColumnDefs": [ |
22 |
{ "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, |
23 |
{ "sType": "anti-the", "aTargets" : [ "anti-the" ] }, |
24 |
{ "sType": "title-string", "aTargets" : [ "title-string" ] } |
25 |
], |
26 |
"sPaginationType": "four_button", |
27 |
"aaSorting": [] |
28 |
} ) ); |
29 |
|
30 |
// keep copy of the inactive budgets |
31 |
disabledBudgetsCopy = $("select[name='all_budget_id']").html(); |
32 |
$("select[name='all_budget_id'] .b_inactive").remove(); |
33 |
$("select[name='budget_id'] .b_inactive").remove(); |
34 |
|
35 |
$("#showallbudgets").click(function() { |
36 |
if ($(this).is(":checked")) { |
37 |
$("select[name='budget_id']").html(disabledBudgetsCopy) |
38 |
} |
39 |
else { |
40 |
$("select[name='budget_id'] .b_inactive").remove(); |
41 |
} |
42 |
}); |
43 |
|
44 |
$("#all_showallbudgets").click(function() { |
45 |
if ($(this).is(":checked")) { |
46 |
$("select[name='all_budget_id']").html(disabledBudgetsCopy); |
47 |
} |
48 |
else { |
49 |
$("select[name='all_budget_id'] .b_inactive").remove(); |
50 |
} |
51 |
}); |
52 |
|
53 |
$("select[name='budget_id']").change(function(){ |
54 |
var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat'); |
55 |
var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat'); |
56 |
var destination_sort1 = $(this).parents('fieldset').find('li.sort1').find('input[name="sort1"]'); |
57 |
var sort1 = $(destination_sort1).val() || ""; |
58 |
if ( destination_sort1.length < 1 ) { |
59 |
destination_sort1 = $(this).parents('fieldset').find('li.sort1 > select[name="sort1"]'); |
60 |
} |
61 |
var destination_sort2 = $(this).parents('fieldset').find('li.sort2').find('input[name="sort2"]'); |
62 |
var sort2 = $(destination_sort2).val() || ""; |
63 |
if ( destination_sort2.length < 1 ) { |
64 |
destination_sort2 = $(this).parents('fieldset').find('li.sort2').find('select[name="sort2"]'); |
65 |
} |
66 |
getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1, sort1 ); |
67 |
|
68 |
getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2, sort2 ); |
69 |
} ); |
70 |
|
71 |
$("select[name='budget_id']").change(); |
72 |
|
73 |
$("select[name='all_budget_id']").change(function(){ |
74 |
var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat'); |
75 |
var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat'); |
76 |
var destination_sort1 = $(this).parent().siblings('li').find('input[name="all_sort1"]'); |
77 |
if ( destination_sort1.length < 1 ) { |
78 |
destination_sort1 = $(this).parent().siblings('li').find('select[name="all_sort1"]'); |
79 |
} |
80 |
var destination_sort2 = $(this).parent().siblings('li').find('input[name="all_sort2"]'); |
81 |
if ( destination_sort2.length < 1 ) { |
82 |
destination_sort2 = $(this).parent().siblings('li').find('select[name="all_sort2"]'); |
83 |
} |
84 |
getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1 ); |
85 |
getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2 ); |
86 |
$(this).parent().siblings('li').find('select[name="sort1"]').attr('name', 'all_sort1'); |
87 |
$(this).parent().siblings('li').find('input[name="sort1"]').attr('name', 'all_sort1'); |
88 |
$(this).parent().siblings('li').find('select[name="sort2"]').attr('name', 'all_sort2'); |
89 |
$(this).parent().siblings('li').find('input[name="sort2"]').attr('name', 'all_sort2'); |
90 |
} ); |
91 |
|
92 |
$("select[name='all_budget_id']").change(); |
93 |
|
94 |
$("#records_to_import fieldset.rows div").hide(); |
95 |
$('input:checkbox[name="import_record_id"]').change(function(){ |
96 |
var container = $(this).parents("fieldset"); |
97 |
if ( $(this).is(':checked') ) { |
98 |
$(container).addClass("selected"); |
99 |
$(container).removeClass("unselected"); |
100 |
$(container).find("div").toggle(true); |
101 |
} else { |
102 |
$(container).addClass("unselected"); |
103 |
$(container).removeClass("selected"); |
104 |
$(container).find("div").toggle(false); |
105 |
} |
106 |
} ); |
107 |
|
108 |
$("input:checkbox").prop("checked", false); |
109 |
$("div.biblio.unselected select").prop('disabled', false); |
110 |
$("div.biblio.unselected input").prop('disabled', false); |
111 |
|
112 |
$("#checkAll").click(function(){ |
113 |
$("#Aform").checkCheckboxes(); |
114 |
$("input:checkbox[name='import_record_id']").change(); |
115 |
return false; |
116 |
}); |
117 |
$("#unCheckAll").click(function(){ |
118 |
$("#Aform").unCheckCheckboxes(); |
119 |
$("input:checkbox[name='import_record_id']").change(); |
120 |
return false; |
121 |
}); |
122 |
|
123 |
$("#Aform").on("submit", function(){ |
124 |
if ( $("input:checkbox[name='import_record_id']:checked").length < 1 ) { |
125 |
alert(_("There is no record selected")); |
126 |
return false; |
127 |
} |
128 |
|
129 |
var error = 0; |
130 |
$("input:checkbox[name='import_record_id']:checked").parents('fieldset').find('input[name="quantity"]').each(function(){ |
131 |
if ( $(this).val().length < 1 || isNaN( $(this).val() ) ) { |
132 |
error++; |
133 |
} |
134 |
}); |
135 |
if ( error > 0 ) { |
136 |
alert(error + " " + _("quantity values are not filled in or are not numbers")); |
137 |
return false; |
138 |
|
139 |
} |
140 |
var error = 0; |
141 |
$("select[name='budget_id']").each(function() { |
142 |
if (!$(this).val()) { |
143 |
error++; |
144 |
} |
145 |
}); |
146 |
if ( error > 0 ) { |
147 |
alert(_("Some budgets are not defined in item records")); |
148 |
return false; |
149 |
} |
150 |
|
151 |
return disableUnchecked($(this)); |
152 |
}); |
153 |
$('#tabs').tabs(); |
154 |
$(".previewData").on("click", function(e){ |
155 |
e.preventDefault(); |
156 |
var ltitle = $(this).text(); |
157 |
var page = $(this).attr("href"); |
158 |
$("#dataPreviewLabel").text(ltitle); |
159 |
$("#dataPreview .modal-body").load(page + " div"); |
160 |
$('#dataPreview').modal({show:true}); |
161 |
}); |
162 |
$("#dataPreview").on("hidden", function(){ |
163 |
$("#dataPreviewLabel").html(""); |
164 |
$("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); |
165 |
}); |
166 |
}); |
167 |
|
168 |
function disableUnchecked(form){ |
169 |
$("fieldset.biblio.unselected").each(function(){ |
170 |
$(this).remove(); |
171 |
}); |
172 |
return 1; |
173 |
} |
174 |
//]]> |
175 |
</script> |
176 |
</head> |
15 |
</head> |
|
|
16 |
|
177 |
<body id="acq_addorderiso2709" class="acq"> |
17 |
<body id="acq_addorderiso2709" class="acq"> |
178 |
[% INCLUDE 'header.inc' %] |
18 |
[% INCLUDE 'header.inc' %] |
179 |
[% INCLUDE 'acquisitions-search.inc' %] |
19 |
[% INCLUDE 'acquisitions-search.inc' %] |
Lines 583-587
Link Here
|
583 |
</div> |
423 |
</div> |
584 |
</div> |
424 |
</div> |
585 |
</div> |
425 |
</div> |
586 |
</body> |
426 |
|
587 |
</html> |
427 |
[% MACRO jsinclude BLOCK %] |
|
|
428 |
<script type="text/javascript" src="[% interface %]/[% theme %]/js/acquisitions-menu.js"></script> |
429 |
[% INCLUDE 'datatables.inc' %] |
430 |
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script> |
431 |
<script type="text/javascript" src="[% interface %]/[% theme %]/js/acq.js"></script> |
432 |
<script type="text/JavaScript"> |
433 |
$(document).ready(function() { |
434 |
$("#files").dataTable($.extend(true, {}, dataTablesDefaults, { |
435 |
"aoColumnDefs": [ |
436 |
{ "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, |
437 |
{ "sType": "anti-the", "aTargets" : [ "anti-the" ] }, |
438 |
{ "sType": "title-string", "aTargets" : [ "title-string" ] } |
439 |
], |
440 |
"sPaginationType": "four_button", |
441 |
"aaSorting": [] |
442 |
} ) ); |
443 |
|
444 |
// keep copy of the inactive budgets |
445 |
disabledBudgetsCopy = $("select[name='all_budget_id']").html(); |
446 |
$("select[name='all_budget_id'] .b_inactive").remove(); |
447 |
$("select[name='budget_id'] .b_inactive").remove(); |
448 |
|
449 |
$("#showallbudgets").click(function() { |
450 |
if ($(this).is(":checked")) { |
451 |
$("select[name='budget_id']").html(disabledBudgetsCopy) |
452 |
} |
453 |
else { |
454 |
$("select[name='budget_id'] .b_inactive").remove(); |
455 |
} |
456 |
}); |
457 |
|
458 |
$("#all_showallbudgets").click(function() { |
459 |
if ($(this).is(":checked")) { |
460 |
$("select[name='all_budget_id']").html(disabledBudgetsCopy); |
461 |
} |
462 |
else { |
463 |
$("select[name='all_budget_id'] .b_inactive").remove(); |
464 |
} |
465 |
}); |
466 |
|
467 |
$("select[name='budget_id']").change(function(){ |
468 |
var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat'); |
469 |
var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat'); |
470 |
var destination_sort1 = $(this).parents('fieldset').find('li.sort1').find('input[name="sort1"]'); |
471 |
var sort1 = $(destination_sort1).val() || ""; |
472 |
if ( destination_sort1.length < 1 ) { |
473 |
destination_sort1 = $(this).parents('fieldset').find('li.sort1 > select[name="sort1"]'); |
474 |
} |
475 |
var destination_sort2 = $(this).parents('fieldset').find('li.sort2').find('input[name="sort2"]'); |
476 |
var sort2 = $(destination_sort2).val() || ""; |
477 |
if ( destination_sort2.length < 1 ) { |
478 |
destination_sort2 = $(this).parents('fieldset').find('li.sort2').find('select[name="sort2"]'); |
479 |
} |
480 |
getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1, sort1 ); |
481 |
|
482 |
getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2, sort2 ); |
483 |
} ); |
484 |
|
485 |
$("select[name='budget_id']").change(); |
486 |
|
487 |
$("select[name='all_budget_id']").change(function(){ |
488 |
var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat'); |
489 |
var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat'); |
490 |
var destination_sort1 = $(this).parent().siblings('li').find('input[name="all_sort1"]'); |
491 |
if ( destination_sort1.length < 1 ) { |
492 |
destination_sort1 = $(this).parent().siblings('li').find('select[name="all_sort1"]'); |
493 |
} |
494 |
var destination_sort2 = $(this).parent().siblings('li').find('input[name="all_sort2"]'); |
495 |
if ( destination_sort2.length < 1 ) { |
496 |
destination_sort2 = $(this).parent().siblings('li').find('select[name="all_sort2"]'); |
497 |
} |
498 |
getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1 ); |
499 |
getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2 ); |
500 |
$(this).parent().siblings('li').find('select[name="sort1"]').attr('name', 'all_sort1'); |
501 |
$(this).parent().siblings('li').find('input[name="sort1"]').attr('name', 'all_sort1'); |
502 |
$(this).parent().siblings('li').find('select[name="sort2"]').attr('name', 'all_sort2'); |
503 |
$(this).parent().siblings('li').find('input[name="sort2"]').attr('name', 'all_sort2'); |
504 |
} ); |
505 |
|
506 |
$("select[name='all_budget_id']").change(); |
507 |
|
508 |
$("#records_to_import fieldset.rows div").hide(); |
509 |
$('input:checkbox[name="import_record_id"]').change(function(){ |
510 |
var container = $(this).parents("fieldset"); |
511 |
if ( $(this).is(':checked') ) { |
512 |
$(container).addClass("selected"); |
513 |
$(container).removeClass("unselected"); |
514 |
$(container).find("div").toggle(true); |
515 |
} else { |
516 |
$(container).addClass("unselected"); |
517 |
$(container).removeClass("selected"); |
518 |
$(container).find("div").toggle(false); |
519 |
} |
520 |
} ); |
521 |
|
522 |
$("input:checkbox").prop("checked", false); |
523 |
$("div.biblio.unselected select").prop('disabled', false); |
524 |
$("div.biblio.unselected input").prop('disabled', false); |
525 |
|
526 |
$("#checkAll").click(function(){ |
527 |
$("#Aform").checkCheckboxes(); |
528 |
$("input:checkbox[name='import_record_id']").change(); |
529 |
return false; |
530 |
}); |
531 |
$("#unCheckAll").click(function(){ |
532 |
$("#Aform").unCheckCheckboxes(); |
533 |
$("input:checkbox[name='import_record_id']").change(); |
534 |
return false; |
535 |
}); |
536 |
|
537 |
$("#Aform").on("submit", function(){ |
538 |
if ( $("input:checkbox[name='import_record_id']:checked").length < 1 ) { |
539 |
alert(_("There is no record selected")); |
540 |
return false; |
541 |
} |
542 |
|
543 |
var error = 0; |
544 |
$("input:checkbox[name='import_record_id']:checked").parents('fieldset').find('input[name="quantity"]').each(function(){ |
545 |
if ( $(this).val().length < 1 || isNaN( $(this).val() ) ) { |
546 |
error++; |
547 |
} |
548 |
}); |
549 |
if ( error > 0 ) { |
550 |
alert(error + " " + _("quantity values are not filled in or are not numbers")); |
551 |
return false; |
552 |
|
553 |
} |
554 |
var error = 0; |
555 |
$("select[name='budget_id']").each(function() { |
556 |
if (!$(this).val()) { |
557 |
error++; |
558 |
} |
559 |
}); |
560 |
if ( error > 0 ) { |
561 |
alert(_("Some budgets are not defined in item records")); |
562 |
return false; |
563 |
} |
564 |
|
565 |
return disableUnchecked($(this)); |
566 |
}); |
567 |
$('#tabs').tabs(); |
568 |
$(".previewData").on("click", function(e){ |
569 |
e.preventDefault(); |
570 |
var ltitle = $(this).text(); |
571 |
var page = $(this).attr("href"); |
572 |
$("#dataPreviewLabel").text(ltitle); |
573 |
$("#dataPreview .modal-body").load(page + " div"); |
574 |
$('#dataPreview').modal({show:true}); |
575 |
}); |
576 |
$("#dataPreview").on("hidden", function(){ |
577 |
$("#dataPreviewLabel").html(""); |
578 |
$("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); |
579 |
}); |
580 |
}); |
581 |
|
582 |
function disableUnchecked(form){ |
583 |
$("fieldset.biblio.unselected").each(function(){ |
584 |
$(this).remove(); |
585 |
}); |
586 |
return 1; |
587 |
} |
588 |
</script> |
589 |
[% END %] |
590 |
|
591 |
[% INCLUDE 'intranet-bottom.inc' %] |