Kernel::System::Ticket::NumberBase - Common functions for ticket number generators
informs if the current number counter has a reset with every new day or not. All generators need to implement this function.
my $IsDatebased = $TicketNumberObject->IsDateBased();
Add a new unique ticket counter entry. These counters are used by the different number generators to generate unique TicketNumber
s
my $Counter = $TicketNumberObject->TicketNumberCounterAdd( Offset => 123, );
Returns:
my $Counter = 123; # undef in case of an error
This method has logic to generate unique numbers even though concurrent processes might write to the same table. The algorithm runs as follows: - Insert a new record into the ticket_number_counter
table with a counter
value of 0. - Then update all preceding records including and up to the current one that still have value 0 and compute the correct value for each, which depends on the previous record.
This works well also if concurrent processes write to the records at the same time, because they will compute the same (unique) values for the counters.
Remove a ticket counter entry.
my $Success = $TicketNumberObject->TicketNumberCounterDelete( CounterID => 123, );
Returns:
my $Success = 1; # false in case of an error
Check if there are no records in ticket_number_counter DB table.
my $IsEmpty = $TicketNumberObject->TicketNumberCounterIsEmpty();
Returns:
my $IsEmpty = 1; # 0 if it is not empty and undef in case of an error
Removes old counters from the system.
my $Success = $TicketNumberObject->TicketNumberCounterCleanup();
Returns:
my $Success = 1; # or false in case of an error
Creates a unique ticket number.
my $TicketNumber = $TicketNumberObject->TicketCreateNumber();
Returns:
my $TicketNumber = 456;
Generates a unique identifier.
my $UID = $TicketNumberObject->_GetUID();
Returns:
my $UID = 14906327941360ed8455f125d0450277;
This software is part of the OTRS project (https://otrs.org/).
This software comes with ABSOLUTELY NO WARRANTY. For details, see the enclosed file COPYING for license information (GPL). If you did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.