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>
|| ""; # "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
</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>
</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>
[% 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>
</li>
<li>
<label for="medium">Request type:</label>
- [% request.medium | html %]
+ [% request.getType | html %]
</li>
<li>
<label for="placed">Request placed:</label>