Browse Source

Bug 11280 - Change Withdrawn toggle to drop down selection of authorized values

'Withdrawn' is an authorised value just like 'Lost' and 'Damaged,' so
the item detail screen should offer the same means of selecting one of
multiple values.

This patch re-uses the same template markup and code 'Lost' and 'Damage'
use to make it possible to select a specific withdrawn value.

To test you should have multiple values entered for the authorised value
category 'WITHDRAWN'.

1. Apply the patch and locate any record in the catalog.
2. From the detail screen, click the barcode in the items table to go to
   the item detail page.
3. Confirm that there is a dropdown list of choices for 'Withdrawn
   status.'
4. Try both setting and unsetting various withdrawn statuses.
5. Confirm that setting Lost or Damaged statuses.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
new_12478_elasticsearch
Owen Leonard 9 years ago
committed by Brendan A Gallagher
parent
commit
0dd817178b
  1. 1
      catalogue/moredetail.pl
  2. 50
      koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt

1
catalogue/moredetail.pl

@ -139,6 +139,7 @@ foreach my $item (@items){
$item->{object} = Koha::Items->find( $item->{itemnumber} );
$item->{itemlostloop}= GetAuthorisedValues(GetAuthValCode('items.itemlost',$fw),$item->{itemlost}) if GetAuthValCode('items.itemlost',$fw);
$item->{itemdamagedloop}= GetAuthorisedValues(GetAuthValCode('items.damaged',$fw),$item->{damaged}) if GetAuthValCode('items.damaged',$fw);
$item->{itemwithdrawnloop}= GetAuthorisedValues(GetAuthValCode('items.withdrawn',$fw),$item->{withdrawn}) if GetAuthValCode('items.withdrawn',$fw);
$item->{'collection'} = $ccodes->{ $item->{ccode} } if ($ccodes);
$item->{'itype'} = $itemtypes->{ $item->{'itype'} }->{'translated_description'};
$item->{'replacementprice'} = sprintf( "%.2f", $item->{'replacementprice'} );

50
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt

@ -162,25 +162,41 @@
[% END %]
</li>
[% END %]
<li><span class="label">Withdrawn?:</span>[% IF ( ITEM_DAT.withdrawn ) %]Yes[% ELSE %]No[% END %]
[% IF ( CAN_user_circulate ) %]
<form 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 %]" />
<input type="hidden" name="itemlost" value="[% ITEM_DAT.itemlost %]" />
<input type="hidden" name="damaged" value="[% ITEM_DAT.damaged %]" />
[% IF ( ITEM_DAT.withdrawn ) %]
<input type="hidden" name="withdrawn" value="0" />[% ELSE %]<input type="hidden" name="withdrawn" value="1" />
[% END %]
[% IF ( ITEM_DAT.withdrawn ) %]
<input type="submit" name="submit" class="submit" value="Restore" />[% ELSE %]<input type="submit" name="submit" class="submit" value="Withdraw" />
[% END %]
</form>
[% IF ( ITEM_DAT.itemwithdrawnloop ) %]
<li><span class="label">Withdrawn status:</span>
[% IF ( CAN_user_circulate ) %]
<form 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 %]" />
<select name="withdrawn" >
<option value="">Choose</option>
[% FOREACH itemwithdrawn IN ITEM_DAT.itemwithdrawnloop %]
[% IF ( itemwithdrawn.selected ) %]
<option value="[% itemwithdrawn.authorised_value %]" selected="selected">[% itemwithdrawn.lib %]</option>
[% ELSE %]
<option value="[% itemwithdrawn.authorised_value %]">[% itemwithdrawn.lib %]</option>
[% END %]
[% END %]
</select>
<input type="hidden" name="itemlost" value="[% ITEM_DAT.itemlost %]" />
<input type="hidden" name="damaged" value="[% ITEM_DAT.damaged %]" />
<input type="submit" name="submit" class="submit" value="Set status" /></form>
[% ELSE %]
[% FOREACH itemwithdrawn IN ITEM_DAT.itemwithdrawnloop %]
[% IF ( itemwithdrawn.selected ) %]
[% itemwithdrawn.lib %]
[% END %]
[% END %]
&nbsp;
[% END %]
</li>
[% IF ITEM_DAT.withdrawn != "" && ITEM_DAT.withdrawn_on %]
<li><span class="label">Withdrawn on:</span>[% ITEM_DAT.withdrawn_on | $KohaDates %] &nbsp;</li>
[% END %]
</li>
[% IF ITEM_DAT.withdrawn_on %]<li><span class="label">Withdrawn on:</span>[% ITEM_DAT.withdrawn_on | $KohaDates %] &nbsp;</li>[% END %]
[% END %]
</ol></div>
<div class="listgroup"><h4>History</h4>
<ol class="bibliodetails">

Loading…
Cancel
Save