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

(-)a/Koha/ItemType.pm (+14 lines)
Lines 139-144 sub _library_limits { Link Here
139
    };
139
    };
140
}
140
}
141
141
142
=head3 parent
143
144
    Returns the ItemType object of the parent_type or undef.
145
146
=cut
147
148
sub parent {
149
    my ( $self ) = @_;
150
    my $parent_rs = $self->_result->parent_type;
151
    return unless $parent_rs;
152
    return Koha::ItemType->_new_from_dbic( $parent_rs );
153
154
}
155
142
=head3 type
156
=head3 type
143
157
144
=cut
158
=cut
(-)a/admin/itemtypes.pl (-1 / +1 lines)
Lines 89-95 if ( $op eq 'add_form' ) { Link Here
89
} elsif ( $op eq 'add_validate' ) {
89
} elsif ( $op eq 'add_validate' ) {
90
    my $is_a_modif   = $input->param('is_a_modif');
90
    my $is_a_modif   = $input->param('is_a_modif');
91
    my $itemtype     = Koha::ItemTypes->find($itemtype_code);
91
    my $itemtype     = Koha::ItemTypes->find($itemtype_code);
92
    my $parent_type  = $input->param('parent_type');
92
    my $parent_type  = $input->param('parent_type') || undef;
93
    my $description  = $input->param('description');
93
    my $description  = $input->param('description');
94
    my $rentalcharge = $input->param('rentalcharge');
94
    my $rentalcharge = $input->param('rentalcharge');
95
    my $rentalcharge_daily = $input->param('rentalcharge_daily');
95
    my $rentalcharge_daily = $input->param('rentalcharge_daily');
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt (-18 / +40 lines)
Lines 119-124 Item types administration Link Here
119
                    <label for="parent_type">Parent item type: </label>
119
                    <label for="parent_type">Parent item type: </label>
120
                    [% IF !is_a_parent && parent_types %]
120
                    [% IF !is_a_parent && parent_types %]
121
                    <select name="parent_type" id="parent_type">
121
                    <select name="parent_type" id="parent_type">
122
                        <option value="">None</option>
122
                        [% FOREACH pt IN parent_types %]
123
                        [% FOREACH pt IN parent_types %]
123
                            [% IF parent_type == pt.itemtype %]
124
                            [% IF parent_type == pt.itemtype %]
124
                                <option value="[% pt.itemtype | html %]" selected="selected">[% pt.description | html %]</option>
125
                                <option value="[% pt.itemtype | html %]" selected="selected">[% pt.description | html %]</option>
Lines 371-379 Item types administration Link Here
371
        <table id="table_item_type">
372
        <table id="table_item_type">
372
          <thead>
373
          <thead>
373
            [% UNLESS Koha.Preference('noItemTypeImages') %]<th class="noExport">Image</th>[% END %]
374
            [% UNLESS Koha.Preference('noItemTypeImages') %]<th class="noExport">Image</th>[% END %]
375
            <th>Description</th>
374
            <th>Code</th>
376
            <th>Code</th>
375
            <th>Parent code</th>
377
            <th>Parent code</th>
376
            <th>Description</th>
377
            <th>Search category</th>
378
            <th>Search category</th>
378
            <th>Not for loan</th>
379
            <th>Not for loan</th>
379
            <th>Hide in OPAC</th>
380
            <th>Hide in OPAC</th>
Lines 395-400 Item types administration Link Here
395
                    </td>
396
                    </td>
396
                [% END %]
397
                [% END %]
397
            <td>
398
            <td>
399
                [% IF itemtype.parent_type %]
400
                    [% IF itemtype.parent.translated_descriptions.size %]
401
                        [% itemtype.parent.description | html %] (default)<br/>
402
                    [% ELSE %]
403
                        [% itemtype.parent.description | html %]
404
                    [% END %]
405
                    </br>
406
                    [% IF itemtype.translated_descriptions.size %]
407
                        [% itemtype.description | html %] (default)<br/>
408
                        [% FOR description IN itemtype.translated_descriptions %]
409
                            [% IF description.translation == itemtype.translated_description %]
410
                            --    <b>[% description.translation | html %]</b>
411
                            [% ELSE %]
412
                            --    [% description.translation | html %] ([% description.lang | html %])
413
                            [% END %]
414
                            <br/>
415
                        [% END %]
416
                    [% ELSE %]
417
                    --    [% itemtype.description | html %]
418
                    [% END %]
419
                [% ELSE %]
420
                    [% IF itemtype.translated_descriptions.size %]
421
                        [% itemtype.description | html %] (default)<br/>
422
                        [% FOR description IN itemtype.translated_descriptions %]
423
                            [% IF description.translation == itemtype.translated_description %]
424
                                <b>[% description.translation | html %]</b>
425
                            [% ELSE %]
426
                                [% description.translation | html %] ([% description.lang | html %])
427
                            [% END %]
428
                            <br/>
429
                        [% END %]
430
                    [% ELSE %]
431
                        [% itemtype.description | html %]
432
                    [% END %]
433
                [% END %]
434
            </td>
435
            <td>
398
              <a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&amp;itemtype=[% itemtype.itemtype | uri %]">
436
              <a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&amp;itemtype=[% itemtype.itemtype | uri %]">
399
                [% itemtype.itemtype | html %]
437
                [% itemtype.itemtype | html %]
400
              </a>
438
              </a>
Lines 402-422 Item types administration Link Here
402
            <td>
440
            <td>
403
                [% itemtype.parent_type | html %]
441
                [% itemtype.parent_type | html %]
404
            </td>
442
            </td>
405
            <td>
406
                [% IF itemtype.translated_descriptions.size %]
407
                    [% itemtype.description | html %] (default)<br/>
408
                    [% FOR description IN itemtype.translated_descriptions %]
409
                        [% IF description.translation == itemtype.translated_description %]
410
                            <b>[% description.translation | html %]</b>
411
                        [% ELSE %]
412
                            [% description.translation | html %] ([% description.lang | html %])
413
                        [% END %]
414
                        <br/>
415
                    [% END %]
416
                [% ELSE %]
417
                    [% itemtype.description | html %]
418
                [% END %]
419
            </td>
420
            <td>[% itemtype.searchcategory | html %]</td>
443
            <td>[% itemtype.searchcategory | html %]</td>
421
            <td>[% IF ( itemtype.notforloan ) %]Yes[% ELSE %]&nbsp;[% END %]</td>
444
            <td>[% IF ( itemtype.notforloan ) %]Yes[% ELSE %]&nbsp;[% END %]</td>
422
            <td>[% IF ( itemtype.hideinopac ) %]Yes[% ELSE %]&nbsp;[% END %]</td>
445
            <td>[% IF ( itemtype.hideinopac ) %]Yes[% ELSE %]&nbsp;[% END %]</td>
Lines 499-505 Item types administration Link Here
499
                    "aoColumnDefs": [
522
                    "aoColumnDefs": [
500
                        { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
523
                        { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
501
                    ],
524
                    ],
502
                "aaSorting": [[ 2, "asc" ]],
525
                "aaSorting": [[ 1, "asc" ]],
503
                "iDisplayLength": 10,
526
                "iDisplayLength": 10,
504
                "sPaginationType": "full"
527
                "sPaginationType": "full"
505
                }, columns_settings);
528
                }, columns_settings);
506
- 

Return to bug 21946