Lines 104-114
my ( $template, $borrowernumber, $cookie, $userflags ) = get_template_and_user(
Link Here
|
104 |
} |
104 |
} |
105 |
); |
105 |
); |
106 |
|
106 |
|
|
|
107 |
$borrowernumber = $input->param('borrowernumber') if ( $input->param('borrowernumber') ); |
108 |
$template->param('borrowernumber' => $borrowernumber); |
109 |
|
107 |
######################################### |
110 |
######################################### |
108 |
## Operations |
111 |
## Operations |
109 |
## |
112 |
## |
110 |
if ( $op =~ /save/i ) { |
113 |
if ( $op =~ /save/i ) { |
111 |
if ( $$suggestion_ref{"STATUS"} ) { |
114 |
if ( $$suggestion_ref{"STATUS"} ) { |
112 |
if ( my $tmpstatus = lc( $$suggestion_ref{"STATUS"} ) =~ /ACCEPTED|REJECTED/i ) { |
115 |
if ( my $tmpstatus = lc( $$suggestion_ref{"STATUS"} ) =~ /ACCEPTED|REJECTED/i ) { |
113 |
$$suggestion_ref{ lc( $$suggestion_ref{"STATUS"}) . "date" } = C4::Dates->today; |
116 |
$$suggestion_ref{ lc( $$suggestion_ref{"STATUS"}) . "date" } = C4::Dates->today; |
114 |
$$suggestion_ref{ lc( $$suggestion_ref{"STATUS"}) . "by" } = C4::Context->userenv->{number}; |
117 |
$$suggestion_ref{ lc( $$suggestion_ref{"STATUS"}) . "by" } = C4::Context->userenv->{number}; |
Lines 123-129
if ( $op =~ /save/i ) {
Link Here
|
123 |
my $suggestions_loop = |
126 |
my $suggestions_loop = |
124 |
SearchSuggestion( $suggestion_ref ); |
127 |
SearchSuggestion( $suggestion_ref ); |
125 |
if (@$suggestions_loop>=1){ |
128 |
if (@$suggestions_loop>=1){ |
126 |
#some suggestion are answering the request Donot Add |
129 |
#some suggestion are answering the request Donot Add |
127 |
} |
130 |
} |
128 |
else { |
131 |
else { |
129 |
## Adding some informations related to suggestion |
132 |
## Adding some informations related to suggestion |
Lines 134-141
if ( $op =~ /save/i ) {
Link Here
|
134 |
map{delete $$suggestion_ref{$_}} keys %$suggestion_ref; |
137 |
map{delete $$suggestion_ref{$_}} keys %$suggestion_ref; |
135 |
$op = 'else'; |
138 |
$op = 'else'; |
136 |
|
139 |
|
137 |
if( $redirect ) { |
140 |
if( $redirect eq 'purchase_suggestions' ) { |
138 |
print $input->redirect("/cgi-bin/koha/members/purchase-suggestions.pl?borrowernumber=$redirect"); |
141 |
print $input->redirect("/cgi-bin/koha/members/purchase-suggestions.pl?borrowernumber=$borrowernumber"); |
139 |
} |
142 |
} |
140 |
|
143 |
|
141 |
} |
144 |
} |
Lines 160-179
elsif ($op eq "change" ) {
Link Here
|
160 |
$$suggestion_ref{"rejecteddate"}=C4::Dates->today; |
163 |
$$suggestion_ref{"rejecteddate"}=C4::Dates->today; |
161 |
$$suggestion_ref{"rejectedby"}=C4::Context->userenv->{number}; |
164 |
$$suggestion_ref{"rejectedby"}=C4::Context->userenv->{number}; |
162 |
} |
165 |
} |
163 |
if ($$suggestion_ref{"STATUS"}){ |
166 |
if ($$suggestion_ref{"STATUS"}){ |
164 |
$$suggestion_ref{"manageddate"}=C4::Dates->today; |
167 |
$$suggestion_ref{"manageddate"}=C4::Dates->today; |
165 |
$$suggestion_ref{"managedby"}=C4::Context->userenv->{number}; |
168 |
$$suggestion_ref{"managedby"}=C4::Context->userenv->{number}; |
166 |
} |
169 |
} |
167 |
if ( my $reason = $$suggestion_ref{"reason$tabcode"}){ |
170 |
if ( my $reason = $$suggestion_ref{"reason$tabcode"}){ |
168 |
if ( $reason eq "other" ) { |
171 |
if ( $reason eq "other" ) { |
169 |
$reason = $$suggestion_ref{"other_reason$tabcode"}; |
172 |
$reason = $$suggestion_ref{"other_reason$tabcode"}; |
170 |
} |
173 |
} |
171 |
$$suggestion_ref{'reason'}=$reason; |
174 |
$$suggestion_ref{'reason'}=$reason; |
172 |
} |
175 |
} |
173 |
delete $$suggestion_ref{$_} foreach ("reason$tabcode", "other_reason$tabcode"); |
176 |
delete $$suggestion_ref{$_} foreach ("reason$tabcode", "other_reason$tabcode"); |
174 |
foreach (keys %$suggestion_ref){ |
177 |
foreach (keys %$suggestion_ref){ |
175 |
delete $$suggestion_ref{$_} unless ($$suggestion_ref{$_}); |
178 |
delete $$suggestion_ref{$_} unless ($$suggestion_ref{$_}); |
176 |
} |
179 |
} |
177 |
foreach my $suggestionid (@editsuggestions) { |
180 |
foreach my $suggestionid (@editsuggestions) { |
178 |
next unless $suggestionid; |
181 |
next unless $suggestionid; |
179 |
$$suggestion_ref{'suggestionid'}=$suggestionid; |
182 |
$$suggestion_ref{'suggestionid'}=$suggestionid; |
Lines 277-283
$template->param(
Link Here
|
277 |
|
280 |
|
278 |
if(defined($returnsuggested) and $returnsuggested ne "noone") |
281 |
if(defined($returnsuggested) and $returnsuggested ne "noone") |
279 |
{ |
282 |
{ |
280 |
print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=".$returnsuggested."#suggestions"); |
283 |
print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=".$returnsuggested."#suggestions"); |
281 |
} |
284 |
} |
282 |
|
285 |
|
283 |
#################### |
286 |
#################### |
Lines 365-377
for ( my $i = 0 ; $i < $count ; $i++ ) {
Link Here
|
365 |
my %line; |
368 |
my %line; |
366 |
$line{currcode} = $rates[$i]->{'currency'}; |
369 |
$line{currcode} = $rates[$i]->{'currency'}; |
367 |
$line{rate} = $rates[$i]->{'rate'}; |
370 |
$line{rate} = $rates[$i]->{'rate'}; |
368 |
$line{selected} = 1 if ($line{'currcode'} eq $selected_currency); |
371 |
$line{selected} = 1 if ($line{'currcode'} eq $selected_currency); |
369 |
push @loop_currency, \%line; |
372 |
push @loop_currency, \%line; |
370 |
} |
373 |
} |
371 |
$template->param( |
374 |
$template->param( |
372 |
loop_currency => \@loop_currency, |
375 |
loop_currency => \@loop_currency, |
373 |
price => sprintf("%.2f", $$suggestion_ref{'price'}||0), |
376 |
price => sprintf("%.2f", $$suggestion_ref{'price'}||0), |
374 |
total => sprintf("%.2f", $$suggestion_ref{'total'}||0), |
377 |
total => sprintf("%.2f", $$suggestion_ref{'total'}||0), |
375 |
); |
378 |
); |
376 |
|
379 |
|
377 |
# lists of distinct values (without empty) for filters |
380 |
# lists of distinct values (without empty) for filters |
Lines 389-395
foreach my $field ( qw(managedby acceptedby suggestedby budgetid) ) {
Link Here
|
389 |
} @$values_list; |
392 |
} @$values_list; |
390 |
$hashlists{ lc($field) . "_loop" } = \@codes_list; |
393 |
$hashlists{ lc($field) . "_loop" } = \@codes_list; |
391 |
} |
394 |
} |
392 |
$template->param(%hashlists); |
|
|
393 |
|
395 |
|
394 |
$template->param( |
396 |
$template->param( |
395 |
%hashlists, |
397 |
%hashlists, |
396 |
- |
|
|