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

(-)a/Koha/Illrequest.pm (-5 / +5 lines)
Lines 724-741 sub getPrefix { Link Here
724
        || "";                  # "the empty prefix"
724
        || "";                  # "the empty prefix"
725
}
725
}
726
726
727
=head3 getType
727
=head3 get_type
728
728
729
    my $type = $abstract->getType();
729
    my $type = $abstract->get_type();
730
730
731
Return a string representing the material type of this request
731
Return a string representing the material type of this request or undef
732
732
733
=cut
733
=cut
734
734
735
sub getType {
735
sub get_type {
736
    my ($self) = @_;
736
    my ($self) = @_;
737
    my $attr = $self->illrequestattributes->find({ type => 'type'});
737
    my $attr = $self->illrequestattributes->find({ type => 'type'});
738
    return $attr ? $attr->value : '<span>N/A</span>';
738
    return $attr ? $attr->value : undef;
739
};
739
};
740
740
741
#### Illrequests Imports
741
#### Illrequests Imports
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt (-2 / +4 lines)
Lines 412-417 Link Here
412
                        <fieldset class="rows">
412
                        <fieldset class="rows">
413
                            <legend>Request details</legend>
413
                            <legend>Request details</legend>
414
                            <ol>
414
                            <ol>
415
                                [% type = request.get_type %]
415
                                <li class="borrowernumber">
416
                                <li class="borrowernumber">
416
                                    <label for="borrowernumber">Patron ID:</label>
417
                                    <label for="borrowernumber">Patron ID:</label>
417
                                    <input name="borrowernumber" id="borrowernumber" type="text" value="[% request.borrowernumber | html %]">
418
                                    <input name="borrowernumber" id="borrowernumber" type="text" value="[% request.borrowernumber | html %]">
Lines 437-443 Link Here
437
                                </li>
438
                                </li>
438
                                <li class="medium">
439
                                <li class="medium">
439
                                    <label class="medium">Request type:</label>
440
                                    <label class="medium">Request type:</label>
440
                                    [% request.getType | html %]
441
                                    [% type ? type : 'N/A' | html %]
441
                                </li>
442
                                </li>
442
                                <li class="cost">
443
                                <li class="cost">
443
                                    <label class="cost">Cost:</label>
444
                                    <label class="cost">Cost:</label>
Lines 537-543 Link Here
537
                                </div>
538
                                </div>
538
                                <div class="medium">
539
                                <div class="medium">
539
                                    <span class="label medium">Request type:</span>
540
                                    <span class="label medium">Request type:</span>
540
                                    [% request.getType | html %]
541
                                    [% type = request.get_type  %]
542
                                    [% type ? type : 'N/A' | html %]
541
                                </div>
543
                                </div>
542
                                <div class="cost">
544
                                <div class="cost">
543
                                    <span class="label cost">Cost:</span>
545
                                    <span class="label cost">Cost:</span>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt (-2 / +4 lines)
Lines 124-134 Link Here
124
                        <tbody>
124
                        <tbody>
125
                            [% FOREACH request IN requests %]
125
                            [% FOREACH request IN requests %]
126
                                [% status = request.status | html %]
126
                                [% status = request.status | html %]
127
                                [% type = request.get_type %]
127
                                <tr>
128
                                <tr>
128
                                    <td>[% request.metadata.Author || 'N/A' | html %]</td>
129
                                    <td>[% request.metadata.Author || 'N/A' | html %]</td>
129
                                    <td>[% request.metadata.Title || 'N/A' | html %]</td>
130
                                    <td>[% request.metadata.Title || 'N/A' | html %]</td>
130
                                    <td>[% request.backend | html %]</td>
131
                                    <td>[% request.backend | html %]</td>
131
                                    <td>[% request.getType | html %]</td>
132
                                    <td>[% type ? type : '<span>N/A</span>' | html %]</td>
132
                                    <td>[% request.capabilities.$status.name | html %]</td>
133
                                    <td>[% request.capabilities.$status.name | html %]</td>
133
                                    <td>[% request.placed | html %]</td>
134
                                    <td>[% request.placed | html %]</td>
134
                                    <td>[% request.updated | html %]</td>
135
                                    <td>[% request.updated | html %]</td>
Lines 147-152 Link Here
147
                            <fieldset class="rows">
148
                            <fieldset class="rows">
148
                                <legend id="library_legend">Details from library</legend>
149
                                <legend id="library_legend">Details from library</legend>
149
                                <ol>
150
                                <ol>
151
                                    [% type = request.get_type %]
150
                                    <li>
152
                                    <li>
151
                                        <label for="backend">Requested from:</label>
153
                                        <label for="backend">Requested from:</label>
152
                                        [% request.backend | html %]
154
                                        [% request.backend | html %]
Lines 167-173 Link Here
167
                                    </li>
169
                                    </li>
168
                                    <li>
170
                                    <li>
169
                                        <label for="medium">Request type:</label>
171
                                        <label for="medium">Request type:</label>
170
                                        [% request.getType | html %]
172
                                        [% type ? type : '<span>N/A</span>' | html %]
171
                                    </li>
173
                                    </li>
172
                                    <li>
174
                                    <li>
173
                                        <label for="placed">Request placed:</label>
175
                                        <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