[Rt-commit] rt branch, 5.0/mobile-config-option, created. rt-5.0.0alpha1-383-g918955a057

Jim Brandt jbrandt at bestpractical.com
Thu May 7 14:16:43 EDT 2020


The branch, 5.0/mobile-config-option has been created
        at  918955a057ee375c45ab388558d460250f9753b0 (commit)

- Log -----------------------------------------------------------------
commit 918955a057ee375c45ab388558d460250f9753b0
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu May 7 14:15:01 2020 -0400

    Default mobile devices to the full RT UI
    
    Previously RT detected mobile devices and presented a
    mobile-optimized interface. RT is now responsive, so default
    mobile devices to the full UI. The new configuration option
    can be used to restore the previous behavior.

diff --git a/docs/UPGRADING-5.0 b/docs/UPGRADING-5.0
index ebe2958dd5..c9ff9d5ac6 100644
--- a/docs/UPGRADING-5.0
+++ b/docs/UPGRADING-5.0
@@ -122,6 +122,13 @@ All other dashboard menu functionality should be the same including editing
 your own menu, the global settings, and setting a user's menu from the user
 admin page for that user.
 
+=item *
+
+Accessing RT from a mobile device no longer defaults to the mobile-optimized
+interface. RT 5.0 is fully responsive so the full UI can be used on mobile
+devices. Set the configuration option C<$ShowMobileSite> to true to restore
+the previous behavior.
+
 =back
 
 =cut
diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 6834f32939..e1e86b258b 100644
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1627,6 +1627,18 @@ be overridden by users in their preferences.
 
 =cut
 
+Set($ShowMobileSite, 0);
+
+=item C<$ShowMobileSite>
+
+Starting with RT 5.0, RT's web interface is fully responsive and
+will render correctly on most mobile devices. However, RT also has
+a mobile-optimized mode that shows a limited feature set
+focused on ticket updates. To default to this site when RT is accessed
+from a mobile device, enable this option (set to 1).
+
+=cut
+
 Set($WebDefaultStylesheet, "elevator-light");
 
 =item C<$DefaultQueue>
diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index 853e05b971..4960737156 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -1856,6 +1856,9 @@ our %META;
     LogToSyslogConf => {
         Immutable     => 1,
     },
+    ShowMobileSite => {
+        Widget => '/Widgets/Form/Boolean',
+    }
 );
 my %OPTIONS = ();
 my @LOADED_CONFIGS = ();
diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index f21eaf42be..74103b03f5 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -1167,6 +1167,7 @@ sub SendStaticFile {
 sub MobileClient {
     my $self = shift;
 
+    return undef unless RT->Config->Get('ShowMobileSite');
 
 if ((RequestENV('HTTP_USER_AGENT') || '') =~ /(?:hiptop|Blazer|Novarra|Vagabond|SonyEricsson|Symbian|NetFront|UP.Browser|UP.Link|Windows CE|MIDP|J2ME|DoCoMo|J-PHONE|PalmOS|PalmSource|iPhone|iPod|AvantGo|Nokia|Android|WebOS|S60|Mobile)/io && !$HTML::Mason::Commands::session{'NotMobile'})  {
     return 1;

-----------------------------------------------------------------------


More information about the rt-commit mailing list