diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc
index ecd297c744..6f6f6704c9 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc
@@ -1,5 +1,6 @@
[% SET ClaimReturnedWarningThreshold = Koha.Preference('ClaimReturnedWarningThreshold') %]
[% SET return_claims = patron.return_claims %]
+[% SET logged_in_branchcode = Branches.GetLoggedInBranchcode() %]
[% IF ( has_modifications || warndeparture || returnbeforeexpiry || expired || patron.gonenoaddress || patron.lost || userdebarred || odues || ( return_claims.count > ClaimReturnedWarningThreshold ) || age_limitations || charges || charges_guarantors_guarantees || charges_guarantees || credits ) %]
Attention
@@ -134,7 +135,7 @@
[% SET waiting_here = 0 %]
[% SET waiting_elsewhere = 0 %]
[% FOREACH w IN waiting_recalls %]
- [% IF ( w.pickup_library_id == Branches.GetLoggedInBranchcode() ) %]
+ [% IF ( w.pickup_library_id == logged_in_branchcode ) %]
[% waiting_here = waiting_here + 1 %]
[% ELSE %]
[% waiting_elsewhere = waiting_elsewhere + 1 %]
@@ -145,7 +146,7 @@
Recalls waiting here ([% waiting_here | html %])
[% FOREACH w IN waiting_recalls %]
- [% IF ( w.pickup_library_id == Branches.GetLoggedInBranchcode() ) %]
+ [% IF ( w.pickup_library_id == logged_in_branchcode ) %]
-
[% w.biblio.title | html %]
([% ItemTypes.GetDescription( w.item.effective_itemtype ) | html %]),
@@ -167,7 +168,7 @@
Recalls waiting at other libraries ([% waiting_elsewhere | html %])
[% FOREACH w IN waiting_recalls %]
- [% IF ( w.pickup_library_id != Branches.GetLoggedInBranchcode() ) %]
+ [% IF ( w.pickup_library_id != logged_in_branchcode ) %]
-
[% w.biblio.title | html %]
([% ItemTypes.GetDescription( w.item.effective_itemtype ) | html %]),
@@ -192,7 +193,7 @@
[% SET waiting_here = 0 %]
[% SET waiting_elsewhere = 0 %]
[% FOREACH w IN WaitingHolds %]
- [% IF ( w.branch.branchcode == Branches.GetLoggedInBranchcode() ) %]
+ [% IF ( w.branch.branchcode == logged_in_branchcode ) %]
[% waiting_here = waiting_here + 1 %]
[% ELSE %]
[% waiting_elsewhere = waiting_elsewhere + 1 %]
@@ -203,7 +204,7 @@
Holds waiting here ([% waiting_here | html %])
[% FOREACH w IN WaitingHolds %]
- [% IF ( w.branch.branchcode == Branches.GetLoggedInBranchcode() ) %]
+ [% IF ( w.branch.branchcode == logged_in_branchcode ) %]
-
[% w.biblio.title | html %]
([% ItemTypes.GetDescription( w.item.effective_itemtype ) | html %]),
@@ -225,7 +226,7 @@
Holds waiting at other libraries ([% waiting_elsewhere | html %])
[% FOREACH w IN WaitingHolds %]
- [% IF ( w.branch.branchcode != Branches.GetLoggedInBranchcode() ) %]
+ [% IF ( w.branch.branchcode != logged_in_branchcode ) %]
-
[% w.biblio.title | html %]
([% ItemTypes.GetDescription( w.item.effective_itemtype ) | html %]),