[otrs-cvs] ITSMIncidentProblemManagement/Kernel/Output/HTML TicketOverviewMedium.pm, 1.17, 1.18 TicketOverviewPreview.pm, 1.25, 1.26

"CVS commits notifications of OTRS.org" <[email protected]> Tue, 18 Jun 2013 14:30:08 +0000
Newsgroups gmane.comp.otrs.cvs
Message-ID <[email protected]>
Comments:
Update of /home/cvs/ITSMIncidentProblemManagement/Kernel/Output/HTML
In directory lancelot:/tmp/cvs-serv22690/Kernel/Output/HTML

Modified Files:
	TicketOverviewMedium.pm TicketOverviewPreview.pm 
Log Message:
Updated file to latest framework version.

Author: ub

Index: TicketOverviewMedium.pm
===================================================================
RCS file: /home/cvs/ITSMIncidentProblemManagement/Kernel/Output/HTML/TicketOverviewMedium.pm,v
retrieving revision 1.17
retrieving revision 1.18
diff -2 -u -d -r1.17 -r1.18
--- TicketOverviewMedium.pm	23 Jan 2013 14:57:00 -0000	1.17
+++ TicketOverviewMedium.pm	18 Jun 2013 14:30:03 -0000	1.18
@@ -38,5 +38,5 @@
     # get needed objects
     for (
-        qw(ConfigObject LogObject DBObject LayoutObject UserID UserObject GroupObject TicketObject MainObject QueueObject)
+        qw(ConfigObject LogObject DBObject EncodeObject LayoutObject UserID UserObject GroupObject TicketObject MainObject QueueObject)
         )
     {
@@ -106,4 +106,78 @@
     }
 
+    # run ticket overview document item menu modules
+    if (
+        $Param{Config}->{OverviewMenuModules}
+        && ref $Self->{ConfigObject}->Get('Ticket::Frontend::OverviewMenuModule') eq 'HASH'
+    ) {
+
+        my %Menus = %{ $Self->{ConfigObject}->Get('Ticket::Frontend::OverviewMenuModule') };
+        MENUMODULE:
+        for my $Menu ( sort keys %Menus ) {
+
+            next MENUMODULE if !IsHashRefWithData($Menus{$Menu});
+            next MENUMODULE if ( $Menus{$Menu}->{View} && $Menus{$Menu}->{View} ne $Param{View} );
+
+            # load module
+            if ( !$Self->{MainObject}->Require( $Menus{$Menu}->{Module} ) ) {
+                return $Self->{LayoutObject}->FatalError();
+            }
+            my $Object = $Menus{$Menu}->{Module}->new( %{$Self} );
+
+            # run module
+            my $Item = $Object->Run(
+                %Param,
+                Config => $Menus{$Menu},
+            );
+            next MENUMODULE if !IsHashRefWithData($Item);
+
+            if ( $Item->{Block} eq 'DocumentActionRowItem' ) {
+
+                # add session id if needed
+                if ( !$Self->{LayoutObject}->{SessionIDCookie} && $Item->{Link} ) {
+                    $Item->{Link}
+                        .= ';'
+                        . $Self->{LayoutObject}->{SessionName} . '='
+                        . $Self->{LayoutObject}->{SessionID};
+                }
+
+                # create id
+                $Item->{ID} = $Item->{Name};
+                $Item->{ID} =~ s/(\s|&|;)//ig;
+
+                my $Link = $Item->{Link};
+                if ( $Item->{Target} ) {
+                    $Link = '#';
+                }
+
+                my $Class = '';
+                if ( $Item->{PopupType} ) {
+                    $Class = 'AsPopup PopupType_' . $Item->{PopupType};
+                }
+
+                $Self->{LayoutObject}->Block(
+                    Name => $Item->{Block},
+                    Data => {
+                        ID          => $Item->{ID},
+                        Name        => $Self->{LayoutObject}->{LanguageObject}->Get( $Item->{Name} ),
+                        Link        => $Self->{LayoutObject}->{Baselink} . $Item->{Link},
+                        Description => $Item->{Description},
+                        Block       => $Item->{Block},
+                        Class       => $Class,
+                    },
+                );
+            }
+            elsif ( $Item->{Block} eq 'DocumentActionRowHTML' ) {
+
+                next MENUMODULE if !$Item->{HTML};
+
+                $Self->{LayoutObject}->Block(
+                    Name => $Item->{Block},
+                    Data => $Item,
+                );
+            }
+        }
+    }
+
     # init for table control
     $Self->{LayoutObject}->Block(
@@ -256,5 +330,5 @@
     );
 
