Bugzilla – Attachment 101848 Details for
Bug 24201
Attach desk to intranet session
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24201: (follow-up) Use GetLoggedInDeskName
Bug-24201-follow-up-Use-GetLoggedInDeskName.patch (text/plain), 5.94 KB, created by
Martin Renvoize (ashimema)
on 2020-03-26 13:51:32 UTC
(
hide
)
Description:
Bug 24201: (follow-up) Use GetLoggedInDeskName
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-03-26 13:51:32 UTC
Size:
5.94 KB
patch
obsolete
>From 132f1d3cbae6a1ddb9f037f3f717c6b2dfc14433 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 26 Mar 2020 13:49:57 +0000 >Subject: [PATCH] Bug 24201: (follow-up) Use GetLoggedInDeskName > >This patch updates the templates to use the new TT plugin instead of >adding additional variables to the already crouded get_template_and_user. >--- > C4/Auth.pm | 3 --- > Koha/Template/Plugin/Desks.pm | 16 ++++++++++++++++ > .../intranet-tmpl/prog/en/includes/header.inc | 10 +++++----- > 3 files changed, 21 insertions(+), 8 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 35b794c3a5..e8af5389af 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -462,7 +462,6 @@ sub get_template_and_user { > OpenLibraryCovers => C4::Context->preference("OpenLibraryCovers"), > KohaAdminEmailAddress => "" . C4::Context->preference("KohaAdminEmailAddress"), > LoginBranchcode => ( C4::Context->userenv ? C4::Context->userenv->{"branch"} : undef ), >- LoginDeskname => ( C4::Context->userenv ? C4::Context->userenv->{"desk_name"} : undef ), > LoginFirstname => ( C4::Context->userenv ? C4::Context->userenv->{"firstname"} : "Bel" ), > LoginSurname => C4::Context->userenv ? C4::Context->userenv->{"surname"} : "Inconnu", > emailaddress => C4::Context->userenv ? C4::Context->userenv->{"emailaddress"} : undef, >@@ -491,7 +490,6 @@ sub get_template_and_user { > IntranetmainUserblock => C4::Context->preference("IntranetmainUserblock"), > LibraryName => C4::Context->preference("LibraryName"), > LoginBranchname => ( C4::Context->userenv ? C4::Context->userenv->{"branchname"} : undef ), >- LoginDeskname => ( C4::Context->userenv ? C4::Context->userenv->{"desk_name"} : undef ), > advancedMARCEditor => C4::Context->preference("advancedMARCEditor"), > canreservefromotherbranches => C4::Context->preference('canreservefromotherbranches'), > intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), >@@ -560,7 +558,6 @@ sub get_template_and_user { > LibraryName => "" . C4::Context->preference("LibraryName"), > LibraryNameTitle => "" . $LibraryNameTitle, > LoginBranchname => C4::Context->userenv ? C4::Context->userenv->{"branchname"} : "", >- LoginDeskname => C4::Context->userenv ? C4::Context->userenv->{"desk_name"} : "", > OPACAmazonCoverImages => C4::Context->preference("OPACAmazonCoverImages"), > OPACFRBRizeEditions => C4::Context->preference("OPACFRBRizeEditions"), > OpacHighlightedWords => C4::Context->preference("OpacHighlightedWords"), >diff --git a/Koha/Template/Plugin/Desks.pm b/Koha/Template/Plugin/Desks.pm >index 99fe2329e3..a3be8c365f 100644 >--- a/Koha/Template/Plugin/Desks.pm >+++ b/Koha/Template/Plugin/Desks.pm >@@ -67,6 +67,22 @@ sub GetLoggedInDeskId { > ''; > } > >+=head3 GetLoggedInDeskName >+ >+[% Desks.GetLoggedInDeskName %] >+ >+Return the desk name that is attached to the session or empty string >+ >+=cut >+ >+sub GetLoggedInDeskName { >+ my ($self) = @_; >+ >+ return C4::Context->userenv ? >+ C4::Context->userenv->{'desk_name'} : >+ ''; >+} >+ > =head3 all > > [% Desks.all %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc >index 2af835004c..37b16132c8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc >@@ -89,10 +89,10 @@ > [% IF (Desks.defined) %] > <span class="separator">|</span> > <strong> >- [% IF ( LoginDeskname == '') %] >+ [% IF ( Desks.GetLoggedInDeskName == '' ) %] > <span class="logged-in-desk-name">NO DESK SET</span> > [% ELSE %] >- <span class="logged-in-desk-name">[% LoginDeskname | html %]</span> >+ <span class="logged-in-desk-name">[% Desks.GetLoggedInDeskName | html %]</span> > <span class="logged-in-desk-id content_hidden">[% Desks.GetLoggedInDeskId | html %]</span> > [% END %] > </strong> >@@ -119,10 +119,10 @@ > </li> > <li class="loggedin-menu-label"> > Desk: <br /> >- [% IF ( LoginDeskname == '' AND Desks.defined ) %] >+ [% IF ( Desks.GetLoggedInDeskName == '' AND Desks.defined ) %] > <span class="logged-in-desk-name">NO DESK SET</span> >- [% ELSIF ( LoginDeskname != '' ) %] >- <span class="logged-in-desk-name">[% LoginDeskname | html %]</span> >+ [% ELSIF ( Desks.GetLoggedInDeskName != '' ) %] >+ <span class="logged-in-desk-name">[% Desks.GetLoggedInDeskName | html %]</span> > <span class="logged-in-desk-id content_hidden">[% Desks.GetLoggedInDeskId | html %]</span> > [% END %] > </li> >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24201
:
96158
|
96164
|
96165
|
96166
|
101452
|
101564
|
101684
|
101697
|
101704
|
101705
|
101848
|
101865
|
101866
|
101877
|
101878
|
101879
|
101880
|
101881
|
101882
|
101883
|
103839
|
103840
|
105795
|
105869
|
105873
|
105874
|
105875
|
106576
|
107089
|
107090
|
107091
|
107092
|
107093
|
107094
|
107095
|
107096
|
107097
|
107667
|
107668
|
107669
|
107670
|
107671
|
107672
|
107673
|
107674
|
107675
|
107676
|
107677
|
107678
|
107679
|
107680
|
107728
|
107729
|
107730
|
107731
|
107732
|
107750
|
107751
|
107752
|
107815
|
107816
|
107817
|
107818
|
107951
|
107952
|
107967
|
107968
|
107980
|
107981