X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FAdmin%2FUsers%2FModify.html;h=62d828c18a4b8584d91d65e946003d7accc7a9af;hp=28d59437788007ef0d721931a7216ea4ae752f4b;hb=919e930aa9279b3c5cd12b593889cd6de79d67bf;hpb=fb4ab1073f0d15d660c6cdc4e07afebf68ef3924 diff --git a/rt/share/html/Admin/Users/Modify.html b/rt/share/html/Admin/Users/Modify.html index 28d594377..62d828c18 100755 --- a/rt/share/html/Admin/Users/Modify.html +++ b/rt/share/html/Admin/Users/Modify.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -46,11 +46,7 @@ %# %# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> -<& /Admin/Elements/UserTabs, - id => $id, - UserObj => $UserObj, - current_tab => $current_tab, - Title => $title &> +<& /Elements/Tabs &> <& /Elements/ListActions, actions => \@results &> @@ -70,37 +66,37 @@ <&|/l&>Username: - <&|/l&>(required) + <&|/l&>(required) <&|/l&>Email: - + <&|/l&>Real Name: - + <&|/l&>Nickname: - + <&|/l&>Unix login: - + <&|/l&>Language: -<& /Elements/SelectLang, Name => 'Lang', Default => $UserObj->Lang &> +<& /Elements/SelectLang, Name => 'Lang', Default => $UserObj->Lang||$Lang &> <&|/l&>Extra info: - + @@ -113,7 +109,7 @@ <&| /Widgets/TitleBox, title => loc('Access control') &> - /> + /> <&|/l&>Let this user access RT
@@ -134,39 +130,39 @@ <&|/l&>Organization: - + <&|/l&>Address1: - + <&|/l&>Address2: - + <&|/l&>City: - + <&|/l&>State: - + <&|/l&>Zip: - + <&|/l&>Country: - + @@ -176,22 +172,22 @@ <&|/l&>Residence: -
+
<&|/l&>Work: -
+
<&|/l&>Mobile: -
+
<&|/l&>Pager: -
+
@@ -207,7 +203,7 @@ % if ($UserObj->id) { <& /Elements/EditCustomField, %ARGS, Object => $UserObj, CustomField => $CF &> % } else { -<& /Elements/EditCustomField, %ARGS, NamePrefix => 'Object-RT::User-new-CustomField-', CustomField => $CF &> +<& /Elements/EditCustomField, %ARGS, NamePrefix => 'Object-RT::User--CustomField-', CustomField => $CF &> % } % } @@ -218,12 +214,12 @@ <&| /Widgets/TitleBox, title => loc('Comments about this user') &> - + %if (!$Create && $UserObj->Privileged) {
<&| /Widgets/TitleBox, title => loc('Signature') &> - + % } @@ -240,20 +236,16 @@ <%INIT> -my $current_tab; -my $UserObj = new RT::User($session{'CurrentUser'}); +my $UserObj = RT::User->new($session{'CurrentUser'}); my ($title, $PrivilegedChecked, $EnabledChecked, $Disabled, $result, @results); my ($val, $msg); if ($Create) { - $current_tab = 'Admin/Users/Modify.html?Create=1'; $title = loc("Create a new user"); } else { - $current_tab = 'Admin/Users/Modify.html?id='.$id if $id; - if ( defined $id && $id eq 'new') { ( $val, $msg ) = $UserObj->Create( Name => $Name, @@ -290,12 +282,6 @@ else { if ($val) { push @results, $msg; - foreach my $key ( keys %ARGS) { - # Convert custom fields on the "new" object to custom fields on the one we've just created - if ($key =~ /^Object-RT::User-new-CustomField-(.*)$/) { - $ARGS{'Object-RT::User-'.$val.'-CustomField-'.$1} = delete $ARGS{$key}; - } - } push @results, ProcessObjectCustomFieldUpdates( ARGSRef => \%ARGS, Object => $UserObj ); } else { push @results, loc('User could not be created: [_1]', $msg); @@ -318,6 +304,7 @@ else { } +$m->callback( %ARGS, CallbackName => 'BeforeUpdate', User => $UserObj, ARGSRef => \%ARGS, Results => \@results ); # If we have a user to modify, lets try. @@ -354,7 +341,6 @@ if ($UserObj->Id && $id ne 'new') { } - # }}} } @@ -379,13 +365,15 @@ unless ( $UserObj->id && $UserObj->Disabled ) { $EnabledChecked = 'checked="checked"'; } -if (!$Create && $UserObj->Privileged()) { +if ((!$Create && $UserObj->Privileged()) or (!$UserObj->Id and $Privileged)) { $PrivilegedChecked = 'checked="checked"'; } -# set the id, so the the menu will have the right info, this needs to -# be done here to avoid creating and then modifying a user -$id = $UserObj->Id; +# This code does automatic redirection if any updates happen. +MaybeRedirectForResults( + Actions => \@results, + Arguments => { id => $UserObj->Id }, +) if $UserObj->Id;