Bugzilla – Attachment 124666 Details for
Bug 28762
Item status shows incorrectly on course-details.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28762: add staff item-status.inc and better handle statues on course-details.tt
Bug-28762-add-staff-item-statusinc-and-better-hand.patch (text/plain), 7.26 KB, created by
Hayley Pelham
on 2021-09-09 01:53:51 UTC
(
hide
)
Description:
Bug 28762: add staff item-status.inc and better handle statues on course-details.tt
Filename:
MIME Type:
Creator:
Hayley Pelham
Created:
2021-09-09 01:53:51 UTC
Size:
7.26 KB
patch
obsolete
>From ae8a71709783e97a7be2439e0a790d0069a27551 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Tue, 27 Jul 2021 21:17:48 +0000 >Subject: [PATCH] Bug 28762: add staff item-status.inc and better handle > statues on course-details.tt > >This patch adds an item-status.inc to the staff side much like what is already in place on the OPAC. > >To test: >1. create a course in course reserves, add an item to it. >2. confirm your item shows Available for its status on course-details.pl >3. edit your item to be withdrawn, lost, damaged, notforloan, and restricted use >4. reload course-details.pl, confirm it still shows available >5. apply patch >6. repeat step 3 with each of the statuses and make sure it correctly shows on course-details.pl > >Signed-off-by: Hayley Pelham <hayleypelham@catalyst.net.nz> >--- > .../intranet-tmpl/prog/css/src/staff-global.scss | 6 +- > .../intranet-tmpl/prog/en/includes/item-status.inc | 107 +++++++++++++++++++++ > .../en/modules/course_reserves/course-details.tt | 8 +- > 3 files changed, 113 insertions(+), 8 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/item-status.inc > >diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >index 9d8f5e8069..538f5d0a5d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >+++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >@@ -2288,7 +2288,11 @@ td { > > .lost, > .dmg, >-.wdn { >+.wdn, >+.restricted, >+.damaged, >+.lost, >+.withdrawn { > color: #990000; > display: block; > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/item-status.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/item-status.inc >new file mode 100644 >index 0000000000..7da27283f6 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/item-status.inc >@@ -0,0 +1,107 @@ >+[% USE Branches %] >+[% USE AuthorisedValues %] >+[% SET itemavailable = 1 %] >+ >+[%#- This include takes two parameters: an item structure -%] >+[%#- and an optional loan (issue) structure. The issue -%] >+[%#- structure is used by course reserves pages, which do -%] >+[%#- not use an API to fetch items that populates item.datedue. -%] >+ >+[% IF ( item.itemlost ) %] >+ [% SET itemavailable = 0 %] >+ [% av_lib_include = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost ) %] >+ [% IF ( av_lib_include ) %] >+ <span class="item-status lost">[% av_lib_include | html %]</span> >+ [% ELSE %] >+ <span class="item-status lost">Item lost</span> >+ [% END %] >+[% END %] >+ >+[% IF item.isa('Koha::Item') %] >+ [% SET datedue = issue.date_due %] >+ [% SET onsite_checkout = issue.onsite_checkout %] >+[% ELSE %] >+ [% SET datedue = item.datedue || issue.date_due %] >+ [% SET onsite_checkout = item.onsite_checkout %] >+[% END %] >+[% IF datedue %] >+ [% SET itemavailable = 0 %] >+ [% IF onsite_checkout %] >+ [% IF ( OPACShowCheckoutName ) %] >+ <span class="item-status checkedout">Currently in local use by [% item.firstname | html %] [% item.surname | html %] [% IF ( item.cardnumber ) %]([% item.cardnumber | html %])[% END %]</span> >+ [% ELSE %] >+ <span class="item-status checkedout">Currently in local use</span> >+ [% END %] >+ [% ELSE %] >+ [% IF ( OPACShowCheckoutName ) %] >+ <span class="item-status checkedout">Checked out to [% item.firstname | html %] [% item.surname | html %] [% IF ( item.cardnumber ) %]([% item.cardnumber | html %])[% END %]</span> >+ [% ELSE %] >+ <span class="item-status checkedout">Checked out</span> >+ [% END %] >+ [% END %] >+[% END %] >+ >+[% IF NOT ( item.isa('Koha::Item') ) AND item.transfertwhen %] [%# transfertwhen is set in C4::Search, do not have it for course reserves %] >+ [% SET itemavailable = 0 %] >+ <span class="item-status intransit">In transit from [% Branches.GetName( item.transfertfrom ) | html %] >+ to [% Branches.GetName( item.transfertto ) | html %] since [% item.transfertwhen | $KohaDates %]</span> >+[% END %] >+ >+[% IF NOT( item.isa('Koha::Item') ) AND item.waiting %] [%# Not sure where does come from this waiting flag %] >+ [% SET itemavailable = 0 %] >+ <span class="item-status onhold">On hold</span> >+[% END %] >+ >+[% IF ( item.withdrawn ) %] >+ [% SET itemavailable = 0 %] >+ [% av_lib_include = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn ) %] >+ [% IF av_lib_include %] >+ <span class="item-status withdrawn">[% av_lib_include | html %]</span> >+ [% ELSE %] >+ <span class="item-status withdrawn">Item withdrawn</span> >+ [% END %] >+[% END %] >+ >+ >+[% IF NOT ( item.isa('Koha::Item') ) AND item.itemnotforloan %] >+ [% SET itemavailable = 0 %] >+ [% IF ( item.notforloanvalueopac ) %] >+ <span class="item-status notforloan">[% item.notforloanvalueopac | html %]</span> >+ [% ELSE %] >+ <span class="item-status notforloan">Not for loan</span> >+ [% END %] >+[% ELSIF NOT ( item.isa('Koha::Item') ) AND item.notforloan_per_itemtype %] >+ [% SET itemavailable = 0 %] >+ <span class="item-status notforloan">Not for loan</span> >+[% END %] >+ >+[% IF ( item.damaged ) %] >+ [% SET itemavailable = 0 %] >+ [% av_lib_include = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => item.damaged ) %] >+ [% IF av_lib_include %] >+ <span class="item-status damaged">[% av_lib_include | html %]</span> >+ [% ELSE %] >+ <span class="item-status damaged">Item damaged</span> >+ [% END %] >+[% END %] >+ >+[% IF ( item.restricted ) %] >+ [% SET itemavailable = 0 %] >+ [% av_lib_include = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.restricted', authorised_value => item.restricted ) %] >+ [% IF av_lib_include %] >+ <span class="item-status restricted">[% av_lib_include | html %]</span> >+ [% ELSE %] >+ <span class="item-status restricted">On order</span> >+ [% END %] >+[% END %] >+ >+[% IF item.has_pending_hold %] >+ [% SET itemavailable = 0 %] >+ <span class="item-status pendinghold">Pending hold</span> >+[% END %] >+ >+[% IF ( itemavailable ) %] >+ [% IF NOT item.isa('Koha::Item') %] >+ <span class="item-status available">Available</span> >+ [% END %] >+[% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt >index 12efce92bb..6ab2a04b5e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt >@@ -264,13 +264,7 @@ > </td> > > <td class="status"> >- <span> >- [% IF cr.item.onloan %] >- Checked out >- [% ELSE %] >- Available >- [% END %] >- </span> >+ [% INCLUDE 'item-status.inc' item=cr.item issue=cr.issue %] > </td> > > [% IF CAN_user_coursereserves_add_reserves || CAN_user_coursereserves_delete_reserves %] >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28762
:
123233
|
123234
|
123236
|
123237
|
124661
|
124666
|
124667
|
124668
|
124744
|
125220
|
125228
|
125229
|
125233
|
161563
|
161564
|
161565
|
161566
|
161567
|
161568
|
161569
|
161570
|
161571
|
161572
|
161573
|
161574
|
161584
|
161585
|
161586
|
161587
|
161588
|
161589
|
161590
|
161591
|
163310
|
163311
|
163312
|
163313
|
163314
|
163315
|
163316
|
163317
|
165843
|
165844
|
165845
|
165846
|
165847
|
165848
|
165849
|
165850
|
169172
|
169273
|
169274
|
169275
|
169276
|
169277
|
169278
|
169279
|
169280
|
169281
|
169311
|
169312
|
169313
|
169314
|
169354
|
169355
|
169356
|
169357
|
169358
|
169359
|
169360
|
169361
|
169362
|
169363
|
169364
|
169365
|
169366
|
169367
|
169393