OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)
This commit is contained in:
50
app/Domain/Projects/Hxcontrollers/ProjectCardProgress.php
Normal file
50
app/Domain/Projects/Hxcontrollers/ProjectCardProgress.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace Leantime\Domain\Projects\Hxcontrollers;
|
||||
|
||||
use Leantime\Core\Controller\Frontcontroller;
|
||||
use Leantime\Core\Controller\HtmxController;
|
||||
use Leantime\Domain\Menu\Services\Menu;
|
||||
use Leantime\Domain\Projects\Services\Projects as ProjectService;
|
||||
|
||||
class ProjectCardProgress extends HtmxController
|
||||
{
|
||||
protected static string $view = 'projects::partials.projectCardProgressBar';
|
||||
|
||||
private ProjectService $projectsService;
|
||||
|
||||
private Menu $menuService;
|
||||
|
||||
/**
|
||||
* Controller constructor
|
||||
*
|
||||
* @param \Leantime\Domain\Projects\Services\Projects $projectsService The projects domain service.
|
||||
* @param \Leantime\Domain\Menu\Services\Menu $menuService The menu domain service.
|
||||
*/
|
||||
public function init(
|
||||
ProjectService $projectsService,
|
||||
Menu $menuService
|
||||
): void {
|
||||
$this->projectsService = $projectsService;
|
||||
$this->menuService = $menuService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the project card progress bar partial.
|
||||
*/
|
||||
public function getProgress(): void
|
||||
{
|
||||
$projectId = $_GET['pId'];
|
||||
|
||||
$project = $this->projectsService->getProjectCardData($projectId);
|
||||
|
||||
$projectTypeAvatars = $this->menuService->getProjectTypeAvatars();
|
||||
|
||||
$currentUrlPath = BASE_URL.'/'.str_replace('.', '/', Frontcontroller::getCurrentRoute());
|
||||
|
||||
$this->tpl->assign('projectTypeAvatars', $projectTypeAvatars);
|
||||
$this->tpl->assign('currentUrlPath', $currentUrlPath);
|
||||
$this->tpl->assign('project', $project);
|
||||
$this->tpl->assign('type', 'full');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user