Files
Leantime/app/Domain/Tickets/Hxcontrollers/Milestones.php
wangruiguo d647428529
Some checks failed
Security Audit / Composer Security Audit (push) Has been cancelled
Security Audit / NPM Security Audit (push) Has been cancelled
Security Audit / CodeQL Analysis (push) Has been cancelled
OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)
2026-09-03 18:49:20 +08:00

51 lines
1.3 KiB
PHP

<?php
namespace Leantime\Domain\Tickets\Hxcontrollers;
use Leantime\Core\Controller\HtmxController;
use Leantime\Domain\Tickets\Services\Tickets;
class Milestones extends HtmxController
{
protected static string $view = 'tickets::partials.milestoneCard';
private Tickets $ticketService;
/**
* Controller constructor
*/
public function init(Tickets $ticketService): void
{
$this->ticketService = $ticketService;
}
public function progress()
{
$getParams = $_GET;
$milestone = $this->ticketService->getTicket($getParams['milestoneId']);
$percentDone = $this->ticketService->getMilestoneProgress($getParams['milestoneId']);
$this->tpl->assign('progressColor', $getParams['progressColor'] ?? 'default');
$this->tpl->assign('noText', $getParams['noText'] ?? false);
$this->tpl->assign('milestone', $milestone);
$this->tpl->assign('percentDone', $percentDone);
return 'progress';
}
public function showCard()
{
$getParams = $_GET;
$milestone = $this->ticketService->getTicket($getParams['milestoneId']);
$percentDone = $this->ticketService->getMilestoneProgress($getParams['milestoneId']);
$this->tpl->assign('percentDone', $percentDone);
$this->tpl->assign('milestone', $milestone);
}
}