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

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 717878982f)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
(cherry picked from commit a5b993672f)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
This commit is contained in:
Kyle M Hall 2015-04-24 10:41:58 -04:00 committed by Frédéric Demians
parent d52ae9be23
commit 1a49ebf90b
6 changed files with 76 additions and 43 deletions

View File

@ -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;

View File

@ -565,17 +565,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'};

View File

@ -237,6 +237,14 @@ $(document).ready(function() {
title += " - <span class='" + span_class + "'>" + oObj.itemnotes + "</span>"
}
if ( oObj.itemnotes_nonpublic ) {
var span_class = "";
if ( $.datepicker.formatDate('yy-mm-dd', new Date(oObj.issuedate) ) == ymd ) {
span_class = "circ-hlt";
}
title += " - <span class='" + span_class + "'>" + oObj.itemnotes_nonpublic + "</span>"
}
var onsite_checkout = '';
if ( oObj.onsite_checkout == 1 ) {
onsite_checkout += " <span class='onsite_checkout'>(" + INHOUSE_USE + ")</span>";

View File

@ -220,18 +220,34 @@
[% IF ( ITEM_DAT.card1 ) %]<li><span class="label">Previous borrower:</span> <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% ITEM_DAT.borrower1 %]">[% ITEM_DAT.card1 %]</a>&nbsp;</li>[% END %]
[% IF ( ITEM_DAT.card2 ) %]<li><span class="label">Previous borrower:</span> <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% ITEM_DAT.borrower2 %]">[% ITEM_DAT.card2 %]</a>&nbsp;</li>[% END %]
[% IF ( ITEM_DAT.paidfor ) %]<li><span class="label">Paid for?:</span> [% ITEM_DAT.paidfor %]&nbsp;</li>[% END %]
[% IF ( ITEM_DAT.enumchron ) %]<li><span class="label">Serial enumeration:</span> [% ITEM_DAT.enumchron %]&nbsp;</li>[% END %]
<li><span class="label">Public note:</span>
[% IF ( CAN_user_editcatalogue_edit_items ) %]
<form class="inline" action="updateitem.pl" method="post"><input type="hidden" name="biblionumber" value="[% ITEM_DAT.biblionumber %]" />
<input type="hidden" name="biblioitemnumber" value="[% ITEM_DAT.biblioitemnumber %]" /><input type="hidden" name="itemnumber" value="[% ITEM_DAT.itemnumber %]" />
<textarea name="itemnotes" rows="2" cols="30">[% ITEM_DAT.itemnotes %]</textarea><input type="submit" name="submit" class="submit" value="Update" />
</form>
[% ELSE %]
[% ITEM_DAT.itemnotes %]
&nbsp;
[% END %]
</li>
<li>
<span class="label">Public note:</span>
[% IF ( CAN_user_editcatalogue_edit_items ) %]
<form class="inline" action="updateitem.pl" method="post"><input type="hidden" name="biblionumber" value="[% ITEM_DAT.biblionumber %]" />
<input type="hidden" name="biblioitemnumber" value="[% ITEM_DAT.biblioitemnumber %]" /><input type="hidden" name="itemnumber" value="[% ITEM_DAT.itemnumber %]" />
<textarea name="itemnotes" rows="2" cols="30">[% ITEM_DAT.itemnotes %]</textarea><input type="submit" name="submit" class="submit" value="Update" />
</form>
[% ELSE %]
[% ITEM_DAT.itemnotes %]
&nbsp;
[% END %]
</li>
<li>
<span class="label">Non-public note:</span>
[% IF ( CAN_user_editcatalogue_edit_items ) %]
<form class="inline" action="updateitem.pl" method="post"><input type="hidden" name="biblionumber" value="[% ITEM_DAT.biblionumber %]" />
<input type="hidden" name="biblioitemnumber" value="[% ITEM_DAT.biblioitemnumber %]" /><input type="hidden" name="itemnumber" value="[% ITEM_DAT.itemnumber %]" />
<textarea name="itemnotes_nonpublic" rows="2" cols="30">[% ITEM_DAT.itemnotes_nonpublic %]</textarea><input type="submit" name="submit" class="submit" value="Update" />
</form>
[% ELSE %]
[% ITEM_DAT.itemnotes_nonpublic %]
&nbsp;
[% END %]
</li>
</ol>
</div>
</div>

View File

@ -588,8 +588,10 @@ $(document).ready(function () {
[% riloo.borsurname %], [% riloo.borfirstname %] ([% riloo.borcategorycode %])
</a>
[% ELSE %]Not checked out[% END %]</td>
<td class="ci-note">[% IF ( riloo.bornote ) %]<span class="circ-hlt">[% riloo.bornote %]<br /></span>[% END %]
[% IF ( riloo.itemnote ) %]<span class="circ-hlt">[% riloo.itemnote %]</span>[% END %]
<td class="ci-note">
[% IF ( riloo.bornote ) %]<p><span class="circ-hlt">[% riloo.bornote %]</p></span>[% END %]
[% IF ( riloo.itemnote ) %]<p><span class="circ-hlt">[% riloo.itemnote %]</p></span>[% END %]
[% IF ( riloo.itemnotes_nonpublic ) %]<p><span class="circ-hlt">[% riloo.itemnotes_nonpublic %]</p></span>[% END %]
</td>
</tr>
[% END %]

View File

@ -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},
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},
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 => $itemtype->{translated_description},
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},