Add task completion toggle, custom task templates, and umlaut UI updates
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package main
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
@@ -16,7 +16,7 @@ func (a *App) handleSetDaysPerMonth(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if err := r.ParseForm(); err != nil {
|
||||
redirectWithMessage(w, r, "/general", "error", "Form ungueltig")
|
||||
redirectWithMessage(w, r, "/general", "error", "Form ungültig")
|
||||
return
|
||||
}
|
||||
days := mustInt(r.FormValue("days_per_month"), 2)
|
||||
@@ -37,7 +37,7 @@ func (a *App) handleSetCurrentTime(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if err := r.ParseForm(); err != nil {
|
||||
redirectWithMessage(w, r, "/", "error", "Form ungueltig")
|
||||
redirectWithMessage(w, r, "/", "error", "Form ungültig")
|
||||
return
|
||||
}
|
||||
settings, err := a.getSettings()
|
||||
@@ -48,7 +48,7 @@ func (a *App) handleSetCurrentTime(w http.ResponseWriter, r *http.Request) {
|
||||
month := mustInt(r.FormValue("current_month"), 1)
|
||||
day := mustInt(r.FormValue("current_day"), 1)
|
||||
if month < 1 || month > 12 || day < 1 || day > settings.DaysPerMonth {
|
||||
redirectWithMessage(w, r, "/", "error", "Ingame-Zeit ungueltig")
|
||||
redirectWithMessage(w, r, "/", "error", "Ingame-Zeit ungültig")
|
||||
return
|
||||
}
|
||||
if _, err := a.db.Exec(`UPDATE settings SET current_month=?, current_day=? WHERE id=1`, month, day); err != nil {
|
||||
@@ -64,14 +64,14 @@ func (a *App) handleCreateField(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if err := r.ParseForm(); err != nil {
|
||||
redirectWithMessage(w, r, "/fields", "error", "Form ungueltig")
|
||||
redirectWithMessage(w, r, "/fields", "error", "Form ungültig")
|
||||
return
|
||||
}
|
||||
number := mustInt(r.FormValue("number"), 0)
|
||||
name := strings.TrimSpace(r.FormValue("name"))
|
||||
owned := r.FormValue("owned") == "on"
|
||||
if number <= 0 {
|
||||
redirectWithMessage(w, r, "/fields", "error", "Feldnummer ungueltig")
|
||||
redirectWithMessage(w, r, "/fields", "error", "Feldnummer ungültig")
|
||||
return
|
||||
}
|
||||
if _, err := a.db.Exec(`INSERT INTO fields(number,name,owned) VALUES (?,?,?)`, number, name, owned); err != nil {
|
||||
@@ -87,14 +87,14 @@ func (a *App) handleUpdateField(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if err := r.ParseForm(); err != nil {
|
||||
redirectWithMessage(w, r, "/fields", "error", "Form ungueltig")
|
||||
redirectWithMessage(w, r, "/fields", "error", "Form ungültig")
|
||||
return
|
||||
}
|
||||
id := mustInt64(r.FormValue("id"), 0)
|
||||
name := strings.TrimSpace(r.FormValue("name"))
|
||||
owned := r.FormValue("owned") == "on"
|
||||
if id <= 0 {
|
||||
redirectWithMessage(w, r, "/fields", "error", "Feld-ID ungueltig")
|
||||
redirectWithMessage(w, r, "/fields", "error", "Feld-ID ungültig")
|
||||
return
|
||||
}
|
||||
if owned {
|
||||
@@ -117,19 +117,19 @@ func (a *App) handleDeleteField(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if err := r.ParseForm(); err != nil {
|
||||
redirectWithMessage(w, r, "/fields", "error", "Form ungueltig")
|
||||
redirectWithMessage(w, r, "/fields", "error", "Form ungültig")
|
||||
return
|
||||
}
|
||||
id := mustInt64(r.FormValue("id"), 0)
|
||||
if id <= 0 {
|
||||
redirectWithMessage(w, r, "/fields", "error", "Feld-ID ungueltig")
|
||||
redirectWithMessage(w, r, "/fields", "error", "Feld-ID ungültig")
|
||||
return
|
||||
}
|
||||
if _, err := a.db.Exec(`DELETE FROM fields WHERE id=?`, id); err != nil {
|
||||
redirectWithMessage(w, r, "/fields", "error", "Feld nicht geloescht")
|
||||
redirectWithMessage(w, r, "/fields", "error", "Feld nicht gelöscht")
|
||||
return
|
||||
}
|
||||
redirectWithMessage(w, r, "/fields", "info", "Feld geloescht")
|
||||
redirectWithMessage(w, r, "/fields", "info", "Feld gelöscht")
|
||||
}
|
||||
|
||||
func (a *App) handleCreateFieldGroup(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -138,12 +138,12 @@ func (a *App) handleCreateFieldGroup(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if err := r.ParseForm(); err != nil {
|
||||
redirectWithMessage(w, r, "/fields", "error", "Form ungueltig")
|
||||
redirectWithMessage(w, r, "/fields", "error", "Form ungültig")
|
||||
return
|
||||
}
|
||||
ids, err := parseInt64List(r.Form["field_ids"])
|
||||
if err != nil || len(ids) == 0 {
|
||||
redirectWithMessage(w, r, "/fields", "error", "Mindestens ein Feld auswaehlen")
|
||||
redirectWithMessage(w, r, "/fields", "error", "Mindestens ein Feld auswählen")
|
||||
return
|
||||
}
|
||||
fields, err := a.getFieldsByIDs(ids)
|
||||
@@ -182,19 +182,19 @@ func (a *App) handleDeleteFieldGroup(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if err := r.ParseForm(); err != nil {
|
||||
redirectWithMessage(w, r, "/fields", "error", "Form ungueltig")
|
||||
redirectWithMessage(w, r, "/fields", "error", "Form ungültig")
|
||||
return
|
||||
}
|
||||
key := strings.TrimSpace(r.FormValue("group_key"))
|
||||
if key == "" {
|
||||
redirectWithMessage(w, r, "/fields", "error", "Gruppen-ID ungueltig")
|
||||
redirectWithMessage(w, r, "/fields", "error", "Gruppen-ID ungültig")
|
||||
return
|
||||
}
|
||||
if _, err := a.db.Exec(`UPDATE fields SET group_key='',group_name='' WHERE group_key=?`, key); err != nil {
|
||||
redirectWithMessage(w, r, "/fields", "error", "Gruppe nicht aufgeloest")
|
||||
redirectWithMessage(w, r, "/fields", "error", "Gruppe nicht aufgelöst")
|
||||
return
|
||||
}
|
||||
redirectWithMessage(w, r, "/fields", "info", "Gruppe aufgeloest")
|
||||
redirectWithMessage(w, r, "/fields", "info", "Gruppe aufgelöst")
|
||||
}
|
||||
|
||||
func (a *App) handleCreateCrop(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -203,7 +203,7 @@ func (a *App) handleCreateCrop(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if err := r.ParseForm(); err != nil {
|
||||
redirectWithMessage(w, r, "/crops", "error", "Form ungueltig")
|
||||
redirectWithMessage(w, r, "/crops", "error", "Form ungültig")
|
||||
return
|
||||
}
|
||||
name := strings.TrimSpace(r.FormValue("name"))
|
||||
@@ -232,7 +232,7 @@ func (a *App) handleUpdateCrop(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if err := r.ParseForm(); err != nil {
|
||||
redirectWithMessage(w, r, "/crops", "error", "Form ungueltig")
|
||||
redirectWithMessage(w, r, "/crops", "error", "Form ungültig")
|
||||
return
|
||||
}
|
||||
id := mustInt64(r.FormValue("id"), 0)
|
||||
@@ -243,7 +243,7 @@ func (a *App) handleUpdateCrop(w http.ResponseWriter, r *http.Request) {
|
||||
regrowEnabled := r.FormValue("regrow_enabled") == "on"
|
||||
regrowCycles := mustInt(r.FormValue("regrow_cycles"), 0)
|
||||
if id <= 0 {
|
||||
redirectWithMessage(w, r, "/crops", "error", "Feldfrucht-ID ungueltig")
|
||||
redirectWithMessage(w, r, "/crops", "error", "Feldfrucht-ID ungültig")
|
||||
return
|
||||
}
|
||||
if err := validateCropInput(name, start, end, grow, regrowCycles); err != nil {
|
||||
@@ -266,19 +266,19 @@ func (a *App) handleDeleteCrop(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if err := r.ParseForm(); err != nil {
|
||||
redirectWithMessage(w, r, "/crops", "error", "Form ungueltig")
|
||||
redirectWithMessage(w, r, "/crops", "error", "Form ungültig")
|
||||
return
|
||||
}
|
||||
id := mustInt64(r.FormValue("id"), 0)
|
||||
if id <= 0 {
|
||||
redirectWithMessage(w, r, "/crops", "error", "Feldfrucht-ID ungueltig")
|
||||
redirectWithMessage(w, r, "/crops", "error", "Feldfrucht-ID ungültig")
|
||||
return
|
||||
}
|
||||
if _, err := a.db.Exec(`DELETE FROM crops WHERE id=?`, id); err != nil {
|
||||
redirectWithMessage(w, r, "/crops", "error", "Feldfrucht nicht geloescht")
|
||||
redirectWithMessage(w, r, "/crops", "error", "Feldfrucht nicht gelöscht")
|
||||
return
|
||||
}
|
||||
redirectWithMessage(w, r, "/crops", "info", "Feldfrucht geloescht")
|
||||
redirectWithMessage(w, r, "/crops", "info", "Feldfrucht gelöscht")
|
||||
}
|
||||
|
||||
func (a *App) handleCreatePlan(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -287,7 +287,7 @@ func (a *App) handleCreatePlan(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if err := r.ParseForm(); err != nil {
|
||||
redirectWithMessage(w, r, "/planning", "error", "Form ungueltig")
|
||||
redirectWithMessage(w, r, "/planning", "error", "Form ungültig")
|
||||
return
|
||||
}
|
||||
targetRef := strings.TrimSpace(r.FormValue("target_ref"))
|
||||
@@ -296,7 +296,7 @@ func (a *App) handleCreatePlan(w http.ResponseWriter, r *http.Request) {
|
||||
startDay := mustInt(r.FormValue("start_day"), 1)
|
||||
notes := strings.TrimSpace(r.FormValue("notes"))
|
||||
if targetRef == "" || cropID <= 0 {
|
||||
redirectWithMessage(w, r, "/planning", "error", "Planungsziel oder Feldfrucht ungueltig")
|
||||
redirectWithMessage(w, r, "/planning", "error", "Planungsziel oder Feldfrucht ungültig")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ func (a *App) handleCreatePlan(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if startMonth < 1 || startMonth > 12 || startDay < 1 || startDay > settings.DaysPerMonth {
|
||||
redirectWithMessage(w, r, "/planning", "error", "Startdatum ungueltig")
|
||||
redirectWithMessage(w, r, "/planning", "error", "Startdatum ungültig")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -318,7 +318,7 @@ func (a *App) handleCreatePlan(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if !monthInWindow(startMonth, c.SowStartMonth, c.SowEndMonth) {
|
||||
redirectWithMessage(w, r, "/planning", "error", "Aussaat ausserhalb des Zeitfensters")
|
||||
redirectWithMessage(w, r, "/planning", "error", "Aussaat außerhalb des Zeitfensters")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -347,19 +347,148 @@ func (a *App) handleDeletePlan(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if err := r.ParseForm(); err != nil {
|
||||
redirectWithMessage(w, r, "/planning", "error", "Form ungueltig")
|
||||
redirectWithMessage(w, r, "/planning", "error", "Form ungültig")
|
||||
return
|
||||
}
|
||||
id := mustInt64(r.FormValue("id"), 0)
|
||||
if id <= 0 {
|
||||
redirectWithMessage(w, r, "/planning", "error", "Plan-ID ungueltig")
|
||||
redirectWithMessage(w, r, "/planning", "error", "Plan-ID ungültig")
|
||||
return
|
||||
}
|
||||
if _, err := a.db.Exec(`DELETE FROM plans WHERE id=?`, id); err != nil {
|
||||
redirectWithMessage(w, r, "/planning", "error", "Plan nicht geloescht")
|
||||
redirectWithMessage(w, r, "/planning", "error", "Plan nicht gelöscht")
|
||||
return
|
||||
}
|
||||
redirectWithMessage(w, r, "/planning", "info", "Plan geloescht")
|
||||
redirectWithMessage(w, r, "/planning", "info", "Plan gelöscht")
|
||||
}
|
||||
|
||||
func (a *App) handleToggleTaskDone(w http.ResponseWriter, r *http.Request) {
|
||||
if r.Method != http.MethodPost {
|
||||
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
if err := r.ParseForm(); err != nil {
|
||||
redirectWithMessage(w, r, "/", "error", "Form ungültig")
|
||||
return
|
||||
}
|
||||
|
||||
uid := strings.TrimSpace(r.FormValue("uid"))
|
||||
month := mustInt(r.FormValue("month"), 0)
|
||||
day := mustInt(r.FormValue("day"), 0)
|
||||
yearOffset := mustInt(r.FormValue("year_offset"), 0)
|
||||
currentDone := r.FormValue("completed") == "1"
|
||||
if uid == "" || month < 1 || month > 12 || day < 1 {
|
||||
redirectWithMessage(w, r, "/", "error", "Aufgabe ungültig")
|
||||
return
|
||||
}
|
||||
|
||||
if currentDone {
|
||||
if _, err := a.db.Exec(`DELETE FROM task_completions WHERE task_uid=? AND month=? AND day=? AND year_offset=?`, uid, month, day, yearOffset); err != nil {
|
||||
redirectWithMessage(w, r, "/", "error", "Status konnte nicht geändert werden")
|
||||
return
|
||||
}
|
||||
redirectWithMessage(w, r, "/", "info", "Aufgabe wieder offen")
|
||||
return
|
||||
}
|
||||
if _, err := a.db.Exec(`INSERT INTO task_completions(task_uid,month,day,year_offset,done) VALUES (?,?,?,?,1) ON DUPLICATE KEY UPDATE done=1`, uid, month, day, yearOffset); err != nil {
|
||||
redirectWithMessage(w, r, "/", "error", "Status konnte nicht geändert werden")
|
||||
return
|
||||
}
|
||||
redirectWithMessage(w, r, "/", "info", "Aufgabe erledigt")
|
||||
}
|
||||
|
||||
func (a *App) handleCreateTaskTemplate(w http.ResponseWriter, r *http.Request) {
|
||||
if r.Method != http.MethodPost {
|
||||
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
if err := r.ParseForm(); err != nil {
|
||||
redirectWithMessage(w, r, "/planning", "error", "Form ungültig")
|
||||
return
|
||||
}
|
||||
title := strings.TrimSpace(r.FormValue("title"))
|
||||
if title == "" {
|
||||
redirectWithMessage(w, r, "/planning", "error", "Template-Titel fehlt")
|
||||
return
|
||||
}
|
||||
if _, err := a.db.Exec(`INSERT INTO custom_task_templates(title) VALUES (?)`, title); err != nil {
|
||||
redirectWithMessage(w, r, "/planning", "error", "Template konnte nicht gespeichert werden")
|
||||
return
|
||||
}
|
||||
redirectWithMessage(w, r, "/planning", "info", "Template gespeichert")
|
||||
}
|
||||
|
||||
func (a *App) handleCreateCustomTask(w http.ResponseWriter, r *http.Request) {
|
||||
if r.Method != http.MethodPost {
|
||||
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
if err := r.ParseForm(); err != nil {
|
||||
redirectWithMessage(w, r, "/planning", "error", "Form ungültig")
|
||||
return
|
||||
}
|
||||
|
||||
templateID := mustInt64(r.FormValue("template_id"), 0)
|
||||
title := strings.TrimSpace(r.FormValue("title"))
|
||||
month := mustInt(r.FormValue("month"), 0)
|
||||
day := mustInt(r.FormValue("day"), 0)
|
||||
yearOffset := mustInt(r.FormValue("year_offset"), 0)
|
||||
targetName := strings.TrimSpace(r.FormValue("target_name"))
|
||||
notes := strings.TrimSpace(r.FormValue("notes"))
|
||||
settings, err := a.getSettings()
|
||||
if err != nil {
|
||||
redirectWithMessage(w, r, "/planning", "error", "Einstellungen nicht lesbar")
|
||||
return
|
||||
}
|
||||
if month < 1 || month > 12 || day < 1 || day > settings.DaysPerMonth || yearOffset < 0 || yearOffset > 4 {
|
||||
redirectWithMessage(w, r, "/planning", "error", "Aufgaben-Datum ungültig")
|
||||
return
|
||||
}
|
||||
if templateID > 0 {
|
||||
if err = a.db.QueryRow(`SELECT title FROM custom_task_templates WHERE id=?`, templateID).Scan(&title); err != nil {
|
||||
redirectWithMessage(w, r, "/planning", "error", "Template nicht gefunden")
|
||||
return
|
||||
}
|
||||
}
|
||||
if title == "" {
|
||||
redirectWithMessage(w, r, "/planning", "error", "Aufgaben-Titel fehlt")
|
||||
return
|
||||
}
|
||||
|
||||
if _, err = a.db.Exec(`INSERT INTO custom_tasks(template_id,title,month,day,year_offset,target_name,notes) VALUES (?,?,?,?,?,?,?)`,
|
||||
nullInt64(templateID), title, month, day, yearOffset, targetName, notes); err != nil {
|
||||
redirectWithMessage(w, r, "/planning", "error", "Aufgabe konnte nicht gespeichert werden")
|
||||
return
|
||||
}
|
||||
redirectWithMessage(w, r, "/planning", "info", "Aufgabe eingeplant")
|
||||
}
|
||||
|
||||
func (a *App) handleDeleteCustomTask(w http.ResponseWriter, r *http.Request) {
|
||||
if r.Method != http.MethodPost {
|
||||
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
if err := r.ParseForm(); err != nil {
|
||||
redirectWithMessage(w, r, "/planning", "error", "Form ungültig")
|
||||
return
|
||||
}
|
||||
id := mustInt64(r.FormValue("id"), 0)
|
||||
if id <= 0 {
|
||||
redirectWithMessage(w, r, "/planning", "error", "Aufgaben-ID ungültig")
|
||||
return
|
||||
}
|
||||
if _, err := a.db.Exec(`DELETE FROM custom_tasks WHERE id=?`, id); err != nil {
|
||||
redirectWithMessage(w, r, "/planning", "error", "Aufgabe konnte nicht gelöscht werden")
|
||||
return
|
||||
}
|
||||
redirectWithMessage(w, r, "/planning", "info", "Aufgabe gelöscht")
|
||||
}
|
||||
|
||||
func nullInt64(v int64) sql.NullInt64 {
|
||||
if v <= 0 {
|
||||
return sql.NullInt64{}
|
||||
}
|
||||
return sql.NullInt64{Int64: v, Valid: true}
|
||||
}
|
||||
|
||||
func (a *App) handleCreateCropStep(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -368,7 +497,7 @@ func (a *App) handleCreateCropStep(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if err := r.ParseForm(); err != nil {
|
||||
redirectWithMessage(w, r, "/crops", "error", "Form ungueltig")
|
||||
redirectWithMessage(w, r, "/crops", "error", "Form ungültig")
|
||||
return
|
||||
}
|
||||
cropID := mustInt64(r.FormValue("crop_id"), 0)
|
||||
@@ -376,7 +505,7 @@ func (a *App) handleCreateCropStep(w http.ResponseWriter, r *http.Request) {
|
||||
offset := mustInt(r.FormValue("month_offset"), -1)
|
||||
title := strings.TrimSpace(r.FormValue("title"))
|
||||
if cropID <= 0 || (phase != "pre" && phase != "post") || offset < 0 || offset > 24 || title == "" {
|
||||
redirectWithMessage(w, r, "/crops", "error", "Vor/Nachbereitung ungueltig")
|
||||
redirectWithMessage(w, r, "/crops", "error", "Vor/Nachbereitung ungültig")
|
||||
return
|
||||
}
|
||||
if _, err := a.db.Exec(`INSERT INTO crop_steps(crop_id,phase,month_offset,title) VALUES (?,?,?,?)`, cropID, phase, offset, title); err != nil {
|
||||
@@ -392,26 +521,26 @@ func (a *App) handleDeleteCropStep(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if err := r.ParseForm(); err != nil {
|
||||
redirectWithMessage(w, r, "/crops", "error", "Form ungueltig")
|
||||
redirectWithMessage(w, r, "/crops", "error", "Form ungültig")
|
||||
return
|
||||
}
|
||||
id := mustInt64(r.FormValue("id"), 0)
|
||||
if id <= 0 {
|
||||
redirectWithMessage(w, r, "/crops", "error", "Schritt-ID ungueltig")
|
||||
redirectWithMessage(w, r, "/crops", "error", "Schritt-ID ungültig")
|
||||
return
|
||||
}
|
||||
if _, err := a.db.Exec(`DELETE FROM crop_steps WHERE id=?`, id); err != nil {
|
||||
redirectWithMessage(w, r, "/crops", "error", "Schritt nicht geloescht")
|
||||
redirectWithMessage(w, r, "/crops", "error", "Schritt nicht gelöscht")
|
||||
return
|
||||
}
|
||||
redirectWithMessage(w, r, "/crops", "info", "Schritt geloescht")
|
||||
redirectWithMessage(w, r, "/crops", "info", "Schritt gelöscht")
|
||||
}
|
||||
|
||||
func (a *App) resolvePlanningTarget(ref string) (sql.NullInt64, string, error) {
|
||||
if strings.HasPrefix(ref, "f:") {
|
||||
id := mustInt64(strings.TrimPrefix(ref, "f:"), 0)
|
||||
if id <= 0 {
|
||||
return sql.NullInt64{}, "", errors.New("Feld-Ziel ungueltig")
|
||||
return sql.NullInt64{}, "", errors.New("Feld-Ziel ungültig")
|
||||
}
|
||||
var f Field
|
||||
err := a.db.QueryRow(`SELECT id,number,name,owned FROM fields WHERE id=?`, id).Scan(&f.ID, &f.Number, &f.Name, &f.Owned)
|
||||
@@ -426,7 +555,7 @@ func (a *App) resolvePlanningTarget(ref string) (sql.NullInt64, string, error) {
|
||||
if strings.HasPrefix(ref, "g:") {
|
||||
key := strings.TrimPrefix(ref, "g:")
|
||||
if key == "" {
|
||||
return sql.NullInt64{}, "", errors.New("Gruppen-Ziel ungueltig")
|
||||
return sql.NullInt64{}, "", errors.New("Gruppen-Ziel ungültig")
|
||||
}
|
||||
rows, err := a.db.Query(`SELECT number FROM fields WHERE group_key=? AND owned=1 ORDER BY number`, key)
|
||||
if err != nil {
|
||||
@@ -451,5 +580,6 @@ func (a *App) resolvePlanningTarget(ref string) (sql.NullInt64, string, error) {
|
||||
}
|
||||
return sql.NullInt64{}, groupName, nil
|
||||
}
|
||||
return sql.NullInt64{}, "", errors.New("Planungsziel ungueltig")
|
||||
return sql.NullInt64{}, "", errors.New("Planungsziel ungültig")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user