Bugzilla – Attachment 79114 Details for
Bug 10382
collection and location not returning to null when removed from course reserves
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10382 - collection not returning to null when removed from course reserves
Bug-10382---collection-not-returning-to-null-when-.patch (text/plain), 7.85 KB, created by
ByWater Sandboxes
on 2018-09-19 14:34:20 UTC
(
hide
)
Description:
Bug 10382 - collection not returning to null when removed from course reserves
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2018-09-19 14:34:20 UTC
Size:
7.85 KB
patch
obsolete
>From 52807718f1d0269b4d3c5f76626a7d1afad05046 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 5 Jun 2013 10:01:17 -0400 >Subject: [PATCH] Bug 10382 - collection not returning to null when removed > from course reserves > >Test Plan: >1) Create an item, do not set a collection code >2) Add the item to a course, and choose to set a collection code >3) Ensure the course is enabled, and the collection code is now visible >4) Disable the course, ensure the collection code is no longer visible > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> > >Signed-off-by: Spencer <ssmith3@mckinneytexas.org> >--- > C4/CourseReserves.pm | 6 +++--- > .../prog/en/modules/course_reserves/add_items-step2.tt | 8 ++++---- > .../prog/en/modules/course_reserves/course-details.tt | 8 ++++---- > 3 files changed, 11 insertions(+), 11 deletions(-) > >diff --git a/C4/CourseReserves.pm b/C4/CourseReserves.pm >index 3a3f422a96..19ed685c3c 100644 >--- a/C4/CourseReserves.pm >+++ b/C4/CourseReserves.pm >@@ -604,7 +604,7 @@ sub _ModStoredFields { > my ( @fields_to_update, @values_to_update ); > > foreach (@FIELDS) { >- if ( $params{$_} ) { >+ if ( defined($params{$_}) ) { > push( @fields_to_update, $_ ); > push( @values_to_update, $params{$_} ); > } >@@ -670,9 +670,9 @@ sub _SwapAllFields { > my %course_item_fields; > my %item_fields; > foreach (@FIELDS) { >- if ( $course_item->{$_} ) { >+ if ( defined( $course_item->{$_} ) ) { > $course_item_fields{$_} = $course_item->{$_}; >- $item_fields{$_} = $item->{$_}; >+ $item_fields{$_} = $item->{$_} || q{}; > } > } > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt >index 02a531c294..0d9359e2c4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt >@@ -39,7 +39,7 @@ > <option value="">LEAVE UNCHANGED</option> > > [% FOREACH it IN itypes %] >- [% IF course_item.itype && ( ( course.enabled == 'yes' && it.itemtype == item.itype ) || ( course.enabled == 'no' && it.itemtype == course_item.itype ) ) %] >+ [% IF course_item.itype.defined && ( ( course.enabled == 'yes' && it.itemtype == item.itype ) || ( course.enabled == 'no' && it.itemtype == course_item.itype ) ) %] > <option value="[% it.itemtype | html %]" selected="selected">[% it.description | html %]</option> > [% ELSE %] > <option value="[% it.itemtype | html %]">[% it.description | html %]</option> >@@ -55,7 +55,7 @@ > <option value="">LEAVE UNCHANGED</option> > > [% FOREACH c IN ccodes %] >- [% IF course_item.ccode && ( ( course.enabled == 'yes' && c.authorised_value == item.ccode ) || ( course.enabled == 'no' && c.authorised_value == course_item.ccode ) ) %] >+ [% IF course_item.ccode.defined && ( ( course.enabled == 'yes' && c.authorised_value == item.ccode ) || ( course.enabled == 'no' && c.authorised_value == course_item.ccode ) ) %] > <option value="[% c.authorised_value | html %]" selected="selected">[% c.lib | html %]</option> > [% ELSE %] > <option value="[% c.authorised_value | html %]">[% c.lib | html %]</option> >@@ -70,7 +70,7 @@ > <option value="">LEAVE UNCHANGED</option> > > [% FOREACH s IN locations %] >- [% IF course_item.location && ( ( course.enabled == 'yes' && s.authorised_value == item.location ) || ( course.enabled == 'no' && s.authorised_value == course_item.location ) ) %] >+ [% IF course_item.location.defined && ( ( course.enabled == 'yes' && s.authorised_value == item.location ) || ( course.enabled == 'no' && s.authorised_value == course_item.location ) ) %] > <option value="[% s.authorised_value | html %]" selected="selected">[% s.lib | html %]</option> > [% ELSE %] > <option value="[% s.authorised_value | html %]">[% s.lib | html %]</option> >@@ -84,7 +84,7 @@ > <select id="holdingbranch" name="holdingbranch"> > <option value="">LEAVE UNCHANGED</option> > [% FOREACH b IN Branches.all() %] >- [% IF course_item.holdingbranch && ( ( course.enabled == 'yes' && b.branchcode == item.holdingbranch ) || ( course.enabled == 'no' && b.branchcode == course_item.holdingbranch ) ) %] >+ [% IF course_item.holdingbranch.defined && ( ( course.enabled == 'yes' && b.value == item.holdingbranch ) || ( course.enabled == 'no' && b.value == course_item.holdingbranch ) ) %] > <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option> > [% ELSE %] > <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt >index f43eb90df9..f762e6c03f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt >@@ -84,7 +84,7 @@ > <td>[% cr.item.itemcallnumber | html %]</td> > [% IF item_level_itypes %] > <td> >- [% IF cr.course_item.itype %] >+ [% IF cr.course_item.itype.defined %] > [% IF cr.course_item.enabled == 'yes' %] > [% ItemTypes.GetDescription( cr.item.itype ) | html %] > [% ELSE %] >@@ -99,7 +99,7 @@ > </td> > [% END %] > <td> >- [% IF cr.course_item.ccode %] >+ [% IF cr.course_item.ccode.defined %] > [% IF cr.course_item.enabled == 'yes' %] > [% AuthorisedValues.GetByCode( 'CCODE', cr.item.ccode ) | html %] > [% ELSE %] >@@ -113,7 +113,7 @@ > [% END %] > </td> > <td> >- [% IF cr.course_item.location %] >+ [% IF cr.course_item.location.defined %] > [% IF cr.course_item.enabled == 'yes' %] > [% AuthorisedValues.GetByCode( 'LOC', cr.item.location ) | html %] > [% ELSE %] >@@ -127,7 +127,7 @@ > [% END %] > </td> > <td> >- [% IF cr.course_item.holdingbranch %] >+ [% IF cr.course_item.holdingbranch.defined %] > [% IF cr.course_item.enabled == 'yes' %] > [% Branches.GetName( cr.item.holdingbranch ) | html %] > [% ELSE %] >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10382
:
18674
|
19611
|
60947
|
60948
|
60979
|
61814
|
61815
|
61816
|
63531
|
72022
|
79030
|
79031
|
79032
|
79114
|
79115
|
79116
|
79207
|
79208
|
79209
|
79722
|
79723
|
79724
|
80007
|
80008
|
80009