[Koha-patches] [PATCH 09/11] (MT #3651) Fills "book fund" combobox with bugdets and fix some bugs of research by filter.
Henri-Damien LAURENT
henridamien.laurent at biblibre.com
Thu Jun 24 19:26:19 CEST 2010
From: Alex Arnaud <alex.arnaud at biblibre.com>
---
.../prog/en/modules/suggestion/suggestion.tmpl | 10 ++++----
suggestion/suggestion.pl | 25 +++++++++++++++++--
2 files changed, 27 insertions(+), 8 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tmpl
index 74cc5fb..694002a 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tmpl
@@ -304,20 +304,20 @@ h4.collapse a { font-size : 80%; text-decoration: none; } fieldset.brief ol { di
<!-- TMPL_LOOP name="suggestedby_loop" --><!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR name="code" -->" selected="selected"><!-- TMPL_VAR name="desc" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR name="code" -->"><!-- TMPL_VAR name="desc" --></option><!-- /TMPL_IF --><!-- /TMPL_LOOP -->
</select></li>
<li><label for="suggesteddate"> Suggested on:</label><!--TMPL_VAR Name="suggesteddate"--></li>
- <li><label for="suggestionmanagedby"> Managed by:</label><select id="suggestionmanagedby" name="suggestionmanagedby"><option value="">Any</option>
+ <li><label for="managedby"> Managed by:</label><select id="managedby" name="managedby"><option value="">Any</option>
<!-- TMPL_LOOP name="managedby_loop" --><!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR name="code" -->" selected="selected"><!-- TMPL_VAR name="desc" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR name="code" -->"><!-- TMPL_VAR name="desc" --></option><!-- /TMPL_IF --><!-- /TMPL_LOOP -->
</select></li>
<li><label for="manageddate"> Management date:</label><!--TMPL_VAR Name="manageddate"--></li>
- <li><label for="suggestionacceptedby"> Accepted by:</label><select id="suggestionacceptedby" name="suggestionacceptedby"><option value="">Any</option>
+ <li><label for="acceptedby"> Accepted by:</label><select id="acceptedby" name="acceptedby"><option value="">Any</option>
<!-- TMPL_LOOP name="acceptedby_loop" --><!-- TMPL_IF NAME="selected" --> <option value="<!-- TMPL_VAR name="code" -->" selected="selected"><!-- TMPL_VAR name="desc" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR name="code" -->"><!-- TMPL_VAR name="desc" --></option><!-- /TMPL_IF --><!-- /TMPL_LOOP -->
</select></li>
<li><label for="accepteddate"> Accepted on:</label><!--TMPL_VAR Name="accepteddate"--></li><li><input type="submit" value="Go" /></li></ol>
</fieldset>
<fieldset class="brief"><h4 class="collapse"><a href="#">Acquistion information</a></h4>
- <ol><li><label for="bookfundid"> Book fund:</label>
- <select name="bookfundid" id="bookfundid"><option value="">Any</option><!-- TMPL_LOOP name="bookfundsloop" -->
- <!-- TMPL_IF NAME="selected" --> <option value="<!-- TMPL_VAR name="bookfundid" -->" selected="selected"><!-- TMPL_VAR name="bookfundname" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR name="bookfundid" -->"><!-- TMPL_VAR name="bookfundname" --></option><!-- /TMPL_IF -->
+ <ol><li><label for="budgetid"> Book fund:</label>
+ <select name="budgetid" id="budgetid"><option value="">Any</option><!-- TMPL_LOOP name="budgetid_loop" -->
+ <!-- TMPL_IF NAME="selected" --> <option value="<!-- TMPL_VAR name="code" -->" selected="selected"><!-- TMPL_VAR name="desc" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR name="code" -->"><!-- TMPL_VAR name="desc" --></option><!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
</select></li>
<li><label for="branchcode"> For:</label>
diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl
index 68f35be..c744dc4 100755
--- a/suggestion/suggestion.pl
+++ b/suggestion/suggestion.pl
@@ -57,9 +57,13 @@ sub GetCriteriumDesc{
if ($displayby =~/managedby/||$displayby =~/acceptedby/){
my $borr=C4::Members::GetMember(borrowernumber=>$criteriumvalue);
return "" unless $borr;
-# warn '$borr : ',Data::Dumper::Dumper($borr);
- return $$borr{firstname}.", ".$$borr{surname};
- }
+ return $$borr{firstname} . ", " . $$borr{surname};
+ }
+ if ( $displayby =~ /budgetid/) {
+ my $budget = GetBudget($criteriumvalue);
+ return "" unless $budget;
+ return $$budget{budget_name};
+ }
}
my $input = CGI->new;
@@ -161,11 +165,21 @@ if ($op=~/else/) {
my $reasonsloop = GetAuthorisedValues("SUGGEST");
foreach my $criteriumvalue (map{$$_{'value'}} @$criteria_list){
my $definedvalue = defined $$suggestion_ref{$displayby} && $$suggestion_ref{$displayby} ne "";
+<<<<<<< HEAD
next if ($definedvalue && $$suggestion_ref{$displayby} ne $criteriumvalue);
$$suggestion_ref{$displayby}=$criteriumvalue;
# warn $$suggestion_ref{$displayby}."=$criteriumvalue; $displayby";
+=======
+
+ next if ( $definedvalue && $$suggestion_ref{$displayby} ne $criteriumvalue );
+ $$suggestion_ref{$displayby} = $criteriumvalue;
+
+ # warn $$suggestion_ref{$displayby}."=$criteriumvalue; $displayby";
+ #warn "===========================================";
+ #warn Data::Dumper::Dumper($suggestion_ref);
+>>>>>>> (MT #3651) Fills "book fund" combobox with bugdets and fix some bugs of research by filter.
my $suggestions = &SearchSuggestion($suggestion_ref);
foreach my $suggestion (@$suggestions){
$suggestion->{budget_name}=GetBudget($suggestion->{budgetid})->{budget_name} if $suggestion->{budgetid};
@@ -265,8 +279,13 @@ foreach my $budget (@$budgets){
$template->param( budgetsloop => $budgets);
+<<<<<<< HEAD
my %hashlists;
foreach my $field qw(managedby acceptedby suggestedby STATUS){
+=======
+my %hashlists;
+foreach my $field qw(managedby acceptedby suggestedby budgetid STATUS) {
+>>>>>>> (MT #3651) Fills "book fund" combobox with bugdets and fix some bugs of research by filter.
my $values_list;
$values_list=GetDistinctValues("suggestions.".$field) ;
my @codes_list = map{
--
1.7.0.4
More information about the Koha-patches
mailing list