|
@@ -56,9 +56,11 @@ final class TaskRepository
|
|
|
?int $linkedTaskId = null,
|
|
?int $linkedTaskId = null,
|
|
|
): Task {
|
|
): Task {
|
|
|
$now = gmdate('Y-m-d\TH:i:s\Z');
|
|
$now = gmdate('Y-m-d\TH:i:s\Z');
|
|
|
- $max = (int) $this->pdo
|
|
|
|
|
- ->query('SELECT COALESCE(MAX(sort_order), 0) FROM tasks WHERE sprint_id = ' . $sprintId)
|
|
|
|
|
- ->fetchColumn();
|
|
|
|
|
|
|
+ $maxStmt = $this->pdo->prepare(
|
|
|
|
|
+ 'SELECT COALESCE(MAX(sort_order), 0) FROM tasks WHERE sprint_id = ?'
|
|
|
|
|
+ );
|
|
|
|
|
+ $maxStmt->execute([$sprintId]);
|
|
|
|
|
+ $max = (int) $maxStmt->fetchColumn();
|
|
|
$stmt = $this->pdo->prepare(
|
|
$stmt = $this->pdo->prepare(
|
|
|
'INSERT INTO tasks
|
|
'INSERT INTO tasks
|
|
|
(sprint_id, title, owner_worker_id, priority, sort_order,
|
|
(sprint_id, title, owner_worker_id, priority, sort_order,
|
|
@@ -96,9 +98,11 @@ final class TaskRepository
|
|
|
$this->pdo->prepare('DELETE FROM task_assignments WHERE task_id = ?')
|
|
$this->pdo->prepare('DELETE FROM task_assignments WHERE task_id = ?')
|
|
|
->execute([$taskId]);
|
|
->execute([$taskId]);
|
|
|
|
|
|
|
|
- $maxOrder = (int) $this->pdo
|
|
|
|
|
- ->query('SELECT COALESCE(MAX(sort_order), 0) FROM tasks WHERE sprint_id = ' . $destSprintId)
|
|
|
|
|
- ->fetchColumn();
|
|
|
|
|
|
|
+ $maxStmt = $this->pdo->prepare(
|
|
|
|
|
+ 'SELECT COALESCE(MAX(sort_order), 0) FROM tasks WHERE sprint_id = ?'
|
|
|
|
|
+ );
|
|
|
|
|
+ $maxStmt->execute([$destSprintId]);
|
|
|
|
|
+ $maxOrder = (int) $maxStmt->fetchColumn();
|
|
|
|
|
|
|
|
$stmt = $this->pdo->prepare(
|
|
$stmt = $this->pdo->prepare(
|
|
|
'UPDATE tasks
|
|
'UPDATE tasks
|