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

(-)a/C4/CourseReserves.pm (-3 / +3 lines)
Lines 605-611 sub _ModStoredFields { Link Here
605
    my ( @fields_to_update, @values_to_update );
605
    my ( @fields_to_update, @values_to_update );
606
606
607
    foreach (@FIELDS) {
607
    foreach (@FIELDS) {
608
        if ( $params{$_} ) {
608
        if ( defined($params{$_}) ) {
609
            push( @fields_to_update, $_ );
609
            push( @fields_to_update, $_ );
610
            push( @values_to_update, $params{$_} );
610
            push( @values_to_update, $params{$_} );
611
        }
611
        }
Lines 671-679 sub _SwapAllFields { Link Here
671
    my %course_item_fields;
671
    my %course_item_fields;
672
    my %item_fields;
672
    my %item_fields;
673
    foreach (@FIELDS) {
673
    foreach (@FIELDS) {
674
        if ( $course_item->{$_} ) {
674
        if ( defined( $course_item->{$_} ) ) {
675
            $course_item_fields{$_} = $course_item->{$_};
675
            $course_item_fields{$_} = $course_item->{$_};
676
            $item_fields{$_}        = $item->{$_};
676
            $item_fields{$_}        = $item->{$_} || q{};
677
        }
677
        }
678
    }
678
    }
679
679
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt (-4 / +4 lines)
Lines 38-44 Link Here
38
                            <option value="">LEAVE UNCHANGED</option>
38
                            <option value="">LEAVE UNCHANGED</option>
39
39
40
                            [% FOREACH it IN itypes %]
40
                            [% FOREACH it IN itypes %]
41
                                [% IF course_item.itype && ( ( course.enabled == 'yes' && it.itemtype == item.itype ) || ( course.enabled == 'no' && it.itemtype == course_item.itype ) ) %]
41
                                [% IF course_item.itype.defined && ( ( course.enabled == 'yes' && it.itemtype == item.itype ) || ( course.enabled == 'no' && it.itemtype == course_item.itype ) ) %]
42
                                    <option value="[% it.itemtype %]" selected="selected">[% it.description %]</option>
42
                                    <option value="[% it.itemtype %]" selected="selected">[% it.description %]</option>
43
                                [% ELSE %]
43
                                [% ELSE %]
44
                                    <option value="[% it.itemtype %]">[% it.description %]</option>
44
                                    <option value="[% it.itemtype %]">[% it.description %]</option>
Lines 54-60 Link Here
54
                            <option value="">LEAVE UNCHANGED</option>
54
                            <option value="">LEAVE UNCHANGED</option>
55
55
56
                            [% FOREACH c IN ccodes %]
56
                            [% FOREACH c IN ccodes %]
57
                                [% IF course_item.ccode && ( ( course.enabled == 'yes' && c.authorised_value == item.ccode ) || ( course.enabled == 'no' && c.authorised_value == course_item.ccode ) ) %]
57
                                [% IF course_item.ccode.defined && ( ( course.enabled == 'yes' && c.authorised_value == item.ccode ) || ( course.enabled == 'no' && c.authorised_value == course_item.ccode ) ) %]
58
                                    <option value="[% c.authorised_value %]" selected="selected">[% c.lib %]</option>
58
                                    <option value="[% c.authorised_value %]" selected="selected">[% c.lib %]</option>
59
                                [% ELSE %]
59
                                [% ELSE %]
60
                                    <option value="[% c.authorised_value %]">[% c.lib %]</option>
60
                                    <option value="[% c.authorised_value %]">[% c.lib %]</option>
Lines 69-75 Link Here
69
                            <option value="">LEAVE UNCHANGED</option>
69
                            <option value="">LEAVE UNCHANGED</option>
70
70
71
                            [% FOREACH s IN locations %]
71
                            [% FOREACH s IN locations %]
72
                                [% IF course_item.location && ( ( course.enabled == 'yes' && s.authorised_value == item.location ) || ( course.enabled == 'no' && s.authorised_value == course_item.location ) ) %]
72
                                [% IF course_item.location.defined && ( ( course.enabled == 'yes' && s.authorised_value == item.location ) || ( course.enabled == 'no' && s.authorised_value == course_item.location ) ) %]
73
                                    <option value="[% s.authorised_value %]" selected="selected">[% s.lib %]</option>
73
                                    <option value="[% s.authorised_value %]" selected="selected">[% s.lib %]</option>
74
                                [% ELSE %]
74
                                [% ELSE %]
75
                                    <option value="[% s.authorised_value %]">[% s.lib %]</option>
75
                                    <option value="[% s.authorised_value %]">[% s.lib %]</option>
Lines 83-89 Link Here
83
                        <select id="holdingbranch" name="holdingbranch">
83
                        <select id="holdingbranch" name="holdingbranch">
84
                            <option value="">LEAVE UNCHANGED</option>
84
                            <option value="">LEAVE UNCHANGED</option>
85
                            [% FOREACH b IN Branches.all() %]
85
                            [% FOREACH b IN Branches.all() %]
86
                                [% IF course_item.holdingbranch && ( ( course.enabled == 'yes' && b.value == item.holdingbranch ) || ( course.enabled == 'no' && b.value == course_item.holdingbranch ) ) %]
86
                                [% IF course_item.holdingbranch.defined && ( ( course.enabled == 'yes' && b.value == item.holdingbranch ) || ( course.enabled == 'no' && b.value == course_item.holdingbranch ) ) %]
87
                                    <option value="[% b.branchcode %]" selected="selected">[% b.branchname %]</option>
87
                                    <option value="[% b.branchcode %]" selected="selected">[% b.branchname %]</option>
88
                                [% ELSE %]
88
                                [% ELSE %]
89
                                    <option value="[% b.branchcode %]">[% b.branchname %]</option>
89
                                    <option value="[% b.branchcode %]">[% b.branchname %]</option>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt (-5 / +4 lines)
Lines 108-114 Link Here
108
                            <td>[% cr.item.itemcallnumber %]</td>
108
                            <td>[% cr.item.itemcallnumber %]</td>
109
                            [% IF item_level_itypes %]
109
                            [% IF item_level_itypes %]
110
                            <td>
110
                            <td>
111
                                [% IF cr.course_item.itype %]
111
                                [% IF cr.course_item.itype.defined %]
112
                                    [% IF cr.course_item.enabled == 'yes' %]
112
                                    [% IF cr.course_item.enabled == 'yes' %]
113
                                        [% ItemTypes.GetDescription( cr.item.itype ) %]
113
                                        [% ItemTypes.GetDescription( cr.item.itype ) %]
114
                                    [% ELSE %]
114
                                    [% ELSE %]
Lines 123-129 Link Here
123
                            </td>
123
                            </td>
124
                            [% END %]
124
                            [% END %]
125
                            <td>
125
                            <td>
126
                                 [% IF cr.course_item.ccode %]
126
                                 [% IF cr.course_item.ccode.defined %]
127
                                     [% IF cr.course_item.enabled == 'yes' %]
127
                                     [% IF cr.course_item.enabled == 'yes' %]
128
                                          [% AuthorisedValues.GetByCode( 'CCODE', cr.item.ccode ) %]
128
                                          [% AuthorisedValues.GetByCode( 'CCODE', cr.item.ccode ) %]
129
                                     [% ELSE %]
129
                                     [% ELSE %]
Lines 137-143 Link Here
137
                                 [% END %]
137
                                 [% END %]
138
                            </td>
138
                            </td>
139
                            <td>
139
                            <td>
140
                                [% IF cr.course_item.location %]
140
                                [% IF cr.course_item.location.defined %]
141
                                     [% IF cr.course_item.enabled == 'yes' %]
141
                                     [% IF cr.course_item.enabled == 'yes' %]
142
                                         [% AuthorisedValues.GetByCode( 'LOC', cr.item.location ) %]
142
                                         [% AuthorisedValues.GetByCode( 'LOC', cr.item.location ) %]
143
                                    [% ELSE %]
143
                                    [% ELSE %]
Lines 151-157 Link Here
151
                                [% END %]
151
                                [% END %]
152
                            </td>
152
                            </td>
153
                            <td>
153
                            <td>
154
                                [% IF cr.course_item.holdingbranch %]
154
                                [% IF cr.course_item.holdingbranch.defined %]
155
                                    [% IF cr.course_item.enabled == 'yes' %]
155
                                    [% IF cr.course_item.enabled == 'yes' %]
156
                                        [% Branches.GetName( cr.item.holdingbranch ) %]
156
                                        [% Branches.GetName( cr.item.holdingbranch ) %]
157
                                    [% ELSE %]
157
                                    [% ELSE %]
158
- 

Return to bug 10382