[Rt-commit] rt branch, 4.4/tweak-request-user-info-update-portlet, created. rt-4.4.3-183-g7c26029a7

? sunnavy sunnavy at bestpractical.com
Fri Jan 4 16:40:35 EST 2019


The branch, 4.4/tweak-request-user-info-update-portlet has been created
        at  7c26029a79de78f1d7aabea00e776a6a7587e4b7 (commit)

- Log -----------------------------------------------------------------
commit 93928117ab818c4658da9498fd1d994647983fea
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Jan 5 04:43:12 2019 +0800

    Rename $SelfServiceRequestUpdatePortlet to $SelfServiceRequestUpdateQueue
    
    This is to hard-code the queue that stores user info update requests in
    config.  Empty $SelfServiceRequestUpdateQueue means to disable this
    feature.

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 6daff76fd..938e15874 100644
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1867,17 +1867,17 @@ all of their stored RT user information.
 
 Set($SelfServiceUserPrefs, 'edit-prefs');
 
-=item C<$SelfServiceRequestUpdatePortlet>
+=item C<$SelfServiceRequestUpdateQueue>
 
-Set this to 1 to allow Self Service users to request updates to
-their RT user information. When enabled, this portlet adds a quick
-ticket create portlet to the Self Service preferences page. This
-option is only available when $SelfServiceUserPrefs is set to
-'view-info' or 'edit-prefs-view-info'.
+Set this to the name of the queue where to store tickets of updating
+user infomation requests for Self Service users. Once it's set, a quick
+ticket create portlet will show up on Preferences page.  This option is
+only available when $SelfServiceUserPrefs is set to 'view-info' or
+'edit-prefs-view-info'.
 
 =cut
 
-Set($SelfServiceRequestUpdatePortlet, 0);
+Set($SelfServiceRequestUpdateQueue, undef);
 
 =item C<$SelfServiceDownloadUserData>
 
diff --git a/share/html/SelfService/Elements/RequestUpdate b/share/html/SelfService/Elements/RequestUpdate
index 538c417d5..7f6b9b7ff 100644
--- a/share/html/SelfService/Elements/RequestUpdate
+++ b/share/html/SelfService/Elements/RequestUpdate
@@ -58,10 +58,6 @@ action="<%RT->Config->Get('WebPath')%><% $r->path_info %>"
             <td class="label"><&|/l&>Subject</&>:</td>
             <td colspan="3" class="value"><input type="text" size="50" name="Subject" value="<% $args->{Subject} || '' %>" /></td>
         </tr>
-        <tr class="input-row">
-            <td class="label"><&|/l&>Queue</&>:</td>
-            <td class="value"><& /Elements/SelectNewTicketQueue, Name => 'Queue', Default => $args->{Queue} &></td>
-        </tr>
         <tr>
             <td class="label"><&|/l&>Requestors</&>:</td>
             <td colspan="3" class="value"><& /Elements/EmailInput, Name => 'Requestors', Size => '40', Default => $args->{Requestors} || $session{CurrentUser}->EmailAddress &></td>
