Bugzilla – Attachment 102834 Details for
Bug 23596
Add ability to modify the suggestions 'reason' field when receiving the item
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23596: Edit suggestion's reason when receiving
Bug-23596-Edit-suggestions-reason-when-receiving.patch (text/plain), 7.42 KB, created by
Katrin Fischer
on 2020-04-13 13:39:20 UTC
(
hide
)
Description:
Bug 23596: Edit suggestion's reason when receiving
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2020-04-13 13:39:20 UTC
Size:
7.42 KB
patch
obsolete
>From 2b8ec96fd323c9275c8404d1dab0982fe295da55 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 8 Nov 2019 15:50:57 +0100 >Subject: [PATCH] Bug 23596: Edit suggestion's reason when receiving >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This patch displays and let the librarian edit the suggestion.reason >information when receiving an order. > >Note that if no reason was given the edit is not possible (easily >modifiable if needed but it seems that we do not want to display too >much details unnecessarily) > >Test plan: >- Create a suggestion and fill the reason >- Create an order from this suggestion >- Close the basket and start receiving the order >=> The reason is displayed and editable >- Modify the reason and click Save >- Receive again >=> The reason has been correctly modified >- Play with the "Others..." option and give a specific reason > >Sponsored-by: BULAC - http://www.bulac.fr/ >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> >Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > acqui/finishreceive.pl | 9 ++++ > acqui/orderreceive.pl | 10 ++-- > .../prog/en/modules/acqui/orderreceive.tt | 53 +++++++++++++++++++++- > 3 files changed, 65 insertions(+), 7 deletions(-) > >diff --git a/acqui/finishreceive.pl b/acqui/finishreceive.pl >index cc0552687b..a6519703c6 100755 >--- a/acqui/finishreceive.pl >+++ b/acqui/finishreceive.pl >@@ -56,6 +56,7 @@ my $invoiceno = $invoice->{invoicenumber}; > my $booksellerid = $input->param('booksellerid'); > my $cnt = 0; > my $bookfund = $input->param("bookfund"); >+my $suggestion_id = $input->param("suggestionid"); > my $order = GetOrder($ordernumber); > my $new_ordernumber = $ordernumber; > >@@ -181,4 +182,12 @@ while ( my $item = $items->next ) { > $item->store; > } > >+if ($suggestion_id) { >+ my $reason = $input->param("reason") || ''; >+ my $other_reason = $input->param("other_reason"); >+ $reason = $other_reason if $reason eq 'other'; >+ my $suggestion = Koha::Suggestions->find($suggestion_id); >+ $suggestion->update( { reason => $reason } ) if $suggestion; >+} >+ > print $input->redirect("/cgi-bin/koha/acqui/parcel.pl?invoiceid=$invoiceid&sticky_filters=1"); >diff --git a/acqui/orderreceive.pl b/acqui/orderreceive.pl >index f676ae81f8..d73f61b6d3 100755 >--- a/acqui/orderreceive.pl >+++ b/acqui/orderreceive.pl >@@ -186,8 +186,6 @@ if( defined $order->{tax_rate_on_receiving} ) { > $tax_rate = $order->{tax_rate_on_ordering} + 0.0; > } > >-my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber}); >- > my $creator = Koha::Patrons->find( $order->{created_by} ); > > my $budget = GetBudget( $order->{budget_id} ); >@@ -252,12 +250,14 @@ $template->param( > datereceived => $datereceived, > order_internalnote => $order_internalnote, > order_vendornote => $order_vendornote, >- suggestionid => $suggestion->{suggestionid}, >- surnamesuggestedby => $suggestion->{surnamesuggestedby}, >- firstnamesuggestedby => $suggestion->{firstnamesuggestedby}, > gst_values => \@gst_values, > ); > >+my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber}); >+if ( $suggestion ) { >+ $template->param( suggestion => $suggestion ); >+} >+ > my $patron = Koha::Patrons->find( $loggedinuser )->unblessed; > my @budget_loop; > my $periods = GetBudgetPeriods( ); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >index d8972708cd..9671bfe1d6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >@@ -42,13 +42,43 @@ > </ol> > </fieldset> > >- [% IF ( suggestionid ) %] >+ [% IF suggestion %] > <fieldset class="rows"> > <legend>Suggestion</legend> > <ol> > <li> > <span class="label">Suggested by: </span> >- [% surnamesuggestedby | html %][% IF ( firstnamesuggestedby ) %], [% firstnamesuggestedby | html %][% END %] (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestionid | uri %]&op=show">suggestion #[% suggestionid | html %]</a>) >+ [% suggestion.surnamesuggestedby | html %][% IF suggestion.firstnamesuggestedby %], [% suggestion.firstnamesuggestedby | html %][% END %] (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestion.suggestionid | uri %]&op=show">suggestion #[% suggestion.suggestionid | html %]</a>) >+ [% IF suggestion.reason %] >+ <li> >+ <span class="label">Reason:</span> >+ [% SET avs = AuthorisedValues.GetAuthValueDropbox( 'SUGGEST' ) %] >+ [% SET other_reason = 1 %] >+ <select class="select-reason" id="reason" name="reason"> >+ <option value=""> -- Choose a reason -- </option> >+ [% FOREACH reason IN suggestion_reasons %] >+ [% IF reason.lib == suggestion.reason %] >+ <option value="[% reason.lib | html %]" selected="selected">[% reason.lib | html %]</option> >+ [% SET other_reason = 0 %] >+ [% ELSE %] >+ <option value="[% reason.lib | html %]">[% reason.lib | html %]</option> >+ [% END %] >+ [% END %] >+ <option value="other">Others...</option> >+ </select> >+ >+ <span id="other_reason" name="other_reason"> >+ [% IF other_reason %] >+ <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." value="[% suggestion.reason | html %]"/> >+ [% ELSE %] >+ <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." /> >+ [% END %] >+ <a href="#back">Cancel</a> >+ </span> >+ >+ <input type="hidden" name="suggestionid" value="[% suggestion.suggestionid | html %]" /> >+ </li> >+ [% END %] > </li> > </ol> > </fieldset> >@@ -469,6 +499,25 @@ > } > $("select[name='currency']").on("change", function(){update_unitprice()} ); > $("#unitprice_currency").on("change", function(){update_unitprice()} ); >+ >+ [% IF other_reason %] >+ $(".select-reason").hide(); >+ $(".select-reason").find("option[value='other']").attr("selected","selected"); >+ $("#other_reason").show(); >+ [% ELSE %] >+ $("#other_reason").hide(); >+ [% END %] >+ $(".select-reason").change(function(){ >+ if($(this).val() == "other"){ >+ $(this).hide(); >+ $("#other_reason").show(); >+ } >+ }); >+ $("a[href*=back]").click(function(){ >+ $(".select-reason").show().find("option[value='']").attr("selected","selected"); >+ $("#other_reason").hide(); >+ }); >+ > }); > </script> > [% END %] >-- >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 23596
:
95231
|
95296
|
99030
|
99032
|
99033
|
99036
|
99037
|
99116
|
102802
|
102803
| 102834 |
102835