Lines 373-379
Link Here
|
373 |
</thead> |
373 |
</thead> |
374 |
<tbody> |
374 |
<tbody> |
375 |
[% FOREACH item IN items %] |
375 |
[% FOREACH item IN items %] |
376 |
<tr id="item_[% item.itemnumber | html %]" data-itemnumber="[% item.itemnumber | html %]"> |
376 |
<tr id="item_[% item.itemnumber | html %]" data-itemnumber="[% item.itemnumber | html %]" data-duedate="[% item.datedue | html %]"> |
377 |
[% IF (StaffDetailItemSelection) %] |
377 |
[% IF (StaffDetailItemSelection) %] |
378 |
<td style="text-align:center;vertical-align:middle"> |
378 |
<td style="text-align:center;vertical-align:middle"> |
379 |
<input type="checkbox" value="[% item.itemnumber | html %]" name="itemnumber" /> |
379 |
<input type="checkbox" value="[% item.itemnumber | html %]" name="itemnumber" /> |
Lines 1612-1624
Note that permanent location is a code, and location may be an authval.
Link Here
|
1612 |
$(document).ready(function() { |
1612 |
$(document).ready(function() { |
1613 |
|
1613 |
|
1614 |
[% IF bundlesEnabled %] // Bundle handling |
1614 |
[% IF bundlesEnabled %] // Bundle handling |
1615 |
function createChild ( row, itemnumber ) { |
1615 |
function createChild ( row, itemnumber, duedate ) { |
1616 |
|
1616 |
|
1617 |
// Toolbar |
1617 |
// Toolbar |
1618 |
var bundle_toolbar = $('<div id="toolbar" class="btn-toolbar"></div>'); |
1618 |
var bundle_toolbar = $('<div id="toolbar" class="btn-toolbar"></div>'); |
1619 |
bundle_toolbar.append('<a class="btn btn-default" data-toggle="modal" data-target="#addToBundleModal" data-item="' + itemnumber + '"><i class="fa fa-plus"></i> ' + _("Add to bundle") + '</a>'); |
1619 |
bundle_toolbar.append('<a class="btn btn-default" data-toggle="modal" data-target="#addToBundleModal" data-item="' + itemnumber + '"><i class="fa fa-plus"></i> ' + _("Add to bundle") + '</a>'); |
1620 |
bundle_toolbar.append('<a class="btn btn-default" data-toggle="modal" data-target="#removeFromBundleModal" data-item="' + itemnumber + '"><i class="fa fa-minus"></i> ' + _("Remove from bundle") + '</a>'); |
1620 |
bundle_toolbar.append('<a class="btn btn-default" data-toggle="modal" data-target="#removeFromBundleModal" data-item="' + itemnumber + '"><i class="fa fa-minus"></i> ' + _("Remove from bundle") + '</a>'); |
1621 |
|
1621 |
|
|
|
1622 |
// Disable management if there's a duedate |
1623 |
if(duedate) { |
1624 |
bundle_toolbar.children('.btn').addClass("disabled"); |
1625 |
} |
1626 |
|
1622 |
// This is the table we'll convert into a DataTable |
1627 |
// This is the table we'll convert into a DataTable |
1623 |
var bundles_table = $('<table class="display tbundle" data-itemnumber="'+itemnumber+'" id="bundle_table_'+itemnumber+'" width="100%"/>'); |
1628 |
var bundles_table = $('<table class="display tbundle" data-itemnumber="'+itemnumber+'" id="bundle_table_'+itemnumber+'" width="100%"/>'); |
1624 |
|
1629 |
|
Lines 1717-1723
Note that permanent location is a code, and location may be an authval.
Link Here
|
1717 |
}, |
1722 |
}, |
1718 |
{ |
1723 |
{ |
1719 |
"data": function( row, type, val, meta ) { |
1724 |
"data": function( row, type, val, meta ) { |
1720 |
var result = '<button class="btn btn-default btn-xs remove" role="button" data-itemnumber="'+row.item_id+'"><i class="fa fa-minus" aria-hidden="true"></i> '+_("Remove")+'</button>\n'; |
1725 |
var result; |
|
|
1726 |
if (duedate) { |
1727 |
result = '<button class="btn btn-default btn-xs remove disabled" role="button" data-itemnumber="'+row.item_id+'"><i class="fa fa-minus" aria-hidden="true"></i> '+_("Remove")+'</button>\n'; |
1728 |
} else { |
1729 |
result = '<button class="btn btn-default btn-xs remove" role="button" data-itemnumber="'+row.item_id+'"><i class="fa fa-minus" aria-hidden="true"></i> '+_("Remove")+'</button>\n'; |
1730 |
} |
1721 |
return result; |
1731 |
return result; |
1722 |
}, |
1732 |
}, |
1723 |
"title": _("Actions"), |
1733 |
"title": _("Actions"), |
Lines 1727-1733
Note that permanent location is a code, and location may be an authval.
Link Here
|
1727 |
} |
1737 |
} |
1728 |
] |
1738 |
] |
1729 |
}, bundle_settings, 1); |
1739 |
}, bundle_settings, 1); |
1730 |
$(".tbundle").on("click", ".remove", function(){ |
1740 |
$(".tbundle").on("click", ".remove:not(.disabled)", function(){ |
1731 |
var bundle_table = $(this).closest('table'); |
1741 |
var bundle_table = $(this).closest('table'); |
1732 |
var host_itemnumber = bundle_table.data('itemnumber'); |
1742 |
var host_itemnumber = bundle_table.data('itemnumber'); |
1733 |
var component_itemnumber = $(this).data('itemnumber'); |
1743 |
var component_itemnumber = $(this).data('itemnumber'); |
Lines 1909-1914
Note that permanent location is a code, and location may be an authval.
Link Here
|
1909 |
var dTable = $(this).closest('table').DataTable({ 'retrieve': true }); |
1919 |
var dTable = $(this).closest('table').DataTable({ 'retrieve': true }); |
1910 |
|
1920 |
|
1911 |
var itemnumber = tr.data('itemnumber'); |
1921 |
var itemnumber = tr.data('itemnumber'); |
|
|
1922 |
var duedate = tr.data('duedate'); |
1912 |
var row = dTable.row( tr ); |
1923 |
var row = dTable.row( tr ); |
1913 |
|
1924 |
|
1914 |
if ( row.child.isShown() ) { |
1925 |
if ( row.child.isShown() ) { |
Lines 1918-1924
Note that permanent location is a code, and location may be an authval.
Link Here
|
1918 |
} |
1929 |
} |
1919 |
else { |
1930 |
else { |
1920 |
// Open this row |
1931 |
// Open this row |
1921 |
createChild(row, itemnumber); |
1932 |
createChild(row, itemnumber, duedate); |
1922 |
tr.addClass('shown'); |
1933 |
tr.addClass('shown'); |
1923 |
} |
1934 |
} |
1924 |
} ); |
1935 |
} ); |
1925 |
- |
|
|