[Rt-commit] rt branch, records_history, created. rt-3.8.8-98-g83ace0a

Ruslan Zakirov ruz at bestpractical.com
Wed Jun 30 00:27:41 EDT 2010


The branch, records_history has been created
        at  83ace0a90979429c8784623f0dde1d4d638c362e (commit)

- Log -----------------------------------------------------------------
commit 7cfa19b2076252e593d9b3adbb2bf978898379fb
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Jun 17 16:21:59 2010 -0400

    $RememberDefaultQueue for "sticky" default queue

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 109f1fb..85d04b5 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1521,6 +1521,15 @@ queue selection boxes on the web interface.
 
 #Set($DefaultQueue, 'General');
 
+=item C<$RememberDefaultQueue>
+
+When a queue is selected in the new ticket dropdown, make it the new default
+for the new ticket dropdown.
+
+=cut
+
+#Set($RememberDefaultQueue, 1);
+
 =item C<$DefaultTimeUnitsToHours>
 
 Use this to set the default units for time entry to hours instead of minutes.
diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index 6134716..9de441f 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -151,10 +151,19 @@ our %META = (
             },
         }
     },
+    RememberDefaultQueue => {
+        Section     => 'General',
+        Overridable => 1,
+        SortOrder   => 2,
+        Widget      => '/Widgets/Form/Boolean',
+        WidgetArguments => {
+            Description => 'Remember default queue' # loc
+        }
+    },
     UsernameFormat => {
         Section         => 'General',
         Overridable     => 1,
-        SortOrder       => 2,
+        SortOrder       => 3,
         Widget          => '/Widgets/Form/Select',
         WidgetArguments => {
             Description => 'Username format', # loc
@@ -168,7 +177,7 @@ our %META = (
     WebDefaultStylesheet => {
         Section         => 'General',                #loc
         Overridable     => 1,
-        SortOrder       => 3,
+        SortOrder       => 4,
         Widget          => '/Widgets/Form/Select',
         WidgetArguments => {
             Description => 'Theme',                  #loc
@@ -179,7 +188,7 @@ our %META = (
     MessageBoxRichText => {
         Section => 'General',
         Overridable => 1,
-        SortOrder => 4,
+        SortOrder => 5,
         Widget => '/Widgets/Form/Boolean',
         WidgetArguments => {
             Description => 'WYSIWYG message composer' # loc
@@ -188,7 +197,7 @@ our %META = (
     MessageBoxRichTextHeight => {
         Section => 'General',
         Overridable => 1,
-        SortOrder => 5,
+        SortOrder => 6,
         Widget => '/Widgets/Form/Integer',
         WidgetArguments => {
             Description => 'WYSIWYG composer height', # loc
@@ -197,7 +206,7 @@ our %META = (
     MessageBoxWidth => {
         Section         => 'General',
         Overridable     => 1,
-        SortOrder       => 6,
+        SortOrder       => 7,
         Widget          => '/Widgets/Form/Integer',
         WidgetArguments => {
             Description => 'Message box width',           #loc
@@ -206,7 +215,7 @@ our %META = (
     MessageBoxHeight => {
         Section         => 'General',
         Overridable     => 1,
-        SortOrder       => 7,
+        SortOrder       => 8,
         Widget          => '/Widgets/Form/Integer',
         WidgetArguments => {
             Description => 'Message box height',          #loc
@@ -215,7 +224,7 @@ our %META = (
     SearchResultsRefreshInterval => {
         Section         => 'General',                       #loc
         Overridable     => 1,
-        SortOrder       => 8,
+        SortOrder       => 9,
         Widget          => '/Widgets/Form/Select',
         WidgetArguments => {
             Description => 'Search results refresh interval',                            #loc
@@ -234,7 +243,7 @@ our %META = (
     ResolveDefaultUpdateType => {
         Section         => 'General',                                      #loc
         Overridable     => 1,
-        SortOrder       => 9,
+        SortOrder       => 10,
         Widget          => '/Widgets/Form/Select',
         WidgetArguments => {
             Description => 'Default Update Type when Resolving',           #loc
diff --git a/share/html/Elements/SelectNewTicketQueue b/share/html/Elements/SelectNewTicketQueue
index 403b1f6..949faca 100755
--- a/share/html/Elements/SelectNewTicketQueue
+++ b/share/html/Elements/SelectNewTicketQueue
@@ -50,5 +50,12 @@
 </label>
 <%INIT>
 my $queue = RT->Config->Get("DefaultQueue", $session{'CurrentUser'});
+
+if (RT->Config->Get("RememberDefaultQueue", $session{'CurrentUser'})) {
+    if (my $session_default = $session{'DefaultQueue'}) {
+        $queue = $session_default;
+    }
+}
+
 $m->callback(Queue => \$queue, CallbackName => 'DefaultQueue');
 </%INIT>
diff --git a/share/html/Ticket/Create.html b/share/html/Ticket/Create.html
index 2c8e357..b46a3b4 100755
--- a/share/html/Ticket/Create.html
+++ b/share/html/Ticket/Create.html
@@ -250,6 +250,7 @@
 <%INIT>
 $m->callback( CallbackName => "Init", ARGSRef => \%ARGS );
 my $Queue = $ARGS{Queue};
+$session{DefaultQueue} = $Queue;
 
 my $CloneTicketObj;
 if ($CloneTicket) {

commit 69642a9912b9b8feea4ccd53c97f7c754c252048
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Fri Jun 18 16:29:45 2010 -0400

    Add some stubby methods to make CollectionList happier

diff --git a/lib/RT/SavedSearches.pm b/lib/RT/SavedSearches.pm
index 0848fc8..7f5aabe 100644
--- a/lib/RT/SavedSearches.pm
+++ b/lib/RT/SavedSearches.pm
@@ -146,6 +146,29 @@ sub Count {
     return scalar @{$self->{'objects'}};
 }
 
+=head2 CountAll
+
+Returns the number of search objects found
+
+=cut
+
+sub CountAll {
+    my $self = shift;
+    return $self->Count;
+}
+
+=head2 GotoPage
+
+Act more like a normal L<DBIx::SearchBuilder> collection.
+Moves the internal index around
+
+=cut
+
+sub GotoPage {
+    my $self = shift;
+    $self->{idx} = shift;
+}
+
 ### Internal methods
 
 # _GetObject: helper routine to load the correct object whose parameters

commit 9c3e93a0ac550c894cba45d8b4c264d50c9a2399
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Fri Jun 18 13:00:01 2010 -0400

    Add a SavedSearch Homepage element
    
    Uses a basic CollectionList to show all your personal and
    group SavedSearches as clickable result links on your homepage.

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 85d04b5..125fafb 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1348,7 +1348,7 @@ customized homepage ("RT at a glance").
 
 =cut
 
-Set($HomepageComponents, [qw(QuickCreate Quicksearch MyAdminQueues MySupportQueues MyReminders RefreshHomepage Dashboards)]);
+Set($HomepageComponents, [qw(QuickCreate Quicksearch MyAdminQueues MySupportQueues MyReminders RefreshHomepage Dashboards SavedSearches)]);
 
 =item C<@MasonParameters>
 
diff --git a/share/html/Elements/RT__SavedSearch/ColumnMap b/share/html/Elements/RT__SavedSearch/ColumnMap
new file mode 100644
index 0000000..795b5a2
--- /dev/null
+++ b/share/html/Elements/RT__SavedSearch/ColumnMap
@@ -0,0 +1,86 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC
+%#                                          <jesse at bestpractical.com>
+%#
+%# (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
+%# you are the copyright holder for those contributions and you grant
+%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
+%# 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 }}}
+<%ARGS>
+$Name
+$Attr => undef
+</%ARGS>
+<%ONCE>
+my $COLUMN_MAP = {
+    id => {
+        title     => '#', # loc
+        attribute => 'id',
+        align     => 'right',
+        value     => sub { return $_[0]->Id },
+    },
+    Name => {
+        title     => sub { return "foo" }, #'Name', # loc
+        attribute => 'Name',
+        value     => sub { return $_[0]->Name()||loc("Unnamed search") },
+    },
+    Query => {
+        title     => 'Query', # loc
+        attribute => 'Query',
+        value     => sub { return $_[0]->GetParameter('Query') },
+    },
+    ResultsURL => {
+        title     => '',
+        attribute => 'ResultsURL',
+        value     => sub { my $search = shift;
+                           return join('&', sort
+                            map { $m->interp->apply_escapes($_,'u') .
+                                  '=' .
+                                  $m->interp->apply_escapes($search->GetParameter($_),'u') }
+                            qw(Query Format Rows Order OrderBy)) },
+    }
+};
+
+</%ONCE>
+<%INIT>
+$m->callback( COLUMN_MAP => $COLUMN_MAP, CallbackName => 'ColumnMap', CallbackOnce => 1 );
+return GetColumnMapEntry( Map => $COLUMN_MAP, Name => $Name, Attribute => $Attr );
+</%INIT>
diff --git a/share/html/Elements/SavedSearches b/share/html/Elements/SavedSearches
new file mode 100644
index 0000000..e7b7d1e
--- /dev/null
+++ b/share/html/Elements/SavedSearches
@@ -0,0 +1,29 @@
+<&|/Widgets/TitleBox, title => loc('Saved Searches') &>
+% foreach my $Object (@Objects) {
+%   my $SavedSearches = RT::SavedSearches->new($session{CurrentUser});
+%   $SavedSearches->LimitToPrivacy(join('-',ref($Object),$Object->Id),'Ticket');
+%   my $title;
+%   if (ref $Object eq 'RT::User' && $Object->Id == $session{CurrentUser}->Id) {
+%       $title = loc("My saved searches");
+%   } else {
+%       $title = loc("[_1]'s saved searches",$Object->Name);
+%   }
+%   $title = $m->interp->apply_escapes($title, 'h');
+<& /Elements/CollectionList,
+    %ARGS,
+    Class => 'RT::SavedSearch',
+    Format => qq{'<a href="__WebPath__/Search/Results.html?__ResultsURL__">__Name__</a>/TITLE:$title'},
+    Collection => $SavedSearches,
+    PassArguments => [qw(Format Name id)],
+&>
+% }
+</&>
+<%init>
+my @Objects = RT::SavedSearches->new($session{CurrentUser})->_PrivacyObjects;
+push @Objects, RT::System->new( $session{'CurrentUser'} )
+    if $session{'CurrentUser'}->HasRight( Object=> $RT::System,
+                                          Right => 'SuperUser' );
+</%init>
+<%ARGS>
+$user_attrs => undef
+</%ARGS>

commit 9d1b85ef8ecc58f80f29581bb7feecf8ea4a73f9
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Fri Jun 18 16:51:03 2010 -0400

    Remove old cache cleaning code
    
    This cache has been irrelevant since
    36bf6181f1e4d867bcfec27bd29ad16d000898ec

diff --git a/share/html/Admin/Queues/Modify.html b/share/html/Admin/Queues/Modify.html
index c6ffe17..906ee39 100755
--- a/share/html/Admin/Queues/Modify.html
+++ b/share/html/Admin/Queues/Modify.html
@@ -153,7 +153,6 @@ if ($Create) {
     if ( defined $id && $id eq 'new' ) {
         my ($val, $msg) = $QueueObj->Create( Name => $Name );
         Abort("$msg") unless $val;
-        delete $session{'create_in_queues'};
 		push @results, $msg;
     }
     else {
@@ -164,7 +163,6 @@ if ($Create) {
     $current_tab = 'Admin/Queues/Modify.html?id='.$QueueObj->id;
 }
 if ( $QueueObj->Id ) {
-    delete $session{'create_in_queues'};
     my @attribs= qw(Description CorrespondAddress CommentAddress Name
         InitialPriority FinalPriority DefaultDueIn Sign Encrypt SubjectTag Disabled);
 

commit e1f8be744fbd91b1448f15613b9fb3aebdc25ce1
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Mon Jun 28 14:34:36 2010 -0400

    Only show dashboards tab if you can see or subscribe to dashboards

diff --git a/share/html/Tools/Elements/Tabs b/share/html/Tools/Elements/Tabs
index 4e49795..aa75222 100644
--- a/share/html/Tools/Elements/Tabs
+++ b/share/html/Tools/Elements/Tabs
@@ -54,10 +54,6 @@
 
 <%INIT>
 my $tabs = {
-    a => {
-        title => loc('Dashboards'),
-        path  => 'Dashboards/index.html',
-    },
     b => {
         title => loc('Offline'),
         path  => 'Tools/Offline.html',
@@ -72,6 +68,16 @@ my $tabs = {
     },
 };
 
+my $can_see_dashboards = $session{CurrentUser}->HasRight(Right => 'SubscribeDashboard', Object => $RT::System)
+                       || RT::Dashboard->new($session{CurrentUser})->_PrivacyObjects;
+
+if ($can_see_dashboards) {
+    $tabs->{a} = {
+        title => loc('Dashboards'),
+        path  => 'Dashboards/index.html',
+    };
+}
+
 $m->callback( %ARGS, tabs => $tabs );
 
 foreach my $tab ( sort keys %{$tabs} ) {
diff --git a/share/html/Tools/index.html b/share/html/Tools/index.html
index 8e5e02b..26e0f47 100644
--- a/share/html/Tools/index.html
+++ b/share/html/Tools/index.html
@@ -54,11 +54,6 @@
 <%init>
 
 my $tabs = {
-    A => {
-        title       => loc('Dashboards'),
-        path        => '/Dashboards/index.html',
-        description => loc('Named, shared collection of portlets'),
-    },
     B => {
         title       => loc('Offline'),
         path        => '/Tools/Offline.html',
@@ -76,6 +71,17 @@ my $tabs = {
     },
 };
 
+my $can_see_dashboards = $session{CurrentUser}->HasRight(Right => 'SubscribeDashboard', Object => $RT::System)
+                       || RT::Dashboard->new($session{CurrentUser})->_PrivacyObjects;
+
+if ($can_see_dashboards) {
+    $tabs->{A} = {
+        title       => loc('Dashboards'),
+        path        => '/Dashboards/index.html',
+        description => loc('Named, shared collection of portlets'),
+    };
+}
+
 $m->callback( %ARGS, tabs => $tabs );
 
 </%init>

commit 1c1d8a202f6d012485f2f0b4fc4cb94ea5dd902d
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Jun 23 23:44:45 2010 +0400

    don't encode folded headers and tabs in EncodeToMIME
    
    * rfc822 allows you to put whole ascii into header field body,
      let's allow tab as well
    * if field is folded then do nothing special
    * use B encoding in other cases

diff --git a/lib/RT/Interface/Email.pm b/lib/RT/Interface/Email.pm
index f618c40..35a56a7 100755
--- a/lib/RT/Interface/Email.pm
+++ b/lib/RT/Interface/Email.pm
@@ -890,7 +890,7 @@ sub EncodeToMIME {
         return ($value);
     }
 
-    return ($value) unless $value =~ /[^\x20-\x7e]/;
+    return ($value) if $value =~ /^(?:[\t\x20-\x7e]|\x0D*\x0A[ \t])+$/s;
 
     $value =~ s/\s+$//;
 

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