Bug 20941: Add Illrequest->getType method

This patch adds a method to the Illrequest object enabling it to return
its type, which is stored as an Illrequestattribute object

To observe broken state:

- Do not apply patch
- Ensure you have at least one Interlibrary loan created
- In OPAC view, go to "your interlibrary loan requests"
  - => TEST: Observe that the "Request type" column is not populated
  - Click on "View" for one of the requests
  - => TEST: Observer that the "Request type" row is not populated
- In Staff view, go to "ILL requests"
- Click on "Manage request" on a request
  - => TEST: Observer that the "Request type" row is not populated

To Test:

- Apply patch
- In OPAC view, go to "your interlibrary loan requests"
  - => TEST: Observe that the "Request type" column IS populated
  - Click on "View" for one of the requests
  - => TEST: Observer that the "Request type" row IS populated
- In Staff view, go to "ILL requests"
- Click on "Manage request" on a request
  - => TEST: Observer that the "Request type" row IS populated

Signed-off-by: Niamh.Walker-Headon@it-tallaght.ie

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Andrew Isherwood 2018-06-14 14:26:02 +01:00 committed by Nick Clemens
parent 9f65d3422e
commit cc12509c1e
3 changed files with 18 additions and 4 deletions

View file

@ -737,6 +737,20 @@ sub getPrefix {
|| ""; # "the empty prefix"
}
=head3 getType
my $type = $abstract->getType();
Return a string representing the material type of this request
=cut
sub getType {
my ($self) = @_;
my $attr = $self->illrequestattributes->find({ type => 'type'});
return $attr ? $attr->value : '<span>N/A</span>';
};
#### Illrequests Imports
=head3 check_limits

View file

@ -449,7 +449,7 @@
</li>
<li class="medium">
<label class="medium">Request type:</label>
[% request.medium | html %]
[% request.getType | html %]
</li>
<li class="cost">
<label class="cost">Cost:</label>
@ -558,7 +558,7 @@
</div>
<div class="medium">
<span class="label medium">Request type:</span>
[% request.medium | html %]
[% request.getType | html %]
</div>
<div class="cost">
<span class="label cost">Cost:</span>

View file

@ -135,7 +135,7 @@
[% IF request.metadata.Title %][% request.metadata.Title | html %][% ELSE %]<span>N/A</span>[% END %]
</td>
<td>[% request.backend | html %]</td>
<td>[% request.medium | html %]</td>
<td>[% request.getType | 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>
@ -178,7 +178,7 @@
</li>
<li>
<label for="medium">Request type:</label>
[% request.medium | html %]
[% request.getType | html %]
</li>
<li>
<label for="placed">Request placed:</label>