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