Bug 4210 - Acquisitions suggestion templates have library name field, but data is not passed
Summary: Acquisitions suggestion templates have library name field, but data is not pa...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: PC All
: PATCH-Sent (DO NOT USE) minor (vote)
Assignee: Jane Wagner
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-17 07:39 UTC by Jane Wagner
Modified: 2012-10-25 23:03 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
patch file (1.26 KB, application/octet-stream)
2010-02-17 19:44 UTC, Chris Cormack
Details
patch against current head (1018 bytes, patch)
2010-02-25 18:00 UTC, Chris Cormack
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cormack 2010-05-21 01:24:26 UTC


---- Reported by jwagner@ptfs.com 2010-02-17 19:39:42 ----

The various acquisitions suggestion templates in kohaclone/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion have a line like:

Dear <!-- TMPL_VAR NAME="LibraryName" --> user,

but the LibraryName variable is not passed to the suggestions script.  I modified C4/Suggestions.pm to add it into the list being passed to the templates:

LibraryName => C4::Context->preference("LibraryName")



---- Additional Comments From jwagner@ptfs.com 2010-02-17 19:44:25 ----

Created an attachment
patch file

Patch sent February 17, 2010.



---- Additional Comments From jwagner@ptfs.com 2010-02-18 16:55:27 ----

My apologies -- I thought I was building the patch on a system updated to current head, but I wasn't.  The problem still exists at current head, but the suggestion code has changed a lot.  At first glance, I'm not sure where to do the fix.  Maybe someone from BibLibre could do it?  If not, I'll work on it when I have time and resubmit a patch.




---- Additional Comments From jwagner@ptfs.com 2010-02-25 17:42:30 ----

I think I've found the right place to fix this in current head (code has moved from Suggestions.pm to suggestion.pl).  Is adding LibraryName into this section correct?

foreach my $element qw(managedby suggestedby){
#    $debug || warn $$suggestion_ref{$element};
    if ($$suggestion_ref{$element}){
        my $member=GetMember(borrowernumber=>$$suggestion_ref{$element});
        $template->param(
            $element."_borrowernumber"=>$$member{borrowernumber},
            $element."_firstname"=>$$member{firstname},
            $element."_surname"=>$$member{surname},
            $element."_branchcode"=>$$member{branchcode},
            $element."_LibraryName"=>C4::Context->preference("LibraryName"),
            $element."_description"=>$$member{description},
            $element."_category_type"=>$$member{category_type}
        );
    }
}




---- Additional Comments From jwagner@ptfs.com 2010-02-25 17:55:51 ----

Wrong place -- thanks to hdl_laptop on the IRC.  It should be added in Suggestions.pm under the EnqueueLetter section:

        my $enqueued = C4::Letters::EnqueueLetter({
            letter=>$letter,
            borrowernumber=>$suggestion->{suggestedby},
            suggestionid=>$suggestion->{suggestionid},
            LibraryName => C4::Context->preference("LibraryName"),
            msg_transport_type=>'email'
            });
 

I'll do a patch.




---- Additional Comments From jwagner@ptfs.com 2010-02-25 18:00:54 ----

Created an attachment
patch against current head

Revised patch sent February 25, 2010.



---- Additional Comments From gmcharlt@gmail.com 2010-04-30 02:14:29 ----

Patch pushed.  Please test and close.



---- Additional Comments From jwagner@ptfs.com 2010-04-30 13:56:33 ----

I've tried testing, but I'm not now getting any emails at all from suggestions. Not sure if the problem is with the patch or with my setup.  Can someone else test?



---- Additional Comments From jwagner@ptfs.com 2010-05-12 13:54:54 ----

The fix for this bug (in ptfs-harley) can also be pulled from the public git repository at http://github.com/Koha-PTFS, branch http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=4210




--- Bug imported by chris@bigballofwax.co.nz 2010-05-21 01:24 UTC  ---

This bug was previously known as _bug_ 4210 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=4210
Imported an attachment (id=1909)
Imported an attachment (id=1910)

Unknown operating system Windows 2000. Setting to default OS "All".
Actual time not defined. Setting to 0.0
The original reporter of this bug does not have
   an account here. Reassigning to the person who moved
   it here: chris@bigballofwax.co.nz.
   Previous reporter was jwagner@ptfs.com.
The original assignee of this bug does not have
   an account here. Reassigning to the default assignee
   for the component, chris@bigballofwax.co.nz.
   Previous assignee was jwagner@ptfs.com.
Setting qa contact to the default for this product.
   This bug either had no qa contact or an invalid one.
Bug reassigned, setting status to "NEW".
   Previous status was "ASSIGNED".
The original submitter of attachment 1909 [details] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.
The original submitter of attachment 1910 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.

Comment 1 Paul Poulain 2011-04-04 09:04:37 UTC
patch already in master