|
Lines 28-33
use C4::Output;
Link Here
|
| 28 |
use C4::Dates qw(format_date format_date_in_iso); |
28 |
use C4::Dates qw(format_date format_date_in_iso); |
| 29 |
use C4::Debug; |
29 |
use C4::Debug; |
| 30 |
use C4::Letters; |
30 |
use C4::Letters; |
|
|
31 |
use Koha::DateUtils qw( dt_from_string ); |
| 32 |
|
| 31 |
use List::MoreUtils qw(any); |
33 |
use List::MoreUtils qw(any); |
| 32 |
use C4::Dates qw(format_date_in_iso); |
34 |
use C4::Dates qw(format_date_in_iso); |
| 33 |
use base qw(Exporter); |
35 |
use base qw(Exporter); |
|
Lines 428-433
sub NewSuggestion {
Link Here
|
| 428 |
|
430 |
|
| 429 |
$suggestion->{STATUS} = "ASKED" unless $suggestion->{STATUS}; |
431 |
$suggestion->{STATUS} = "ASKED" unless $suggestion->{STATUS}; |
| 430 |
|
432 |
|
|
|
433 |
for my $field ( qw( |
| 434 |
suggestedby |
| 435 |
managedby |
| 436 |
manageddate |
| 437 |
acceptedby |
| 438 |
accepteddate |
| 439 |
rejectedby |
| 440 |
rejecteddate |
| 441 |
) ) { |
| 442 |
# Set the fields to NULL if not given. |
| 443 |
$suggestion->{$field} ||= undef; |
| 444 |
} |
| 445 |
|
| 446 |
$suggestion->{suggesteddate} = dt_from_string unless $suggestion->{suggesteddate}; |
| 447 |
|
| 431 |
my $rs = Koha::Database->new->schema->resultset('Suggestion'); |
448 |
my $rs = Koha::Database->new->schema->resultset('Suggestion'); |
| 432 |
return $rs->create($suggestion)->id; |
449 |
return $rs->create($suggestion)->id; |
| 433 |
} |
450 |
} |
|
Lines 456-461
sub ModSuggestion {
Link Here
|
| 456 |
}; |
473 |
}; |
| 457 |
$status_update_table = 0 if( $@ ); |
474 |
$status_update_table = 0 if( $@ ); |
| 458 |
|
475 |
|
|
|
476 |
for my $field ( qw( |
| 477 |
suggestedby |
| 478 |
managedby |
| 479 |
manageddate |
| 480 |
acceptedby |
| 481 |
accepteddate |
| 482 |
rejectedby |
| 483 |
rejecteddate |
| 484 |
) ) { |
| 485 |
# Set the fields to NULL if not given. |
| 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 |