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>
This commit is contained in:
parent
4c781d9911
commit
0dd817178b
2 changed files with 34 additions and 17 deletions
|
@ -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'} );
|
||||
|
|
|
@ -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 %]
|
||||
|
||||
[% END %]
|
||||
</li>
|
||||
[% IF ITEM_DAT.withdrawn != "" && ITEM_DAT.withdrawn_on %]
|
||||
<li><span class="label">Withdrawn on:</span>[% ITEM_DAT.withdrawn_on | $KohaDates %] </li>
|
||||
[% END %]
|
||||
</li>
|
||||
[% IF ITEM_DAT.withdrawn_on %]<li><span class="label">Withdrawn on:</span>[% ITEM_DAT.withdrawn_on | $KohaDates %] </li>[% END %]
|
||||
[% END %]
|
||||
|
||||
</ol></div>
|
||||
<div class="listgroup"><h4>History</h4>
|
||||
<ol class="bibliodetails">
|
||||
|
|
Loading…
Reference in a new issue