summaryrefslogtreecommitdiff
path: root/fml
diff options
context:
space:
mode:
authorfukachan <fukachan>2001-01-26 05:01:37 +0000
committerfukachan <fukachan>2001-01-26 05:01:37 +0000
commitd958824167df319d2f6e77d048ca53896bb93ca6 (patch)
tree6f74a4d105a6d9574f340f556ae9423d5b41d259 /fml
parent743212b89a80a6327289c111eba84b87e03b9223 (diff)
downloadfml8-d958824167df319d2f6e77d048ca53896bb93ca6.tar.gz
fml8-d958824167df319d2f6e77d048ca53896bb93ca6.tar.bz2
fml8-d958824167df319d2f6e77d048ca53896bb93ca6.zip
recode that ticke is closed
Diffstat (limited to 'fml')
-rw-r--r--fml/lib/FML/Process/Distribute.pm1
-rw-r--r--fml/lib/FML/Ticket/Model/toymodel.pm21
2 files changed, 19 insertions, 3 deletions
diff --git a/fml/lib/FML/Process/Distribute.pm b/fml/lib/FML/Process/Distribute.pm
index ad2124b9..0930e1aa 100644
--- a/fml/lib/FML/Process/Distribute.pm
+++ b/fml/lib/FML/Process/Distribute.pm
@@ -214,6 +214,7 @@ sub _ticket_check
unless ($@) {
my $ticket = $pkg->new;
$ticket->assign($curproc, $args);
+ $ticket->update_status($curproc, $args);
$ticket->update_cache($curproc, $args);
}
else {
diff --git a/fml/lib/FML/Ticket/Model/toymodel.pm b/fml/lib/FML/Ticket/Model/toymodel.pm
index 71445d1c..84b8346e 100644
--- a/fml/lib/FML/Ticket/Model/toymodel.pm
+++ b/fml/lib/FML/Ticket/Model/toymodel.pm
@@ -66,6 +66,21 @@ sub assign
}
+sub update_status
+{
+ my ($self, $curproc, $args) = @_;
+ my $rbody = $curproc->{ article }->{ body };
+ my $content = $rbody->get_content_reference();
+
+ if ($$content =~ /close/) {
+ $self->{ _ticket_id } .= " closed";
+ }
+ else {
+ Log("(debug) ticket status not changes");
+ }
+}
+
+
sub update_cache
{
my ($self, $curproc, $args) = @_;
@@ -77,6 +92,9 @@ sub update_cache
# cache file
$self->{ _cache_file } = $cache_file;
+ # initialize $db_dir and $cache_file for further work
+ $self->_update_cache_init($curproc, $args) || do { return undef;};
+
# save $id in $cache_file
$self->_save_ticket_id_in_cache($curproc, $args);
}
@@ -130,9 +148,6 @@ sub _save_ticket_id_in_cache
my $config = $curproc->{ config };
my $pcb = $curproc->{ pcb };
- # initialize $db_dir and $cache_file for further work
- $self->_update_cache_init($curproc, $args) || do { return undef;};
-
use IO::File;
my $fh = new IO::File $self->{ _cache_file }, "a";
if (defined $fh) {