Skip to content

Commit ddd4e13

Browse files
author
Simon Karlen
committed
fixed display of new task from recurrent task
1 parent d3c8f7b commit ddd4e13

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

src/behaviors/RepeatableBehavior.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ public function updateRecurrentInstance(\yii\base\ModelEvent $event)
206206
}
207207
$record->save();
208208
}
209+
$this->owner->setAttribute($this->idProperty, $instance->{$this->idProperty});
209210

210211
$event->isValid = false;
211212
}

src/controllers/TaskController.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,14 @@ public function actionUpdate($id, $updateSeries = false, $return = 'card')
433433
return $this->renderAjax('todo', [
434434
'kanbanModuleName' => $this->module->id
435435
]);
436+
} elseif ($return === 'bucket') {
437+
return $this->renderAjax('/bucket/view', [
438+
'model' => $model->bucket,
439+
'statuses' => $this->module->statuses,
440+
'users' => $this->module->users,
441+
'closeModal' => true,
442+
'finishedTasks' => $model->bucket->getTasks()->where(['status' => Task::STATUS_DONE])->count('id')
443+
]);
436444
}
437445

438446
$model = $this->findModel($model->id);

src/views/task/item.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,8 @@ class="dropdown-toggle text-decoration-none text-reset">
239239
<?php endif; ?>
240240
<?= Html::a(FAS::i('edit'), [
241241
'task/update',
242-
'id' => $model->isRecurrentInstance() ? $model->recurrence_parent_id : $model->id
242+
'id' => $model->isRecurrentInstance() ? $model->recurrence_parent_id : $model->id,
243+
'return' => $model->isRecurrentInstance() ? 'bucket' : 'card'
243244
], [
244245
'class' => ['btn', 'btn-sm', 'ml-auto', 'kanban-task-update-link'],
245246
'data' => [
@@ -292,7 +293,8 @@ class="dropdown-toggle text-decoration-none text-reset">
292293
'label' => FAS::i('edit', ['class' => ['mr-1']])->fixedWidth() . ' ' . Yii::t('yii', 'Update'),
293294
'url' => [
294295
'task/update',
295-
'id' => ($model->isRecurrentInstance() ? $model->recurrence_parent_id : $model->id)
296+
'id' => $model->isRecurrentInstance() ? $model->recurrence_parent_id : $model->id,
297+
'return' => $model->isRecurrentInstance() ? 'bucket' : 'card'
296298
],
297299
'linkOptions' => [
298300
'data' => [

src/views/task/update.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@
5151
'data' => [
5252
'turbo-frame' => ($return === 'todo')
5353
? 'kanban-todo-frame'
54+
/*
5455
: 'task-' . ($model->isRecurrentInstance() ? $model->recurrence_parent_id : $model->id) . '-frame'
56+
/*/
57+
: ($model->isRecurrentInstance() ? 'bucket-' . $model->bucket_id . '-frame' : 'task-' . $model->id . '-frame')
58+
//*/
5559
]
5660
]
5761
]); ?>

0 commit comments

Comments
 (0)