OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)
This commit is contained in:
37
app/Domain/Tickets/Hxcontrollers/TimerButton.php
Normal file
37
app/Domain/Tickets/Hxcontrollers/TimerButton.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Leantime\Domain\Tickets\Hxcontrollers;
|
||||
|
||||
use Leantime\Core\Controller\HtmxController;
|
||||
use Leantime\Domain\Timesheets\Services\Timesheets;
|
||||
|
||||
class TimerButton extends HtmxController
|
||||
{
|
||||
protected static string $view = 'tickets::partials.timerButton';
|
||||
|
||||
private Timesheets $timesheetService;
|
||||
|
||||
/**
|
||||
* Controller constructor
|
||||
*/
|
||||
public function init(Timesheets $timesheetService): void
|
||||
{
|
||||
$this->timesheetService = $timesheetService;
|
||||
}
|
||||
|
||||
public function getStatus(): void
|
||||
{
|
||||
|
||||
$params = $this->incomingRequest->query->all();
|
||||
|
||||
$onTheClock = session()->exists('userdata') ? $this->timesheetService->isClocked(session('userdata.id')) : false;
|
||||
$this->tpl->assign('onTheClock', $onTheClock);
|
||||
$this->tpl->assign('parentTicketId', $params['request_parts'] ?? false);
|
||||
}
|
||||
|
||||
public function getStatusButton(): void
|
||||
{
|
||||
$this->getStatus();
|
||||
$this->tpl->displayPartial('tickets::partials.timerButton');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user