Bugzilla – Attachment 40202 Details for
Bug 14376
Allow the librarian to choose a patron when entering a purchase suggestion
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14376: Allow the librarian to choose a patron when entering a purchase suggestion.
Bug-14376-Allow-the-librarian-to-choose-a-patron-w.patch (text/plain), 6.01 KB, created by
Indranil Das Gupta
on 2015-06-16 22:46:26 UTC
(
hide
)
Description:
Bug 14376: Allow the librarian to choose a patron when entering a purchase suggestion.
Filename:
MIME Type:
Creator:
Indranil Das Gupta
Created:
2015-06-16 22:46:26 UTC
Size:
6.01 KB
patch
obsolete
>From 45555fce1838a2b7378371cbe7e1838fd63cd86d Mon Sep 17 00:00:00 2001 >From: Matthias Meusburger <matthias.meusburger@biblibre.com> >Date: Thu, 11 Jun 2015 16:42:29 +0200 >Subject: [PATCH] Bug 14376: Allow the librarian to choose a patron when > entering a purchase suggestion. > > Sometimes librarians are creating purchase suggestions that came from patrons > which didn't use the opac (but sent an email, or told the librarian verbally...) > > This patch allows the librarian to change the creator of the purchase suggestion > when entering it. > > This way, the patron will be able to receive notifications during the purchase > suggestion workflow. > > Test plan: > - Create a new suggestion > - Edit the input "By" from "Suggestion creation" > - Check that autocomplete works. > - Submit the suggestion with a user different than the logged-in librarian. > - Check that the correct user is recorded for this suggestion. > >Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com> >--- > .../prog/en/modules/suggestion/suggestion.tt | 31 +++++++++++++++++++--- > suggestion/suggestion.pl | 12 +++++++++ > 2 files changed, 39 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >index 4bd3908..9e897a5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >@@ -167,8 +167,25 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o > [% IF ( op_save ) %] > <script type="text/javascript"> > // <![CDATA[ >- $(document).ready(function() { calcNewsuggTotal(); }); >- // ]]> >+ $(document).ready(function() { >+ calcNewsuggTotal(); >+ $( "#findborrowersuggestion" ).autocomplete({ >+ source: "/cgi-bin/koha/circ/ysearch.pl", >+ minLength: 3, >+ select: function( event, ui ) { >+ $( "#findborrowersuggestion" ).val( ui.item.surname + ', ' + ui.item.firstname + ' (' + ui.item.cardnumber + ')' ); >+ $( "#suggestedby").val( ui.item.borrowernumber ); >+ return false; >+ } >+ }) >+ .data( "ui-autocomplete" )._renderItem = function( ul, item ) { >+ return $( "<li></li>" ) >+ .data( "ui-autocomplete-item", item ) >+ .append( "<a>" + item.surname + ", " + item.firstname + " (" + item.cardnumber + ") <small>" + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "</small></a>" ) >+ .appendTo( ul ); >+ }; >+ }); >+ // ]]> > </script> > [% END %] > <script type="text/javascript" src="[% themelang %]/js/acq.js"></script> >@@ -397,8 +414,14 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o > <tr> > <th><label for="suggesteddate">Suggestion creation</label> </th> > <td><input type="text" id="suggesteddate" name="suggesteddate" size="10" maxlength="10" value="[% suggesteddate | $KohaDates %]"/></td> >- <td><input type="hidden" id="suggestedby" name="suggestedby" value="[% suggestedby %]"/>[% IF ( suggestedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestedby_borrowernumber %]">[% suggestedby_surname %], [% suggestedby_firstname %]</a> [% Branches.GetName( suggestedby_branchcode ) %] ([% suggestedby_description %])[% END %] >- </td> >+ <td> >+ <div class="autocomplete"> >+ <input autocomplete="on" id="findborrowersuggestion" name="findborrowersuggestion" size="40" class="focus" type="text" [% IF ( suggestedby_borrowernumber ) %] value="[% suggestedby_surname %], [% suggestedby_firstname %] [% Branches.GetName( suggestedby_branchcode ) %] ([% suggestedby_description %])" [% END %] /> >+ <input name="branch" value="[% Branches.GetLoggedInBranchcode() %]" type="hidden" /> >+ <input name="printer" value="" type="hidden" /> >+ </div> >+ <input type="hidden" id="suggestedby" name="suggestedby" value="[% suggestedby %]"/> >+ </td> > </tr> > <tr> > <th><label for="managedon">Suggestion management</label> </th> >diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl >index 43834f6..aba43cf 100755 >--- a/suggestion/suggestion.pl >+++ b/suggestion/suggestion.pl >@@ -30,6 +30,7 @@ use C4::Budgets; > use C4::Search; > use C4::Members; > use C4::Debug; >+use C4::Log; > > use Koha::DateUtils qw( dt_from_string ); > >@@ -128,6 +129,12 @@ if ( $op =~ /save/i ) { > } > if ( $suggestion_only->{'suggestionid'} > 0 ) { > &ModSuggestion($suggestion_only); >+ my $member = GetMember(borrowernumber => $$suggestion_only{'suggestedby'}); >+ logaction('ACQUISITIONS', 'MODIFY', undef, 'Suggestion title: ' . $$suggestion_only{'title'} . ", creator: " . >+ $member->{'surname'} . ', ' . >+ $member->{'firstname'} . ' (' . >+ $member->{'cardnumber'} . ')' ); >+ > } else { > ###FIXME:Search here if suggestion already exists. > my $suggestions_loop = >@@ -143,6 +150,11 @@ if ( $op =~ /save/i ) { > else { > ## Adding some informations related to suggestion > &NewSuggestion($suggestion_only); >+ my $member = GetMember(borrowernumber => $$suggestion_only{'suggestedby'}); >+ logaction('ACQUISITIONS', 'ADD', undef, 'Suggestion title: ' . $$suggestion_only{'title'} . ", creator: " . >+ $member->{'surname'} . ', ' . >+ $member->{'firstname'} . ' (' . >+ $member->{'cardnumber'} . ')' ); > } > # empty fields, to avoid filter in "SearchSuggestion" > } >-- >1.9.1
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 14376
:
40095
|
40131
|
40181
| 40202 |
40203
|
40514