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

(-)a/Koha/Illrequest.pm (-5 / +5 lines)
Lines 737-754 sub getPrefix { Link Here
737
        || "";                  # "the empty prefix"
737
        || "";                  # "the empty prefix"
738
}
738
}
739
739
740
=head3 getType
740
=head3 get_type
741
741
742
    my $type = $abstract->getType();
742
    my $type = $abstract->get_type();
743
743
744
Return a string representing the material type of this request
744
Return a string representing the material type of this request or undef
745
745
746
=cut
746
=cut
747
747
748
sub getType {
748
sub get_type {
749
    my ($self) = @_;
749
    my ($self) = @_;
750
    my $attr = $self->illrequestattributes->find({ type => 'type'});
750
    my $attr = $self->illrequestattributes->find({ type => 'type'});
751
    return $attr ? $attr->value : '<span>N/A</span>';
751
    return $attr ? $attr->value : undef;
752
};
752
};
753
753
754
#### Illrequests Imports
754
#### Illrequests Imports
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt (-2 / +4 lines)
Lines 424-429 Link Here
424
                        <fieldset class="rows">
424
                        <fieldset class="rows">
425
                            <legend>Request details</legend>
425
                            <legend>Request details</legend>
426
                            <ol>
426
                            <ol>
427
                                [% type = request.get_type %]
427
                                <li class="borrowernumber">
428
                                <li class="borrowernumber">
428
                                    <label for="borrowernumber">Patron ID:</label>
429
                                    <label for="borrowernumber">Patron ID:</label>
429
                                    [% request.borrowernumber | html %]
430
                                    [% request.borrowernumber | html %]
Lines 449-455 Link Here
449
                                </li>
450
                                </li>
450
                                <li class="medium">
451
                                <li class="medium">
451
                                    <label class="medium">Request type:</label>
452
                                    <label class="medium">Request type:</label>
452
                                    [% request.getType | html %]
453
                                    [% type ? type : 'N/A' | html %]
453
                                </li>
454
                                </li>
454
                                <li class="cost">
455
                                <li class="cost">
455
                                    <label class="cost">Cost:</label>
456
                                    <label class="cost">Cost:</label>
Lines 558-564 Link Here
558
                                </div>
559
                                </div>
559
                                <div class="medium">
560
                                <div class="medium">
560
                                    <span class="label medium">Request type:</span>
561
                                    <span class="label medium">Request type:</span>
561
                                    [% request.getType | html %]
562
                                    [% type = request.get_type  %]
563
                                    [% type ? type : 'N/A' | html %]
562
                                </div>
564
                                </div>
563
                                <div class="cost">
565
                                <div class="cost">
564
                                    <span class="label cost">Cost:</span>
566
                                    <span class="label cost">Cost:</span>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt (-3 / +5 lines)
Lines 125-131 Link Here
125
                        </thead>
125
                        </thead>
126
                        <tbody>
126
                        <tbody>
127
                            [% FOREACH request IN requests %]
127
                            [% FOREACH request IN requests %]
128
                                [% status = request.status %]
128
                                [% status = request.status | html %]
129
                                [% type = request.get_type %]
129
                                <tr>
130
                                <tr>
130
                                    <td>[% request.id | html %]</td>
131
                                    <td>[% request.id | html %]</td>
131
                                    <td>
132
                                    <td>
Lines 135-141 Link Here
135
                                        [% IF request.metadata.Title %][% request.metadata.Title | html %][% ELSE %]<span>N/A</span>[% END %]
136
                                        [% IF request.metadata.Title %][% request.metadata.Title | html %][% ELSE %]<span>N/A</span>[% END %]
136
                                    </td>
137
                                    </td>
137
                                    <td>[% request.backend | html %]</td>
138
                                    <td>[% request.backend | html %]</td>
138
                                    <td>[% request.getType | html %]</td>
139
                                    <td>[% type ? type : '<span>N/A</span>' | html %]</td>
139
                                    <td>[% request.capabilities.$status.name | html %]</td>
140
                                    <td>[% request.capabilities.$status.name | html %]</td>
140
                                    <td><span title="[% request.placed | html %]">[% request.placed | $KohaDates %]</span></td>
141
                                    <td><span title="[% request.placed | html %]">[% request.placed | $KohaDates %]</span></td>
141
                                    <td><span title="[% request.updated | html %]">[% request.updated | $KohaDates %]</span></td>
142
                                    <td><span title="[% request.updated | html %]">[% request.updated | $KohaDates %]</span></td>
Lines 154-159 Link Here
154
                            <fieldset class="rows">
155
                            <fieldset class="rows">
155
                                <legend id="library_legend">Details from library</legend>
156
                                <legend id="library_legend">Details from library</legend>
156
                                <ol>
157
                                <ol>
158
                                    [% type = request.get_type %]
157
                                    <li>
159
                                    <li>
158
                                        <label for="request_id">Request ID:</label>
160
                                        <label for="request_id">Request ID:</label>
159
                                        [% request.id | html %]
161
                                        [% request.id | html %]
Lines 178-184 Link Here
178
                                    </li>
180
                                    </li>
179
                                    <li>
181
                                    <li>
180
                                        <label for="medium">Request type:</label>
182
                                        <label for="medium">Request type:</label>
181
                                        [% request.getType | html %]
183
                                        [% type ? type : '<span>N/A</span>' | html %]
182
                                    </li>
184
                                    </li>
183
                                    <li>
185
                                    <li>
184
                                        <label for="placed">Request placed:</label>
186
                                        <label for="placed">Request placed:</label>
(-)a/t/db_dependent/Illrequests.t (-5 / +4 lines)
Lines 85-92 subtest 'Basic object tests' => sub { Link Here
85
    is($illrq_obj->backend, $illrq->{backend},
85
    is($illrq_obj->backend, $illrq->{backend},
86
       "Backend getter works.");
86
       "Backend getter works.");
87
87
88
    is($illrq_obj->getType, '<span>N/A</span>',
88
    is($illrq_obj->get_type, '<span>N/A</span>',
89
        'getType() returns placeholder if no type is set');
89
        'get_type() returns placeholder if no type is set');
90
    $builder->build({
90
    $builder->build({
91
        source => 'Illrequestattribute',
91
        source => 'Illrequestattribute',
92
        value  => {
92
        value  => {
Lines 95-102 subtest 'Basic object tests' => sub { Link Here
95
            value => 'book'
95
            value => 'book'
96
        }
96
        }
97
    });
97
    });
98
    is($illrq_obj->getType, 'book',
98
    is($illrq_obj->get_type, 'book',
99
        'getType() returns correct type if set');
99
        'get_type() returns correct type if set');
100
100
101
    isnt($illrq_obj->status, 'COMP',
101
    isnt($illrq_obj->status, 'COMP',
102
         "ILL is not currently marked complete.");
102
         "ILL is not currently marked complete.");
103
- 

Return to bug 20941