View | Details | Raw Unified | Return to bug 8028
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt (-3 / +6 lines)
Lines 50-57 Link Here
50
50
51
	rowCountPending  = $("#pendingt tbody.filterclass tr").length;
51
	rowCountPending  = $("#pendingt tbody.filterclass tr").length;
52
	rowCountReceived = $("#receivedt tbody.filterclass tr").length;
52
	rowCountReceived = $("#receivedt tbody.filterclass tr").length;
53
	if (rowCountPending  > rowsToCollapse) { pendingCollapse(); }
53
	if (rowCountPending  > rowsToCollapse && $.cookie("pendingKeepExpanded") != 1 ) { pendingCollapse(); }
54
	if (rowCountReceived > rowsToCollapse) { receivedCollapse(); }
54
	if (rowCountReceived > rowsToCollapse && $.cookie("receivedKeepExpanded") != 1 ) { receivedCollapse(); } else { receivedExpand(); }
55
    });
55
    });
56
56
57
     // Case-insensitive version of jquery's contains function
57
     // Case-insensitive version of jquery's contains function
Lines 67-72 Link Here
67
67
68
    // Collapse pending items table
68
    // Collapse pending items table
69
    function pendingCollapse() {
69
    function pendingCollapse() {
70
        $.cookie("pendingKeepExpanded", 0, { path: "/", expires: 9999 });
70
	$("#pendingcollapserow").remove();
71
	$("#pendingcollapserow").remove();
71
    $("#pendingt tr").show();
72
    $("#pendingt tr").show();
72
	$("#pendingt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide();
73
	$("#pendingt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide();
Lines 76-81 Link Here
76
77
77
    // Expend pending items table
78
    // Expend pending items table
78
    function pendingExpand() {
79
    function pendingExpand() {
80
        $.cookie("pendingKeepExpanded", 1, { path: "/", expires: 9999 });
79
	$("#pendingcollapserow").remove();
81
	$("#pendingcollapserow").remove();
80
	$("#pendingt tr").show();
82
	$("#pendingt tr").show();
81
    $("#pendingt tbody.filterclass tr.orderfound").remove();
83
    $("#pendingt tbody.filterclass tr.orderfound").remove();
Lines 84-89 Link Here
84
86
85
    // Collapse already received items table
87
    // Collapse already received items table
86
    function receivedCollapse() {
88
    function receivedCollapse() {
89
        $.cookie("receivedKeepExpanded", 0, { path: "/", expires: 9999 });
87
	$("#receivedcollapserow").remove();
90
	$("#receivedcollapserow").remove();
88
	$("#receivedt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide();
91
	$("#receivedt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide();
89
	$("#receivedt").before("<p id=\"receivedcollapserow\">" + _("Only the first ") + rowsToCollapse + _(" items are displayed.") + "<a href=\"javascript:receivedExpand();\">" + _("Click here to show all ") + rowCountReceived + _(" items") + "<\/a>.<\/p>");
92
	$("#receivedt").before("<p id=\"receivedcollapserow\">" + _("Only the first ") + rowsToCollapse + _(" items are displayed.") + "<a href=\"javascript:receivedExpand();\">" + _("Click here to show all ") + rowCountReceived + _(" items") + "<\/a>.<\/p>");
Lines 91-96 Link Here
91
94
92
    // Expand already received items table
95
    // Expand already received items table
93
    function receivedExpand() {
96
    function receivedExpand() {
97
        $.cookie("receivedKeepExpanded", 1, { path: "/", expires: 9999 });
94
	$("#receivedcollapserow").remove();
98
	$("#receivedcollapserow").remove();
95
	$("#receivedt tr").show();
99
	$("#receivedt tr").show();
96
	$("#receivedt").before("<p id=\"receivedcollapserow\">" + _("All ") + rowCountReceived + _(" items are displayed.") + "<a href=\"javascript:receivedCollapse();\">" + _("Click here to show only the first ") + rowsToCollapse + _(" items") + "<\/a>.<\/p>");
100
	$("#receivedt").before("<p id=\"receivedcollapserow\">" + _("All ") + rowCountReceived + _(" items are displayed.") + "<a href=\"javascript:receivedCollapse();\">" + _("Click here to show only the first ") + rowsToCollapse + _(" items") + "<\/a>.<\/p>");
97
- 

Return to bug 8028