[Bps-public-commit] r17642 - in sd/trunk: .

spang at bestpractical.com spang at bestpractical.com
Thu Jan 8 10:42:23 EST 2009


Author: spang
Date: Thu Jan  8 10:42:22 2009
New Revision: 17642

Modified:
   sd/trunk/   (props changed)
   sd/trunk/lib/App/SD/CLI/Command/Ticket/Search.pm

Log:
 r53420 at loki:  spang | 2009-01-08 16:25:56 +0200
 run perltidy on Search.pm


Modified: sd/trunk/lib/App/SD/CLI/Command/Ticket/Search.pm
==============================================================================
--- sd/trunk/lib/App/SD/CLI/Command/Ticket/Search.pm	(original)
+++ sd/trunk/lib/App/SD/CLI/Command/Ticket/Search.pm	Thu Jan  8 10:42:22 2009
@@ -7,18 +7,23 @@
 before run => sub {
     my $self = shift;
 
-    if (!$self->has_arg('sort') &&  $self->app_handle->config->get('default_sort_ticket_list')) {
-        $self->set_arg('sort' => $self->app_handle->config->get('default_sort_ticket_list'));
+    if (  !$self->has_arg('sort')
+        && $self->app_handle->config->get('default_sort_ticket_list') )
+    {
+        $self->set_arg(
+            'sort' => $self->app_handle->config->get('default_sort_ticket_list')
+        );
     }
-    
-    if (!$self->has_arg('group') &&  $self->app_handle->config->get('default_group_ticket_list')) {
-        $self->set_arg('group' => $self->app_handle->config->get('default_group_ticket_list'));
+
+    if (  !$self->has_arg('group')
+        && $self->app_handle->config->get('default_group_ticket_list') )
+    {
+        $self->set_arg( 'group' =>
+              $self->app_handle->config->get('default_group_ticket_list') );
     }
-    
-    
 
     # sort output by created date if user specifies --sort
-    if ( $self->has_arg('sort') && ($self->arg('sort') ne 'none')) {
+    if ( $self->has_arg('sort') && ( $self->arg('sort') ne 'none' ) ) {
 
         # some records might not have creation dates
         no warnings 'uninitialized';
@@ -30,20 +35,35 @@
         );
     }
 
-    if ( $self->has_arg('group') && ($self->arg('group') ne 'none')) {
+    if ( $self->has_arg('group') && ( $self->arg('group') ne 'none' ) ) {
         $self->group_routine(
             sub {
                 my $records = shift;
-                my $groups =  $self->group_by_prop( $self->arg('group') => $records );
-                if ($self->arg('group') eq 'milestone') {
-                    my $order = $self->app_handle->setting( label => 'milestones' )->get();
-                    my %group_hash = map { $_->{'label'} => $_->{'records'} } @$groups;
-                    my $sorted_groups = [ map { 
-                                
-                                    { label => $_, records => (delete $group_hash{$_} || []) }
-
-                                } @$order ];
-                    return [@$sorted_groups, (map { {label => $_, records => $group_hash{$_}}} keys %group_hash )];
+                my $groups =
+                  $self->group_by_prop( $self->arg('group') => $records );
+                if ( $self->arg('group') eq 'milestone' ) {
+                    my $order =
+                      $self->app_handle->setting( label => 'milestones' )
+                      ->get();
+                    my %group_hash =
+                      map { $_->{'label'} => $_->{'records'} } @$groups;
+                    my $sorted_groups = [
+                        map {
+
+                            {
+                                label   => $_,
+                                records => ( delete $group_hash{$_} || [] )
+                            }
+
+                          } @$order
+                    ];
+                    return [
+                        @$sorted_groups,
+                        (
+                            map { { label => $_, records => $group_hash{$_} } }
+                              keys %group_hash
+                        )
+                    ];
                 }
                 return $groups;
             }
@@ -53,7 +73,7 @@
 
 # implicit status != closed
 sub default_match {
-    my $self = shift;
+    my $self   = shift;
     my $ticket = shift;
 
     return 1 if $ticket->has_active_status();



More information about the Bps-public-commit mailing list