Forcing desktop view for mobile device users

We’ve got a couple of “power users” who use mobile devices but want the full RT desktop web site UI experience. They’ve got the link on the mobile UI to switch to the desktop view, but they were complaining about having to do that on each session.

I therefore create a new user preference to determine whether to decided to use the Mobile UI automatically, or force the desktop layout. It seems to be working for our chaps, so I thought other RT sites might find it useful. I’ve submitted a patch to Best Practical, which you can grab from:

https://rt.bestpractical.com/Ticket/Display.html?id=35210

3 Likes

thanks @GreenJimll this is absolutely usefull !

1 Like

Hi.

When I try to login and enter not correct pass (for example), I see error in log:

[5091] [Thu Sep 26 11:17:04 2019] [warning]: Use of uninitialized value in concatenation (.) or string at /opt/rt4/sbin/…/lib/RT/CurrentUser.pm line 163. (/opt/rt4/sbin/…/lib/RT/CurrentUser.pm:163)
[5091] [Thu Sep 26 11:17:04 2019] [error]: Couldn’t load from the users database. (/opt/rt4/sbin/…/lib/RT/CurrentUser.pm:163)

In /NoAuth/Login.html and /index.html replace

my $user = $session{'CurrentUser'}->UserObj;
$choice = $user->Preferences('MobileUI') || 'Automatic';

with

if($session{‘CurrentUser’}->Id) {
my $user = $session{‘CurrentUser’}->UserObj;
$choice = $user->Preferences(‘MobileUI’) || ‘Automatic’;
}

1 Like