OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)
This commit is contained in:
50
app/Domain/Tickets/Hxcontrollers/Milestones.php
Normal file
50
app/Domain/Tickets/Hxcontrollers/Milestones.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?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);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user