New Ticket Number generator - Question

Hi, I just tried to hack Date.pm to a new DateChecksum.pm (for an additional checksum appended to the regular TTN, like in STTS2). I did this, but in $HOME/var/log/procmail-2002-06.log there is a line like this: Undefined subroutine &Kernel::System::Ticket::Number::DateChecksum::GetTNByString called at /opt/OpenTRS/bin/..//Kernel/System/PostMaster.pm line 235, <STDIN> line 39. procmail: Non-zero exitcode (255) from "/opt/OpenTRS//bin/PostMaster.pl" Do I have to register the new Ticket hook anywhere or did I just a stupid mistake during coding? BTW: I attached the new module. BTW2: Is there a specific reason, why the default TTN is smthn. like that: 10001? Why the leading '1'? I want to create TTN's like in STTS, rotating the TTN's on a daily basis via cron. Stefan -- Stefan Schmidt Email: jsj@jsj.dyndns.org jsj@exsuse.de Bremen jsj-hb@t-online.de s.schmidt@iu-bremen.de

Hi Stefan, On Sun, Jun 30, 2002 at 11:32:57AM +0200, Stefan Schmidt wrote:
I just tried to hack Date.pm to a new DateChecksum.pm (for an additional checksum appended to the regular TTN, like in STTS2). I did this, but in $HOME/var/log/procmail-2002-06.log there is a line like this: Undefined subroutine &Kernel::System::Ticket::Number::DateChecksum::GetTNByString called at /opt/OpenTRS/bin/..//Kernel/System/PostMaster.pm line 235, <STDIN> line 39. procmail: Non-zero exitcode (255) from "/opt/OpenTRS//bin/PostMaster.pl"
Do I have to register the new Ticket hook anywhere or did I just a stupid mistake during coding?
Register the module only in the Config.pm. The perl syntax of your DateChecksum.pm is the problem. Try `perl -cw DateChecksum.pm` .-) I attached the diff. ;-)
BTW2: Is there a specific reason, why the default TTN is smthn. like that: 10001? Why the leading '1'? I want to create TTN's like in STTS, rotating the TTN's on a daily basis via cron.
There is no reason. You can also rotate the TicketCounter.log via cron. The whole logic of new ticket numbers are in this module. Just take care that your module returns no existing ticket numbers. Example: If you want ticket numbers like `abc` you can do this with this module.
Stefan
Martin -- Martin Edenhofer - <martin at edenhofer.de> - http://martin.edenhofer.de/ -- Perfection is our goal, excellence will be tolerated. -- J. Yahl

Hi Martin, On Sunday 30 June 2002 17:00, Martin Edenhofer wrote:
On Sun, Jun 30, 2002 at 11:32:57AM +0200, Stefan Schmidt wrote: Register the module only in the Config.pm. The perl syntax of your DateChecksum.pm is the problem. Try `perl -cw DateChecksum.pm` .-)
Thank you, I see. I think, I have to buy a good book ;-)
I attached the diff. ;-)
Again, thank you. Will you put it in CVS?
Martin
Stefan -- Stefan Schmidt Email: jsj@jsj.dyndns.org jsj@exsuse.de Bremen jsj-hb@t-online.de s.schmidt@iu-bremen.de

Hi, On Sunday 30 June 2002 17:15, Stefan Schmidt wrote:
Again, thank you. Will you put it in CVS?
There was another big error in it, thats why here the correct version. Martin, do you have a good idea, how to configure starting a cronjob to reset the ticketcounter? I thought of grepping Config.pm for the TicketNumberGenerator and 'Date'. but if you do not want to reset it, a dedicated option should be there. What do you think? Stefan -- Stefan Schmidt Email: jsj@jsj.dyndns.org jsj@exsuse.de Bremen jsj-hb@t-online.de s.schmidt@iu-bremen.de

Hi Stefan, On Sun, Jun 30, 2002 at 07:06:08PM +0200, Stefan Schmidt wrote:
Again, thank you. Will you put it in CVS?
Ja. I added it to the CVS tree. A good job Stefan. ,-)
Martin, do you have a good idea, how to configure starting a cronjob to reset the ticketcounter? I thought of grepping Config.pm for the TicketNumberGenerator and 'Date'. but if you do not want to reset it, a dedicated option should be there. What do you think?
A good idea! Maybe we should add the last modified time stamp to the TicketCounter.log like "$Counter;$TimeStamp" - "1547;2002-07-01" . So we can put the logic (rotating or not) into the modules. Because it depends on the type of module if the counter should be rotated. Ok?
Stefan
Martin -- Martin Edenhofer - <martin at edenhofer.de> - http://martin.edenhofer.de/ -- "The number of Unix installations has grown to 10, with more expected." The Unix Programmer's Manual, 2nd Edition, June 1972

Hi, On Monday 01 July 2002 23:21, Martin Edenhofer wrote:
Ja. I added it to the CVS tree. A good job Stefan. ,-)
Not all mine, ask Sibbi, if some code is known to him ;-) BTW: perhaps he should be mentioned in copyright in that file.
A good idea! Maybe we should add the last modified time stamp to the TicketCounter.log like "$Counter;$TimeStamp" - "1547;2002-07-01" . So we can put the logic (rotating or not) into the modules. Because it depends on the type of module if the counter should be rotated.
Ok?
Of course this is the best idea, but will it break compatibility? Or, if you read the TicketCounter.log from other modules, can you ignore the timestamp? This is never done, and if you change the ticket number syntax, you always have to do things by hand, but we should keep it in mind and change all other modules, that way. Will you do? Or should I try?
Martin
Stefan -- Stefan Schmidt Email: jsj@jsj.dyndns.org jsj@exsuse.de Bremen jsj-hb@t-online.de s.schmidt@iu-bremen.de

Hi Stefan, On Tue, Jul 02, 2002 at 07:23:08PM +0200, Stefan Schmidt wrote:
Ja. I added it to the CVS tree. A good job Stefan. ,-)
Not all mine, ask Sibbi, if some code is known to him ;-) BTW: perhaps he should be mentioned in copyright in that file.
Ja, both. Sibbi is a pretty good coder and we should add him.
A good idea! Maybe we should add the last modified time stamp to the TicketCounter.log like "$Counter;$TimeStamp" - "1547;2002-07-01" . So we can put the logic (rotating or not) into the modules. Because it depends on the type of module if the counter should be rotated. Ok?
Of course this is the best idea, but will it break compatibility?
No. .)
Or, if you read the TicketCounter.log from other modules, can you ignore the timestamp? This is never done, and if you change the ticket number syntax, you always have to do things by hand, but we should keep it in mind and change all other modules, that way.
Will you do? Or should I try?
Done. It was easy for me. Stefan: You are providing good code and good ideas to the OpenTRS project. Thanks a lot.
Stefan
Martin -- Martin Edenhofer - <martin at edenhofer.de> - http://martin.edenhofer.de/ -- socrate: 10:42pm up 17 days, 22:42, 3 users, load average: 0.03, 0.04, 0.00

Hi,
Zitat von Martin Edenhofer
Not all mine, ask Sibbi, if some code is known to him ;-) BTW: perhaps he should be mentioned in copyright in that file.
Ja, both. Sibbi is a pretty good coder and we should add him.
No, please don't mention me, it's not my code. But thanks anyways.
Martin
cu, Sibbi -- You can observe a lot by just watching.
participants (3)
-
Martin Edenhofer
-
Sebastian Wormser
-
Stefan Schmidt