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