Lines 45-51
use C4::Biblio;
Link Here
|
45 |
use C4::Items; |
45 |
use C4::Items; |
46 |
use C4::Members; |
46 |
use C4::Members; |
47 |
use C4::Members::Messaging; |
47 |
use C4::Members::Messaging; |
48 |
use C4::Branch; # GetBranches |
|
|
49 |
use C4::Koha; # FIXME : is it still useful ? |
48 |
use C4::Koha; # FIXME : is it still useful ? |
50 |
use C4::RotatingCollections; |
49 |
use C4::RotatingCollections; |
51 |
use Koha::DateUtils; |
50 |
use Koha::DateUtils; |
Lines 83-89
if ( $query->param('print_slip') ) {
Link Here
|
83 |
|
82 |
|
84 |
##################### |
83 |
##################### |
85 |
#Global vars |
84 |
#Global vars |
86 |
my $branches = GetBranches(); |
|
|
87 |
my $printers = GetPrinters(); |
85 |
my $printers = GetPrinters(); |
88 |
my $userenv = C4::Context->userenv; |
86 |
my $userenv = C4::Context->userenv; |
89 |
my $userenv_branch = $userenv->{'branch'} // ''; |
87 |
my $userenv_branch = $userenv->{'branch'} // ''; |
Lines 401-407
if ( $messages->{'WrongTransfer'} and not $messages->{'WasTransfered'}) {
Link Here
|
401 |
); |
399 |
); |
402 |
|
400 |
|
403 |
my $reserve = $messages->{'ResFound'}; |
401 |
my $reserve = $messages->{'ResFound'}; |
404 |
my $branchname = $branches->{ $reserve->{'branchcode'} }->{'branchname'}; |
|
|
405 |
my $borr = C4::Members::GetMember( borrowernumber => $reserve->{'borrowernumber'} ); |
402 |
my $borr = C4::Members::GetMember( borrowernumber => $reserve->{'borrowernumber'} ); |
406 |
my $name = $borr->{'surname'} . ", " . $borr->{'title'} . " " . $borr->{'firstname'}; |
403 |
my $name = $borr->{'surname'} . ", " . $borr->{'title'} . " " . $borr->{'firstname'}; |
407 |
$template->param( |
404 |
$template->param( |
Lines 427-433
if ( $messages->{'WrongTransfer'} and not $messages->{'WasTransfered'}) {
Link Here
|
427 |
# |
424 |
# |
428 |
if ( $messages->{'ResFound'}) { |
425 |
if ( $messages->{'ResFound'}) { |
429 |
my $reserve = $messages->{'ResFound'}; |
426 |
my $reserve = $messages->{'ResFound'}; |
430 |
my $branchname = $branches->{ $reserve->{'branchcode'} }->{'branchname'}; |
|
|
431 |
my $borr = C4::Members::GetMember( borrowernumber => $reserve->{'borrowernumber'} ); |
427 |
my $borr = C4::Members::GetMember( borrowernumber => $reserve->{'borrowernumber'} ); |
432 |
my $holdmsgpreferences = C4::Members::Messaging::GetMessagingPreferences( { borrowernumber => $reserve->{'borrowernumber'}, message_name => 'Hold_Filled' } ); |
428 |
my $holdmsgpreferences = C4::Members::Messaging::GetMessagingPreferences( { borrowernumber => $reserve->{'borrowernumber'}, message_name => 'Hold_Filled' } ); |
433 |
if ( $reserve->{'ResFound'} eq "Waiting" or $reserve->{'ResFound'} eq "Reserved" ) { |
429 |
if ( $reserve->{'ResFound'} eq "Waiting" or $reserve->{'ResFound'} eq "Reserved" ) { |
Lines 447-454
if ( $messages->{'ResFound'}) {
Link Here
|
447 |
# same params for Waiting or Reserved |
443 |
# same params for Waiting or Reserved |
448 |
$template->param( |
444 |
$template->param( |
449 |
found => 1, |
445 |
found => 1, |
450 |
currentbranch => $branches->{$userenv_branch}->{'branchname'}, |
446 |
destbranchname => $reserve->{'branchcode'}, |
451 |
destbranchname => $branches->{ $reserve->{'branchcode'} }->{'branchname'}, |
|
|
452 |
name => $borr->{'surname'} . ", " . $borr->{'title'} . " " . $borr->{'firstname'}, |
447 |
name => $borr->{'surname'} . ", " . $borr->{'title'} . " " . $borr->{'firstname'}, |
453 |
borfirstname => $borr->{'firstname'}, |
448 |
borfirstname => $borr->{'firstname'}, |
454 |
borsurname => $borr->{'surname'}, |
449 |
borsurname => $borr->{'surname'}, |
Lines 485-491
foreach my $code ( keys %$messages ) {
Link Here
|
485 |
elsif ( $code eq 'NotIssued' ) { |
480 |
elsif ( $code eq 'NotIssued' ) { |
486 |
$err{notissued} = 1; |
481 |
$err{notissued} = 1; |
487 |
$err{msg} = ''; |
482 |
$err{msg} = ''; |
488 |
$err{msg} = $branches->{ $messages->{'IsPermanent'} }->{'branchname'} if $messages->{'IsPermanent'}; |
483 |
$err{msg} = $messages->{'IsPermanent'} if $messages->{'IsPermanent'}; |
489 |
} |
484 |
} |
490 |
elsif ( $code eq 'LocalUse' ) { |
485 |
elsif ( $code eq 'LocalUse' ) { |
491 |
$err{localuse} = 1; |
486 |
$err{localuse} = 1; |
Lines 512-519
foreach my $code ( keys %$messages ) {
Link Here
|
512 |
elsif ( ( $code eq 'IsPermanent' ) && ( not $messages->{'ResFound'} ) ) { |
507 |
elsif ( ( $code eq 'IsPermanent' ) && ( not $messages->{'ResFound'} ) ) { |
513 |
if ( $messages->{'IsPermanent'} ne $userenv_branch ) { |
508 |
if ( $messages->{'IsPermanent'} ne $userenv_branch ) { |
514 |
$err{ispermanent} = 1; |
509 |
$err{ispermanent} = 1; |
515 |
$err{msg} = |
510 |
$err{msg} = $messages->{'IsPermanent'}; |
516 |
$branches->{ $messages->{'IsPermanent'} }->{'branchname'}; |
|
|
517 |
} |
511 |
} |
518 |
} |
512 |
} |
519 |
elsif ( $code eq 'WrongTransfer' ) { |
513 |
elsif ( $code eq 'WrongTransfer' ) { |
Lines 617-634
foreach ( sort { $a <=> $b } keys %returneditems ) {
Link Here
|
617 |
} |
611 |
} |
618 |
push @riloop, \%ri; |
612 |
push @riloop, \%ri; |
619 |
} |
613 |
} |
620 |
my ($genbrname, $genprname); |
614 |
|
621 |
if (my $b = $branches->{$userenv_branch}) { |
|
|
622 |
$genbrname = $b->{'branchname'}; |
623 |
} |
624 |
if (my $p = $printers->{$printer}) { |
625 |
$genprname = $p->{'printername'}; |
626 |
} |
627 |
$template->param( |
615 |
$template->param( |
628 |
riloop => \@riloop, |
616 |
riloop => \@riloop, |
629 |
genbrname => $genbrname, |
|
|
630 |
genprname => $genprname, |
631 |
branchname => $genbrname, |
632 |
printer => $printer, |
617 |
printer => $printer, |
633 |
errmsgloop => \@errmsgloop, |
618 |
errmsgloop => \@errmsgloop, |
634 |
exemptfine => $exemptfine, |
619 |
exemptfine => $exemptfine, |