diff --git a/ressources.csv b/ressources.csv new file mode 100644 index 0000000..c2f5e78 --- /dev/null +++ b/ressources.csv @@ -0,0 +1,4 @@ +ressource,profil,7/14/2025,7/15/2025,7/16/2025,7/17/2025,7/18/2025,7/19/2025,7/20/2025,7/21/2025,7/22/2025 +Simon BOYER,dev,0,0.5,0.5,0.5,0.5,0,0.5,0.5,0.5 +Fatima BROUM,dev,0,1,1,1,1,0,1,1,1 +Need Dev,dev,0,0,0,0,0,0,1,1,1 diff --git a/svar-gantt-app/scripts/init-db.js b/svar-gantt-app/scripts/init-db.js new file mode 100644 index 0000000..77cc968 --- /dev/null +++ b/svar-gantt-app/scripts/init-db.js @@ -0,0 +1,46 @@ +// scripts/init-db.ts +import Database from 'better-sqlite3'; +import { mkdirSync, existsSync } from 'fs'; + +if (!existsSync('data')) { + mkdirSync('data'); +} + +const db = new Database('data.db'); + +db.exec(` + DROP TABLE IF EXISTS tasks; + DROP TABLE IF EXISTS links; + + CREATE TABLE tasks ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + text TEXT NOT NULL, + start TEXT NOT NULL, + end TEXT NOT NULL, + duration INTEGER, + progress INTEGER, + type TEXT, + parent INTEGER, + lazy BOOLEAN DEFAULT 0 -- ✅ Ajout ici + ); + + CREATE TABLE links ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + source INTEGER, + target INTEGER, + type TEXT + ); +`); + // table pour les ressources + db.exec(` + CREATE TABLE IF NOT EXISTS resource_planning ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + ressource TEXT NOT NULL, + profil TEXT NOT NULL, + date TEXT NOT NULL, + disponibilite REAL NOT NULL + ); +`); + + +console.log('✅ Base de données initialisée avec succès.'); diff --git a/svar-gantt-app/src/routes/planning/+page.svelte b/svar-gantt-app/src/routes/planning/+page.svelte new file mode 100644 index 0000000..1312867 --- /dev/null +++ b/svar-gantt-app/src/routes/planning/+page.svelte @@ -0,0 +1,127 @@ + + +
| Ressource | +Profil | + {#each $dates as date} ++ {formatDateFr(date)} + | + {/each} +
|---|---|---|
| {row.ressource} | +{row.profil} | + {#each $dates as date} ++ updateCell(i, date, e.target.value)} + /> + | + {/each} +
| Total | + {#each $dates as date} ++ {totalByDate(date)} + | + {/each} +|