[Bps-public-commit] r19094 - in RT-Extension-MergeUsers/trunk: html/Callbacks/RT-Extension-MergeUsers/Admin/Users/Modify.html

falcone at bestpractical.com falcone at bestpractical.com
Tue Apr 7 17:30:43 EDT 2009


Author: falcone
Date: Tue Apr  7 17:30:35 2009
New Revision: 19094

Modified:
   RT-Extension-MergeUsers/trunk/   (props changed)
   RT-Extension-MergeUsers/trunk/html/Callbacks/RT-Extension-MergeUsers/Admin/Users/Modify.html/RightColumnBottom

Log:
 r46250 at ketch:  falcone | 2009-04-07 17:08:21 -0400
 * handle unmerging users from the main user page


Modified: RT-Extension-MergeUsers/trunk/html/Callbacks/RT-Extension-MergeUsers/Admin/Users/Modify.html/RightColumnBottom
==============================================================================
--- RT-Extension-MergeUsers/trunk/html/Callbacks/RT-Extension-MergeUsers/Admin/Users/Modify.html/RightColumnBottom	(original)
+++ RT-Extension-MergeUsers/trunk/html/Callbacks/RT-Extension-MergeUsers/Admin/Users/Modify.html/RightColumnBottom	Tue Apr  7 17:30:35 2009
@@ -49,11 +49,19 @@
 <&| /Widgets/TitleBox, title => loc('Merge user') &>
 <p class="error"><% $result %></p>
 % my ($EffectiveId) = $UserObj->Attributes->Named("EffectiveId");
+% my $MergedUsers = $UserObj->FirstAttribute('MergedUsers');
 % if ($EffectiveId) {
 This user has been merged with <a href="Modify.html?id=<% $EffectiveId->Content %>">
 % my $real = RT::User->new($session{'CurrentUser'});
 % $real->Load($EffectiveId->Content);
 <% $real->EmailAddress %></a>; <input type="submit" name="Unmerge" value="Unmerge" />
+% } elsif ($MergedUsers) {
+The following users have been merged into this user:<br>
+%   foreach my $user_id (@{$MergedUsers->Content}) {
+%       my $user = RT::User->new($session{'CurrentUser'});
+%       $user->LoadOriginal(Id => $user_id);
+<% $user->EmailAddress %><input type="submit" name="Unmerge<%$user_id%>" value="Unmerge"><br>
+%   }
 % } else {
 Merge this user into: <input name="MergeUser" value="" />
 % }
@@ -63,7 +71,15 @@
 if ($MergeUser) {
     ($id, $result) = $UserObj->MergeInto($MergeUser);
 } elsif ($Unmerge) {
-    $UserObj->UnMerge();
+    ($id, $result) = $UserObj->UnMerge();
+}
+
+foreach my $key (keys %ARGS) {
+    if ($key =~ /Unmerge(\d+)/) {
+        my $merged_user = RT::User->new($session{'CurrentUser'});
+        $merged_user->LoadOriginal( id => $1 );
+        ($id, $result) = $merged_user->UnMerge()
+    }
 }
 </%init>
 <%args>



More information about the Bps-public-commit mailing list