OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)
This commit is contained in:
42
app/Domain/Clients/Controllers/ShowAll.php
Normal file
42
app/Domain/Clients/Controllers/ShowAll.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Leantime\Domain\Clients\Controllers;
|
||||
|
||||
use Leantime\Core\Auth\Permissions\RequiresPermission;
|
||||
use Leantime\Core\Controller\Controller;
|
||||
use Leantime\Domain\Clients\Permissions\ClientsPermissions;
|
||||
use Leantime\Domain\Clients\Services\Clients as ClientService;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
/**
|
||||
* ShowAll Controller - Show all clients.
|
||||
*/
|
||||
class ShowAll extends Controller
|
||||
{
|
||||
private ClientService $clientService;
|
||||
|
||||
/**
|
||||
* Initializes dependencies.
|
||||
*/
|
||||
public function init(ClientService $clientService): void
|
||||
{
|
||||
$this->clientService = $clientService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the list of all clients.
|
||||
*
|
||||
* @param array $params Request parameters
|
||||
*/
|
||||
#[RequiresPermission(ClientsPermissions::VIEW, global: true)]
|
||||
public function get(array $params): Response
|
||||
{
|
||||
if (session('userdata.role') == 'admin') {
|
||||
$this->tpl->assign('admin', true);
|
||||
}
|
||||
|
||||
$this->tpl->assign('allClients', $this->clientService->getAll());
|
||||
|
||||
return $this->tpl->display('clients.showAll');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user