@@ -, +, @@
templates more consistant
---
Koha/Illrequest.pm | 3 ++-
koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt | 6 +++---
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt | 4 ++--
t/db_dependent/Illrequests.t | 4 ++--
4 files changed, 9 insertions(+), 8 deletions(-)
--- a/Koha/Illrequest.pm
+++ a/Koha/Illrequest.pm
@@ -735,7 +735,8 @@ Return a string representing the material type of this request or undef
sub get_type {
my ($self) = @_;
my $attr = $self->illrequestattributes->find({ type => 'type'});
- return $attr ? $attr->value : undef;
+ return if !$attr;
+ return $attr->value;
};
#### Illrequests Imports
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt
@@ -438,7 +438,7 @@
- [% type ? type : 'N/A' | html %]
+ [% type || 'N/A' | html %]
@@ -538,8 +538,8 @@
Request type:
- [% type = request.get_type %]
- [% type ? type : 'N/A' | html %]
+ % type = request.get_type %]
+ [% type || 'N/A' | html %]
Cost:
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt
+++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt
@@ -129,7 +129,7 @@
[% request.metadata.Author || 'N/A' | html %] |
[% request.metadata.Title || 'N/A' | html %] |
[% request.backend | html %] |
- [% type ? type : 'N/A' | html %] |
+ [% type || 'N/A' | html %] |
[% request.capabilities.$status.name | html %] |
[% request.placed | html %] |
[% request.updated | html %] |
@@ -169,7 +169,7 @@
- [% type ? type : 'N/A' | html %]
+ [% type || 'N/A' | html %]
--- a/t/db_dependent/Illrequests.t
+++ a/t/db_dependent/Illrequests.t
@@ -83,8 +83,8 @@ subtest 'Basic object tests' => sub {
is($illrq_obj->backend, $illrq->{backend},
"Backend getter works.");
- is($illrq_obj->get_type, 'N/A',
- 'get_type() returns placeholder if no type is set');
+ is($illrq_obj->get_type, undef,
+ 'get_type() returns undef if no type is set');
$builder->build({
source => 'Illrequestattribute',
value => {
--