[Rt-devel] PATCH Allows users to edit their user CFs in Preferences

Todd Chapman todd at chaka.net
Tue Sep 19 13:44:28 EDT 2006


The attached patch allows as user to see and modify user
CFs in Preferences (assuming they have the rights).

-Todd
-------------- next part --------------
--- html/User/Prefs.html	(revision 8756)
+++ html/User/Prefs.html	(local)
@@ -169,7 +169,22 @@
 <textarea cols="80" rows="5" name="Signature" class="signature" wrap="hard">
 <%$UserObj->Signature%></textarea>
 </&>
+<br />
+<&| /Widgets/TitleBox, title => loc('Custom Fields') &>
+<table>
+% my $CFs = $UserObj->CustomFields;
+% while (my $CF = $CFs->Next) {
+<tr valign="top"><td align="right">
+<% $CF->Name %>:
+</td><td>
+<& /Elements/EditCustomField, %ARGS, Object => $UserObj, CustomField => $CF &>
+</td></tr>
 % }
+<tr>
+</tr>
+</table>
+</&>
+% }
 
 </td>
 
@@ -216,6 +231,9 @@
     my @fieldresults = UpdateRecordObject ( AttributesRef => \@fields,
 					    Object => $UserObj,
 					    ARGSRef => \%ARGS );
+
+    push @fieldresults, ProcessObjectCustomFieldUpdates( ARGSRef => \%ARGS, Object => $UserObj );
+
     if ($Lang) {
 	$session{'CurrentUser'}->LanguageHandle($Lang);
 	$session{'CurrentUser'} = $session{'CurrentUser'}; # force writeback
=== html/User/Prefs.html
==================================================================


More information about the Rt-devel mailing list