X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=koha-tmpl%2Fintranet-tmpl%2Fprog%2Fen%2Fmodules%2Facqui%2Fparcel.tt;h=877d263d73b7bff42e6688cb0b72f9031a913b0a;hb=04b4afbd92ab952671e5ea6124e9e95da4a05874;hp=6c8d087f4ecd1e5ddddb122d05dda84be9946e5e;hpb=3e131101911fda60580b1dd757d078c172f19c3b;p=koha_fer diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt index 6c8d087f4e..877d263d73 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt @@ -13,9 +13,11 @@ dt_overwrite_html_sorting_localeCompare(); - var rowsToCollapse = 5; $(document).ready(function(){ var pendingt = $("#pendingt").dataTable($.extend(true, {}, dataTablesDefaults, { + "bStateSave": true, + "iCookieDuration": 60*60*24*1000, // 1000 days + "aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]], "aoColumnDefs": [ { "aTargets": [ 3, 8, 9 ], "bSortable": false, "bSearchable": false }, ], @@ -34,6 +36,9 @@ "sPaginationType": "four_button" } ) ); var receivedt = $("#receivedt").dataTable($.extend(true, {}, dataTablesDefaults, { + "bStateSave": true, + "iCookieDuration": 60*60*24*1000, // 1000 days + "aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]], "aoColumnDefs": [ { "aTargets": [ 3, -1 ], "bSortable": false, "bSearchable": false }, ], @@ -56,10 +61,6 @@ }); */ - rowCountPending = $("#pendingt tbody.filterclass tr").length; - rowCountReceived = $("#receivedt tbody.filterclass tr").length; - if (rowCountPending > rowsToCollapse ) { if ( $.cookie("pendingKeepExpanded") != 1 ) { pendingCollapse(); } else { pendingExpand(); } } - if (rowCountReceived > rowsToCollapse ) { if ( $.cookie("receivedKeepExpanded") != 1 ) { receivedCollapse(); } else { receivedExpand(); } } }); // Case-insensitive version of jquery's contains function @@ -72,42 +73,6 @@ containsExactly: "$(a).text() == m[3]" }); - - // Collapse pending items table - function pendingCollapse() { - $.cookie("pendingKeepExpanded", 0, { path: "/", expires: 9999 }); - $("#pendingcollapserow").remove(); - $("#pendingt tr").show(); - $("#pendingt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide(); - $("#pendingt").before("

" + _("Only the first ") + rowsToCollapse + _(" items are displayed.") + " " + _("Click here to show all ") + rowCountPending + _(" items") + "<\/a>.<\/p>"); - - } - - // Expend pending items table - function pendingExpand() { - $.cookie("pendingKeepExpanded", 1, { path: "/", expires: 9999 }); - $("#pendingcollapserow").remove(); - $("#pendingt tr").show(); - $("#pendingt tbody.filterclass tr.orderfound").remove(); - $("#pendingt").before("

" + rowCountPending + _(" items are displayed.") + " " + _("Click here to show only the first ") + rowsToCollapse + _(" items") + "<\/a>.<\/p>"); - } - - // Collapse already received items table - function receivedCollapse() { - $.cookie("receivedKeepExpanded", 0, { path: "/", expires: 9999 }); - $("#receivedcollapserow").remove(); - $("#receivedt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide(); - $("#receivedt").before("

" + _("Only the first ") + rowsToCollapse + _(" items are displayed.") + " " + _("Click here to show all ") + rowCountReceived + _(" items") + "<\/a>.<\/p>"); - } - - // Expand already received items table - function receivedExpand() { - $.cookie("receivedKeepExpanded", 1, { path: "/", expires: 9999 }); - $("#receivedcollapserow").remove(); - $("#receivedt tr").show(); - $("#receivedt").before("

" + _("All ") + rowCountReceived + _(" items are displayed.") + " " + _("Click here to show only the first ") + rowsToCollapse + _(" items") + "<\/a>.<\/p>"); - } - //]]>