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

(-)a/Koha/ItemType.pm (+13 lines)
Lines 125-130 sub may_article_request { Link Here
125
    return ( $guess->{ $itemtype // q{} } || $guess->{ '*' } ) ? 1 : q{};
125
    return ( $guess->{ $itemtype // q{} } || $guess->{ '*' } ) ? 1 : q{};
126
}
126
}
127
127
128
=head3 parent
129
130
    Returns the ItemType object of the parent_type or undef.
131
132
=cut
133
134
sub parent {
135
    my ( $self ) = @_;
136
    my $parent_rs = $self->_result->parent_type;
137
    return unless $parent_rs;
138
    return Koha::ItemType->_new_from_dbic( $parent_rs );
139
140
}
128
=head3 type
141
=head3 type
129
142
130
=cut
143
=cut
(-)a/admin/itemtypes.pl (-1 / +1 lines)
Lines 75-81 if ( $op eq 'add_form' ) { Link Here
75
} elsif ( $op eq 'add_validate' ) {
75
} elsif ( $op eq 'add_validate' ) {
76
    my $is_a_modif   = $input->param('is_a_modif');
76
    my $is_a_modif   = $input->param('is_a_modif');
77
    my $itemtype     = Koha::ItemTypes->find($itemtype_code);
77
    my $itemtype     = Koha::ItemTypes->find($itemtype_code);
78
    my $parent_type  = $input->param('parent_type');
78
    my $parent_type  = $input->param('parent_type') || undef;
79
    my $description  = $input->param('description');
79
    my $description  = $input->param('description');
80
    my $rentalcharge = $input->param('rentalcharge');
80
    my $rentalcharge = $input->param('rentalcharge');
81
    my $rentalcharge_daily = $input->param('rentalcharge_daily');
81
    my $rentalcharge_daily = $input->param('rentalcharge_daily');
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt (-18 / +40 lines)
Lines 118-123 Item types administration Link Here
118
                    <label for="parent_type">Parent item type: </label>
118
                    <label for="parent_type">Parent item type: </label>
119
                    [% IF !is_a_parent && parent_types %]
119
                    [% IF !is_a_parent && parent_types %]
120
                    <select name="parent_type" id="parent_type">
120
                    <select name="parent_type" id="parent_type">
121
                        <option value="">None</option>
121
                        [% FOREACH pt IN parent_types %]
122
                        [% FOREACH pt IN parent_types %]
122
                            [% IF parent_type == pt.itemtype %]
123
                            [% IF parent_type == pt.itemtype %]
123
                                <option value="[% pt.itemtype | html %]" selected="selected">[% pt.description | html %]</option>
124
                                <option value="[% pt.itemtype | html %]" selected="selected">[% pt.description | html %]</option>
Lines 355-363 Item types administration Link Here
355
        <table id="table_item_type">
356
        <table id="table_item_type">
356
          <thead>
357
          <thead>
357
            [% UNLESS Koha.Preference('noItemTypeImages') %]<th>Image</th>[% END %]
358
            [% UNLESS Koha.Preference('noItemTypeImages') %]<th>Image</th>[% END %]
359
            <th>Description</th>
358
            <th>Code</th>
360
            <th>Code</th>
359
            <th>Parent code</th>
361
            <th>Parent code</th>
360
            <th>Description</th>
361
            <th>Search category</th>
362
            <th>Search category</th>
362
            <th>Not for loan</th>
363
            <th>Not for loan</th>
363
            <th>Hide in OPAC</th>
364
            <th>Hide in OPAC</th>
Lines 378-383 Item types administration Link Here
378
                    </td>
379
                    </td>
379
                [% END %]
380
                [% END %]
380
            <td>
381
            <td>
382
                [% IF itemtype.parent_type %]
383
                    [% IF itemtype.parent.translated_descriptions.size %]
384
                        [% itemtype.parent.description | html %] (default)<br/>
385
                    [% ELSE %]
386
                        [% itemtype.parent.description | html %]
387
                    [% END %]
388
                    </br>
389
                    [% IF itemtype.translated_descriptions.size %]
390
                        [% itemtype.description | html %] (default)<br/>
391
                        [% FOR description IN itemtype.translated_descriptions %]
392
                            [% IF description.translation == itemtype.translated_description %]
393
                            --    <b>[% description.translation | html %]</b>
394
                            [% ELSE %]
395
                            --    [% description.translation | html %] ([% description.lang | html %])
396
                            [% END %]
397
                            <br/>
398
                        [% END %]
399
                    [% ELSE %]
400
                    --    [% itemtype.description | html %]
401
                    [% END %]
402
                [% ELSE %]
403
                    [% IF itemtype.translated_descriptions.size %]
404
                        [% itemtype.description | html %] (default)<br/>
405
                        [% FOR description IN itemtype.translated_descriptions %]
406
                            [% IF description.translation == itemtype.translated_description %]
407
                                <b>[% description.translation | html %]</b>
408
                            [% ELSE %]
409
                                [% description.translation | html %] ([% description.lang | html %])
410
                            [% END %]
411
                            <br/>
412
                        [% END %]
413
                    [% ELSE %]
414
                        [% itemtype.description | html %]
415
                    [% END %]
416
                [% END %]
417
            </td>
418
            <td>
381
              <a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&amp;itemtype=[% itemtype.itemtype | uri %]">
419
              <a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&amp;itemtype=[% itemtype.itemtype | uri %]">
382
                [% itemtype.itemtype | html %]
420
                [% itemtype.itemtype | html %]
383
              </a>
421
              </a>
Lines 385-405 Item types administration Link Here
385
            <td>
423
            <td>
386
                [% itemtype.parent_type | html %]
424
                [% itemtype.parent_type | html %]
387
            </td>
425
            </td>
388
            <td>
389
                [% IF itemtype.translated_descriptions.size %]
390
                    [% itemtype.description | html %] (default)<br/>
391
                    [% FOR description IN itemtype.translated_descriptions %]
392
                        [% IF description.translation == itemtype.translated_description %]
393
                            <b>[% description.translation | html %]</b>
394
                        [% ELSE %]
395
                            [% description.translation | html %] ([% description.lang | html %])
396
                        [% END %]
397
                        <br/>
398
                    [% END %]
399
                [% ELSE %]
400
                    [% itemtype.description | html %]
401
                [% END %]
402
            </td>
403
            <td>[% itemtype.searchcategory | html %]</td>
426
            <td>[% itemtype.searchcategory | html %]</td>
404
            <td>[% IF ( itemtype.notforloan ) %]Yes[% ELSE %]&nbsp;[% END %]</td>
427
            <td>[% IF ( itemtype.notforloan ) %]Yes[% ELSE %]&nbsp;[% END %]</td>
405
            <td>[% IF ( itemtype.hideinopac ) %]Yes[% ELSE %]&nbsp;[% END %]</td>
428
            <td>[% IF ( itemtype.hideinopac ) %]Yes[% ELSE %]&nbsp;[% END %]</td>
Lines 455-461 Item types administration Link Here
455
                "aoColumnDefs": [
478
                "aoColumnDefs": [
456
                    { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
479
                    { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
457
                ],
480
                ],
458
                "aaSorting": [[ 2, "asc" ]],
481
                "aaSorting": [[ 1, "asc" ]],
459
                "iDisplayLength": 10,
482
                "iDisplayLength": 10,
460
                "sPaginationType": "four_button"
483
                "sPaginationType": "four_button"
461
            }));
484
            }));
462
- 

Return to bug 21946