From b904347142e812c70a578e00ae3e0c4dc293f83c Mon Sep 17 00:00:00 2001 From: Garry Collum Date: Thu, 30 Jul 2009 19:16:41 -0400 Subject: [PATCH] Bug 3452: Additional patch that expands the branch name and category code in Suggestions Management. Displays the Branch name and Category description along with their codes in Suggestion Management. Also since I joined to the branches table the 'map' function in opac-suggestions.pl to retrieve the branchname was no longer necessary. Signed-off-by: Galen Charlton --- C4/Suggestions.pm | 14 ++++++++++++-- .../prog/en/modules/suggestion/acceptorreject.tmpl | 7 +++---- .../prog/en/modules/opac-suggestions.tmpl | 2 +- opac/opac-suggestions.pl | 1 - 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm index dceea5ccb7..491739c1f9 100644 --- a/C4/Suggestions.pm +++ b/C4/Suggestions.pm @@ -90,17 +90,23 @@ sub SearchSuggestion { my $query = " SELECT suggestions.*, U1.branchcode AS branchcodesuggestedby, + B1.branchname AS branchnamesuggestedby, U1.surname AS surnamesuggestedby, U1.firstname AS firstnamesuggestedby, U1.borrowernumber AS borrnumsuggestedby, U1.categorycode AS categorycodesuggestedby, + C1.description AS categorydescriptionsuggestedby, U2.branchcode AS branchcodemanagedby, + B2.branchname AS branchnamemanagedby, U2.surname AS surnamemanagedby, U2.firstname AS firstnamemanagedby, U2.borrowernumber AS borrnummanagedby FROM suggestions LEFT JOIN borrowers AS U1 ON suggestedby=U1.borrowernumber LEFT JOIN borrowers AS U2 ON managedby=U2.borrowernumber + LEFT JOIN categories AS C1 ON C1.categorycode = U1.categorycode + LEFT JOIN branches AS B1 ON B1.branchcode = U1.branchcode + LEFT JOIN branches AS B2 ON B2.branchcode = U2.branchcode WHERE 1=1 "; my @sql_params; @@ -226,15 +232,19 @@ sub GetSuggestionByStatus { my $query = qq(SELECT suggestions.*, U1.surname AS surnamesuggestedby, U1.firstname AS firstnamesuggestedby, - U1.branchcode AS branchcodesuggestedby, + U1.branchcode AS branchcodesuggestedby, + B1.branchname AS branchnamesuggestedby, U1.borrowernumber AS borrnumsuggestedby, U1.categorycode AS categorycodesuggestedby, + C1.description AS categorydescriptionsuggestedby, U2.surname AS surnamemanagedby, U2.firstname AS firstnamemanagedby, - U2.borrowernumber AS borrnummanagedby + U2.borrowernumber AS borrnummanagedby FROM suggestions LEFT JOIN borrowers AS U1 ON suggestedby=U1.borrowernumber LEFT JOIN borrowers AS U2 ON managedby=U2.borrowernumber + LEFT JOIN categories AS C1 ON C1.categorycode=U1.categorycode + LEFT JOIN branches AS B1 on B1.branchcode = U1.branchcode WHERE status = ?); if (C4::Context->preference("IndependantBranches") || $branchcode) { my $userenv = C4::Context->userenv; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/acceptorreject.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/acceptorreject.tmpl index c3aa93d257..6cc5cbe2ff 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/acceptorreject.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/acceptorreject.tmpl @@ -153,11 +153,10 @@ ; ISBN : ; Published by in in
- "> - , + ">,
- Branch:
- Category: + ()
+ () diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tmpl index addc4ec7bc..aaba1eb130 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tmpl @@ -131,7 +131,7 @@ $.tablesorter.addParser({ -   +   ,   diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl index 838cd05a7a..a12826aa61 100755 --- a/opac/opac-suggestions.pl +++ b/opac/opac-suggestions.pl @@ -97,7 +97,6 @@ if ( $op eq "delete_confirm" ) { my $suggestions_loop = &SearchSuggestion( $borrowernumber, $author, $title, $publishercode, $status, $suggestedbyme ); -map{ $_->{'branchcodesuggestedby'}=GetBranchInfo($_->{'branchcodesuggestedby'})->[0]->{'branchname'}} @$suggestions_loop; foreach my $suggestion(@$suggestions_loop) { if($suggestion->{'suggestedby'} == $borrowernumber) { -- 2.39.5