1package Goo::Thing::bug::Maker;
2
3###############################################################################
4# Turbo10.com
5#
6# Copyright Turbo10.com 2005
7# All Rights Reserved
8#
9# Author:       Nigel Hamilton
10# Filename:     Goo::Thing::bug::Maker.pm
11# Description:  What?? something that *makes* bugs!!
12#               Bugs are a software artefact too.
13#
14# Date          Change
15# -----------------------------------------------------------------------------
16# 16/10/2005    Auto generated file
17# 16/10/2005    Need to create a task object
18#
19###############################################################################
20
21use strict;
22
23use Goo::Object;
24use Goo::Header;
25use Goo::Prompter;
26use Goo::Database;
27use Goo::Prompter;
28use Goo::TeamManager;
29
30use base qw(Goo::Object);
31
32
33###############################################################################
34#
35# run - make a bug_maker
36#
37###############################################################################
38
39sub run {
40
41    my ($this, $filename) = @_;
42
43	$filename = $filename || "bug";
44
45    Goo::Prompter::clear();
46
47    Goo::Header::show("Bug Maker", $filename, "database");
48
49    Goo::Prompter::say();
50
51    my $query = Goo::Database::prepare_sql(<<EOSQL);
52
53	insert 	into bug (	title,
54						description,
55						foundby,
56						importance,
57						status,
58						foundon)
59	values			  (?, ?, ?, ?, 'alive', now())
60
61EOSQL
62
63    Goo::Database::bind_param($query, 1, Goo::Prompter::insist("Enter a new bug?"));
64    Goo::Database::bind_param($query, 2,
65                              Goo::Prompter::ask("Bug description (how/when/where/why)?"));
66
67    my $found_by = Goo::Prompter::pick_one("Found by?", Goo::TeamManager::get_all_nick_names());
68
69    Goo::Database::bind_param($query, 3, $found_by);
70    Goo::Database::bind_param($query, 4, Goo::Prompter::ask("How important is this (1-10)?", 3));
71
72    #my $company = Goo::Prompter::pick_one("which company?", qw(turbo trexy));
73    #Goo::Database::bind_param($query, 5, "");
74
75    # what is the pain associated with this task???
76    Goo::Database::execute($query);
77
78    Goo::Prompter::say("Bug recorded.");
79
80    if (Goo::Prompter::confirm("Enter another bug?")) {
81        $this->run($filename);
82    }
83
84}
85
86
871;
88
89
90__END__
91
92=head1 NAME
93
94Goo::Thing::bug::Maker - What?? something that *makes* bugs!!
95
96=head1 SYNOPSIS
97
98use Goo::Thing::bug::Maker;
99
100=head1 DESCRIPTION
101
102
103
104=head1 METHODS
105
106=over
107
108=item run
109
110make a bug_maker
111
112
113=back
114
115=head1 AUTHOR
116
117Nigel Hamilton <nigel@trexy.com>
118
119=head1 SEE ALSO
120
121