@@ -1612,13 +1612,18 @@ Note that permanent location is a code, and location may be an authval.
$(document).ready(function() {
[% IF bundlesEnabled %] // Bundle handling
- function createChild ( row, itemnumber ) {
+ function createChild ( row, itemnumber, duedate ) {
// Toolbar
var bundle_toolbar = $('');
bundle_toolbar.append(' ' + _("Add to bundle") + '');
bundle_toolbar.append(' ' + _("Remove from bundle") + '');
+ // Disable management if there's a duedate
+ if(duedate) {
+ bundle_toolbar.children('.btn').addClass("disabled");
+ }
+
// This is the table we'll convert into a DataTable
var bundles_table = $('
');
@@ -1717,7 +1722,12 @@ Note that permanent location is a code, and location may be an authval.
},
{
"data": function( row, type, val, meta ) {
- var result = '\n';
+ var result;
+ if (duedate) {
+ result = '\n';
+ } else {
+ result = '\n';
+ }
return result;
},
"title": _("Actions"),
@@ -1727,7 +1737,7 @@ Note that permanent location is a code, and location may be an authval.
}
]
}, bundle_settings, 1);
- $(".tbundle").on("click", ".remove", function(){
+ $(".tbundle").on("click", ".remove:not(.disabled)", function(){
var bundle_table = $(this).closest('table');
var host_itemnumber = bundle_table.data('itemnumber');
var component_itemnumber = $(this).data('itemnumber');
@@ -1909,6 +1919,7 @@ Note that permanent location is a code, and location may be an authval.
var dTable = $(this).closest('table').DataTable({ 'retrieve': true });
var itemnumber = tr.data('itemnumber');
+ var duedate = tr.data('duedate');
var row = dTable.row( tr );
if ( row.child.isShown() ) {
@@ -1918,7 +1929,7 @@ Note that permanent location is a code, and location may be an authval.
}
else {
// Open this row
- createChild(row, itemnumber);
+ createChild(row, itemnumber, duedate);
tr.addClass('shown');
}
} );
--