Iframe Dashboard Shoutbox

Hilfe zu Znuny Problemen aller Art
Locked
eugsterli
Znuny newbie
Posts: 16
Joined: 30 Aug 2010, 11:27
Znuny Version: 3

Iframe Dashboard Shoutbox

Post by eugsterli »

Guten Tag alleseites,

ich schreibe gerade ein Shoutbox welche ich nun per iframe in das Dashboard einbinde.

Zurzeit müssen die Agenten Ihr Name noch von Hand eintragen, ich möchte jedoch das dies automatisch vonstatten geht.

mit mysql hat ichs schon versucht, da bekomme ich ja nicht die Information welcher Agent eingeloggt ist. Aber wie bekommt ich die Verbindung zu perl hin damit ich z.B $QEnv{"UserFirstname"} einbinden kann.

geschrieben ich das Ding mit php, hat mir jemand ein Input?
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Iframe Dashboard Shoutbox

Post by reneeb »

Wie integrierst Du das iframe im Dashboard? Das Modul, kennt die UserID des eingeloggten Users, damit kommst Du an den Namen (siehe http://dev.otrs.org/ -> Kernel::System::User) des Agenten. Das kannst Du dann dem iframe-src übergeben...
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
eugsterli
Znuny newbie
Posts: 16
Joined: 30 Aug 2010, 11:27
Znuny Version: 3

Re: Iframe Dashboard Shoutbox

Post by eugsterli »

Im Anhang siehst du wie ich die Shoutbox einbinde...
Wie soll ich jetzt das mitgeben können?
You do not have the required permissions to view the files attached to this post.
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Iframe Dashboard Shoutbox

Post by reneeb »

In Kernel::Output::HTML::DashboardIFrame steht die UserID zur Verfügung...

Änderung in Kernel/Output/HTML/Standard/AgentDashboardIFrame.dtl:

Code: Select all

<iframe src="$QData{"URL"}"
nach

Code: Select all

<iframe src="$QData{"URL"}?Username=$QData{"UserFirstname"}"
neue Version des Moduls:

Code: Select all

# --
# Kernel/Output/HTML/DashboardIFrame.pm
# Copyright (C) 2001-2012 xxx, http://otrs.org/
# --
# $Id:
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see L<http://www.gnu.org/licenses/agpl.txt>.
# --

package Kernel::Output::HTML::DashboardIFrame;

use strict;
use warnings;

use vars qw($VERSION);
$VERSION = qw($Revision: 1.3 $) [1];

sub new {
    my ( $Type, %Param ) = @_;

    # allocate new hash for object
    my $Self = {%Param};
    bless( $Self, $Type );

    # get needed objects
    for (
        qw(Config Name ConfigObject LogObject DBObject LayoutObject ParamObject TicketObject UserObject UserID)
        )
    {
        die "Got no $_!" if ( !$Self->{$_} );
    }

    return $Self;
}

sub Preferences {
    my ( $Self, %Param ) = @_;

    return;
}

sub Config {
    my ( $Self, %Param ) = @_;

    return (
        %{ $Self->{Config} }
    );
}

sub Run {
    my ( $Self, %Param ) = @_;

    # quote Title attribute, it will be used as name="" parameter of the iframe
    my $Title = $Self->{Config}->{Title} || '';
    $Title =~ s/\s/_/smx;

    my %UserData = $Self->{UserObject}->GetUserData(
            UserID        => $Self->{UserID},
     );

    my $Content = $Self->{LayoutObject}->Output(
        TemplateFile => 'AgentDashboardIFrame',
        Data         => {
            %{ $Self->{Config} },
            Title => $Title,
            %UserData,
        },
    );

    return $Content;
}

1;
(ungetestet)

Edit: Dem GET-Parameter für URL noch den Namen "Username" gegeben...
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Locked