diff options
| author | fukachan <fukachan> | 2001-11-03 00:18:00 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2001-11-03 00:18:00 +0000 |
| commit | 707c14a03a4de82064901fdd5ce3e8ef6c5a25c3 (patch) | |
| tree | 39b15d246d299218d1c5e7089501341d8c11dd45 /fml/lib/Mail/ThreadTrack | |
| parent | 94a4a178a096260827d4468692860fc0da4eb511 (diff) | |
| download | fml8-707c14a03a4de82064901fdd5ce3e8ef6c5a25c3.tar.gz fml8-707c14a03a4de82064901fdd5ce3e8ef6c5a25c3.tar.bz2 fml8-707c14a03a4de82064901fdd5ce3e8ef6c5a25c3.zip | |
s/ticket_id/thread_id/g
Diffstat (limited to 'fml/lib/Mail/ThreadTrack')
| -rw-r--r-- | fml/lib/Mail/ThreadTrack/Analyze.pm | 110 | ||||
| -rw-r--r-- | fml/lib/Mail/ThreadTrack/DB.pm | 6 | ||||
| -rw-r--r-- | fml/lib/Mail/ThreadTrack/HeaderRewrite.pm | 6 | ||||
| -rw-r--r-- | fml/lib/Mail/ThreadTrack/Print.pm | 28 | ||||
| -rw-r--r-- | fml/lib/Mail/ThreadTrack/Print/CGI.pm | 20 |
5 files changed, 85 insertions, 85 deletions
diff --git a/fml/lib/Mail/ThreadTrack/Analyze.pm b/fml/lib/Mail/ThreadTrack/Analyze.pm index a30b5923..238f5651 100644 --- a/fml/lib/Mail/ThreadTrack/Analyze.pm +++ b/fml/lib/Mail/ThreadTrack/Analyze.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: Analyze.pm,v 1.1.1.1 2001/11/02 09:07:39 fukachan Exp $ +# $FML: Analyze.pm,v 1.2 2001/11/03 00:13:10 fukachan Exp $ # package Mail::ThreadTrack::Analyze; @@ -68,7 +68,7 @@ sub _is_reply # Descriptions: assign a new ticket or # extract the existing ticket-id from the subject # Arguments: $self $curproc $args -# Side Effects: a new ticket_id may be assigned +# Side Effects: a new thread_id may be assigned # article header is rewritten # Return Value: none sub _assign @@ -79,19 +79,19 @@ sub _assign my $subject = $header->get('subject'); my $is_reply = _is_reply($subject); - # 1. try to extract $ticket_id from subject: field - my $ticket_id = $self->_extract_ticket_id_in_subject($header, $config); - unless ($ticket_id) { - # 1.1 hmm, we tail to but we try to speculate ticket_id + # 1. try to extract $thread_id from subject: field + my $thread_id = $self->_extract_thread_id_in_subject($header, $config); + unless ($thread_id) { + # 1.1 hmm, we tail to but we try to speculate thread_id # from other header information. - $ticket_id = $self->_speculate_ticket_id($msg); - if ($ticket_id) { + $thread_id = $self->_speculate_thread_id($msg); + if ($thread_id) { $is_reply = 1; - $self->{ _ticket_id } = $ticket_id; - $self->log("speculated id=$ticket_id"); + $self->{ _thread_id } = $thread_id; + $self->log("speculated id=$thread_id"); } else { - $self->log("(debug) fail to spelucate ticket_id"); + $self->log("(debug) fail to spelucate thread_id"); } } @@ -107,20 +107,20 @@ sub _assign } # if the header carries "Subject: Re: ..." with ticket-id, - # we do not rewrite the subject but save the extracted $ticket_id. - if ($is_reply && $ticket_id) { - $self->log("reply message with ticket_id=$ticket_id"); - $self->{ _ticket_id } = $ticket_id; + # we do not rewrite the subject but save the extracted $thread_id. + if ($is_reply && $thread_id) { + $self->log("reply message with thread_id=$thread_id"); + $self->{ _thread_id } = $thread_id; $self->{ _status } = 'analyzed'; $self->_append_ticket_status_info('analyzed'); } - elsif ($ticket_id) { - $self->log("usual message with ticket_id=$ticket_id"); - $self->{ _ticket_id } = $ticket_id; + elsif ($thread_id) { + $self->log("usual message with thread_id=$thread_id"); + $self->{ _thread_id } = $thread_id; $self->_append_ticket_status_info("found"); } else { - $self->log("message with no ticket_id"); + $self->log("message with no thread_id"); # assign a new ticket number for a new message my $id = $self->increment_id(); @@ -128,7 +128,7 @@ sub _assign # O.K. rewrite Subject: of the article to distribute unless ($self->error) { my $header = $msg->rfc822_message_header(); - $self->_get_ticket_id($header, $config, $id); + $self->_get_thread_id($header, $config, $id); $self->_rewrite_header($header, $config, $id); $self->_append_ticket_status_info("newly assigned"); } @@ -151,12 +151,12 @@ sub _assign # From: rudo # To: elena-ml # -# This reply message has no ticket_id since the message from kenken to +# This reply message has no thread_id since the message from kenken to # rudo comes directly from kenken not through fml driver. -# In this case, we try to speculdate the reply relation and the ticket_id -# of this thread by using _speculate_ticket_id(). +# In this case, we try to speculdate the reply relation and the thread_id +# of this thread by using _speculate_thread_id(). # -sub _speculate_ticket_id +sub _speculate_thread_id { my ($self, $msg) = @_; my $header = $msg->rfc822_message_header(); @@ -284,14 +284,14 @@ sub _extract_message_id_references } -sub _extract_ticket_id_in_subject +sub _extract_thread_id_in_subject { my ($self, $header, $config) = @_; my $tag = $config->{ ticket_subject_tag }; my $subject = $header->get('subject'); my $regexp = _regexp_compile($tag); - # Subject: ... [ticket_id] + # Subject: ... [thread_id] if (($config->{ ticket_subject_tag_location } eq 'appended') && ($subject =~ /($regexp)\s*$/)) { my $id = $1; @@ -300,8 +300,8 @@ sub _extract_ticket_id_in_subject return $id; } # XXX incomplete, we check subject after cutting off "Re:" et. al. - # Subject: [ticket_id] ... - # Subject: Re: [ticket_id] ... + # Subject: [thread_id] ... + # Subject: Re: [thread_id] ... elsif (($config->{ ticket_subject_tag_location } eq 'appended') && ($subject =~ /^\s*($regexp)/)) { my $id = $1; @@ -316,20 +316,20 @@ sub _extract_ticket_id_in_subject } -sub _get_ticket_id +sub _get_thread_id { my ($self, $header, $config, $id) = @_; my $subject_tag = $config->{ ticket_subject_tag }; - my $id_syntax = $config->{ ticket_id_syntax }; + my $id_syntax = $config->{ thread_id_syntax }; - # ticket_id in subject - my $ticket_id = sprintf($subject_tag, $id); - $self->{ _ticket_subject_tag } = $ticket_id; + # thread_id in subject + my $thread_id = sprintf($subject_tag, $id); + $self->{ _ticket_subject_tag } = $thread_id; - $ticket_id = sprintf($id_syntax, $id); - $self->{ _ticket_id } = $ticket_id; + $thread_id = sprintf($id_syntax, $id); + $self->{ _thread_id } = $thread_id; - return $ticket_id; + return $thread_id; } @@ -393,18 +393,18 @@ sub _update_db my ($self, $msg) = @_; my $config = $self->{ _config }; my $article_id = $config->{ article_id }; - my $ticket_id = $self->{ _ticket_id }; + my $thread_id = $self->{ _thread_id }; # 0. logging - $self->log("article_id=$article_id ticket_id=$ticket_id"); + $self->log("article_id=$article_id thread_id=$thread_id"); # prepare hash table tied to db_dir/*db's my $rh = $self->{ _hash_table }; # 1. - $rh->{ _ticket_id }->{ $article_id } = $ticket_id; + $rh->{ _thread_id }->{ $article_id } = $thread_id; $rh->{ _date }->{ $article_id } = time; - $rh->{ _articles }->{ $ticket_id } .= $article_id . " "; + $rh->{ _articles }->{ $thread_id } .= $article_id . " "; # 2. record the sender information my $header = $msg->rfc822_message_header; @@ -412,24 +412,24 @@ sub _update_db # 3. update status information if (defined $self->{ _status }) { - $self->_set_status($ticket_id, $self->{ _status }); + $self->_set_status($thread_id, $self->{ _status }); } else { # set the default status value for the first time. - unless (defined $rh->{ _status }->{ $ticket_id }) { - $self->_set_status($ticket_id, 'open'); + unless (defined $rh->{ _status }->{ $thread_id }) { + $self->_set_status($thread_id, 'open'); } } # 4. save optional/additional information - # message_id hash is { message_id => ticket_id }; + # message_id hash is { message_id => thread_id }; my $mid = $header->get('message-id'); $mid = $self->_address_clean_up($mid); - $rh->{ _message_id }->{ $mid } = $ticket_id; + $rh->{ _message_id }->{ $mid } = $thread_id; # 5. history my $buf = ''; - my (@aid) = split(/\s+/, $rh->{ _articles }->{ $ticket_id }); + my (@aid) = split(/\s+/, $rh->{ _articles }->{ $thread_id }); my $sender = $rh->{ _sender }->{ $aid[0] }; my $when = $rh->{ _date }->{ $aid[0] }; @@ -454,24 +454,24 @@ sub _update_index_db { my ($self) = @_; my $config = $self->{ _config }; - my $ticket_id = $self->{ _ticket_id }; + my $thread_id = $self->{ _thread_id }; my $rh = $self->{ _hash_table }; my $ml_name = $config->{ ml_name }; - my $ref = $rh->{ _index }->{ $ticket_id } || ''; + my $ref = $rh->{ _index }->{ $thread_id } || ''; if ($ref !~ /^$ml_name|\s$ml_name\s|$ml_name$/) { - $rh->{ _index }->{ $ticket_id } .= $ml_name." "; + $rh->{ _index }->{ $thread_id } .= $ml_name." "; } } =head2 C<set_status($args)> -set $status for $ticket_id. It rewrites DB (file). +set $status for $thread_id. It rewrites DB (file). C<$args>, HASH reference, must have two keys. $args = { - ticket_id => $ticket_id, + thread_id => $thread_id, status => $status, } @@ -487,19 +487,19 @@ C<set_status()> calls db_open() an db_close() automatically within it. sub set_status { my ($self, $args) = @_; - my $ticket_id = $args->{ ticket_id }; + my $thread_id = $args->{ thread_id }; my $status = $args->{ status }; $self->db_open(); - $self->_set_status($ticket_id, $status); + $self->_set_status($thread_id, $status); $self->db_close(); } sub _set_status { - my ($self, $ticket_id, $value) = @_; - $self->{ _hash_table }->{ _status }->{ $ticket_id } = $value; + my ($self, $thread_id, $value) = @_; + $self->{ _hash_table }->{ _status }->{ $thread_id } = $value; } diff --git a/fml/lib/Mail/ThreadTrack/DB.pm b/fml/lib/Mail/ThreadTrack/DB.pm index 87d4ba02..c682aed0 100644 --- a/fml/lib/Mail/ThreadTrack/DB.pm +++ b/fml/lib/Mail/ThreadTrack/DB.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: @template.pm,v 1.1 2001/08/07 12:23:48 fukachan Exp $ +# $FML: DB.pm,v 1.1.1.1 2001/11/02 09:07:39 fukachan Exp $ # package Mail::ThreadTrack::DB; @@ -29,7 +29,7 @@ Mail::ThreadTrack::DB - what is this open DB. It uses tie() to bind a hash to a DB file. Our minimal_states uses several DB files for -C<%ticket_id>, +C<%thread_id>, C<%date>, C<%status>, C<%sender>, @@ -45,7 +45,7 @@ untie() corresponding hashes opened by C<db_open()>. =cut -my @kind_of_databases = qw(ticket_id +my @kind_of_databases = qw(thread_id info date status diff --git a/fml/lib/Mail/ThreadTrack/HeaderRewrite.pm b/fml/lib/Mail/ThreadTrack/HeaderRewrite.pm index ee6f860a..a05ee571 100644 --- a/fml/lib/Mail/ThreadTrack/HeaderRewrite.pm +++ b/fml/lib/Mail/ThreadTrack/HeaderRewrite.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: @template.pm,v 1.2 2001/10/27 04:27:18 fukachan Exp $ +# $FML: HeaderRewrite.pm,v 1.1.1.1 2001/11/02 09:07:39 fukachan Exp $ # package Mail::ThreadTrack::HeaderRewrite; @@ -40,8 +40,8 @@ sub rewrite_header $header->add('X-Ticket-Status', $self->{ _status_info }); } - if (defined $self->{ _ticket_id }) { - $header->add('X-Ticket-ID', $self->{ _ticket_id }); + if (defined $self->{ _thread_id }) { + $header->add('X-Ticket-ID', $self->{ _thread_id }); } if (defined $self->{ _status_history }) { diff --git a/fml/lib/Mail/ThreadTrack/Print.pm b/fml/lib/Mail/ThreadTrack/Print.pm index 76b535f7..855fa2ed 100644 --- a/fml/lib/Mail/ThreadTrack/Print.pm +++ b/fml/lib/Mail/ThreadTrack/Print.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: Print.pm,v 1.1.1.1 2001/11/02 09:07:39 fukachan Exp $ +# $FML: Print.pm,v 1.2 2001/11/03 00:10:06 fukachan Exp $ # package Mail::ThreadTrack::Print; @@ -41,7 +41,7 @@ C<articles>, which is a list of articles with the ticket-id. =head2 C<simple_print()> -show entries by the ticket_id order. For example, +show entries by the thread_id order. For example, date age status ticket id articles ------------------------------------------------------------ @@ -65,30 +65,30 @@ It is also larger if $status is C<open>. sub show_summary { my ($self) = @_; - my ($tid, $status, $ticket_id); + my ($tid, $status, $thread_id); my $mode = $self->get_mode || 'text'; # rh: ticket id list, which is ARRAY REFERENCE tied to db_dir/*db's - $ticket_id = $self->list_up_ticket_id(); + $thread_id = $self->list_up_thread_id(); # self->{ _hash_table } is tied to DB's. $self->db_open(); - if (@$ticket_id) { + if (@$thread_id) { # sort the ticket output order it out by cost # and print the ticket summary in that order. - $self->sort($ticket_id); + $self->sort($thread_id); if ($mode eq 'html') { print "<TABLE BORDER=4>\n" if $mode eq 'html'; - $self->_print_ticket_summary($ticket_id); + $self->_print_ticket_summary($thread_id); print "</TABLE>\n" if $mode eq 'html'; } else { - $self->_print_ticket_summary($ticket_id); + $self->_print_ticket_summary($thread_id); # show short summary for each article - $self->_print_article_summary($ticket_id); + $self->_print_article_summary($thread_id); } } @@ -100,7 +100,7 @@ sub show_summary sub _print_ticket_summary { - my ($self, $ticket_id) = @_; + my ($self, $thread_id) = @_; my $mode = $self->get_mode || 'text'; my $rh_age = $self->{ _age } || {}; my $fd = $self->{ _fd } || \*STDOUT; @@ -120,13 +120,13 @@ sub _print_ticket_summary my ($tid, @article_id, $article_id, $date, $age, $status) = (); my $dh = new Mail::Message::Date; - for $tid (@$ticket_id) { + for $tid (@$thread_id) { # get the first $article_id from the article_id list (@article_id) = split(/\s+/, $rh->{ _articles }->{ $tid }); $article_id = $article_id[0]; # determine $date for the $article_id - # $age and $status for $ticket_id + # $age and $status for $thread_id $date = $dh->YYYYxMMxDD( $rh->{ _date }->{ $article_id } , '/'); $age = $rh_age->{ $tid }; $status = $rh->{ _status }->{ $tid }; @@ -164,7 +164,7 @@ sub _cost_to_indicator sub _print_article_summary { - my ($self, $ticket_id) = @_; + my ($self, $thread_id) = @_; my $config = $self->{ _config }; my $age = $self->{ _age } || {}; my $cost = $self->{ _cost } || {}; @@ -179,7 +179,7 @@ sub _print_article_summary } my $spool_dir = $config->{ spool_dir }; - for my $tid (@$ticket_id) { + for my $tid (@$thread_id) { if ($is_show_cost_indicate) { my $how_bad = _cost_to_indicator( $cost->{ $tid } ); printf $fd "\n%6s %-10s %s\n", $how_bad, $tid; diff --git a/fml/lib/Mail/ThreadTrack/Print/CGI.pm b/fml/lib/Mail/ThreadTrack/Print/CGI.pm index 6fe0e844..0eb9b1a0 100644 --- a/fml/lib/Mail/ThreadTrack/Print/CGI.pm +++ b/fml/lib/Mail/ThreadTrack/Print/CGI.pm @@ -10,17 +10,17 @@ sub STR2EUC sub show_articles_for_ticket { - my ($self, $ticket_id) = @_; + my ($self, $thread_id) = @_; my $mode = $self->get_mode || 'text'; my $config = $self->{ _config }; my $spool_dir = $config->{ spool_dir }; $self->db_open(); - my $articles = $self->{ _hash_table }->{ _articles }->{ $ticket_id }; + my $articles = $self->{ _hash_table }->{ _articles }->{ $thread_id }; print "<B>"; - print "show contents related with ticket_id=$ticket_id\n"; + print "show contents related with thread_id=$thread_id\n"; print "</B>"; print "<HR>"; print "<PRE>\n"; @@ -87,7 +87,7 @@ sub cgi_top_menu -# This shows summary on C<$ticket_id> in HTML language. +# This shows summary on C<$thread_id> in HTML language. # It is used in C<FML::CGI::TicketSystem>. sub _show_ticket_by_html_table { @@ -108,13 +108,13 @@ sub _show_ticket_by_html_table my $articles = $optargs->{ articles }; my $aid = (split(/\s+/, $articles))[0]; - # do nothing if the $ticket_id is unknown. + # do nothing if the $thread_id is unknown. return unless $tid; # <FORM ACTION=> ..> my $xtid = CGI::escape($tid); $action = "${action}?ml_name=${ml_name}"; - $action .= "&ticket_id=$xtid&article_id=$aid"; + $action .= "&thread_id=$xtid&article_id=$aid"; print "<TR>\n"; print "<TD>"; @@ -159,21 +159,21 @@ sub run_cgi # get action parameter via HTTP my $action = param('action') || 'list'; - my $ticket_id = param('ticket_id'); + my $thread_id = param('thread_id'); # o.k start html print start_html(-title=>$title,-BGCOLOR=>$color), "\n"; if ($action eq 'close') { $self->set_status({ - ticket_id => $ticket_id, + thread_id => $thread_id, status => 'closed', }); } if ($action eq 'show') { - Log("run.cgi.show_articles for $ticket_id"); - $self->show_articles_for_ticket($ticket_id); + Log("run.cgi.show_articles for $thread_id"); + $self->show_articles_for_ticket($thread_id); } else { # menu at the top of scrren |
