Bugzilla – Attachment 107381 Details for
Bug 24279
Claims Returned does not work when set from moredetail.pl or additem.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24279: Disable editing lost status in items editor if item is a return claim
Bug-24279-Disable-editing-lost-status-in-items-edi.patch (text/plain), 5.48 KB, created by
Marcel de Rooy
on 2020-07-27 06:54:54 UTC
(
hide
)
Description:
Bug 24279: Disable editing lost status in items editor if item is a return claim
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2020-07-27 06:54:54 UTC
Size:
5.48 KB
patch
obsolete
>From d5dc773aa86a1483d68830f091683b3120654b27 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 24 Jul 2020 07:26:14 -0400 >Subject: [PATCH] Bug 24279: Disable editing lost status in items editor if > item is a return claim >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > cataloguing/additem.pl | 29 +++++++++++++--------- > .../prog/en/modules/cataloguing/additem.tt | 2 +- > 2 files changed, 18 insertions(+), 13 deletions(-) > >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index d4cee2e3f0..001d9d8c15 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -107,7 +107,7 @@ sub _increment_barcode { > > > sub generate_subfield_form { >- my ($tag, $subfieldtag, $value, $tagslib,$subfieldlib, $branches, $biblionumber, $temp, $loop_data, $i, $restrictededition) = @_; >+ my ($tag, $subfieldtag, $value, $tagslib,$subfieldlib, $branches, $biblionumber, $temp, $loop_data, $i, $restrictededition, $item) = @_; > > my $frameworkcode = &GetFrameworkCode($biblionumber); > >@@ -171,13 +171,18 @@ sub generate_subfield_form { > my %authorised_lib; > # builds list, depending on authorised value... > if ( $subfieldlib->{authorised_value} eq "LOST" ) { >- $subfield_data{IS_LOST_AV} = 1; >- push @authorised_values, qq{}; >- my $av = GetAuthorisedValues( $subfieldlib->{authorised_value} ); >- for my $r ( @$av ) { >- push @authorised_values, $r->{authorised_value}; >- $authorised_lib{$r->{authorised_value}} = $r->{lib}; >- } >+ my $ClaimReturnedLostValue = C4::Context->preference('ClaimReturnedLostValue'); >+ my $item_is_return_claim = $ClaimReturnedLostValue && $item && $item->itemlost && $ClaimReturnedLostValue eq $item->itemlost; >+ $subfield_data{IS_RETURN_CLAIM} = $item_is_return_claim; >+ >+ $subfield_data{IS_LOST_AV} = 1; >+ >+ push @authorised_values, qq{}; >+ my $av = GetAuthorisedValues( $subfieldlib->{authorised_value} ); >+ for my $r ( @$av ) { >+ push @authorised_values, $r->{authorised_value}; >+ $authorised_lib{$r->{authorised_value}} = $r->{lib}; >+ } > } > elsif ( $subfieldlib->{authorised_value} eq "branches" ) { > foreach my $thisbranch (@$branches) { >@@ -918,6 +923,8 @@ for my $library ( @$libraries ) { > $library->{selected} = 1 if $library->{branchcode} eq $branch > } > >+my $item = Koha::Items->find($itemnumber); >+ > # We generate form, from actuel record > @fields = (); > if($itemrecord){ >@@ -931,7 +938,7 @@ if($itemrecord){ > > next if ($tagslib->{$tag}->{$subfieldtag}->{'tab'} ne "10"); > >- my $subfield_data = generate_subfield_form($tag, $subfieldtag, $value, $tagslib, $subfieldlib, $libraries, $biblionumber, $temp, \@loop_data, $i, $restrictededition); >+ my $subfield_data = generate_subfield_form($tag, $subfieldtag, $value, $tagslib, $subfieldlib, $libraries, $biblionumber, $temp, \@loop_data, $i, $restrictededition, $item); > push @fields, "$tag$subfieldtag"; > push (@loop_data, $subfield_data); > $i++; >@@ -955,7 +962,7 @@ foreach my $tag ( keys %{$tagslib}){ > my @values = (undef); > @values = $itemrecord->field($tag)->subfield($subtag) if ($itemrecord && defined($itemrecord->field($tag)) && defined($itemrecord->field($tag)->subfield($subtag))); > for my $value (@values){ >- my $subfield_data = generate_subfield_form($tag, $subtag, $value, $tagslib, $tagslib->{$tag}->{$subtag}, $libraries, $biblionumber, $temp, \@loop_data, $i, $restrictededition); >+ my $subfield_data = generate_subfield_form($tag, $subtag, $value, $tagslib, $tagslib->{$tag}->{$subtag}, $libraries, $biblionumber, $temp, \@loop_data, $i, $restrictededition, $item); > push (@loop_data, $subfield_data); > $i++; > } >@@ -963,8 +970,6 @@ foreach my $tag ( keys %{$tagslib}){ > } > @loop_data = sort {$a->{subfield} cmp $b->{subfield} } @loop_data; > >-my $item = Koha::Items->find($itemnumber); # We certainly want to fetch it earlier >- > # what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit. > $template->param( > biblionumber => $biblionumber, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >index f8441919e6..19ce9aa9f4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >@@ -157,7 +157,7 @@ > [% IF ( mv.type == 'hidden' ) %] > <input type="hidden" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]"> > [% ELSIF ( mv.type == 'select' ) %] >- [% IF ( mv.readonly ) %] >+ [% IF ( mv.readonly || ite.IS_RETURN_CLAIM ) %] > <select name="field_value" id="[%- mv.id | html -%]" size="1" class="input_marceditor" readonly="readonly" disabled="disabled"> > [% ELSE %] > <select name="field_value" id="[%- mv.id | html -%]" size="1" class="input_marceditor"> >-- >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 24279
:
96683
|
96684
|
96724
|
96725
|
103597
|
103598
|
104487
|
105355
|
107286
|
107287
|
107288
|
107289
|
107290
|
107311
|
107376
|
107377
|
107378
|
107379
|
107380
| 107381