1 %# BEGIN BPS TAGGED BLOCK {{{
5 %# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
6 %# <sales@bestpractical.com>
8 %# (Except where explicitly superseded by other copyright notices)
13 %# This work is made available to you under the terms of Version 2 of
14 %# the GNU General Public License. A copy of that license should have
15 %# been provided with this software, but in any event can be snarfed
18 %# This work is distributed in the hope that it will be useful, but
19 %# WITHOUT ANY WARRANTY; without even the implied warranty of
20 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 %# General Public License for more details.
23 %# You should have received a copy of the GNU General Public License
24 %# along with this program; if not, write to the Free Software
25 %# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26 %# 02110-1301 or visit their web page on the internet at
27 %# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
30 %# CONTRIBUTION SUBMISSION POLICY:
32 %# (The following paragraph is not intended to limit the rights granted
33 %# to you to modify and distribute this software under the terms of
34 %# the GNU General Public License and is only of importance to you if
35 %# you choose to contribute your changes and enhancements to the
36 %# community by submitting them to Best Practical Solutions, LLC.)
38 %# By intentionally submitting any modifications, corrections or
39 %# derivatives to this work, or any other work intended for use with
40 %# Request Tracker, to Best Practical Solutions, LLC, you confirm that
41 %# you are the copyright holder for those contributions and you grant
42 %# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
43 %# royalty-free, perpetual, license to use, copy, create derivative
44 %# works based on those contributions, and sublicense and distribute
45 %# those contributions and any derivatives thereof.
47 %# END BPS TAGGED BLOCK }}}
48 <& /Elements/Header, Title=>loc("Ticketing Preferences") &>
51 <& /Elements/ListActions, actions => \@results &>
53 <form action="<%RT->Config->Get('WebPath')%>/User/Prefs.html" method="post">
54 <input type="hidden" class="hidden" name="id" value="<%$UserObj->Id%>" />
56 <table width="100%" border="0">
59 <td valign="top" class="boxcontainer">
60 <&| /Widgets/TitleBox, title => loc('Identity'), id => "user-prefs-identity" &>
62 <input type="hidden" class="hidden" name="Name" value="<%$UserObj->Name%>" />
63 <table cellspacing="0" cellpadding="0">
65 <td class="label"><&|/l&>Email</&>: </td>
66 <td class="value"><input name="EmailAddress" value="<%$UserObj->EmailAddress%>" /></td>
69 <td class="label"><&|/l&>Real Name</&>:</td>
70 <td class="value"><input name="RealName" value="<%$UserObj->RealName%>" /></td> </tr>
72 <td class="label"><&|/l&>Nickname</&>:</td>
73 <td class="value"><input name="NickName" value="<%$UserObj->NickName || ''%>" /></td>
76 %# <td class="label"><&|/l&>Language</&>:</td>
77 %# <td class="value"><& /Elements/SelectLang, Name => 'Lang', Default => $UserObj->Lang &></td>
80 <td class="label"><&|/l&>Timezone</&>:</td>
81 <td class="value"><& /Elements/SelectTimezone, Name => 'Timezone', Default => $UserObj->Timezone &></td>
83 <& /Elements/EditCustomFields, Object => $UserObj, Grouping => 'Identity', InTable => 1 &>
86 <&| /Widgets/TitleBox, title => loc('Phone numbers'), id => "user-prefs-phone" &>
87 <table cellspacing="0" cellpadding="0">
89 <td class="label"><&|/l&>Residence</&>:</td>
90 <td class="value"><input name="HomePhone" value="<%$UserObj->HomePhone || ''%>" size="13" /></td>
93 <td class="label"><&|/l&>Work</&>:</td>
94 <td class="value"><input name="WorkPhone" value="<%$UserObj->WorkPhone || ''%>" size="13" /></td>
97 <td class="label"><&|/l&>Mobile</&>:</td>
98 <td class="value"><input name="MobilePhone" value="<%$UserObj->MobilePhone || ''%>" size="13" /></td>
101 <td class="label"><&|/l&>Pager</&>:</td>
102 <td class="value"><input name="PagerPhone" value="<%$UserObj->PagerPhone || ''%>" size="13" /></td>
104 <& /Elements/EditCustomFields, Object => $UserObj, Grouping => 'Phones', InTable => 1 &>
108 %if ($UserObj->Privileged) {
109 <&| /Widgets/TitleBox, title => loc('Signature'), id => "user-prefs-signature" &>
110 <textarea cols="80" rows="5" name="Signature" class="signature" wrap="hard">
111 <%$UserObj->Signature || ''%></textarea>
115 % $m->callback( %ARGS, UserObj => $UserObj, CallbackName => 'FormLeftColumn' );
117 <td valign="top" class="boxcontainer">
119 <&| /Widgets/TitleBox, title => loc('Password'), id => "user-prefs-password" &>
120 <& /Elements/EditPassword,
122 Name => [qw(CurrentPass Pass1 Pass2)],
125 <& /Elements/EditCustomFields, Object => $UserObj, Grouping => 'Access control' &>
129 <&| /Widgets/TitleBox, title => loc('Location'), id => "user-prefs-location" &>
130 <table cellspacing="0" cellpadding="0">
132 <td class="label"><&|/l&>Organization</&>:</td>
133 <td class="value"><input name="Organization" value="<%$UserObj->Organization || ''%>" /></td>
136 <td class="label"><&|/l&>Address1</&>:</td>
137 <td class="value"><input name="Address1" value="<%$UserObj->Address1 || ''%>" /></td>
140 <td class="label"><&|/l&>Address2</&>:</td>
141 <td class="value"><input name="Address2" value="<%$UserObj->Address2 || ''%>" /></td>
144 <td class="label"><&|/l&>City</&>:</td>
145 <td><input name="City" value="<%$UserObj->City || ''%>" size="14" /></td>
148 <td class="label"><&|/l&>State</&>:</td>
149 <td class="value"><input name="State" value="<%$UserObj->State || ''%>" size="3" /></td>
152 <td class="label"><&|/l&>Zip</&>:</td>
153 <td class="value"><input name="Zip" value="<%$UserObj->Zip || ''%>" size="9" /></td>
156 <td class="label"><&|/l&>Country</&>:</td>
157 <td class="value"><input name="Country" value="<%$UserObj->Country || ''%>" /></td>
159 <& /Elements/EditCustomFields, Object => $UserObj, Grouping => 'Location', InTable => 1 &>
165 <& /Elements/EditCustomFieldCustomGroupings, Object => $UserObj &>
169 <& /Elements/Submit, Label => loc('Save Preferences') &>
171 <&| /Widgets/TitleBox, title => loc('Secret authentication token'), id => "user-prefs-feeds" &>
173 <&|/l&>All iCal feeds embed a secret token which authorizes you. If the URL for one of your iCal feeds was exposed to the outside world, you can get a new secret, <b>breaking all existing iCal feeds</b>, below.</&>
175 <a href="#" id="ResetAuthTokenPrompt" style="display: none">
176 <&|/l&>I want to reset my secret token.</&>
179 Label => loc('Reset secret authentication token'),
180 Name => "ResetAuthToken",
181 id => "ResetAuthTokenContainer" &>
183 jQuery("#ResetAuthTokenContainer").hide();
184 jQuery("#ResetAuthTokenPrompt").show().click(function(ev){
185 jQuery(this).slideUp();
186 jQuery("#ResetAuthTokenContainer").slideDown();
192 % $m->callback( %ARGS, UserObj => $UserObj, CallbackName => 'FormRightColumn' );
198 % $m->callback( %ARGS, UserObj => $UserObj, CallbackName => 'FormEnd' );
205 my $UserObj = RT::User->new( $session{'CurrentUser'} );
206 $UserObj->Load($id) if $id;
207 $UserObj->Load($Name) if $Name && !$UserObj->id;
208 unless ( $UserObj->id ) {
209 Abort(loc("Couldn't load user #[_1] or user '[_2]'", $id, $Name))
211 Abort(loc("Couldn't load user #[_1]", $id))
213 Abort(loc("Couldn't load user '[_1]'", $Name))
215 Abort(loc("Couldn't load user"));
221 if ( $ARGS{'ResetAuthToken'} ) {
222 my ($status, $msg) = $UserObj->GenerateAuthToken;
227 Name Comments Signature EmailAddress FreeformContactInfo
228 Organization RealName NickName Lang EmailEncoding WebEncoding
229 ExternalContactInfoId ContactInfoSystem Gecos ExternalAuthId
230 AuthSystem HomePhone WorkPhone MobilePhone PagerPhone Address1
231 Address2 City State Zip Country Timezone
235 CallbackName => 'UpdateLogic',
237 results => \@results,
242 push @results, UpdateRecordObject (
243 AttributesRef => \@fields,
248 push @results, ProcessObjectCustomFieldUpdates( ARGSRef => \%ARGS, Object => $UserObj );
250 # Deal with special fields: Privileged, Enabled, and Password
251 if ( $SetPrivileged and $Privileged != $UserObj->Privileged ) {
252 my ($code, $msg) = $UserObj->SetPrivileged( $Privileged );
253 push @results, loc('Privileged status: [_1]', loc_fuzzy($msg));
256 my %password_cond = $UserObj->CurrentUserRequireToSetPassword;
257 if (defined $Pass1 && length $Pass1 ) {
258 my ($status, $msg) = $UserObj->SafeSetPassword(
259 Current => $CurrentPass,
261 Confirmation => $Pass2,
263 push @results, loc("Password: [_1]", $msg);
268 MaybeRedirectForResults(
269 Actions => \@results,
276 $id => $session{'CurrentUser'}->Id
280 $EmailAddress => undef
281 $FreeformContactInfo => undef
282 $Organization => undef
286 $SetPrivileged => undef
290 $EmailEncoding => undef
291 $WebEncoding => undef
292 $ExternalContactInfoId => undef
293 $ContactInfoSystem => undef
295 $ExternalAuthId => undef
299 $MobilePhone => undef
307 $CurrentPass => undef