summaryrefslogtreecommitdiff
path: root/sqlite.go
diff options
context:
space:
mode:
authorNikolaus Gotsche <n@softwarefools.com>2018-10-26 13:25:45 +0200
committerNikolaus Gotsche <n@softwarefools.com>2018-10-26 13:25:45 +0200
commitd06db7af6014e8498672899218a05adf36ab1aa3 (patch)
tree1e960093c848ad166beb4a5125655e53b04066de /sqlite.go
parentab0058448abc0f51d0165c0278bdd4878a3f4d13 (diff)
Final Framing and Multichoice beatification
Diffstat (limited to 'sqlite.go')
-rw-r--r--sqlite.go15
1 files changed, 10 insertions, 5 deletions
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)
//}