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

(-)a/C4/CourseReserves.pm (-3 / +3 lines)
Lines 604-610 sub _ModStoredFields { Link Here
604
    my ( @fields_to_update, @values_to_update );
604
    my ( @fields_to_update, @values_to_update );
605
605
606
    foreach (@FIELDS) {
606
    foreach (@FIELDS) {
607
        if ( $params{$_} ) {
607
        if ( defined($params{$_}) ) {
608
            push( @fields_to_update, $_ );
608
            push( @fields_to_update, $_ );
609
            push( @values_to_update, $params{$_} );
609
            push( @values_to_update, $params{$_} );
610
        }
610
        }
Lines 670-678 sub _SwapAllFields { Link Here
670
    my %course_item_fields;
670
    my %course_item_fields;
671
    my %item_fields;
671
    my %item_fields;
672
    foreach (@FIELDS) {
672
    foreach (@FIELDS) {
673
        if ( $course_item->{$_} ) {
673
        if ( defined( $course_item->{$_} ) ) {
674
            $course_item_fields{$_} = $course_item->{$_};
674
            $course_item_fields{$_} = $course_item->{$_};
675
            $item_fields{$_}        = $item->{$_};
675
            $item_fields{$_}        = $item->{$_} || q{};
676
        }
676
        }
677
    }
677
    }
678
678
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt (-4 / +4 lines)
Lines 39-45 Link Here
39
                            <option value="">LEAVE UNCHANGED</option>
39
                            <option value="">LEAVE UNCHANGED</option>
40
40
41
                            [% FOREACH it IN itypes %]
41
                            [% FOREACH it IN itypes %]
42
                                [% IF course_item.itype && ( ( course.enabled == 'yes' && it.itemtype == item.itype ) || ( course.enabled == 'no' && it.itemtype == course_item.itype ) ) %]
42
                                [% IF course_item.itype.defined && ( ( course.enabled == 'yes' && it.itemtype == item.itype ) || ( course.enabled == 'no' && it.itemtype == course_item.itype ) ) %]
43
                                    <option value="[% it.itemtype | html %]" selected="selected">[% it.description | html %]</option>
43
                                    <option value="[% it.itemtype | html %]" selected="selected">[% it.description | html %]</option>
44
                                [% ELSE %]
44
                                [% ELSE %]
45
                                    <option value="[% it.itemtype | html %]">[% it.description | html %]</option>
45
                                    <option value="[% it.itemtype | html %]">[% it.description | html %]</option>
Lines 55-61 Link Here
55
                            <option value="">LEAVE UNCHANGED</option>
55
                            <option value="">LEAVE UNCHANGED</option>
56
56
57
                            [% FOREACH c IN ccodes %]
57
                            [% FOREACH c IN ccodes %]
58
                                [% IF course_item.ccode && ( ( course.enabled == 'yes' && c.authorised_value == item.ccode ) || ( course.enabled == 'no' && c.authorised_value == course_item.ccode ) ) %]
58
                                [% IF course_item.ccode.defined && ( ( course.enabled == 'yes' && c.authorised_value == item.ccode ) || ( course.enabled == 'no' && c.authorised_value == course_item.ccode ) ) %]
59
                                    <option value="[% c.authorised_value | html %]" selected="selected">[% c.lib | html %]</option>
59
                                    <option value="[% c.authorised_value | html %]" selected="selected">[% c.lib | html %]</option>
60
                                [% ELSE %]
60
                                [% ELSE %]
61
                                    <option value="[% c.authorised_value | html %]">[% c.lib | html %]</option>
61
                                    <option value="[% c.authorised_value | html %]">[% c.lib | html %]</option>
Lines 70-76 Link Here
70
                            <option value="">LEAVE UNCHANGED</option>
70
                            <option value="">LEAVE UNCHANGED</option>
71
71
72
                            [% FOREACH s IN locations %]
72
                            [% FOREACH s IN locations %]
73
                                [% IF course_item.location && ( ( course.enabled == 'yes' && s.authorised_value == item.location ) || ( course.enabled == 'no' && s.authorised_value == course_item.location ) ) %]
73
                                [% IF course_item.location.defined && ( ( course.enabled == 'yes' && s.authorised_value == item.location ) || ( course.enabled == 'no' && s.authorised_value == course_item.location ) ) %]
74
                                    <option value="[% s.authorised_value | html %]" selected="selected">[% s.lib | html %]</option>
74
                                    <option value="[% s.authorised_value | html %]" selected="selected">[% s.lib | html %]</option>
75
                                [% ELSE %]
75
                                [% ELSE %]
76
                                    <option value="[% s.authorised_value | html %]">[% s.lib | html %]</option>
76
                                    <option value="[% s.authorised_value | html %]">[% s.lib | html %]</option>
Lines 84-90 Link Here
84
                        <select id="holdingbranch" name="holdingbranch">
84
                        <select id="holdingbranch" name="holdingbranch">
85
                            <option value="">LEAVE UNCHANGED</option>
85
                            <option value="">LEAVE UNCHANGED</option>
86
                            [% FOREACH b IN Branches.all() %]
86
                            [% FOREACH b IN Branches.all() %]
87
                                [% IF course_item.holdingbranch && ( ( course.enabled == 'yes' && b.branchcode == item.holdingbranch ) || ( course.enabled == 'no' && b.branchcode == course_item.holdingbranch ) ) %]
87
                                [% IF course_item.holdingbranch.defined && ( ( course.enabled == 'yes' && b.value == item.holdingbranch ) || ( course.enabled == 'no' && b.value == course_item.holdingbranch ) ) %]
88
                                    <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
88
                                    <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
89
                                [% ELSE %]
89
                                [% ELSE %]
90
                                    <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
90
                                    <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt (-5 / +4 lines)
Lines 84-90 Link Here
84
                            <td>[% cr.item.itemcallnumber | html %]</td>
84
                            <td>[% cr.item.itemcallnumber | html %]</td>
85
                            [% IF item_level_itypes %]
85
                            [% IF item_level_itypes %]
86
                            <td>
86
                            <td>
87
                                [% IF cr.course_item.itype %]
87
                                [% IF cr.course_item.itype.defined %]
88
                                    [% IF cr.course_item.enabled == 'yes' %]
88
                                    [% IF cr.course_item.enabled == 'yes' %]
89
                                        [% ItemTypes.GetDescription( cr.item.itype ) | html %]
89
                                        [% ItemTypes.GetDescription( cr.item.itype ) | html %]
90
                                    [% ELSE %]
90
                                    [% ELSE %]
Lines 99-105 Link Here
99
                            </td>
99
                            </td>
100
                            [% END %]
100
                            [% END %]
101
                            <td>
101
                            <td>
102
                                 [% IF cr.course_item.ccode %]
102
                                 [% IF cr.course_item.ccode.defined %]
103
                                     [% IF cr.course_item.enabled == 'yes' %]
103
                                     [% IF cr.course_item.enabled == 'yes' %]
104
                                          [% AuthorisedValues.GetByCode( 'CCODE', cr.item.ccode ) | html %]
104
                                          [% AuthorisedValues.GetByCode( 'CCODE', cr.item.ccode ) | html %]
105
                                     [% ELSE %]
105
                                     [% ELSE %]
Lines 113-119 Link Here
113
                                 [% END %]
113
                                 [% END %]
114
                            </td>
114
                            </td>
115
                            <td>
115
                            <td>
116
                                [% IF cr.course_item.location %]
116
                                [% IF cr.course_item.location.defined %]
117
                                     [% IF cr.course_item.enabled == 'yes' %]
117
                                     [% IF cr.course_item.enabled == 'yes' %]
118
                                         [% AuthorisedValues.GetByCode( 'LOC', cr.item.location ) | html %]
118
                                         [% AuthorisedValues.GetByCode( 'LOC', cr.item.location ) | html %]
119
                                    [% ELSE %]
119
                                    [% ELSE %]
Lines 127-133 Link Here
127
                                [% END %]
127
                                [% END %]
128
                            </td>
128
                            </td>
129
                            <td>
129
                            <td>
130
                                [% IF cr.course_item.holdingbranch %]
130
                                [% IF cr.course_item.holdingbranch.defined %]
131
                                    [% IF cr.course_item.enabled == 'yes' %]
131
                                    [% IF cr.course_item.enabled == 'yes' %]
132
                                        [% Branches.GetName( cr.item.holdingbranch ) | html %]
132
                                        [% Branches.GetName( cr.item.holdingbranch ) | html %]
133
                                    [% ELSE %]
133
                                    [% ELSE %]
134
- 

Return to bug 10382