[otrs-cvs] otrs/Kernel/Modules CustomerTicketMessage.pm, 1.114, 1.115

"CVS commits notifications of OTRS.org" <[email protected]>
Newsgroups gmane.comp.otrs.cvs
Message-ID <[email protected]>
Comments:
Update of /home/cvs/otrs/Kernel/Modules
In directory lancelot:/tmp/cvs-serv2077/Kernel/Modules

Modified Files:
	CustomerTicketMessage.pm 
Log Message:
Fixed bug#9127 - Problem with CustomerPanelOwnSelection.

Author: mg

Index: CustomerTicketMessage.pm
===================================================================
RCS file: /home/cvs/otrs/Kernel/Modules/CustomerTicketMessage.pm,v
retrieving revision 1.114
retrieving revision 1.115
diff -2 -u -d -r1.114 -r1.115
--- CustomerTicketMessage.pm	20 Nov 2012 14:53:45 -0000	1.114
+++ CustomerTicketMessage.pm	13 Feb 2013 15:16:59 -0000	1.115
@@ -1,5 +1,5 @@
 # --
 # Kernel/Modules/CustomerTicketMessage.pm - to handle customer messages
-# Copyright (C) 2001-2012 OTRS AG, http://otrs.org/
+# Copyright (C) 2001-2013 OTRS AG, http://otrs.org/
 # --
 # $Id$
@@ -188,4 +188,5 @@
         $Output    .= $Self->{LayoutObject}->CustomerNavigationBar();
         $Output    .= $Self->_MaskNew(
+            %GetParam,
             QueueID          => $QueueDefaultID,
             ToSelected       => $Param{ToSelected},
@@ -783,62 +784,23 @@
 
     # check own selection
-    my %NewTos;
-    if ( $Self->{ConfigObject}->Get('Ticket::Frontend::NewQueueOwnSelection') ) {
-        %NewTos = %{ $Self->{ConfigObject}->Get('Ticket::Frontend::NewQueueOwnSelection') };
-    }
-    else {
+    my %NewTos = ( '', '-' );
+    my $Module = $Self->{ConfigObject}->Get('CustomerPanel::NewTicketQueueSelectionModule')
+        || 'Kernel::Output::HTML::CustomerNewTicketQueueSelectionGeneric';
+    if ( $Self->{MainObject}->Require($Module) ) {
+        my $Object = $Module->new( %{$Self}, Debug => $Self->{Debug}, );
 
-        # SelectionType Queue or SystemAddress?
-        my %Tos;
-        if ( $Self->{ConfigObject}->Get('Ticket::Frontend::NewQueueSelectionType') eq 'Queue' ) {
-            %Tos = $Self->{TicketObject}->MoveList(
-                %Param,
-                Type           => 'create',
-                Action         => $Self->{Action},
-                QueueID        => $Self->{QueueID},
-                CustomerUserID => $Self->{UserID},
-            );
-        }
-        else {
-            %Tos = $Self->{DBObject}->GetTableData(
-                Table => 'system_address',
-                What  => 'queue_id, id',
-                Valid => 1,
-                Clamp => 1,
+        # log loaded module
+        if ( $Self->{Debug} > 1 ) {
+            $Self->{LogObject}->Log(
+                Priority => 'debug',
+                Message  => "Module: $Module loaded!",
             );
         }
-
-        # get create permission queues
-        my %UserGroups = $Self->{GroupObject}->GroupMemberList(
-            UserID => $Self->{UserID},
-            Type   => 'create',
-            Result => 'HASH',
-        );
-
-        # build selection string
-        for my $QueueID ( sort keys %Tos ) {
-            my %QueueData = $Self->{QueueObject}->QueueGet( ID => $QueueID );
-
-            # permission check, can we create new tickets in queue
-            next if !$UserGroups{ $QueueData{GroupID} };
-
-            my $String = $Self->{ConfigObject}->Get('Ticket::Frontend::NewQueueSelectionString')
-                || '<Realname> <<Email>> - Queue: <Queue>';
-            $String =~ s/<Queue>/$QueueData{Name}/g;
-            $String =~ s/<QueueComment>/$QueueData{Comment}/g;
-            if ( $Self->{ConfigObject}->Get('Ticket::Frontend::NewQueueSelectionType') ne 'Queue' )
-            {
-                my %SystemAddressData = $Self->{SystemAddress}->SystemAddressGet(
-                    ID => $Tos{$QueueID},
-                );
-                $String =~ s/<Realname>/$SystemAddressData{Realname}/g;
-                $String =~ s/<Email>/$SystemAddressData{Name}/g;
-            }
-            $NewTos{$QueueID} = $String;
-        }
+        %NewTos = ( $Object->Run( Env => $Self, ACLParams => \%Param ), ( '', => '-' ) );
+    }
+    else {
+        return $Self->{LayoutObject}->FatalError();
     }
 
-    # add empty selection
-    $NewTos{''} = '-';
     return \%NewTos;
 }
---------------------------------------------------------------------
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.