diff --git a/share/html/SelfService/Prefs.html b/share/html/SelfService/Prefs.html
index 19644c981..e34e10603 100644
--- a/share/html/SelfService/Prefs.html
+++ b/share/html/SelfService/Prefs.html
@@ -88,7 +88,7 @@
 % }
 % if ( $pref eq 'view-info' || $pref eq 'edit-prefs-view-info' ) {
 <& /Prefs/Elements/ShowAboutMe, UserObj => $user &>
-%    if ( $request_portlet ) {
+%    if ( $request_queue->id ) {
 <& Elements/RequestUpdate, User=> $user &>
 %    }
 % }
@@ -104,7 +104,14 @@ my $user = $session{'CurrentUser'}->UserObj;
 my $password = [ qw(CurrentPass NewPass1 NewPass2) ];
 
 my $pref = RT->Config->Get( 'SelfServiceUserPrefs' ) || '';
-my $request_portlet = RT->Config->Get( 'SelfServiceRequestUpdatePortlet' );
+my $request_queue = RT::Queue->new( $session{CurrentUser} );
+
+if ( my $queue_name = RT->Config->Get('SelfServiceRequestUpdateQueue') ) {
+    $request_queue->Load($queue_name);
+    unless ( $request_queue->id ) {
+        RT->Logger->error("Couldn't load $queue_name");
+    }
+}
 
 if ( $pref eq 'edit-prefs' || $pref eq 'edit-prefs-view-info' || $pref eq 'full-edit' ) {
 
@@ -151,9 +158,14 @@ if ( $pref eq 'edit-prefs' || $pref eq 'edit-prefs-view-info' || $pref eq 'full-
     }
 }
 
-if ( $request_portlet ) {
+
+if ( $request_queue->id ) {
     my $path = RT->Config->Get('WebPath') . '/SelfService/Prefs.html';
-    push @results, ProcessQuickCreate( Path => $path, ARGSRef => \%ARGS );
+    push @results,
+      ProcessQuickCreate(
+        Path    => $path,
+        ARGSRef => { %ARGS, Queue => $request_queue->id },
+      );
 }
 
 #A hack to make sure that session gets rewritten.

commit dced3e6705f517e2604919b51552a622694280ea
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Jan 5 04:50:13 2019 +0800

    Always set requestor to current user for user info update requests

diff --git a/share/html/SelfService/Elements/RequestUpdate b/share/html/SelfService/Elements/RequestUpdate
index 7f6b9b7ff..08b8d52fd 100644
--- a/share/html/SelfService/Elements/RequestUpdate
+++ b/share/html/SelfService/Elements/RequestUpdate
@@ -58,10 +58,6 @@ action="<%RT->Config->Get('WebPath')%><% $r->path_info %>"
             <td class="label"><&|/l&>Subject</&>:</td>
             <td colspan="3" class="value"><input type="text" size="50" name="Subject" value="<% $args->{Subject} || '' %>" /></td>
         </tr>
-        <tr>
-            <td class="label"><&|/l&>Requestors</&>:</td>
-            <td colspan="3" class="value"><& /Elements/EmailInput, Name => 'Requestors', Size => '40', Default => $args->{Requestors} || $session{CurrentUser}->EmailAddress &></td>
-        </tr>
         <tr class="input-row">
             <td class="labeltop"><&|/l&>Description</&>:</td>
             <td colspan="3" class="value"><textarea name="Content" cols="50" rows="3"><% $args->{Content} || ''%></textarea></td>
diff --git a/share/html/SelfService/Prefs.html b/share/html/SelfService/Prefs.html
index e34e10603..7b6f79987 100644
--- a/share/html/SelfService/Prefs.html
+++ b/share/html/SelfService/Prefs.html
@@ -164,7 +164,7 @@ if ( $request_queue->id ) {
     push @results,
       ProcessQuickCreate(
         Path    => $path,
-        ARGSRef => { %ARGS, Queue => $request_queue->id },
+        ARGSRef => { %ARGS, Queue => $request_queue->id, Requestors => $session{CurrentUser}->EmailAddress },
       );
 }
 

commit 1a3dc0997b1cf68a9d3033c1524b93d22d447976
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Jan 5 05:03:09 2019 +0800

    Set a sensible default subject for user info update requests

diff --git a/share/html/SelfService/Elements/RequestUpdate b/share/html/SelfService/Elements/RequestUpdate
index 08b8d52fd..24a9f0a55 100644
--- a/share/html/SelfService/Elements/RequestUpdate
+++ b/share/html/SelfService/Elements/RequestUpdate
@@ -56,7 +56,7 @@ action="<%RT->Config->Get('WebPath')%><% $r->path_info %>"
     <table>
         <tr class="input-row">
             <td class="label"><&|/l&>Subject</&>:</td>
-            <td colspan="3" class="value"><input type="text" size="50" name="Subject" value="<% $args->{Subject} || '' %>" /></td>
+            <td colspan="3" class="value"><input type="text" size="50" name="Subject" value="<% $args->{Subject} || loc('Please update my user information') %>" /></td>
         </tr>
         <tr class="input-row">
             <td class="labeltop"><&|/l&>Description</&>:</td>

commit a8fdcc2f5a099e43c6f08bd7304565383ef573a8
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Jan 5 05:01:52 2019 +0800

    Tweak portlet title to "Request user information update"

diff --git a/share/html/SelfService/Elements/RequestUpdate b/share/html/SelfService/Elements/RequestUpdate
index 24a9f0a55..7bfa3bfba 100644
--- a/share/html/SelfService/Elements/RequestUpdate
+++ b/share/html/SelfService/Elements/RequestUpdate
@@ -46,7 +46,7 @@
 %#
 %# END BPS TAGGED BLOCK }}}
 <div class="quick-create">
-<&| /Widgets/TitleBox, title => loc('Update my user information request') &>
+<&| /Widgets/TitleBox, title => loc('Request user information update') &>
 <div><&|/l&>Please indicate which user fields you would like updated</&></div>
 <form method="post"
 action="<%RT->Config->Get('WebPath')%><% $r->path_info %>"

commit 7c26029a79de78f1d7aabea00e776a6a7587e4b7
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Jan 5 05:19:06 2019 +0800

    Update GDPR doc for the feature of SelfServiceRequestUpdateQueue

diff --git a/docs/GDPR.pod b/docs/GDPR.pod
index 41ffa6563..ce973f8dc 100644
--- a/docs/GDPR.pod
+++ b/docs/GDPR.pod
@@ -28,8 +28,13 @@ see and modify their full user record at Logged in as > Settings > About Me.
 Unprivileged users will interact with RT via the Self Service interface or through email only.
 These users are typically customers and will have much less default access in RT. Since there
 are many different relationships with end users, RT offers several different options to
-allow Self Service users to view and edit their user data. All of the options below also
-require the users to have the ModifySelf right.
+allow Self Service users to view and edit their user data. All of the options below except
+C<view-info> also require the users to have the ModifySelf right.
+
+For options C<view-info> and C<edit-prefs-view-info>, Self Service users
+can request user infomation updates by creating tickets on Preferences
+page, the queue of these tickets is set in
+L<RT_Config/SelfServiceRequestUpdateQueue>.
 
 L<RT_Config/SelfServiceUserPrefs> has the following options:
 

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


More information about the rt-commit mailing list