Lines 2-149
Link Here
|
2 |
[% USE Asset %] |
2 |
[% USE Asset %] |
3 |
[% USE Koha %] |
3 |
[% USE Koha %] |
4 |
[% USE ColumnsSettings %] |
4 |
[% USE ColumnsSettings %] |
5 |
|
|
|
6 |
[% INCLUDE 'doc-head-open.inc' %] |
5 |
[% INCLUDE 'doc-head-open.inc' %] |
7 |
<title>Koha › Cataloging › [% title | html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber | html %]) › Items</title> |
6 |
<title>Koha › Cataloging › [% title | html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber | html %]) › Items</title> |
8 |
[% Asset.css("css/datatables.css") | $raw %] |
|
|
9 |
[% INCLUDE 'doc-head-close.inc' %] |
7 |
[% INCLUDE 'doc-head-close.inc' %] |
|
|
8 |
[% Asset.css("css/datatables.css") | $raw %] |
9 |
[% Asset.css("css/addbiblio.css") | $raw %] |
10 |
[% INCLUDE 'datatables.inc' %] |
10 |
[% INCLUDE 'datatables.inc' %] |
11 |
[% Asset.js("js/cataloging.js") | $raw %] |
11 |
[% Asset.js("js/cataloging.js") | $raw %] |
12 |
[% INCLUDE 'columns_settings.inc' %] |
12 |
[% INCLUDE 'columns_settings.inc' %] |
13 |
[% INCLUDE 'browser-strings.inc' %] |
13 |
[% INCLUDE 'browser-strings.inc' %] |
14 |
[% Asset.js("js/browser.js") | $raw %] |
14 |
[% Asset.js("js/browser.js") | $raw %] |
15 |
<script type="text/javascript"> |
|
|
16 |
//<![CDATA[ |
17 |
var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10)); |
18 |
browser.show(); |
19 |
|
20 |
$(document).ready(function(){ |
21 |
|
22 |
// Remove the onclick event defined in browser.js, |
23 |
// otherwise the deletion confirmation will not work correctly |
24 |
$('a[href*="biblionumber="]').off('click'); |
25 |
|
26 |
[% IF (popup) %] |
27 |
[% IF (opisadd) %] |
28 |
window.close(); |
29 |
[% END %] |
30 |
[% END %] |
31 |
$("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit"); |
32 |
/* Inline edit/delete links */ |
33 |
var biblionumber = $("input[name='biblionumber']").attr("value"); |
34 |
$("tr.editable").each(function(){ |
35 |
$(this).find("td:not(:first)").on('click', function(){ |
36 |
var rowid = $(this).parent().attr("id"); |
37 |
num_rowid = rowid.replace("row",""); |
38 |
$(".linktools").remove(); |
39 |
var edit_link = $('<a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&frameworkcode=[% frameworkcode | uri %]&biblionumber=[% biblionumber | uri %]&itemnumber='+num_rowid+'&searchid=[% searchid | uri %]#edititem"></a>'); |
40 |
$(edit_link).text(_("Edit item")); |
41 |
var delete_link = $('<a href="/cgi-bin/koha/cataloguing/additem.pl?op=delitem&frameworkcode=[% frameworkcode | uri %]&biblionumber=[% biblionumber | uri %]&itemnumber='+num_rowid+'&searchid=[% searchid | uri %]"></a>'); |
42 |
$(delete_link).text(_("Delete item")); |
43 |
$(delete_link).on('click', function(e) { |
44 |
return confirm_deletion(); |
45 |
}); |
46 |
var tools_node = $('<span class="linktools"></span>'); |
47 |
$(tools_node).append(edit_link); |
48 |
$(tools_node).append(delete_link); |
49 |
$(this).append(tools_node); |
50 |
}); |
51 |
}); |
52 |
|
53 |
$("#addnewitem").click(function(){ |
54 |
if ( confirm(_("Are you sure you want to add a new item? Any changes made on this page will be lost.")) ){ |
55 |
window.location.href = "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber | html %]"; |
56 |
} |
57 |
}); |
58 |
|
59 |
var columns_settings = [% ColumnsSettings.GetColumns( 'cataloguing', 'additem', 'itemst', 'json' ) | $raw %] |
60 |
// Skip the first column |
61 |
columns_settings.unshift( { cannot_be_toggled: "1" } ); |
62 |
|
63 |
var itemst = KohaTable("itemst", { |
64 |
"aoColumnDefs": [ |
65 |
{ "aTargets": [ 0 ], "bSortable": false, "bSearchable": false }, |
66 |
], |
67 |
'bPaginate': false, |
68 |
'bInfo': false, |
69 |
"bAutoWidth": false, |
70 |
"bKohaColumnsUseNames": true |
71 |
}, columns_settings); |
72 |
|
73 |
var multiCopyControl = $("#add_multiple_copies_span"); |
74 |
var addMultipleBlock = $("#addmultiple"); |
75 |
var addSingleBlock = $("#addsingle"); |
76 |
multiCopyControl.hide(); |
77 |
$("#add_multiple_copies").on("click",function(e){ |
78 |
e.preventDefault; |
79 |
addMultipleBlock.toggle(); |
80 |
addSingleBlock.toggle(); |
81 |
multiCopyControl.toggle(); |
82 |
$('body,html').animate({ scrollTop: $('body').height() }, 100); |
83 |
}); |
84 |
$("#cancel_add_multiple").on("click",function(e){ |
85 |
e.preventDefault(); |
86 |
addMultipleBlock.toggle(); |
87 |
addSingleBlock.toggle(); |
88 |
multiCopyControl.toggle(); |
89 |
}); |
90 |
}); |
91 |
|
92 |
function Check(f) { |
93 |
var total_errors = CheckMandatorySubfields(f); |
94 |
if (total_errors==0) { |
95 |
// Explanation about this line: |
96 |
// In case of limited edition permission, we have to prevent user from modifying some fields. |
97 |
// But there is no such thing as readonly attribute for select elements. |
98 |
// So we use disabled instead. But disabled prevent values from being passed through the form at submit. |
99 |
// So we "un-disable" the elements just before submitting. |
100 |
// That's a bit clumsy, and if someone comes up with a better solution, feel free to improve that. |
101 |
$("select[name=field_value]").prop('disabled', false); |
102 |
return true; |
103 |
} else { |
104 |
var alertString2 = _("Form not submitted because of the following problem(s)"); |
105 |
alertString2 += "\n------------------------------------------------------------------------------------\n"; |
106 |
alertString2 += "\n- " + _("%s mandatory fields empty (highlighted)").format(total_errors); |
107 |
alert(alertString2); |
108 |
return false; |
109 |
} |
110 |
return true; |
111 |
} |
112 |
function CheckMultipleAdd(f) { |
113 |
|
114 |
if (!f || isNaN(f) || !parseInt(f) == f || f <= 0) { |
115 |
alert(_("Please enter a number of items to create.")); |
116 |
return false; |
117 |
} |
118 |
<!-- Add a soft-limit of 99 with a reminder about potential data entry error --> |
119 |
if (f>99) { |
120 |
return confirm(_("You are about to add %s items. Continue?").format(f)); |
121 |
} |
122 |
} |
123 |
function Dopop(link,i) { |
124 |
defaultvalue=document.forms[0].field_value[i].value; |
125 |
newin=window.open(link+"&result="+defaultvalue,"valuebuilder",'width=500,height=400,toolbar=false,scrollbars=yes'); |
126 |
} |
127 |
|
128 |
function confirm_deletion() { |
129 |
return confirm(_("Are you sure you want to delete this item?")); |
130 |
} |
131 |
|
132 |
//]]> |
133 |
</script> |
134 |
[% Asset.css("css/addbiblio.css") | $raw %] |
135 |
|
136 |
[% INCLUDE 'select2.inc' %] |
15 |
[% INCLUDE 'select2.inc' %] |
137 |
<script type="text/javascript"> |
16 |
[% INCLUDE 'str/cataloging_additem.inc' %] |
138 |
$(document).ready(function() { |
17 |
[% Asset.js("js/cataloging_additem.js") | $raw %] |
139 |
$('.subfield_line select').select2(); |
|
|
140 |
}); |
141 |
</script> |
142 |
|
143 |
[% IF ( bidi ) %] |
144 |
[% Asset.css("css/right-to-left.css") | $raw %] |
145 |
[% END %] |
146 |
</head> |
18 |
</head> |
|
|
19 |
|
147 |
<body id="cat_additem" class="cat"> |
20 |
<body id="cat_additem" class="cat"> |
148 |
[% INCLUDE 'header.inc' %] |
21 |
[% INCLUDE 'header.inc' %] |
149 |
[% INCLUDE 'cataloging-search.inc' %] |
22 |
[% INCLUDE 'cataloging-search.inc' %] |
Lines 364-370
function confirm_deletion() {
Link Here
|
364 |
<input type="button" id="addnewitem" value="Add a new item"> |
237 |
<input type="button" id="addnewitem" value="Add a new item"> |
365 |
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]">Cancel</a> |
238 |
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]">Cancel</a> |
366 |
[% END %]</fieldset> |
239 |
[% END %]</fieldset> |
367 |
|
240 |
|
368 |
[%# Fields for fast cataloging %] |
241 |
[%# Fields for fast cataloging %] |
369 |
<input type="hidden" name="circborrowernumber" value="[% circborrowernumber | html %]" /> |
242 |
<input type="hidden" name="circborrowernumber" value="[% circborrowernumber | html %]" /> |
370 |
<input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" /> |
243 |
<input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" /> |
Lines 380-383
function confirm_deletion() {
Link Here
|
380 |
|
253 |
|
381 |
</div> |
254 |
</div> |
382 |
</div> |
255 |
</div> |
|
|
256 |
|
383 |
[% INCLUDE 'intranet-bottom.inc' %] |
257 |
[% INCLUDE 'intranet-bottom.inc' %] |