aboutsummaryrefslogtreecommitdiffstats
path: root/timetask/fields.go
diff options
context:
space:
mode:
authorTeddy Wing2017-06-03 11:22:08 +0200
committerTeddy Wing2017-06-03 11:22:08 +0200
commite99c7b69e0981d4a7b87310cd811b90a2ffbe12f (patch)
treeb3e183c548bb8affb78724cefad8ad539c94c3d5 /timetask/fields.go
parent1a1d9c3c671d33f7013c94564007e2c5b33cea47 (diff)
downloadtimetasker-e99c7b69e0981d4a7b87310cd811b90a2ffbe12f.tar.bz2
Comment out all the things!
Half get rid of a lot of code. I don't like and don't want to use our old field types. Get rid of them and the code in 'http.go' that depends on them. Also get rid of the time entry submission code in 'main.go' as that's going to be redone.
Diffstat (limited to 'timetask/fields.go')
-rw-r--r--timetask/fields.go160
1 files changed, 80 insertions, 80 deletions
diff --git a/timetask/fields.go b/timetask/fields.go
index fb3a026..f3bb27d 100644
--- a/timetask/fields.go
+++ b/timetask/fields.go
@@ -1,85 +1,85 @@
package timetask
-import "fmt"
+// import "fmt"
-type Client struct {
- ID int
- Name string
- Projects []Project
-}
+// type Client struct {
+// ID int
+// Name string
+// Projects []Project
+// }
-type Project struct {
- ID int
- Name string
- Modules []Module
- Tasks []Task
- WorkTypes []WorkType `yaml:"work_types"`
-}
+// type Project struct {
+// ID int
+// Name string
+// Modules []Module
+// Tasks []Task
+// WorkTypes []WorkType `yaml:"work_types"`
+// }
-type Module struct {
- ID int
- Name string
-}
-type Task struct {
- ID int
- Name string
-}
-type WorkType struct {
- ID int
- Name string
-}
-
-type Fields struct {
- PersonID int `yaml:"person_id"`
- Clients []Client
-}
-
-func (f *Fields) ClientByName(client_name string) (*Client, error) {
- for _, client := range f.Clients {
- if client.Name == client_name {
- return &client, nil
- }
- }
-
- return nil, fmt.Errorf("Client %s not found", client_name)
-}
-
-func (c *Client) ProjectByName(project_name string) (*Project, error) {
- for _, project := range c.Projects {
- if project.Name == project_name {
- return &project, nil
- }
- }
-
- return nil, fmt.Errorf("Project %s not found", project_name)
-}
-
-func (p *Project) ModuleByName(module_name string) (*Module, error) {
- for _, module := range p.Modules {
- if module.Name == module_name {
- return &module, nil
- }
- }
-
- return nil, fmt.Errorf("Module %s not found", module_name)
-}
-
-func (p *Project) TaskByName(task_name string) (*Task, error) {
- for _, task := range p.Tasks {
- if task.Name == task_name {
- return &task, nil
- }
- }
-
- return nil, fmt.Errorf("Task %s not found", task_name)
-}
-
-func (p *Project) WorkTypeByName(work_type_name string) (*WorkType, error) {
- for _, work_type := range p.WorkTypes {
- if work_type.Name == work_type_name {
- return &work_type, nil
- }
- }
-
- return nil, fmt.Errorf("Work type %s not found", work_type_name)
-}
+// type Module struct {
+// ID int
+// Name string
+// }
+// type Task struct {
+// ID int
+// Name string
+// }
+// type WorkType struct {
+// ID int
+// Name string
+// }
+//
+// type Fields struct {
+// PersonID int `yaml:"person_id"`
+// Clients []Client
+// }
+//
+// func (f *Fields) ClientByName(client_name string) (*Client, error) {
+// for _, client := range f.Clients {
+// if client.Name == client_name {
+// return &client, nil
+// }
+// }
+//
+// return nil, fmt.Errorf("Client %s not found", client_name)
+// }
+//
+// func (c *Client) ProjectByName(project_name string) (*Project, error) {
+// for _, project := range c.Projects {
+// if project.Name == project_name {
+// return &project, nil
+// }
+// }
+//
+// return nil, fmt.Errorf("Project %s not found", project_name)
+// }
+//
+// func (p *Project) ModuleByName(module_name string) (*Module, error) {
+// for _, module := range p.Modules {
+// if module.Name == module_name {
+// return &module, nil
+// }
+// }
+//
+// return nil, fmt.Errorf("Module %s not found", module_name)
+// }
+//
+// func (p *Project) TaskByName(task_name string) (*Task, error) {
+// for _, task := range p.Tasks {
+// if task.Name == task_name {
+// return &task, nil
+// }
+// }
+//
+// return nil, fmt.Errorf("Task %s not found", task_name)
+// }
+//
+// func (p *Project) WorkTypeByName(work_type_name string) (*WorkType, error) {
+// for _, work_type := range p.WorkTypes {
+// if work_type.Name == work_type_name {
+// return &work_type, nil
+// }
+// }
+//
+// return nil, fmt.Errorf("Work type %s not found", work_type_name)
+// }