[otrs-cvs] FAQ/Kernel/Modules AgentFAQEdit.pm,1.20,1.21

"CVS commits notifications of OTRS.org" <[email protected]> Thu, 6 Jun 2013 11:03:40 +0000
Newsgroups gmane.comp.otrs.cvs
Message-ID <[email protected]>
Comments:
Update of /home/cvs/FAQ/Kernel/Modules
In directory lancelot:/tmp/cvs-serv16676/Kernel/Modules

Modified Files:
	AgentFAQEdit.pm 
Log Message:
Fixed bug# 7345 - Approval link does not work correctly.

Author: ub

Index: AgentFAQEdit.pm
===================================================================
RCS file: /home/cvs/FAQ/Kernel/Modules/AgentFAQEdit.pm,v
retrieving revision 1.20
retrieving revision 1.21
diff -2 -u -d -r1.20 -r1.21
--- AgentFAQEdit.pm	20 Nov 2012 13:05:09 -0000	1.20
+++ AgentFAQEdit.pm	6 Jun 2013 11:03:35 -0000	1.21
@@ -1,5 +1,5 @@
 # --
 # Kernel/Modules/AgentFAQEdit.pm - agent frontend to edit faq articles
-# Copyright (C) 2001-2012 OTRS AG, http://otrs.org/
+# Copyright (C) 2001-2013 OTRS AG, http://otrs.org/
 # --
 # $Id$
@@ -52,4 +52,7 @@
     }
 
+    # get screen type
+    $Self->{ScreenType} = $Self->{ParamObject}->GetParam( Param => 'ScreenType' ) || '';
+
     # set default interface settings
     $Self->{Interface} = $Self->{FAQObject}->StateTypeGet(
@@ -126,6 +129,34 @@
     if ( !$Self->{Subaction} ) {
 
-        # header
-        my $Output = $Self->{LayoutObject}->Header( Type => 'Small' );
+        my $Output;
+
+        # show a popup screen
+        if ( $Self->{ScreenType} eq 'Popup' ) {
+
+            # show the small popup screen header
+            $Output = $Self->{LayoutObject}->Header( Type => 'Small' );
+
+            $Self->{LayoutObject}->Block(
+                Name => 'StartSmall',
+                Data => {
+                    %FAQData,
+                },
+            );
+        }
+
+        # show a normal window
+        else {
+
+            # show the normal screen header with navigation bar
+            $Output = $Self->{LayoutObject}->Header();
+            $Output .= $Self->{LayoutObject}->NavigationBar();
+
+            $Self->{LayoutObject}->Block(
+                Name => 'StartNormal',
+                Data => {
+                    %FAQData,
+                },
+            );
+        }
 
         # get all existing attachments (without inline attachments)
@@ -180,9 +211,30 @@
             %FAQData,
             Attachments => \@Attachments,
+            ScreenType  => $Self->{ScreenType},
             FormID      => $Self->{FormID},
         );
 
-        # footer
-        $Output .= $Self->{LayoutObject}->Footer();
+        # show a popup screen footer
+        if ( $Self->{ScreenType} eq 'Popup' ) {
+
+            $Self->{LayoutObject}->Block(
+                Name => 'EndSmall',
+                Data => {},
+            );
+
+            $Output .= $Self->{LayoutObject}->Footer( Type => 'Small' );
+
+        }
+
+        # show a normal footer
+        else {
+
+            $Self->{LayoutObject}->Block(
+                Name => 'EndNormal',
+                Data => {},
+            );
+
+            $Output .= $Self->{LayoutObject}->Footer();
+        }
 
         return $Output;
@@ -197,6 +249,34 @@
         $Self->{LayoutObject}->ChallengeTokenCheck();
 
-        # header
-        my $Output = $Self->{LayoutObject}->Header( Type => 'Small' );
+        my $Output;
+
+        # show a popup screen
+        if ( $Self->{ScreenType} eq 'Popup' ) {
+
+            # show the small popup screen header
+            $Output = $Self->{LayoutObject}->Header( Type => 'Small' );
+
+            $Self->{LayoutObject}->Block(
+                Name => 'StartSmall',
+                Data => {
+                    %FAQData,
+                },
+            );
+        }
+
+        # show a normal window
+        else {
+
+            # show the normal screen header with navigation bar
+            $Output = $Self->{LayoutObject}->Header();
+            $Output .= $Self->{LayoutObject}->NavigationBar();
+
+            $Self->{LayoutObject}->Block(
+                Name => 'StartNormal',
+                Data => {
+                    %FAQData,
+                },
+            );
+        }
 
         # check required parameters
@@ -269,9 +349,30 @@
                 %GetParam,
                 %Error,
-                FormID => $Self->{FormID},
+                ScreenType => $Self->{ScreenType},
+                FormID     => $Self->{FormID},
             );
 
-            # footer
-            $Output .= $Self->{LayoutObject}->Footer();
+            # show a popup screen footer
+            if ( $Self->{ScreenType} eq 'Popup' ) {
+
+                $Self->{LayoutObject}->Block(
+                    Name => 'EndSmall',
+                    Data => {},
+                );
+
+                $Output .= $Self->{LayoutObject}->Footer( Type => 'Small' );
+
+            }
+
+            # show a normal footer
+            else {
+
+                $Self->{LayoutObject}->Block(
+                    Name => 'EndNormal',
+                    Data => {},
+                );
+
+                $Output .= $Self->{LayoutObject}->Footer();
+            }
 
             return $Output;
@@ -428,8 +529,15 @@
         $Self->{UploadCacheObject}->FormIDRemove( FormID => $Self->{FormID} );
 
-        # reload the parent window and close popup
-        return $Self->{LayoutObject}->PopupClose(
-            URL => "Action=AgentFAQZoom;ItemID=$GetParam{ItemID}",
-        );
+        # check if there if we need to close a popup screen or not
+        if ( $Self->{ScreenType} eq 'Popup' ) {
+            return $Self->{LayoutObject}->PopupClose(
+                URL => "Action=AgentFAQZoom;ItemID=$GetParam{ItemID}",
+            );
+        }
+        else {
+            return $Self->{LayoutObject}->Redirect(
+                OP => "Action=AgentFAQZoom;ItemID=$GetParam{ItemID}",
+            );
+        }
     }
 }
---------------------------------------------------------------------
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