|
Lines 428-433
sub NewSuggestion {
Link Here
|
| 428 |
|
428 |
|
| 429 |
$suggestion->{STATUS} = "ASKED" unless $suggestion->{STATUS}; |
429 |
$suggestion->{STATUS} = "ASKED" unless $suggestion->{STATUS}; |
| 430 |
|
430 |
|
|
|
431 |
for my $field ( qw( |
| 432 |
suggestedby |
| 433 |
managedby |
| 434 |
manageddate |
| 435 |
acceptedby |
| 436 |
accepteddate |
| 437 |
rejectedby |
| 438 |
rejecteddate |
| 439 |
) ) { |
| 440 |
# Set the fields to NULL if not given. |
| 441 |
# Be careful, the following should *not* be //= |
| 442 |
$suggestion->{$field} ||= undef; |
| 443 |
} |
| 444 |
|
| 431 |
my $rs = Koha::Database->new->schema->resultset('Suggestion'); |
445 |
my $rs = Koha::Database->new->schema->resultset('Suggestion'); |
| 432 |
return $rs->create($suggestion)->id; |
446 |
return $rs->create($suggestion)->id; |
| 433 |
} |
447 |
} |
|
Lines 456-461
sub ModSuggestion {
Link Here
|
| 456 |
}; |
470 |
}; |
| 457 |
$status_update_table = 0 if( $@ ); |
471 |
$status_update_table = 0 if( $@ ); |
| 458 |
|
472 |
|
|
|
473 |
for my $field ( qw( |
| 474 |
suggestedby |
| 475 |
managedby |
| 476 |
manageddate |
| 477 |
acceptedby |
| 478 |
accepteddate |
| 479 |
rejectedby |
| 480 |
rejecteddate |
| 481 |
) ) { |
| 482 |
# Set the fields to NULL if not given. |
| 483 |
# Be careful, the following should *not* be //= |
| 484 |
$suggestion->{$field} ||= undef; |
| 485 |
} |
| 486 |
|
| 459 |
if ( $suggestion->{STATUS} ) { |
487 |
if ( $suggestion->{STATUS} ) { |
| 460 |
|
488 |
|
| 461 |
# fetch the entire updated suggestion so that we can populate the letter |
489 |
# fetch the entire updated suggestion so that we can populate the letter |