Hi,
I'm creating a new Ticket::NumberGenerator, and I want my NumberGenerator have the CustomerID, is it possible?
Cumps
Ticket::NumberGenerator
Moderator: crythias
-
- Znuny newbie
- Posts: 28
- Joined: 09 Mar 2015, 14:41
- Znuny Version: 4.0.5
- Real Name: Tiago Rocha
-
- Moderator
- Posts: 10169
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: Ticket::NumberGenerator
yes
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
-
- Znuny newbie
- Posts: 28
- Joined: 09 Mar 2015, 14:41
- Znuny Version: 4.0.5
- Real Name: Tiago Rocha
Re: Ticket::NumberGenerator
can you tell me how?crythias wrote:yes
-
- Znuny newbie
- Posts: 28
- Joined: 09 Mar 2015, 14:41
- Znuny Version: 4.0.5
- Real Name: Tiago Rocha
Re: Ticket::NumberGenerator
can you tell me how can i get the TicketID?crythias wrote:yes
this is my code:
Code: Select all
# check needed stuff
for (qw(TicketID UserID)) {
if ( !$Param{$_} ) {
$Kernel::OM->Get('Kernel::System::Log')->Log(
Priority => 'error',
Message => "Need $_!"
);
return;
}
}
# get ticket data
my %Ticket = $Kernel::OM->Get('Kernel::System::Ticket')->TicketGet(
TicketID => $Param{TicketID},
);
# get customer user object
my $CustomerUserObject = $Kernel::OM->Get('Kernel::System::CustomerUser');
# check customer id
my %CustomerData = $CustomerUserObject->CustomerUserDataGet( User => $Param{UserID} );
# get customer ids
my @CustomerIDs = $CustomerUserObject->CustomerIDs( User => $Param{UserID} );
# add own customer id
if ( $CustomerData{UserCustomerID} ) {
push @CustomerIDs, $CustomerData{UserCustomerID};
}
# check customer ids, return access if customer id is the same
CUSTOMERID:
for my $CustomerID (@CustomerIDs)
{
$CustomerIDFinal = $Ticket{CustomerID} if ( lc $Ticket{CustomerID} eq lc $CustomerID );
next CUSTOMERID if !$Ticket{CustomerID};
}
-
- Moderator
- Posts: 10169
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: Ticket::NumberGenerator
Read the code for a comparable ticket number generator.
It might be helpful to have some background, what you've done, what you're capable of handling, what exactly is blocking your forward progress, etc.
It might be helpful to have some background, what you've done, what you're capable of handling, what exactly is blocking your forward progress, etc.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
-
- Znuny newbie
- Posts: 28
- Joined: 09 Mar 2015, 14:41
- Znuny Version: 4.0.5
- Real Name: Tiago Rocha
Re: Ticket::NumberGenerator
I read, but I continued blocked in with TicketId, any suggestions?crythias wrote:Read the code for a comparable ticket number generator.
It might be helpful to have some background, what you've done, what you're capable of handling, what exactly is blocking your forward progress, etc.
The rest I could already develop (I think)
Cumps
-
- Moderator
- Posts: 10169
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: Ticket::NumberGenerator
I don't know what this means in a context that is reparable.jafumega27 wrote:but I continued blocked in with TicketId, any suggestions?
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask