Bugzilla – Attachment 81690 Details for
Bug 20941
Displaying requests does not display request material type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20941: (follow-up) Carry out comment #4 advice
Bug-20941-follow-up-Carry-out-comment-4-advice.patch (text/plain), 6.72 KB, created by
Josef Moravec
on 2018-10-31 09:53:36 UTC
(
hide
)
Description:
Bug 20941: (follow-up) Carry out comment #4 advice
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2018-10-31 09:53:36 UTC
Size:
6.72 KB
patch
obsolete
>From be677a5affc8123889c0730204e5d14398a33b04 Mon Sep 17 00:00:00 2001 >From: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> >Date: Wed, 3 Oct 2018 12:05:40 +0100 >Subject: [PATCH] Bug 20941: (follow-up) Carry out comment #4 advice > >- Switch getType -> get_type >- get_type now returns a type or undef >- Ternary now performed in template > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > Koha/Illrequest.pm | 10 +++++----- > koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt | 6 ++++-- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt | 8 +++++--- > t/db_dependent/Illrequests.t | 8 ++++---- > 4 files changed, 18 insertions(+), 14 deletions(-) > >diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm >index a46158f..0ce24d2 100644 >--- a/Koha/Illrequest.pm >+++ b/Koha/Illrequest.pm >@@ -737,18 +737,18 @@ sub getPrefix { > || ""; # "the empty prefix" > } > >-=head3 getType >+=head3 get_type > >- my $type = $abstract->getType(); >+ my $type = $abstract->get_type(); > >-Return a string representing the material type of this request >+Return a string representing the material type of this request or undef > > =cut > >-sub getType { >+sub get_type { > my ($self) = @_; > my $attr = $self->illrequestattributes->find({ type => 'type'}); >- return $attr ? $attr->value : '<span>N/A</span>'; >+ return $attr ? $attr->value : undef; > }; > > #### Illrequests Imports >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt >index a8ed6eb..63d5ae2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt >@@ -424,6 +424,7 @@ > <fieldset class="rows"> > <legend>Request details</legend> > <ol> >+ [% type = request.get_type %] > <li class="borrowernumber"> > <label for="borrowernumber">Patron ID:</label> > [% request.borrowernumber | html %] >@@ -449,7 +450,7 @@ > </li> > <li class="medium"> > <label class="medium">Request type:</label> >- [% request.getType | html %] >+ [% type ? type : 'N/A' | html %] > </li> > <li class="cost"> > <label class="cost">Cost:</label> >@@ -558,7 +559,8 @@ > </div> > <div class="medium"> > <span class="label medium">Request type:</span> >- [% request.getType | html %] >+ [% type = request.get_type %] >+ [% type ? type : 'N/A' | html %] > </div> > <div class="cost"> > <span class="label cost">Cost:</span> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt >index e9ad1b9..4374bfc 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt >@@ -125,7 +125,8 @@ > </thead> > <tbody> > [% FOREACH request IN requests %] >- [% status = request.status %] >+ [% status = request.status | html %] >+ [% type = request.get_type %] > <tr> > <td>[% request.id | html %]</td> > <td> >@@ -135,7 +136,7 @@ > [% IF request.metadata.Title %][% request.metadata.Title | html %][% ELSE %]<span>N/A</span>[% END %] > </td> > <td>[% request.backend | html %]</td> >- <td>[% request.getType | html %]</td> >+ <td>[% type ? type : '<span>N/A</span>' | html %]</td> > <td>[% request.capabilities.$status.name | html %]</td> > <td><span title="[% request.placed | html %]">[% request.placed | $KohaDates %]</span></td> > <td><span title="[% request.updated | html %]">[% request.updated | $KohaDates %]</span></td> >@@ -154,6 +155,7 @@ > <fieldset class="rows"> > <legend id="library_legend">Details from library</legend> > <ol> >+ [% type = request.get_type %] > <li> > <label for="request_id">Request ID:</label> > [% request.id | html %] >@@ -178,7 +180,7 @@ > </li> > <li> > <label for="medium">Request type:</label> >- [% request.getType | html %] >+ [% type ? type : '<span>N/A</span>' | html %] > </li> > <li> > <label for="placed">Request placed:</label> >diff --git a/t/db_dependent/Illrequests.t b/t/db_dependent/Illrequests.t >index 3f7ba1e..13bba7d 100644 >--- a/t/db_dependent/Illrequests.t >+++ b/t/db_dependent/Illrequests.t >@@ -85,8 +85,8 @@ subtest 'Basic object tests' => sub { > is($illrq_obj->backend, $illrq->{backend}, > "Backend getter works."); > >- is($illrq_obj->getType, '<span>N/A</span>', >- 'getType() returns placeholder if no type is set'); >+ is($illrq_obj->get_type, '<span>N/A</span>', >+ 'get_type() returns placeholder if no type is set'); > $builder->build({ > source => 'Illrequestattribute', > value => { >@@ -95,8 +95,8 @@ subtest 'Basic object tests' => sub { > value => 'book' > } > }); >- is($illrq_obj->getType, 'book', >- 'getType() returns correct type if set'); >+ is($illrq_obj->get_type, 'book', >+ 'get_type() returns correct type if set'); > > isnt($illrq_obj->status, 'COMP', > "ILL is not currently marked complete."); >-- >2.1.4
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 20941
:
76052
|
79577
|
79825
|
79865
|
79918
|
79919
|
79920
|
79921
|
79945
|
79999
|
80112
|
80113
|
80114
|
80115
|
80116
|
80117
|
80127
|
80128
|
80129
|
80130
|
80131
|
80132
|
80212
|
81688
|
81689
| 81690 |
81691
|
81692
|
81693
|
81694