diff options
Diffstat (limited to 'sqlite.go')
| -rw-r--r-- | sqlite.go | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -286,7 +286,7 @@ func newTask(resume bool) { task = getInterInput(sli+"Specify Task: ") if task == "" { nm,st := GetTaskSums(currproject.id) - ch := Multichoice("What Task should be resumed?",st) + ch := Multichoice("What Task should be restarted?",st) task = nm[ch] bonus = line("xxx",true) } @@ -406,8 +406,8 @@ func loadBills(in []int) (out []bill) { } func strings2items(tasks, times, hours, moneys string) (out []billitem) { - ta := string2StringArray(tasks, ";") - ti := string2StringArray(times, ";") + ta := String2StringArray(tasks, ";") + ti := String2StringArray(times, ";") ho := string2FloatArray(hours, ";") mo := string2FloatArray(moneys, ";") for i, _ := range ta { @@ -794,8 +794,10 @@ func getProjectList(in []int) ([]int, []string) { } return outids, outstr } - -func getTaskList(in []int, showcust bool) ([]int, []string) { +// Returns two Lists of Task ids and corresponding strings for Multichoice selection. +// Depending on showcust the name of the customer will be displayed too +// Depending on exclude Tasks of project 0 will be in the Return Lists +func GetTaskList(in []int, showcust,exclude bool) ([]int, []string) { var outids []int var outstr []string lastpr := 0 @@ -809,6 +811,9 @@ func getTaskList(in []int, showcust bool) ([]int, []string) { //rows,err := db.Query("SELECT id, project, start, stop, task FROM timetable WHERE stop != '1791-09-30 19:07' AND checkout = 0 AND id IN ? ORDER BY project DESC, stop DESC",in) if len(in) == 1 && in[0] == 0 { rows, err = db.Query("SELECT id, project, start, stop, task FROM timetable WHERE stop != '1791-09-30 19:07' AND checkout = 0 ORDER BY project DESC, stop DESC") + if exclude { + rows, err = db.Query("SELECT id, project, start, stop, task FROM timetable WHERE stop != '1791-09-30 19:07' AND checkout = 0 AND project != 0 ORDER BY project DESC, stop DESC") + } } //else{ // rows,err = db.Query("SELECT id, project, start, stop, task FROM timetable WHERE stop != '1791-09-30 19:07' AND checkout = 0 AND id IN ? ORDER BY project DESC, stop DESC",in) //} |
