[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.8.8-98-g83ace0a

Shawn Moore sartak at bestpractical.com
Tue Jun 29 18:25:05 EDT 2010


The branch, 3.9-trunk has been updated
       via  83ace0a90979429c8784623f0dde1d4d638c362e (commit)
       via  d4dd2aebe8564e7a3de947c3c95650e2b753ee51 (commit)
       via  2e71bebadd6703ae50f9c3672eea8987f637da71 (commit)
      from  1c1d8a202f6d012485f2f0b4fc4cb94ea5dd902d (commit)

Summary of changes:
 etc/RT_Config.pm.in                       |   12 ++++++++++++
 share/html/Admin/CustomFields/Modify.html |    9 +++++++++
 share/html/Widgets/ComboBox               |    6 +++++-
 3 files changed, 26 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit 2e71bebadd6703ae50f9c3672eea8987f637da71
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Jun 29 18:11:52 2010 -0400

    Allow specifying different label and name for ComboBox values

diff --git a/share/html/Widgets/ComboBox b/share/html/Widgets/ComboBox
index 04f7b25..969ad71 100644
--- a/share/html/Widgets/ComboBox
+++ b/share/html/Widgets/ComboBox
@@ -59,7 +59,11 @@ my $z_index = 9999;
 <br style="display: none" /><span id="<% $Name %>_Button" class="combo-button">&#9660;</span><select name="List-<% $Name %>" id="<% $Name %>_List" class="combo-list" onchange="ComboBox_SimpleAttach(this, this.form['<% $Name %>']); " size="<% $Rows %>">
 <option style="display: none" value="">-</option>
 % foreach my $value (@Values) {
-        <option value="<%$value%>"><% $value%></option>
+%     if (ref($value) eq 'HASH') {
+          <option value="<%$value->{name}%>"><% $value->{label}%></option>
+%     } else {
+          <option value="<%$value%>"><% $value%></option>
+%     }
 % }
 </select>
 </div>

commit d4dd2aebe8564e7a3de947c3c95650e2b753ee51
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Jun 29 18:15:05 2010 -0400

    POD likes newlines

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 125fafb..c148c25 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1320,6 +1320,7 @@ Set($PlainTextPre, 0);
 
 
 =item C<$PlainTextMono> 
+
 To display plaintext attachments,
 Set C<$PlainTextMono> to 1 to use monospaced font and preserve
 formatting, but unlike PlainTextPre, the text will wrap to fit into the

commit 83ace0a90979429c8784623f0dde1d4d638c362e
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Jun 29 18:19:49 2010 -0400

    New config $HideCustomFieldValidator
    
        This lets you hide the regular expression used to validate custom
        field values by using the regex's comment as a label.

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index c148c25..0142e71 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1539,6 +1539,17 @@ Use this to set the default units for time entry to hours instead of minutes.
 
 Set($DefaultTimeUnitsToHours, 0);
 
+=item C<$HideCustomFieldValidator>
+
+Use this to hide the regular expression used to validate custom field values.
+This applies only to the custom field admin interface. The regular expression's
+first comment will be used as the label for that validator. For example, the
+validator C<(?#Digits)^[\d.]+$> will display as just C<Digits>.
+
+=cut
+
+Set($HideCustomFieldValidator, 0);
+
 =back
 
 =head1 L<Net::Server> (rt-server) Configuration
diff --git a/share/html/Admin/CustomFields/Modify.html b/share/html/Admin/CustomFields/Modify.html
index f75607a..14eceb3 100644
--- a/share/html/Admin/CustomFields/Modify.html
+++ b/share/html/Admin/CustomFields/Modify.html
@@ -230,6 +230,15 @@ my @CFvalidations = (
 
 $m->callback(CallbackName => 'ValidationPatterns', Values => \@CFvalidations);
 
+if (RT->Config->Get('HideCustomFieldValidator')) {
+    for my $pattern (@CFvalidations) {
+        next if ref($pattern);
+        if (my ($name) = $pattern =~ /\(\?\#(\w+)\)/) {
+            $pattern = { name => $pattern, label => $name };
+        }
+    }
+}
+
 </%INIT>
 <%ARGS>
 $id => undef

-----------------------------------------------------------------------


More information about the Rt-commit mailing list