From d06db7af6014e8498672899218a05adf36ab1aa3 Mon Sep 17 00:00:00 2001 From: Nikolaus Gotsche Date: Fri, 26 Oct 2018 13:25:45 +0200 Subject: Final Framing and Multichoice beatification --- sqlite.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'sqlite.go') diff --git a/sqlite.go b/sqlite.go index 5c082fe..68ce3f1 100644 --- a/sqlite.go +++ b/sqlite.go @@ -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) //} -- cgit v1.2.3