OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)
This commit is contained in:
48
app/Domain/Projects/Hxcontrollers/Checklist.php
Normal file
48
app/Domain/Projects/Hxcontrollers/Checklist.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace Leantime\Domain\Projects\Hxcontrollers;
|
||||
|
||||
use Error;
|
||||
use Illuminate\Contracts\Container\BindingResolutionException;
|
||||
use Leantime\Core\Controller\HtmxController;
|
||||
use Leantime\Domain\Projects\Services\Projects;
|
||||
|
||||
class Checklist extends HtmxController
|
||||
{
|
||||
protected static string $view = 'projects::partials.checklist';
|
||||
|
||||
private Projects $projectService;
|
||||
|
||||
/**
|
||||
* Controller constructor
|
||||
*
|
||||
* @param Projects $projectService The projects domain service.
|
||||
*/
|
||||
public function init(Projects $projectService): void
|
||||
{
|
||||
$this->projectService = $projectService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates subtask status
|
||||
*
|
||||
* @throws BindingResolutionException
|
||||
*/
|
||||
public function updateSubtask(): void
|
||||
{
|
||||
if (! $this->incomingRequest->getMethod() == 'PATCH') {
|
||||
throw new Error('This endpoint only supports PATCH requests');
|
||||
}
|
||||
|
||||
// update project progress
|
||||
$projectProgress = $this->incomingRequest->request->all();
|
||||
|
||||
$this->projectService->updateProjectProgress($projectProgress, session('currentProject'));
|
||||
|
||||
// return view with new data
|
||||
[$progressSteps, $percentDone] = $this->projectService->getProjectSetupChecklist(session('currentProject'));
|
||||
$this->tpl->assign('progressSteps', $progressSteps);
|
||||
$this->tpl->assign('percentDone', $percentDone);
|
||||
$this->tpl->assign('includeTitle', false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user