X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FAdmin%2FUsers%2FModify.html;h=814e7f9968850bf6a1df583de3527c1b84a5c3e4;hp=6af7bf378f957cc225aa5fd19d266b97bd11089d;hb=e9e0cf0989259b94d9758eceff448666a2e5a5cc;hpb=e70abd21bab68b23488f7ef1ee2e693a3b365691 diff --git a/rt/share/html/Admin/Users/Modify.html b/rt/share/html/Admin/Users/Modify.html index 6af7bf378..814e7f996 100755 --- a/rt/share/html/Admin/Users/Modify.html +++ b/rt/share/html/Admin/Users/Modify.html @@ -1,40 +1,40 @@ %# BEGIN BPS TAGGED BLOCK {{{ -%# +%# %# COPYRIGHT: -%# -%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC -%# -%# +%# +%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC +%# +%# %# (Except where explicitly superseded by other copyright notices) -%# -%# +%# +%# %# LICENSE: -%# +%# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have %# been provided with this software, but in any event can be snarfed %# from www.gnu.org. -%# +%# %# This work is distributed in the hope that it will be useful, but %# WITHOUT ANY WARRANTY; without even the implied warranty of %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. -%# +%# %# You should have received a copy of the GNU General Public License %# along with this program; if not, write to the Free Software %# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA %# 02110-1301 or visit their web page on the internet at %# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. -%# -%# +%# +%# %# CONTRIBUTION SUBMISSION POLICY: -%# +%# %# (The following paragraph is not intended to limit the rights granted %# to you to modify and distribute this software under the terms of %# the GNU General Public License and is only of importance to you if %# you choose to contribute your changes and enhancements to the %# community by submitting them to Best Practical Solutions, LLC.) -%# +%# %# By intentionally submitting any modifications, corrections or %# derivatives to this work, or any other work intended for use with %# Request Tracker, to Best Practical Solutions, LLC, you confirm that @@ -43,14 +43,10 @@ %# royalty-free, perpetual, license to use, copy, create derivative %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. -%# +%# %# 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,41 +66,47 @@ <&|/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: - +
+ +<&| /Widgets/TitleBox, title => loc('Customers') &> +<& /Elements/EditCustomers, Object => $UserObj, CustomerString=> $CustomerString, ServiceString => $ServiceString &> + +
+ <&| /Widgets/TitleBox, title => loc('Access control') &> /> @@ -112,7 +114,7 @@ - /> <&|/l&>Let this user be granted rights
+ /> <&|/l&>Let this user be granted rights (<&|/l&>Privileged)
<& /Elements/EditPassword, User => $UserObj, @@ -128,39 +130,39 @@ <&|/l&>Organization: - + <&|/l&>Address1: - + <&|/l&>Address2: - + <&|/l&>City: - + <&|/l&>State: - + <&|/l&>Zip: - + <&|/l&>Country: - + @@ -170,22 +172,22 @@ <&|/l&>Residence: -
+
<&|/l&>Work: -
+
<&|/l&>Mobile: -
+
<&|/l&>Pager: -
+
@@ -201,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 &> % } % } @@ -212,12 +214,12 @@ <&| /Widgets/TitleBox, title => loc('Comments about this user') &> - + %if (!$Create && $UserObj->Privileged) {
<&| /Widgets/TitleBox, title => loc('Signature') &> - + % } @@ -234,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, @@ -284,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); @@ -312,6 +304,7 @@ else { } +$m->callback( %ARGS, CallbackName => 'BeforeUpdate', User => $UserObj, ARGSRef => \%ARGS, Results => \@results ); # If we have a user to modify, lets try. @@ -330,6 +323,8 @@ if ($UserObj->Id && $id ne 'new') { push (@results,@fieldresults); push @results, ProcessObjectCustomFieldUpdates( ARGSRef => \%ARGS, Object => $UserObj ); + #deal with freeside customer links + push @results, ProcessObjectCustomers( ARGSRef => \%ARGS, Object => $UserObj ); # {{{ Deal with special fields: Privileged, Enabled if ( $SetPrivileged and $Privileged != $UserObj->Privileged ) { @@ -346,7 +341,6 @@ if ($UserObj->Id && $id ne 'new') { } - # }}} } @@ -371,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; @@ -418,4 +414,8 @@ $CurrentPass => undef $Pass1 => undef $Pass2 => undef $Create=> undef +$OnlySearchForCustomers => undef +$OnlySearchForServices => undef +$CustomerString => undef +$ServiceString => undef