@@ -, +, @@ items.itemnotes_nonpublic database column 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(-) --- a/catalogue/updateitem.pl +++ a/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; --- a/circ/returns.pl +++ a/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'}; --- a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js +++ a/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 + ")"; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt +++ a/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 %] +
  • --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ a/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 %] --- a/svc/checkouts +++ a/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}, --