Lines 72-79
Link Here
|
72 |
<li> |
72 |
<li> |
73 |
[% IF plugin %] |
73 |
[% IF plugin %] |
74 |
<input type="hidden" id="public" name="public" value="1"/> |
74 |
<input type="hidden" id="public" name="public" value="1"/> |
|
|
75 |
[% IF can_use_public_path %] |
76 |
<label id="use_public_path_cb" for="use_public_path">Use a public path:</label> |
77 |
<input type="checkbox" id="use_public_path" name="use_public_path" /> |
78 |
[% END %] |
75 |
[% ELSE %] |
79 |
[% ELSE %] |
76 |
<label id="public_cb">Allow public downloads:</label> |
80 |
<label id="public_cb" for="public">Allow public downloads:</label> |
77 |
<input type="checkbox" id="public" name="public" /> |
81 |
<input type="checkbox" id="public" name="public" /> |
78 |
[% END %] |
82 |
[% END %] |
79 |
</li> |
83 |
</li> |
Lines 175-181
Link Here
|
175 |
[% END %] |
179 |
[% END %] |
176 |
<td class="actions"> |
180 |
<td class="actions"> |
177 |
[% IF plugin %] |
181 |
[% IF plugin %] |
178 |
<button class="btn btn-default btn-xs choose_entry" data-record-hashvalue="[% record.hashvalue | html %]"><i class="fa fa-plus"></i> Choose</button> |
182 |
<button class="btn btn-default btn-xs choose_entry" data-record-url="[% record.url | html %]"><i class="fa fa-plus"></i> Choose</button> |
|
|
183 |
[% IF record.has_local_public_path %] |
184 |
<button class="btn btn-default btn-xs choose_entry_public_path" data-record-url="[% record.direct_url | html %]"><i class="fa fa-plus"></i> Choose the direct url</button> |
185 |
[% END %] |
179 |
[% END %] |
186 |
[% END %] |
180 |
<button class="btn btn-default btn-xs download_entry" data-record-id="[% record.id | html %]"><i class="fa fa-download"></i> Download</button> |
187 |
<button class="btn btn-default btn-xs download_entry" data-record-id="[% record.id | html %]"><i class="fa fa-download"></i> Download</button> |
181 |
[% IF record.owner == owner || CAN_user_tools_upload_manage %] |
188 |
[% IF record.owner == owner || CAN_user_tools_upload_manage %] |
Lines 270-281
Link Here
|
270 |
$("#searchfile").hide(); |
277 |
$("#searchfile").hide(); |
271 |
$("#lastbreadcrumb").text( _("Add a new upload") ); |
278 |
$("#lastbreadcrumb").text( _("Add a new upload") ); |
272 |
|
279 |
|
273 |
var cat, xtra=''; |
280 |
var cat = xtra = use_public_path = ''; |
274 |
if( $("#uploadcategory").val() ) |
281 |
if( $("#uploadcategory").val() ) |
275 |
cat = encodeURIComponent( $("#uploadcategory").val() ); |
282 |
cat = encodeURIComponent( $("#uploadcategory").val() ); |
276 |
if( cat ) xtra= 'category=' + cat + '&'; |
283 |
if( cat ) xtra= 'category=' + cat + '&'; |
|
|
284 |
|
285 |
if( $("#use_public_path").is(":checked") ) { |
286 |
xtra = xtra + 'use_public_path=1&'; |
287 |
} |
288 |
|
277 |
[% IF plugin %] |
289 |
[% IF plugin %] |
278 |
xtra = xtra + 'public=1&temp=0'; |
290 |
xtra = xtra + 'public=1&temp=0&'; |
279 |
[% ELSE %] |
291 |
[% ELSE %] |
280 |
if( !cat ) xtra = 'temp=1&'; |
292 |
if( !cat ) xtra = 'temp=1&'; |
281 |
if( $('#public').prop('checked') ) xtra = xtra + 'public=1'; |
293 |
if( $('#public').prop('checked') ) xtra = xtra + 'public=1'; |
Lines 372-383
Link Here
|
372 |
$(window.opener.document).find('#[% index | html %]').val( '' ); |
384 |
$(window.opener.document).find('#[% index | html %]').val( '' ); |
373 |
[% END %] |
385 |
[% END %] |
374 |
} |
386 |
} |
375 |
function Choose(hashval) { |
387 |
function Choose(url) { |
376 |
var res = '[% Koha.Preference('OPACBaseURL') | html %]'; |
|
|
377 |
res = res.replace( /\/$/, ''); |
378 |
res = res + '/cgi-bin/koha/opac-retrieve-file.pl?id=' + hashval; |
379 |
[% IF index %] |
388 |
[% IF index %] |
380 |
$(window.opener.document).find('#[% index | html %]').val( res ); |
389 |
$(window.opener.document).find('#[% index | html %]').val( url ); |
381 |
[% END %] |
390 |
[% END %] |
382 |
window.close(); |
391 |
window.close(); |
383 |
} |
392 |
} |
Lines 408-415
Link Here
|
408 |
}); |
417 |
}); |
409 |
$(".choose_entry").on("click",function(e){ |
418 |
$(".choose_entry").on("click",function(e){ |
410 |
e.preventDefault(); |
419 |
e.preventDefault(); |
411 |
var record_hashvalue = $(this).data("record-hashvalue"); |
420 |
Choose( $(this).data("record-url") ); |
412 |
Choose( record_hashvalue ); |
421 |
}); |
|
|
422 |
$(".choose_entry_public_path").on("click",function(e){ |
423 |
e.preventDefault(); |
424 |
Choose( $(this).data("record-url") ); |
413 |
}); |
425 |
}); |
414 |
$(".download_entry").on("click",function(e){ |
426 |
$(".download_entry").on("click",function(e){ |
415 |
e.preventDefault(); |
427 |
e.preventDefault(); |