From bd8ab7f9f41b7904c6010be8faade992324f2589 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 24 Apr 2015 10:41:58 -0400 Subject: [PATCH] Bug 13024 - Nonpublic note not appearing in the staff client The nonpublic note for items is not displayed in the staff client. It should be displayed in the following areas: 1) Checkouts (circulation.pl) 2) Checkins (returns.pl) 3) Record details ( moredetail.pl ) Test Plan: 1) Ensure your non-public note field is mapped to the items.itemnotes_nonpublic database column 2) Edit an item, add a test nonpublic note 3) Check out the item, verify the note is visible in the checkouts table 4) Check in the item, verify the note is visible in the checkins table 5) View the item details, verify the note is visible and editable if your account has the rights to edit items --- catalogue/updateitem.pl | 9 ++++- circ/returns.pl | 23 ++++++------ koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js | 8 ++++ .../prog/en/modules/catalogue/moredetail.tt | 38 ++++++++++++++------ .../intranet-tmpl/prog/en/modules/circ/returns.tt | 6 ++- svc/checkouts | 33 ++++++++--------- 6 files changed, 75 insertions(+), 42 deletions(-) diff --git a/catalogue/updateitem.pl b/catalogue/updateitem.pl index db37803..90c6de6 100755 --- a/catalogue/updateitem.pl +++ b/catalogue/updateitem.pl @@ -37,6 +37,7 @@ my $itemnumber=$cgi->param('itemnumber'); my $biblioitemnumber=$cgi->param('biblioitemnumber'); my $itemlost=$cgi->param('itemlost'); my $itemnotes=$cgi->param('itemnotes'); +my $itemnotes_nonpublic=$cgi->param('itemnotes_nonpublic'); my $withdrawn=$cgi->param('withdrawn'); my $damaged=$cgi->param('damaged'); @@ -55,7 +56,13 @@ for ($damaged,$itemlost,$withdrawn) { # modify MARC item if input differs from items table. my $item_changes = {}; -if (defined $itemnotes) { # i.e., itemnotes parameter passed from form +if (defined $itemnotes_nonpublic) { # i.e., itemnotes_nonpublic parameter passed from form + checkauth($cgi, 0, {editcatalogue => 'edit_items'}, 'intranet'); + if ((not defined $item_data_hashref->{'itemnotes_nonpublic'}) or $itemnotes_nonpublic ne $item_data_hashref->{'itemnotes_nonpublic'}) { + $item_changes->{'itemnotes_nonpublic'} = $itemnotes_nonpublic; + } +} +elsif (defined $itemnotes) { # i.e., itemnotes parameter passed from form checkauth($cgi, 0, {editcatalogue => 'edit_items'}, 'intranet'); if ((not defined $item_data_hashref->{'itemnotes'}) or $itemnotes ne $item_data_hashref->{'itemnotes'}) { $item_changes->{'itemnotes'} = $itemnotes; diff --git a/circ/returns.pl b/circ/returns.pl index 8b70e1a..fdd04be 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -569,17 +569,18 @@ foreach ( sort { $a <=> $b } keys %returneditems ) { my $item = GetItem( GetItemnumberFromBarcode($bar_code) ); # fix up item type for display $biblio->{'itemtype'} = C4::Context->preference('item-level_itypes') ? $biblio->{'itype'} : $biblio->{'itemtype'}; - $ri{itembiblionumber} = $biblio->{'biblionumber'}; - $ri{itemtitle} = $biblio->{'title'}; - $ri{itemauthor} = $biblio->{'author'}; - $ri{itemcallnumber} = $biblio->{'itemcallnumber'}; - $ri{itemtype} = $biblio->{'itemtype'}; - $ri{itemnote} = $biblio->{'itemnotes'}; - $ri{ccode} = $biblio->{'ccode'}; - $ri{itemnumber} = $biblio->{'itemnumber'}; - $ri{barcode} = $bar_code; - $ri{homebranch} = $item->{'homebranch'}; - $ri{holdingbranch} = $item->{'holdingbranch'}; + $ri{itembiblionumber} = $biblio->{'biblionumber'}; + $ri{itemtitle} = $biblio->{'title'}; + $ri{itemauthor} = $biblio->{'author'}; + $ri{itemcallnumber} = $biblio->{'itemcallnumber'}; + $ri{itemtype} = $biblio->{'itemtype'}; + $ri{itemnote} = $biblio->{'itemnotes'}; + $ri{itemnotes_nonpublic} = $item->{'itemnotes_nonpublic'}; + $ri{ccode} = $biblio->{'ccode'}; + $ri{itemnumber} = $biblio->{'itemnumber'}; + $ri{barcode} = $bar_code; + $ri{homebranch} = $item->{'homebranch'}; + $ri{holdingbranch} = $item->{'holdingbranch'}; $ri{location} = $biblio->{'location'}; my $shelfcode = $ri{'location'}; diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js index 7607aae..06717ab 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js @@ -237,6 +237,14 @@ $(document).ready(function() { title += " - " + oObj.itemnotes + "" } + if ( oObj.itemnotes_nonpublic ) { + var span_class = ""; + if ( $.datepicker.formatDate('yy-mm-dd', new Date(oObj.issuedate) ) == ymd ) { + span_class = "circ-hlt"; + } + title += " - " + oObj.itemnotes_nonpublic + "" + } + var onsite_checkout = ''; if ( oObj.onsite_checkout == 1 ) { onsite_checkout += " (" + INHOUSE_USE + ")"; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt index 1ddc952..ac6ab11 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt @@ -220,18 +220,34 @@ [% IF ( ITEM_DAT.card1 ) %]
  • Previous borrower: [% ITEM_DAT.card1 %] 
  • [% END %] [% IF ( ITEM_DAT.card2 ) %]
  • Previous borrower: [% ITEM_DAT.card2 %] 
  • [% END %] [% IF ( ITEM_DAT.paidfor ) %]
  • Paid for?: [% ITEM_DAT.paidfor %] 
  • [% END %] + [% IF ( ITEM_DAT.enumchron ) %]
  • Serial enumeration: [% ITEM_DAT.enumchron %] 
  • [% END %] -
  • Public note: - [% IF ( CAN_user_editcatalogue_edit_items ) %] -
    - - -
    - [% ELSE %] - [% ITEM_DAT.itemnotes %] -   - [% END %] -
  • + +
  • + Public note: + [% IF ( CAN_user_editcatalogue_edit_items ) %] +
    + + +
    + [% ELSE %] + [% ITEM_DAT.itemnotes %] +   + [% END %] +
  • + +
  • + Non-public note: + [% IF ( CAN_user_editcatalogue_edit_items ) %] +
    + + +
    + [% ELSE %] + [% ITEM_DAT.itemnotes_nonpublic %] +   + [% END %] +
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt index 211b131..451bc04 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -581,8 +581,10 @@ $(document).ready(function () { [% riloo.borsurname %], [% riloo.borfirstname %] ([% riloo.borcategorycode %]) [% ELSE %]Not checked out[% END %] - [% IF ( riloo.bornote ) %][% riloo.bornote %]
    [% END %] - [% IF ( riloo.itemnote ) %][% riloo.itemnote %][% END %] + + [% IF ( riloo.bornote ) %]

    [% riloo.bornote %]

    [% END %] + [% IF ( riloo.itemnote ) %]

    [% riloo.itemnote %]

    [% END %] + [% IF ( riloo.itemnotes_nonpublic ) %]

    [% riloo.itemnotes_nonpublic %]

    [% END %] [% END %] diff --git a/svc/checkouts b/svc/checkouts index d2eb8ee..8bf33c5 100755 --- a/svc/checkouts +++ b/svc/checkouts @@ -76,6 +76,7 @@ my $sql = ' itemnumber, barcode, itemnotes, + itemnotes_nonpublic, itemcallnumber, replacementprice, @@ -146,16 +147,17 @@ while ( my $c = $sth->fetchrow_hashref() ) { GetRenewCount( $c->{borrowernumber}, $c->{itemnumber} ); my $checkout = { - DT_RowId => $c->{itemnumber} . '-' . $c->{borrowernumber}, - title => $c->{title}, - author => $c->{author}, - barcode => $c->{barcode}, - itemtype => $item_level_itypes ? $c->{itype} : $c->{itemtype}, + DT_RowId => $c->{itemnumber} . '-' . $c->{borrowernumber}, + title => $c->{title}, + author => $c->{author}, + barcode => $c->{barcode}, + itemtype => $item_level_itypes ? $c->{itype} : $c->{itemtype}, itemtype_description => $item_level_itypes ? $c->{itype_description} : $c->{itemtype_description}, - location => $c->{location} ? GetAuthorisedValueByCode( 'LOC', $c->{location} ) : q{}, - itemnotes => $c->{itemnotes}, - branchcode => $c->{branchcode}, - branchname => $c->{branchname}, + location => $c->{location} ? GetAuthorisedValueByCode( 'LOC', $c->{location} ) : q{}, + itemnotes => $c->{itemnotes}, + itemnotes_nonpublic => $c->{itemnotes_nonpublic}, + branchcode => $c->{branchcode}, + branchname => $c->{branchname}, itemcallnumber => $c->{itemcallnumber} || q{}, charge => $charge, fine => $fine, @@ -170,7 +172,7 @@ while ( my $c = $sth->fetchrow_hashref() ) { date_due => $c->{date_due}, date_due_overdue => $c->{date_due_overdue} ? JSON::true : JSON::false, timestamp => $c->{timestamp}, - onsite_checkout => $c->{onsite_checkout}, + onsite_checkout => $c->{onsite_checkout}, renewals_count => $renewals_count, renewals_allowed => $renewals_allowed, renewals_remaining => $renewals_remaining, @@ -186,13 +188,10 @@ while ( my $c = $sth->fetchrow_hashref() ) { as_due_date => 1 } ), - subtitle => GetRecordValue( - 'subtitle', - GetMarcBiblio( $c->{biblionumber} ), - GetFrameworkCode( $c->{biblionumber} ) - ), - lost => $c->{itemlost} ? GetAuthorisedValueByCode( 'LOST', $c->{itemlost} ) : undef, - damaged => $c->{damaged} ? GetAuthorisedValueByCode( 'DAMAGED', $c->{damaged} ) : undef, + subtitle => + GetRecordValue( 'subtitle', GetMarcBiblio( $c->{biblionumber} ), GetFrameworkCode( $c->{biblionumber} ) ), + lost => $c->{itemlost} ? GetAuthorisedValueByCode( 'LOST', $c->{itemlost} ) : undef, + damaged => $c->{damaged} ? GetAuthorisedValueByCode( 'DAMAGED', $c->{damaged} ) : undef, borrower => { surname => $c->{surname}, firstname => $c->{firstname}, -- 1.7.2.5