| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | # -*- Mode: cperl; mode: folding; -*- | 
| 2 |  |  |  |  |  |  |  | 
| 3 |  |  |  |  |  |  | package Goo::Thing::task::Finisher; | 
| 4 |  |  |  |  |  |  |  | 
| 5 |  |  |  |  |  |  | ############################################################################### | 
| 6 |  |  |  |  |  |  | # Turbo10.com | 
| 7 |  |  |  |  |  |  | # | 
| 8 |  |  |  |  |  |  | # Copyright Turbo10.com 2005 | 
| 9 |  |  |  |  |  |  | # All Rights Reserved | 
| 10 |  |  |  |  |  |  | # | 
| 11 |  |  |  |  |  |  | # Author:       Nigel Hamilton | 
| 12 |  |  |  |  |  |  | # Filename:     Goo::Thing::task::Finisher.pm | 
| 13 |  |  |  |  |  |  | # Description:  Finish a task | 
| 14 |  |  |  |  |  |  | # | 
| 15 |  |  |  |  |  |  | # Date          Change | 
| 16 |  |  |  |  |  |  | # ----------------------------------------------------------------------------- | 
| 17 |  |  |  |  |  |  | # 16/10/2005    Auto generated file | 
| 18 |  |  |  |  |  |  | # 16/10/2005    Need to create a task object | 
| 19 |  |  |  |  |  |  | # | 
| 20 |  |  |  |  |  |  | ############################################################################### | 
| 21 |  |  |  |  |  |  |  | 
| 22 | 1 |  |  | 1 |  | 2843 | use strict; | 
|  | 1 |  |  |  |  | 3 |  | 
|  | 1 |  |  |  |  | 30 |  | 
| 23 |  |  |  |  |  |  |  | 
| 24 | 1 |  |  | 1 |  | 5 | use Goo::Object; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 16 |  | 
| 25 | 1 |  |  | 1 |  | 5 | use Goo::Prompter; | 
|  | 1 |  |  |  |  | 3 |  | 
|  | 1 |  |  |  |  | 17 |  | 
| 26 | 1 |  |  | 1 |  | 5 | use Goo::TeamManager; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 19 |  | 
| 27 |  |  |  |  |  |  |  | 
| 28 | 1 |  |  | 1 |  | 5 | use base qw(Goo::Object); | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 259 |  | 
| 29 |  |  |  |  |  |  |  | 
| 30 |  |  |  |  |  |  |  | 
| 31 |  |  |  |  |  |  | ############################################################################### | 
| 32 |  |  |  |  |  |  | # | 
| 33 |  |  |  |  |  |  | # run - make a bug_fixer | 
| 34 |  |  |  |  |  |  | # | 
| 35 |  |  |  |  |  |  | ############################################################################### | 
| 36 |  |  |  |  |  |  |  | 
| 37 |  |  |  |  |  |  | sub run { | 
| 38 |  |  |  |  |  |  |  | 
| 39 | 0 |  |  | 0 | 1 |  | my ($this, $thing) = @_; | 
| 40 |  |  |  |  |  |  |  | 
| 41 | 0 |  |  |  |  |  | my $dbo = $thing->get_database_object(); | 
| 42 |  |  |  |  |  |  |  | 
| 43 |  |  |  |  |  |  | # who was the person who fixed it? | 
| 44 | 0 |  |  |  |  |  | $dbo->{finishedby} = Goo::Prompter::pick_one("who finished it?", qw(sven nigel rena megan)); | 
| 45 | 0 |  |  |  |  |  | $dbo->{finishedon} = "now()"; | 
| 46 | 0 |  |  |  |  |  | $dbo->{status}     = "finished"; | 
| 47 |  |  |  |  |  |  |  | 
| 48 |  |  |  |  |  |  | # remember how we fixed for the future! | 
| 49 | 0 |  |  |  |  |  | $dbo->{comments} .= Goo::Prompter::ask("How did you finish it (how/when/where/why)?"); | 
| 50 |  |  |  |  |  |  |  | 
| 51 | 0 | 0 |  |  |  |  | if (Goo::Prompter::confirm("Update the task to finished?")) { | 
| 52 | 0 |  |  |  |  |  | $dbo->replace(); | 
| 53 | 0 |  |  |  |  |  | Goo::TeamManager::send_email("Tara the Task Manager <tara\@thegoo.org>", | 
| 54 |  |  |  |  |  |  | "$dbo->{finishedby} finished: $dbo->{title} [$dbo->{taskid}]", | 
| 55 |  |  |  |  |  |  | $dbo->{description}); | 
| 56 | 0 |  |  |  |  |  | Goo::Prompter::notify("Task finished."); | 
| 57 |  |  |  |  |  |  | } else { | 
| 58 | 0 |  |  |  |  |  | Goo::Prompter::notify("Task not finished."); | 
| 59 |  |  |  |  |  |  | } | 
| 60 |  |  |  |  |  |  |  | 
| 61 |  |  |  |  |  |  | } | 
| 62 |  |  |  |  |  |  |  | 
| 63 |  |  |  |  |  |  |  | 
| 64 |  |  |  |  |  |  | 1; | 
| 65 |  |  |  |  |  |  |  | 
| 66 |  |  |  |  |  |  |  | 
| 67 |  |  |  |  |  |  | __END__ | 
| 68 |  |  |  |  |  |  |  | 
| 69 |  |  |  |  |  |  | =head1 NAME | 
| 70 |  |  |  |  |  |  |  | 
| 71 |  |  |  |  |  |  | Goo::Thing::task::Finisher - Finish a task | 
| 72 |  |  |  |  |  |  |  | 
| 73 |  |  |  |  |  |  | =head1 SYNOPSIS | 
| 74 |  |  |  |  |  |  |  | 
| 75 |  |  |  |  |  |  | use Goo::Thing::task::Finisher; | 
| 76 |  |  |  |  |  |  |  | 
| 77 |  |  |  |  |  |  | =head1 DESCRIPTION | 
| 78 |  |  |  |  |  |  |  | 
| 79 |  |  |  |  |  |  |  | 
| 80 |  |  |  |  |  |  |  | 
| 81 |  |  |  |  |  |  | =head1 METHODS | 
| 82 |  |  |  |  |  |  |  | 
| 83 |  |  |  |  |  |  | =over | 
| 84 |  |  |  |  |  |  |  | 
| 85 |  |  |  |  |  |  | =item run | 
| 86 |  |  |  |  |  |  |  | 
| 87 |  |  |  |  |  |  | make a bug_fixer | 
| 88 |  |  |  |  |  |  |  | 
| 89 |  |  |  |  |  |  |  | 
| 90 |  |  |  |  |  |  | =back | 
| 91 |  |  |  |  |  |  |  | 
| 92 |  |  |  |  |  |  | =head1 AUTHOR | 
| 93 |  |  |  |  |  |  |  | 
| 94 |  |  |  |  |  |  | Nigel Hamilton <nigel@turbo10.com> | 
| 95 |  |  |  |  |  |  |  | 
| 96 |  |  |  |  |  |  | =head1 SEE ALSO | 
| 97 |  |  |  |  |  |  |  |