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 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 368-376 Item types administration Link Here
368
        <table id="table_item_type">
369
        <table id="table_item_type">
369
          <thead>
370
          <thead>
370
            [% UNLESS Koha.Preference('noItemTypeImages') %]<th>Image</th>[% END %]
371
            [% UNLESS Koha.Preference('noItemTypeImages') %]<th>Image</th>[% END %]
372
            <th>Description</th>
371
            <th>Code</th>
373
            <th>Code</th>
372
            <th>Parent code</th>
374
            <th>Parent code</th>
373
            <th>Description</th>
374
            <th>Search category</th>
375
            <th>Search category</th>
375
            <th>Not for loan</th>
376
            <th>Not for loan</th>
376
            <th>Hide in OPAC</th>
377
            <th>Hide in OPAC</th>
Lines 391-396 Item types administration Link Here
391
                    </td>
392
                    </td>
392
                [% END %]
393
                [% END %]
393
            <td>
394
            <td>
395
                [% IF itemtype.parent_type %]
396
                    [% IF itemtype.parent.translated_descriptions.size %]
397
                        [% itemtype.parent.description | html %] (default)<br/>
398
                    [% ELSE %]
399
                        [% itemtype.parent.description | html %]
400
                    [% END %]
401
                    </br>
402
                    [% IF itemtype.translated_descriptions.size %]
403
                        [% itemtype.description | html %] (default)<br/>
404
                        [% FOR description IN itemtype.translated_descriptions %]
405
                            [% IF description.translation == itemtype.translated_description %]
406
                            --    <b>[% description.translation | html %]</b>
407
                            [% ELSE %]
408
                            --    [% description.translation | html %] ([% description.lang | html %])
409
                            [% END %]
410
                            <br/>
411
                        [% END %]
412
                    [% ELSE %]
413
                    --    [% itemtype.description | html %]
414
                    [% END %]
415
                [% ELSE %]
416
                    [% IF itemtype.translated_descriptions.size %]
417
                        [% itemtype.description | html %] (default)<br/>
418
                        [% FOR description IN itemtype.translated_descriptions %]
419
                            [% IF description.translation == itemtype.translated_description %]
420
                                <b>[% description.translation | html %]</b>
421
                            [% ELSE %]
422
                                [% description.translation | html %] ([% description.lang | html %])
423
                            [% END %]
424
                            <br/>
425
                        [% END %]
426
                    [% ELSE %]
427
                        [% itemtype.description | html %]
428
                    [% END %]
429
                [% END %]
430
            </td>
431
            <td>
394
              <a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&amp;itemtype=[% itemtype.itemtype | uri %]">
432
              <a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&amp;itemtype=[% itemtype.itemtype | uri %]">
395
                [% itemtype.itemtype | html %]
433
                [% itemtype.itemtype | html %]
396
              </a>
434
              </a>
Lines 398-418 Item types administration Link Here
398
            <td>
436
            <td>
399
                [% itemtype.parent_type | html %]
437
                [% itemtype.parent_type | html %]
400
            </td>
438
            </td>
401
            <td>
402
                [% IF itemtype.translated_descriptions.size %]
403
                    [% itemtype.description | html %] (default)<br/>
404
                    [% FOR description IN itemtype.translated_descriptions %]
405
                        [% IF description.translation == itemtype.translated_description %]
406
                            <b>[% description.translation | html %]</b>
407
                        [% ELSE %]
408
                            [% description.translation | html %] ([% description.lang | html %])
409
                        [% END %]
410
                        <br/>
411
                    [% END %]
412
                [% ELSE %]
413
                    [% itemtype.description | html %]
414
                [% END %]
415
            </td>
416
            <td>[% itemtype.searchcategory | html %]</td>
439
            <td>[% itemtype.searchcategory | html %]</td>
417
            <td>[% IF ( itemtype.notforloan ) %]Yes[% ELSE %]&nbsp;[% END %]</td>
440
            <td>[% IF ( itemtype.notforloan ) %]Yes[% ELSE %]&nbsp;[% END %]</td>
418
            <td>[% IF ( itemtype.hideinopac ) %]Yes[% ELSE %]&nbsp;[% END %]</td>
441
            <td>[% IF ( itemtype.hideinopac ) %]Yes[% ELSE %]&nbsp;[% END %]</td>
Lines 468-474 Item types administration Link Here
468
                "aoColumnDefs": [
491
                "aoColumnDefs": [
469
                    { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
492
                    { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
470
                ],
493
                ],
471
                "aaSorting": [[ 2, "asc" ]],
494
                "aaSorting": [[ 1, "asc" ]],
472
                "iDisplayLength": 10,
495
                "iDisplayLength": 10,
473
                "sPaginationType": "full"
496
                "sPaginationType": "full"
474
            }));
497
            }));
475
- 

Return to bug 21946