-    # get last article
+    # get last customer article
     my %Article = $Self->{TicketObject}->ArticleLastCustomerArticle(
         TicketID      => $Param{TicketID},
@@ -262,10 +336,16 @@
     );
 
+    # get ticket data
+    my %Ticket = $Self->{TicketObject}->TicketGet(
+        TicketID      => $Param{TicketID},
+        DynamicFields => 0,
+    );
+
+    # show ticket create time in current view
+    $Article{Created} = $Ticket{Created};
+
     # Fallback for tickets without articles: get at least basic ticket data
     if ( !%Article ) {
-        %Article = $Self->{TicketObject}->TicketGet(
-            TicketID      => $Param{TicketID},
-            DynamicFields => 0,
-        );
+        %Article = %Ticket;
         if ( !$Article{Title} ) {
             $Article{Title} = $Self->{LayoutObject}->{LanguageObject}->Get(

Author: ub

Index: TicketOverviewPreview.pm
===================================================================
RCS file: /home/cvs/ITSMIncidentProblemManagement/Kernel/Output/HTML/TicketOverviewPreview.pm,v
retrieving revision 1.25
retrieving revision 1.26
diff -2 -u -d -r1.25 -r1.26
--- TicketOverviewPreview.pm	23 Jan 2013 14:57:00 -0000	1.25
+++ TicketOverviewPreview.pm	18 Jun 2013 14:30:03 -0000	1.26
@@ -34,5 +34,5 @@
     # get needed objects
     for (
-        qw(ConfigObject LogObject DBObject LayoutObject UserID UserObject GroupObject TicketObject MainObject QueueObject)
+        qw(ConfigObject LogObject DBObject EncodeObject LayoutObject UserID UserObject GroupObject TicketObject MainObject QueueObject)
         )
     {
@@ -103,4 +103,78 @@
     }
 
+    # run ticket overview document item menu modules
+    if (
+        $Param{Config}->{OverviewMenuModules}
+        && ref $Self->{ConfigObject}->Get('Ticket::Frontend::OverviewMenuModule') eq 'HASH'
+    ) {
+
+        my %Menus = %{ $Self->{ConfigObject}->Get('Ticket::Frontend::OverviewMenuModule') };
+        MENUMODULE:
+        for my $Menu ( sort keys %Menus ) {
+
+            next MENUMODULE if !IsHashRefWithData($Menus{$Menu});
+            next MENUMODULE if ( $Menus{$Menu}->{View} && $Menus{$Menu}->{View} ne $Param{View} );
+
+            # load module
+            if ( !$Self->{MainObject}->Require( $Menus{$Menu}->{Module} ) ) {
+                return $Self->{LayoutObject}->FatalError();
+            }
+            my $Object = $Menus{$Menu}->{Module}->new( %{$Self} );
+
+            # run module
+            my $Item = $Object->Run(
+                %Param,
+                Config => $Menus{$Menu},
+            );
+            next MENUMODULE if !IsHashRefWithData($Item);
+
+            if ( $Item->{Block} eq 'DocumentActionRowItem' ) {
+
+                # add session id if needed
+                if ( !$Self->{LayoutObject}->{SessionIDCookie} && $Item->{Link} ) {
+                    $Item->{Link}
+                        .= ';'
+                        . $Self->{LayoutObject}->{SessionName} . '='
+                        . $Self->{LayoutObject}->{SessionID};
+                }
+
+                # create id
+                $Item->{ID} = $Item->{Name};
+                $Item->{ID} =~ s/(\s|&|;)//ig;
+
+                my $Link = $Item->{Link};
+                if ( $Item->{Target} ) {
+                    $Link = '#';
+                }
+
+                my $Class = '';
+                if ( $Item->{PopupType} ) {
+                    $Class = 'AsPopup PopupType_' . $Item->{PopupType};
+                }
+
+                $Self->{LayoutObject}->Block(
+                    Name => $Item->{Block},
+                    Data => {
+                        ID          => $Item->{ID},
+                        Name        => $Self->{LayoutObject}->{LanguageObject}->Get( $Item->{Name} ),
+                        Link        => $Self->{LayoutObject}->{Baselink} . $Item->{Link},
+                        Description => $Item->{Description},
+                        Block       => $Item->{Block},
+                        Class       => $Class,
+                    },
+                );
+            }
+            elsif ( $Item->{Block} eq 'DocumentActionRowHTML' ) {
+
+                next MENUMODULE if !$Item->{HTML};
+
+                $Self->{LayoutObject}->Block(
+                    Name => $Item->{Block},
+                    Data => $Item,
+                );
+            }
+        }
+    }
+
     # init for table control
     $Self->{LayoutObject}->Block(
---------------------------------------------------------------------
OTRS mailing list: cvs-log - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/cvs-log
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/cvs-log