zeiterfassung für admin eingefügt
This commit is contained in:
@@ -432,6 +432,25 @@ def time_tracking():
|
||||
|
||||
return redirect(url_for('dashboard'))
|
||||
|
||||
@app.route('/admin/time_tracking', methods=['GET'])
|
||||
def admin_time_tracking():
|
||||
if not is_admin():
|
||||
flash("Zugriff verweigert!", "red")
|
||||
return redirect(url_for('dashboard'))
|
||||
|
||||
db = get_db()
|
||||
# Hole alle Zeiteinträge (JOIN mit users, damit wir den username sehen)
|
||||
time_entries = db.execute("""
|
||||
SELECT t.id, t.user_id, t.activity, t.start_time, t.end_time,
|
||||
u.username
|
||||
FROM time_entries t
|
||||
JOIN users u ON t.user_id = u.id
|
||||
ORDER BY t.start_time DESC
|
||||
""").fetchall()
|
||||
|
||||
return render_template('admin_time_entries.html', time_entries=time_entries)
|
||||
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# DASHBOARD
|
||||
# ------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user