feat: Enhance task management with client and parent ID prefill in task edit and popup, and improve UI for subtask actions
This commit is contained in:
52
.vscode/ftp-kr.sync.cache.json
vendored
52
.vscode/ftp-kr.sync.cache.json
vendored
@@ -121,8 +121,8 @@
|
||||
},
|
||||
"class.Tasks.php": {
|
||||
"type": "-",
|
||||
"size": 26739,
|
||||
"lmtime": 1772360724134,
|
||||
"size": 27574,
|
||||
"lmtime": 1772534579077,
|
||||
"modified": false
|
||||
},
|
||||
"class.Users.php": {
|
||||
@@ -133,8 +133,8 @@
|
||||
},
|
||||
"class.Wiki.php": {
|
||||
"type": "-",
|
||||
"size": 1825,
|
||||
"lmtime": 0,
|
||||
"size": 2532,
|
||||
"lmtime": 1772532019810,
|
||||
"modified": false
|
||||
}
|
||||
},
|
||||
@@ -235,8 +235,8 @@
|
||||
},
|
||||
"class.Tasks.php": {
|
||||
"type": "-",
|
||||
"size": 29961,
|
||||
"lmtime": 1772361497784,
|
||||
"size": 33489,
|
||||
"lmtime": 1772534585287,
|
||||
"modified": false
|
||||
},
|
||||
"class.Users.php": {
|
||||
@@ -247,8 +247,8 @@
|
||||
},
|
||||
"class.Wiki.php": {
|
||||
"type": "-",
|
||||
"size": 1911,
|
||||
"lmtime": 0,
|
||||
"size": 3707,
|
||||
"lmtime": 1772534016525,
|
||||
"modified": false
|
||||
}
|
||||
},
|
||||
@@ -318,6 +318,12 @@
|
||||
"size": 542,
|
||||
"lmtime": 1772360740310,
|
||||
"modified": false
|
||||
},
|
||||
"2026-03-03-task-wiki-relations.sql": {
|
||||
"type": "-",
|
||||
"size": 294,
|
||||
"lmtime": 1772531577097,
|
||||
"modified": false
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -336,20 +342,20 @@
|
||||
"layout": {
|
||||
"style.css": {
|
||||
"type": "-",
|
||||
"size": 31663,
|
||||
"lmtime": 1772109274106,
|
||||
"size": 32723,
|
||||
"lmtime": 1772532793626,
|
||||
"modified": false
|
||||
},
|
||||
"style.css.map": {
|
||||
"type": "-",
|
||||
"size": 55516,
|
||||
"lmtime": 1772109274106,
|
||||
"size": 56837,
|
||||
"lmtime": 1772532793626,
|
||||
"modified": false
|
||||
},
|
||||
"style.scss": {
|
||||
"type": "-",
|
||||
"size": 39770,
|
||||
"lmtime": 1772111528605,
|
||||
"size": 39846,
|
||||
"lmtime": 1772532792986,
|
||||
"modified": false
|
||||
}
|
||||
},
|
||||
@@ -638,14 +644,14 @@
|
||||
},
|
||||
"task_edit.php": {
|
||||
"type": "-",
|
||||
"size": 33540,
|
||||
"lmtime": 1772361385635,
|
||||
"size": 35593,
|
||||
"lmtime": 1772534468454,
|
||||
"modified": false
|
||||
},
|
||||
"task_popup.php": {
|
||||
"type": "-",
|
||||
"size": 36954,
|
||||
"lmtime": 1772395947362,
|
||||
"size": 39914,
|
||||
"lmtime": 1772534728286,
|
||||
"modified": false
|
||||
},
|
||||
"task_single.php": {
|
||||
@@ -708,8 +714,8 @@
|
||||
},
|
||||
"main-view.php": {
|
||||
"type": "-",
|
||||
"size": 3649,
|
||||
"lmtime": 0,
|
||||
"size": 12222,
|
||||
"lmtime": 1772532898338,
|
||||
"modified": false
|
||||
}
|
||||
}
|
||||
@@ -796,6 +802,12 @@
|
||||
"size": 230708,
|
||||
"lmtime": 1771920013460,
|
||||
"modified": false
|
||||
},
|
||||
"AGENTS.md": {
|
||||
"type": "-",
|
||||
"size": 250,
|
||||
"lmtime": 1772530976286,
|
||||
"modified": false
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
15
AGENTS.md
15
AGENTS.md
@@ -1,5 +1,20 @@
|
||||
# AGENTS.md
|
||||
|
||||
## Zasady pisania kodu
|
||||
- Kod ma być czytelny „dla obcego”: jasne nazwy, mało magii
|
||||
- Brak „skrótów na szybko” typu logika w widokach, copy-paste, losowe helpery bez spójności
|
||||
- Każda funkcja/klasa ma mieć jedną odpowiedzialność, zwykle do 30–50 linii (jeśli dłuższe – dzielić)
|
||||
- max 3 poziomy zagnieżdżeń (if/foreach), reszta do osobnych metod
|
||||
- Nazewnictwo:
|
||||
- klasy: PascalCase
|
||||
- metody/zmienne: camelCase
|
||||
- stałe: UPPER_SNAKE_CASE
|
||||
- Zero „skrótologii” w nazwach (np. $d, $tmp, $x1) poza pętlami 2–3 linijki
|
||||
- medoo + prepared statements bez wyjątków (żadnego sklejania SQL stringiem)
|
||||
- XSS: escape w widokach (np. helper e())
|
||||
- CSRF dla formularzy, sensowna obsługa sesji
|
||||
- Kod ma mieć komentarze tylko tam, gdzie wyjaśniają „dlaczego”, nie „co”
|
||||
|
||||
## Sposób pracy
|
||||
- Pisz do mnie po polsku, zwięźle i krótko, ale merytorycznie
|
||||
|
||||
|
||||
@@ -454,6 +454,22 @@ class Tasks
|
||||
if ( !is_array( $task ) )
|
||||
$task = [];
|
||||
|
||||
if ( !$task_id )
|
||||
{
|
||||
$prefill_project_id = \S::get( 'project_id' );
|
||||
$prefill_client_id = \S::get( 'client_id' );
|
||||
$prefill_parent_id = \S::get( 'parent_id' );
|
||||
|
||||
if ( $prefill_project_id !== '' and $prefill_project_id !== null )
|
||||
$task['project_id'] = (int)$prefill_project_id;
|
||||
|
||||
if ( $prefill_client_id !== '' and $prefill_client_id !== null )
|
||||
$task['client_id'] = (int)$prefill_client_id;
|
||||
|
||||
if ( $prefill_parent_id !== '' and $prefill_parent_id !== null )
|
||||
$task['parent_id'] = (int)$prefill_parent_id;
|
||||
}
|
||||
|
||||
$task['status'] = \Controllers\TasksController::resolveTaskStatusForForm( $task );
|
||||
$task['id'] = isset( $task['id'] ) ? (int)$task['id'] : $task_id;
|
||||
$task_id_for_attachments = (int)$task['id'];
|
||||
|
||||
@@ -30,6 +30,9 @@ $project_id = $this -> task['project_id'] ? $this -> task[ 'project_id' ] : 0;
|
||||
if ( !$this -> task['id'] and !$project_id )
|
||||
$project_id = 72;
|
||||
|
||||
$selected_client_id = isset( $this -> task['client_id'] ) ? (int)$this -> task['client_id'] : 0;
|
||||
$selected_parent_id = isset( $this -> task['parent_id'] ) ? (int)$this -> task['parent_id'] : 0;
|
||||
|
||||
$clients = [ 0 => '--- wybierz klienta ---' ];
|
||||
if ( is_array( $this -> clients ) )
|
||||
foreach ( $this -> clients as $client )
|
||||
@@ -134,7 +137,7 @@ ob_start();
|
||||
'label' => 'Klient',
|
||||
'name' => 'client_id',
|
||||
'id' => 'client_id',
|
||||
'value' => $this -> task[ 'id' ] ? $this -> task[ 'client_id' ] : 0,
|
||||
'value' => $selected_client_id,
|
||||
'values' => $clients
|
||||
] );
|
||||
?>
|
||||
@@ -143,7 +146,7 @@ ob_start();
|
||||
'label' => 'Zadanie nadrzędne',
|
||||
'name' => 'parent_id',
|
||||
'id' => 'parent_id',
|
||||
'value' => $this -> task[ 'parent_id' ],
|
||||
'value' => $selected_parent_id,
|
||||
'values' => $parent_tasks
|
||||
] );
|
||||
?>
|
||||
|
||||
@@ -265,6 +265,9 @@
|
||||
<? endforeach;?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="task-subtask-action">
|
||||
<a href="/tasks/task_edit/project_id=<?= (int)$this -> task['project_id'];?>&client_id=<?= (int)$this -> task['client_id'];?>&parent_id=<?= (int)$this -> task['id'];?>" class="btn btn-success btn-sm task-popup-compact-btn">Dodaj podzadanie</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dates box">
|
||||
<h3>Termin</h3>
|
||||
@@ -278,7 +281,9 @@
|
||||
<input type="date" class="form-control task-date-end-input" value="<?= htmlspecialchars( (string)$this -> task['date_end'] );?>">
|
||||
</div>
|
||||
</div>
|
||||
<a href="#" class="btn btn-primary btn-sm task-popup-compact-btn js-save-task-dates" task_id="<?= (int)$this -> task['id'];?>" style="margin-top: 10px;">Zapisz terminy</a>
|
||||
<div class="task-date-actions">
|
||||
<a href="#" class="btn btn-primary btn-sm task-popup-compact-btn js-save-task-dates" task_id="<?= (int)$this -> task['id'];?>">Zapisz terminy</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="client box">
|
||||
<h3>Klient</h3>
|
||||
@@ -595,10 +600,33 @@
|
||||
min-height: 120px;
|
||||
resize: vertical;
|
||||
}
|
||||
.task_popup .task_details .content .right .project .task-subtask-action {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.task_popup .task_details .content .right .project .task-subtask-action a {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 30px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
line-height: 1;
|
||||
}
|
||||
.task_popup .task_details .content .right .dates .task-date-edit-grid {
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
grid-template-columns: 1fr;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
.task_popup .task_details .content .right .dates .task-date-actions {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.task_popup .task_details .content .right .dates .task-date-actions .js-save-task-dates {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 30px;
|
||||
padding: 0 10px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
line-height: 1;
|
||||
}
|
||||
.task_popup .task_details .content .right .dates .task-date-field label {
|
||||
display: block;
|
||||
@@ -607,6 +635,11 @@
|
||||
margin-bottom: 4px;
|
||||
color: #4e5e6a;
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
.task_popup .task_details .content .right .dates .task-date-edit-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
.task_popup .task_details .task-popup-compact-btn {
|
||||
height: 30px;
|
||||
padding: 0 10px;
|
||||
|
||||
Reference in New Issue
Block a user