-# Replace the template values with the real ones
-# If we have independent branches on we need to only let the user set holidays for their branch
-# (except if the user is superlibrarian, in which case he can choose the branch anyway)
-if ( C4::Context->preference("IndependantBranches") && !(C4::Context->userenv->{'flags'} % 2) ) {
- $template->param(BRANCHES => C4::Context->userenv->{'branchname'}."<input type='hidden' id='branch' value='".C4::Context->userenv->{'branch'}."'>");
-}
-else {
- $template->param(BRANCHES => $branchesList);
-}
-$template->param(WEEK_DAYS_LOOP => \@week_days);
-$template->param(HOLIDAYS_LOOP => \@holidays);
-$template->param(EXCEPTION_HOLIDAYS_LOOP => \@exception_holidays);
-$template->param(DAY_MONTH_HOLIDAYS_LOOP => \@day_month_holidays);
-$template->param(branch => $branch);
+$template->param(WEEK_DAYS_LOOP => \@week_days,
+ branchloop => \@branchloop,
+ HOLIDAYS_LOOP => \@holidays,
+ EXCEPTION_HOLIDAYS_LOOP => \@exception_holidays,
+ DAY_MONTH_HOLIDAYS_LOOP => \@day_month_holidays,
+ calendardate => $calendardate,
+ keydate => $keydate,
+ branchcodes => $branchcodes,
+ branch => $branch
+ );