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