|
Lines 1-6
Link Here
|
| 1 |
[% USE raw %] |
1 |
[% USE raw %] |
| 2 |
[% USE To %] |
2 |
[% USE To %] |
| 3 |
[% USE Asset %] |
3 |
[% USE Asset %] |
|
|
4 |
[% USE Koha %] |
| 5 |
[% USE JSON.Escape %] |
| 6 |
[% PROCESS 'i18n.inc' %] |
| 4 |
|
7 |
|
| 5 |
[% BLOCK form_label %] |
8 |
[% BLOCK form_label %] |
| 6 |
[% SWITCH label %] |
9 |
[% SWITCH label %] |
|
Lines 364-382
Link Here
|
| 364 |
}, |
367 |
}, |
| 365 |
'sDom': '<"top pager"ilp>t<"bottom pager"ip>r', |
368 |
'sDom': '<"top pager"ilp>t<"bottom pager"ip>r', |
| 366 |
'aoColumns': [ |
369 |
'aoColumns': [ |
| 367 |
{ 'sName': 'title' }, |
370 |
{ |
| 368 |
{ 'sName': 'publicationyear' }, |
371 |
'sName': 'title', |
| 369 |
{ 'sName': 'publishercode' }, |
372 |
'mData': 'title', |
| 370 |
{ 'sName': 'ccode' }, |
373 |
'mRender': function (sData, sType, oRow) { |
| 371 |
{ 'sName': 'barcode' }, |
374 |
const a = document.createElement('a'); |
| 372 |
{ 'sName': 'itemcallnumber' }, |
375 |
a.appendChild(document.createTextNode(oRow.title)); |
| 373 |
{ 'sName': 'homebranch' }, |
376 |
a.href = '/cgi-bin/koha/catalogue/detail.pl?biblionumber=' + oRow.biblionumber; |
| 374 |
{ 'sName': 'holdingbranch' }, |
377 |
a.setAttribute('title', [% t('Go to record detail page').json %]); |
| 375 |
{ 'sName': 'location' }, |
378 |
|
| 376 |
{ 'sName': 'stocknumber' }, |
379 |
let output = a.outerHTML; |
| 377 |
{ 'sName': 'notforloan' }, |
380 |
if (oRow.author) { |
| 378 |
{ 'sName': 'issues' }, |
381 |
const marcflavour = [% Koha.Preference('marcflavour').json %]; |
| 379 |
{ 'sName': 'checkbox', 'bSortable': false } |
382 |
if (marcflavour === 'UNIMARC') { |
|
|
383 |
output += ' ' + [% t('by').json %]; |
| 384 |
} |
| 385 |
output += ' ' + oRow.author; |
| 386 |
} |
| 387 |
|
| 388 |
return output; |
| 389 |
} |
| 390 |
}, |
| 391 |
{ |
| 392 |
'sName': 'publicationyear', |
| 393 |
'mData': 'publicationyear', |
| 394 |
'mRender': function (sData) { |
| 395 |
return sData ? sData.escapeHtml() : ''; |
| 396 |
} |
| 397 |
}, |
| 398 |
{ |
| 399 |
'sName': 'publishercode', |
| 400 |
'mData': 'publishercode', |
| 401 |
'mRender': function (sData) { |
| 402 |
return sData ? sData.escapeHtml() : ''; |
| 403 |
} |
| 404 |
}, |
| 405 |
{ |
| 406 |
'sName': 'ccode', |
| 407 |
'mData': 'ccode', |
| 408 |
'mRender': function (sData) { |
| 409 |
return sData ? sData.escapeHtml() : ''; |
| 410 |
} |
| 411 |
}, |
| 412 |
{ |
| 413 |
'sName': 'barcode', |
| 414 |
'mData': 'barcode', |
| 415 |
'mRender': function (sData, sType, oRow) { |
| 416 |
let output = ''; |
| 417 |
if (oRow.barcode) { |
| 418 |
const a = document.createElement('a'); |
| 419 |
a.href = '/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=' + oRow.biblionumber + '#item' + oRow.itemnumber; |
| 420 |
a.setAttribute('title', [% t('Go to item details').json %]); |
| 421 |
a.appendChild(document.createTextNode(oRow.barcode)); |
| 422 |
output = a.outerHTML; |
| 423 |
} |
| 424 |
|
| 425 |
return output; |
| 426 |
} |
| 427 |
}, |
| 428 |
{ |
| 429 |
'sName': 'itemcallnumber', |
| 430 |
'mData': 'itemcallnumber', |
| 431 |
'mRender': function (sData) { |
| 432 |
return sData ? sData.escapeHtml() : ''; |
| 433 |
} |
| 434 |
}, |
| 435 |
{ |
| 436 |
'sName': 'homebranch', |
| 437 |
'mData': 'homebranch', |
| 438 |
'mRender': function (sData) { |
| 439 |
return sData ? sData.escapeHtml() : ''; |
| 440 |
} |
| 441 |
}, |
| 442 |
{ |
| 443 |
'sName': 'holdingbranch', |
| 444 |
'mData': 'holdingbranch', |
| 445 |
'mRender': function (sData) { |
| 446 |
return sData ? sData.escapeHtml() : ''; |
| 447 |
} |
| 448 |
}, |
| 449 |
{ |
| 450 |
'sName': 'location', |
| 451 |
'mData': 'location', |
| 452 |
'mRender': function (sData) { |
| 453 |
return sData ? sData.escapeHtml() : ''; |
| 454 |
} |
| 455 |
}, |
| 456 |
{ |
| 457 |
'sName': 'stocknumber', |
| 458 |
'mData': 'stocknumber', |
| 459 |
'mRender': function (sData) { |
| 460 |
return sData ? sData.escapeHtml() : ''; |
| 461 |
} |
| 462 |
}, |
| 463 |
{ |
| 464 |
'sName': 'notforloan', |
| 465 |
'mData': 'notforloan', |
| 466 |
'mRender': function (sData) { |
| 467 |
return sData ? sData.escapeHtml() : ''; |
| 468 |
} |
| 469 |
}, |
| 470 |
{ |
| 471 |
'sName': 'issues', |
| 472 |
'mData': 'issues', |
| 473 |
}, |
| 474 |
{ |
| 475 |
'sName': 'checkbox', |
| 476 |
'bSortable': false, |
| 477 |
'mData': null, |
| 478 |
'mRender': function (sData, sType, oRow) { |
| 479 |
const pencil = document.createElement('i'); |
| 480 |
pencil.classList.add('fa', 'fa-pencil'); |
| 481 |
|
| 482 |
const edit = document.createTextNode(' ' + [% t('Edit').json %] + ' '); |
| 483 |
|
| 484 |
const caret = document.createElement('span'); |
| 485 |
caret.classList.add('caret') |
| 486 |
|
| 487 |
const button = document.createElement('button'); |
| 488 |
button.type = 'button'; |
| 489 |
button.classList.add('btn', 'btn-xs', 'btn-default', 'dropdown-toggle'); |
| 490 |
button.setAttribute('data-toggle', 'dropdown'); |
| 491 |
button.setAttribute('aria-haspopup', 'true'); |
| 492 |
button.setAttribute('aria-expanded', 'false'); |
| 493 |
button.appendChild(pencil); |
| 494 |
button.appendChild(edit); |
| 495 |
button.appendChild(caret); |
| 496 |
|
| 497 |
const edit_item = document.createElement('a'); |
| 498 |
edit_item.href = '/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=' + oRow.biblionumber + '&itemnumber=' + oRow.itemnumber; |
| 499 |
edit_item.appendChild(document.createTextNode([% t('Edit item').json %])); |
| 500 |
|
| 501 |
const edit_record = document.createElement('a'); |
| 502 |
edit_record.href = '/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=' + oRow.biblionumber; |
| 503 |
edit_record.appendChild(document.createTextNode([% t('Edit record').json %])); |
| 504 |
|
| 505 |
const ul = document.createElement('ul'); |
| 506 |
ul.classList.add('dropdown-menu'); |
| 507 |
ul.appendChild(document.createElement('li').appendChild(edit_item).parentNode); |
| 508 |
ul.appendChild(document.createElement('li').appendChild(edit_record).parentNode); |
| 509 |
|
| 510 |
const div = document.createElement('div'); |
| 511 |
div.classList.add('btn-group', 'dropup'); |
| 512 |
div.appendChild(button); |
| 513 |
div.appendChild(ul); |
| 514 |
|
| 515 |
return div.outerHTML; |
| 516 |
} |
| 517 |
} |
| 380 |
], |
518 |
], |
| 381 |
"sPaginationType": "full_numbers" |
519 |
"sPaginationType": "full_numbers" |
| 382 |
})).columnFilter({ |
520 |
})).columnFilter({ |