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