View | Details | Raw Unified | Return to bug 20941
Collapse All | Expand All

(-)a/Koha/Illrequest.pm (-5 / +5 lines)
Lines 736-753 sub getPrefix { Link Here
736
        || "";                  # "the empty prefix"
736
        || "";                  # "the empty prefix"
737
}
737
}
738
738
739
=head3 getType
739
=head3 get_type
740
740
741
    my $type = $abstract->getType();
741
    my $type = $abstract->get_type();
742
742
743
Return a string representing the material type of this request
743
Return a string representing the material type of this request or undef
744
744
745
=cut
745
=cut
746
746
747
sub getType {
747
sub get_type {
748
    my ($self) = @_;
748
    my ($self) = @_;
749
    my $attr = $self->illrequestattributes->find({ type => 'type'});
749
    my $attr = $self->illrequestattributes->find({ type => 'type'});
750
    return $attr ? $attr->value : '<span>N/A</span>';
750
    return $attr ? $attr->value : undef;
751
};
751
};
752
752
753
#### Illrequests Imports
753
#### Illrequests Imports
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt (-2 / +4 lines)
Lines 436-441 Link Here
436
                        <fieldset class="rows">
436
                        <fieldset class="rows">
437
                            <legend>Request details</legend>
437
                            <legend>Request details</legend>
438
                            <ol>
438
                            <ol>
439
                                [% type = request.get_type %]
439
                                <li class="borrowernumber">
440
                                <li class="borrowernumber">
440
                                    <label for="borrowernumber">Patron ID:</label>
441
                                    <label for="borrowernumber">Patron ID:</label>
441
                                    [% request.borrowernumber | html %]
442
                                    [% request.borrowernumber | html %]
Lines 461-467 Link Here
461
                                </li>
462
                                </li>
462
                                <li class="medium">
463
                                <li class="medium">
463
                                    <label class="medium">Request type:</label>
464
                                    <label class="medium">Request type:</label>
464
                                    [% request.getType | html %]
465
                                    [% type ? type : 'N/A' | html %]
465
                                </li>
466
                                </li>
466
                                <li class="cost">
467
                                <li class="cost">
467
                                    <label class="cost">Cost:</label>
468
                                    <label class="cost">Cost:</label>
Lines 570-576 Link Here
570
                                </div>
571
                                </div>
571
                                <div class="medium">
572
                                <div class="medium">
572
                                    <span class="label medium">Request type:</span>
573
                                    <span class="label medium">Request type:</span>
573
                                    [% request.getType | html %]
574
                                    [% type = request.get_type  %]
575
                                    [% type ? type : 'N/A' | html %]
574
                                </div>
576
                                </div>
575
                                <div class="cost">
577
                                <div class="cost">
576
                                    <span class="label cost">Cost:</span>
578
                                    <span class="label cost">Cost:</span>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt (-2 / +4 lines)
Lines 125-130 Link Here
125
                        <tbody>
125
                        <tbody>
126
                            [% FOREACH request IN requests %]
126
                            [% FOREACH request IN requests %]
127
                                [% status = request.status | html %]
127
                                [% status = request.status | html %]
128
                                [% type = request.get_type %]
128
                                <tr>
129
                                <tr>
129
                                    <td>[% request.id | html %]</td>
130
                                    <td>[% request.id | html %]</td>
130
                                    <td>
131
                                    <td>
Lines 134-140 Link Here
134
                                        [% IF request.metadata.Title %][% request.metadata.Title | html %][% ELSE %]<span>N/A</span>[% END %]
135
                                        [% IF request.metadata.Title %][% request.metadata.Title | html %][% ELSE %]<span>N/A</span>[% END %]
135
                                    </td>
136
                                    </td>
136
                                    <td>[% request.backend | html %]</td>
137
                                    <td>[% request.backend | html %]</td>
137
                                    <td>[% request.getType | html %]</td>
138
                                    <td>[% type ? type : '<span>N/A</span>' | html %]</td>
138
                                    <td>[% request.capabilities.$status.name | html %]</td>
139
                                    <td>[% request.capabilities.$status.name | html %]</td>
139
                                    <td>[% request.placed | html %]</td>
140
                                    <td>[% request.placed | html %]</td>
140
                                    <td>[% request.updated | html %]</td>
141
                                    <td>[% request.updated | html %]</td>
Lines 153-158 Link Here
153
                            <fieldset class="rows">
154
                            <fieldset class="rows">
154
                                <legend id="library_legend">Details from library</legend>
155
                                <legend id="library_legend">Details from library</legend>
155
                                <ol>
156
                                <ol>
157
                                    [% type = request.get_type %]
156
                                    <li>
158
                                    <li>
157
                                        <label for="request_id">Request ID:</label>
159
                                        <label for="request_id">Request ID:</label>
158
                                        [% request.id | html %]
160
                                        [% request.id | html %]
Lines 177-183 Link Here
177
                                    </li>
179
                                    </li>
178
                                    <li>
180
                                    <li>
179
                                        <label for="medium">Request type:</label>
181
                                        <label for="medium">Request type:</label>
180
                                        [% request.getType | html %]
182
                                        [% type ? type : '<span>N/A</span>' | html %]
181
                                    </li>
183
                                    </li>
182
                                    <li>
184
                                    <li>
183
                                        <label for="placed">Request placed:</label>
185
                                        <label for="placed">Request placed:</label>
(-)a/t/db_dependent/Illrequests.t (-5 / +4 lines)
Lines 83-90 subtest 'Basic object tests' => sub { Link Here
83
    is($illrq_obj->backend, $illrq->{backend},
83
    is($illrq_obj->backend, $illrq->{backend},
84
       "Backend getter works.");
84
       "Backend getter works.");
85
85
86
    is($illrq_obj->getType, '<span>N/A</span>',
86
    is($illrq_obj->get_type, '<span>N/A</span>',
87
        'getType() returns placeholder if no type is set');
87
        'get_type() returns placeholder if no type is set');
88
    $builder->build({
88
    $builder->build({
89
        source => 'Illrequestattribute',
89
        source => 'Illrequestattribute',
90
        value  => {
90
        value  => {
Lines 93-100 subtest 'Basic object tests' => sub { Link Here
93
            value => 'book'
93
            value => 'book'
94
        }
94
        }
95
    });
95
    });
96
    is($illrq_obj->getType, 'book',
96
    is($illrq_obj->get_type, 'book',
97
        'getType() returns correct type if set');
97
        'get_type() returns correct type if set');
98
98
99
    isnt($illrq_obj->status, 'COMP',
99
    isnt($illrq_obj->status, 'COMP',
100
         "ILL is not currently marked complete.");
100
         "ILL is not currently marked complete.");
101
- 

Return to bug 20941