Lines 26-31
use C4::Auth qw/:DEFAULT get_session/;
Link Here
|
26 |
use C4::Koha; |
26 |
use C4::Koha; |
27 |
use Koha::BiblioFrameworks; |
27 |
use Koha::BiblioFrameworks; |
28 |
use Koha::Libraries; |
28 |
use Koha::Libraries; |
|
|
29 |
use Koha::Desks; |
29 |
|
30 |
|
30 |
my $query = CGI->new(); |
31 |
my $query = CGI->new(); |
31 |
|
32 |
|
Lines 42-48
my $sessionID = $query->cookie("CGISESSID");
Link Here
|
42 |
my $session = get_session($sessionID); |
43 |
my $session = get_session($sessionID); |
43 |
|
44 |
|
44 |
my $branch = $query->param('branch' ); |
45 |
my $branch = $query->param('branch' ); |
|
|
46 |
my $desk_id = $query->param('desk_id'); |
45 |
my $userenv_branch = C4::Context->userenv->{'branch'} || ''; |
47 |
my $userenv_branch = C4::Context->userenv->{'branch'} || ''; |
|
|
48 |
my $userenv_desk = C4::Context->userenv->{'desk_id'} || ''; |
46 |
my @updated; |
49 |
my @updated; |
47 |
|
50 |
|
48 |
# $session lddines here are doing the updating |
51 |
# $session lddines here are doing the updating |
Lines 56-66
if ( $branch and my $library = Koha::Libraries->find($branch) ) {
Link Here
|
56 |
$session->flush(); |
59 |
$session->flush(); |
57 |
push @updated, { |
60 |
push @updated, { |
58 |
updated_branch => 1, |
61 |
updated_branch => 1, |
59 |
old_branch => $userenv_branch, |
62 |
old_branch => $userenv_branch, |
60 |
}; |
63 |
}; |
61 |
} # else branch the same, no update |
64 |
} # else branch the same, no update |
|
|
65 |
if ( !$userenv_desk or $userenv_desk ne $desk_id ) { |
66 |
my $desk = Koha::Desks->find( { desk_id => $desk_id } ); |
67 |
my $old_desk_name = ''; |
68 |
if ($userenv_desk) { |
69 |
$old_desk_name = Koha::Desks->find( { desk_id => $userenv_desk })->desk_name; |
70 |
} |
71 |
$template->param( LoginDeskname => $desk->desk_name ); |
72 |
$template->param( LoginDeskid => $desk->desk_id ); |
73 |
$session->param( desk_name => $desk->desk_name ); |
74 |
$session->param( desk_id => $desk->desk_id ); |
75 |
push @updated, { |
76 |
updated_desk => 1, |
77 |
old_desk => $old_desk_name, |
78 |
}; |
79 |
} |
62 |
} else { |
80 |
} else { |
63 |
$branch = $userenv_branch; # fallback value |
81 |
$branch = $userenv_branch; # fallback value |
|
|
82 |
$desk_id = $userenv_desk; |
64 |
} |
83 |
} |
65 |
|
84 |
|
66 |
$template->param(updated => \@updated) if (scalar @updated); |
85 |
$template->param(updated => \@updated) if (scalar @updated); |
Lines 87-92
if (scalar @updated and not scalar @recycle_loop) {
Link Here
|
87 |
$template->param( |
106 |
$template->param( |
88 |
referer => $referer, |
107 |
referer => $referer, |
89 |
branch => $branch, |
108 |
branch => $branch, |
|
|
109 |
desk_id => $desk_id, |
90 |
recycle_loop=> \@recycle_loop, |
110 |
recycle_loop=> \@recycle_loop, |
91 |
); |
111 |
); |
92 |
|
112 |
|