diff options
| author | fukachan <fukachan> | 2001-10-08 23:26:08 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2001-10-08 23:26:08 +0000 |
| commit | 29fe54a4bb07ada4a6456ae9f3f5fbe012538caa (patch) | |
| tree | e1d570ede1ee88a414effccdffd54818491d73eb | |
| parent | bf7b3caa8770f7614476bcc26359a931eb65955b (diff) | |
| download | fml8-29fe54a4bb07ada4a6456ae9f3f5fbe012538caa.tar.gz fml8-29fe54a4bb07ada4a6456ae9f3f5fbe012538caa.tar.bz2 fml8-29fe54a4bb07ada4a6456ae9f3f5fbe012538caa.zip | |
consider $ticket_subject_tag_location in regexp
more log messages
| -rw-r--r-- | fml/lib/FML/Ticket/Model/minimal_states.pm | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/fml/lib/FML/Ticket/Model/minimal_states.pm b/fml/lib/FML/Ticket/Model/minimal_states.pm index c24369e5..479972c6 100644 --- a/fml/lib/FML/Ticket/Model/minimal_states.pm +++ b/fml/lib/FML/Ticket/Model/minimal_states.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: minimal_states.pm,v 1.20 2001/07/31 14:19:44 fukachan Exp $ +# $FML: minimal_states.pm,v 1.21 2001/08/22 03:08:00 fukachan Exp $ # package FML::Ticket::Model::minimal_states; @@ -170,6 +170,8 @@ sub assign $self->_set_status_info("found"); } else { + Log("message with no ticket_id"); + # assign a new ticket number for a new message # call SUPER class's FML::Ticket::System::increment_id() my $id = $self->increment_id( $config->{ ticket_sequence_file } ); @@ -324,12 +326,28 @@ sub _extract_ticket_id my $obj = new FML::Header::Subject; my $regexp = $obj->regexp_compile($tag); - if ($subject =~ /($regexp)\s*$/) { + # Subject: ... [ticket_id] + if (($config->{ ticket_subject_tag_location } eq 'appended') && + ($subject =~ /($regexp)\s*$/)) { + my $id = $1; + $id =~ s/^(\[|\(|\{)//; + $id =~ s/(\]|\)|\})$//; + return $id; + } + # XXX incomplete, we check subject after cutting off "Re:" et. al. + # Subject: [ticket_id] ... + # Subject: Re: [ticket_id] ... + elsif (($config->{ ticket_subject_tag_location } eq 'appended') && + ($subject =~ /^\s*($regexp)/)) { my $id = $1; $id =~ s/^(\[|\(|\{)//; $id =~ s/(\]|\)|\})$//; return $id; } + else { + Log("no ticket id /$regexp/ in subject"); + return 0; + } } |
