From 99bc5abac5080998756122c2988b796959878f68 Mon Sep 17 00:00:00 2001 From: Olli-Antti Kivilahti Date: Wed, 10 Dec 2014 16:31:23 +0200 Subject: [PATCH] Bug 13430 - Serial enumeration not visible when handling Serial Items. Circ- and member-modules. Adding enumchron (Vol info) to circ/circulation.pl and members/moremember.pl. Making enumchron (Vol info)-column hide when it is not used. TEST PREPARATIONS: -1. Find a Borrower/parent with a child/guarantee. -0. Make a Subscription (creating Items when receiving serial numbers) to a Biblio and receive atleast 4 numbers. TEST PLAN (HOLDS ENUMERATED): 1. Make a reservation of two of the Serial Items for the Borrower and the Child, totaling 4 reservations. 2. Check-in the reserved books to make sure an Item-level hold is in place and real Items match the reservations. 3. Both the Borrower and Child have a "Vol info"-column with the Item enumchron (enumeration or chronology) in their "Holds"-tab in circ/circulation.pl and members/moremember.pl TEST PLAN (HOLDS UNENUMERATED): 4. Make two arbitrary reserves for both Parent and Child. 5. Observe that in the "Holds"-tab they have now two Items with enumchron and two without. 6. Check-out the reserved Items for the respective Parent/Child. 7. Observe that in the "Holds"-tab there is no "Vol info"-column. TEST PLAN (CHECKOUTS ENUMERATED): 8. Make two arbitrary check-outs for the Parent and the Child. 9. In the "Checkouts"-tab, observe the "Vol info"-column with two Items having an enumchron and two items without. 10. In the "Relatives' checkouts"-tab observe that the Child of the Parent and the Parent of the Child can see the "Vol info"-tab with their relatives' loans proper enumerations. TEST PLAN (CHECKOUTS UNENUMERATED): 11. Check-in the Serial Items for both the Parent and the Child. 12. Observe the missing "Vol info"-tab in the "Checkouts"-tab and in the "Relatives' checkouts"-tab. --- .../prog/en/includes/checkouts-table-footer.inc | 2 +- .../prog/en/includes/checkouts-table.inc | 1 + koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js | 24 ++++++++++++++++++++ koha-tmpl/intranet-tmpl/prog/en/js/holds.js | 23 +++++++++++++++++++ .../prog/en/modules/circ/circulation.tt | 2 ++ .../prog/en/modules/members/moremember.tt | 2 ++ svc/checkouts | 2 ++ svc/holds | 1 + 8 files changed, 56 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc index 3f8db22..a52bad6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc @@ -1,6 +1,6 @@ - Totals: + Totals: [% totaldue %] [% totalprice %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc index fc6d4ed..06efacd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc @@ -14,6 +14,7 @@ Due date Due date Title + Vol info Item type Checked out on Checked out from diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js index a135496..3ab466f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js @@ -252,6 +252,7 @@ $(document).ready(function() { return title; } }, + { "mDataProp": "enumchron" }, //bVisible: controlled by the fnInitComplete if enumchron is used in the table { "mDataProp": "itemtype_description" }, { "mDataProp": "issuedate_formatted" }, { "mDataProp": "branchname" }, @@ -399,6 +400,8 @@ $(document).ready(function() { } } + doHideEnumchron( $( oSettings.nTable ).DataTable() , oSettings.fnRecordsTotal() , '.col_enumchron' ); + oSettings.aaSortingFixed = null; }, }).rowGrouping( @@ -487,6 +490,7 @@ $(document).ready(function() { return title; } }, + { "mDataProp": "enumchron" }, { "mDataProp": "itemtype" }, { "mDataProp": "issuedate_formatted" }, { "mDataProp": "branchname" }, @@ -523,6 +527,9 @@ $(document).ready(function() { fnCallback(json) } ); }, + "fnInitComplete": function(oSettings) { + doHideEnumchron( $( oSettings.nTable ).DataTable() , oSettings.fnRecordsTotal() , '.col_enumchron' ); + }, }); } }); @@ -544,3 +551,20 @@ $(document).ready(function() { } ).attr( 'checked', false ); } }); + +function doHideEnumchron (table, rowCount, colDefinition) { + //Get the presence of a enumchron and hide the column if no enumchron present. + var enumchronPresent = 0; + var col_enumchron = table.column( colDefinition ); + var col_enumchron_data = col_enumchron.data(); + + for(var i=0;i[% message %] Due date (unformatted, hidden) Due date Title + Vol info Item type Checked out on Checked out from @@ -815,6 +816,7 @@ No patron matched [% message %] Hold date Title + Vol info Call number Barcode Expiration diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index 8ebd31f..e7bff04 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -435,6 +435,7 @@ function validate1(date) { Due date Title + Vol info Item type Checked out on Checked out from @@ -467,6 +468,7 @@ function validate1(date) { Hold date Title + Vol info Call number Barcode Expiration diff --git a/svc/checkouts b/svc/checkouts index 51fd861..185381d 100755 --- a/svc/checkouts +++ b/svc/checkouts @@ -76,6 +76,7 @@ my $sql = ' barcode, itemnotes, itemcallnumber, + items.enumchron, replacementprice, issues.branchcode, @@ -153,6 +154,7 @@ while ( my $c = $sth->fetchrow_hashref() ) { branchcode => $c->{branchcode}, branchname => $c->{branchname}, itemcallnumber => $c->{itemcallnumber} || q{}, + enumchron => $c->{enumchron} || q{}, charge => $charge, price => $c->{replacementprice} || q{}, can_renew => $can_renew, diff --git a/svc/holds b/svc/holds index 43bcf2a..f599b5d 100755 --- a/svc/holds +++ b/svc/holds @@ -115,6 +115,7 @@ while ( my $h = $holds_rs->next() ) { $hold->{barcode} = $item->barcode(); $hold->{itemtype} = $item->effective_itemtype(); $hold->{itemcallnumber} = $item->itemcallnumber() || q{}; + $hold->{enumchron} = $item->enumchron() || q{}; my ( $transferred_when, $transferred_from, $transferred_to ) = GetTransfers( $item->itemnumber() ); -- 1.7.9.5