mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-09-25 01:53:03 +02:00
Add thesis status column for two-phase commit lifecycle tracking
This commit is contained in:
+18
-2
@@ -1682,6 +1682,22 @@ class Database
|
||||
Audit::log($this, Audit::actor(), 'UPDATE', 'theses', $thesisId, $old, $new);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the submission lifecycle status of a single thesis.
|
||||
*
|
||||
* Valid statuses: 'draft' (files not yet moved / failed) → 'active' (complete).
|
||||
*/
|
||||
public function setThesisStatus(int $thesisId, string $status): void
|
||||
{
|
||||
require_once __DIR__ . '/Audit.php';
|
||||
$old = $this->fetchRow('theses', $thesisId);
|
||||
$this->pdo->prepare(
|
||||
'UPDATE theses SET status = ?, updated_at = CURRENT_TIMESTAMP WHERE id = ?'
|
||||
)->execute([$status, $thesisId]);
|
||||
$new = $this->fetchRow('theses', $thesisId);
|
||||
Audit::log($this, Audit::actor(), 'UPDATE', 'theses', $thesisId, $old, $new);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the published state for multiple theses at once.
|
||||
* @param int[] $thesisIds
|
||||
@@ -2242,12 +2258,12 @@ class Database
|
||||
baiu_link, license_id, license_custom,
|
||||
access_type_id,
|
||||
objet,
|
||||
is_published,
|
||||
is_published, status,
|
||||
remarks, jury_points,
|
||||
exemplaire_baiu, exemplaire_erg,
|
||||
cc2r,
|
||||
submitted_at
|
||||
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0, ?, ?, ?, ?, ?, CURRENT_TIMESTAMP)
|
||||
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0, "draft", ?, ?, ?, ?, ?, CURRENT_TIMESTAMP)
|
||||
');
|
||||
|
||||
$validObjet = ['tfe', 'thèse', 'frart'];
|
||||
|
||||
Reference in New Issue
Block a user