Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Show scheduler tasks of clients #197

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0b9c606
[TASK] Add database table for tasks
Feb 26, 2021
92c668a
[TASK] Add model, TCA and repo
Feb 26, 2021
b6c58d4
[TASK] Add controller and list action
Feb 26, 2021
b13256f
[TASK] Add option to display tasks
Feb 26, 2021
4ea0419
[DOC] Extend readme
Feb 26, 2021
7d51cf9
[TASK] Add TaskImport
Feb 26, 2021
6774a8d
[TASK] Rename field to lastexecution
Feb 26, 2021
e5037ef
[TASK] Fix language label for menu item
Feb 26, 2021
63fbecf
[TASK] Added properties for task
Mar 5, 2021
9d26426
[TASK] Added task importer
Mar 5, 2021
a0b7c14
[TASK] List of tasks
Mar 5, 2021
619edd7
Merge pull request #1 from georgringer/master
hoermannklaus Mar 5, 2021
e74b8ca
Merge pull request #2 from hoermannklaus/master
hoermannklaus Mar 5, 2021
446104a
[TASK] Add frequency to TCA
Mar 17, 2021
5470fc2
[TASK] Add columns to task list
Mar 17, 2021
3faff2b
[TASK] Add late field
Mar 20, 2021
c1c56a0
[TASK] Remove old comment
Mar 20, 2021
d76529d
[TASK] Add late language fields
Mar 20, 2021
3c45df4
[TASK] Add findByClientId repo method
Mar 20, 2021
13deffa
[TASK] Move table to partial
Mar 20, 2021
7193af1
[TASK] Show tasks in client detail
Mar 20, 2021
d77c16d
[TASK] Add status info in client list
Mar 20, 2021
b584d4f
[TASK] Add alert notification options for tasks
Mar 20, 2021
f8b4a42
[DOC] Adapt code documentation
Mar 30, 2021
2a9c201
[TASK] Remove task notification options
Apr 9, 2021
3bdc913
[BUGFIX] Fix task deletion when none are given
hoermannklaus Sep 9, 2021
348a52f
Merge branch 'georgringer:master' into feature-tasks
hoermannklaus Sep 14, 2021
d944b88
bugfix: only import if there is a json for tasks
hoermannklaus Jun 28, 2022
0a562b7
task: display php version in overview
hoermannklaus Dec 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions Classes/Controller/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ protected function createMenu()
['controller' => 'Sla', 'action' => 'list', 'label' => $this->getLabel('sla')],
['controller' => 'Tag', 'action' => 'list', 'label' => $this->getLabel('tag')],
['controller' => 'Statistic', 'action' => 'administration', 'label' => $this->getLabel('administration')],
['controller' => 'Task', 'action' => 'list', 'label' => $this->getLabel('task')]
];

foreach ($actions as $action) {
Expand Down Expand Up @@ -195,8 +196,10 @@ protected function getButtons()
$addUserGroupButton = $buttonBar->makeLinkButton()
->setHref($uriBuilder->buildUriFromRoute('record_edit', $parameters))
->setTitle($this->getLabel('createNew.client'))
->setIcon($this->view->getModuleTemplate()->getIconFactory()->getIcon('actions-document-new',
Icon::SIZE_SMALL));
->setIcon($this->view->getModuleTemplate()->getIconFactory()->getIcon(
'actions-document-new',
Icon::SIZE_SMALL
));
$buttonBar->addButton($addUserGroupButton, ButtonBar::BUTTON_POSITION_LEFT);

// client single view
Expand All @@ -210,16 +213,20 @@ protected function getButtons()
$editClientButton = $buttonBar->makeLinkButton()
->setHref($uriBuilder->buildUriFromRoute('record_edit', $parameters))
->setTitle($this->getLabel('edit.client'))
->setIcon($this->view->getModuleTemplate()->getIconFactory()->getIcon('actions-open',
Icon::SIZE_SMALL));
->setIcon($this->view->getModuleTemplate()->getIconFactory()->getIcon(
'actions-open',
Icon::SIZE_SMALL
));
$buttonBar->addButton($editClientButton, ButtonBar::BUTTON_POSITION_LEFT);

// fetch client data
$downloadClientDataButton = $buttonBar->makeLinkButton()
->setHref($this->getUriBuilder()->reset()->uriFor('fetch', ['client' => $clientId], 'Client'))
->setTitle($this->getLabel('fetchClient.link'))
->setIcon($this->view->getModuleTemplate()->getIconFactory()->getIcon('actions-system-extension-download',
Icon::SIZE_SMALL));
->setIcon($this->view->getModuleTemplate()->getIconFactory()->getIcon(
'actions-system-extension-download',
Icon::SIZE_SMALL
));
$buttonBar->addButton($downloadClientDataButton, ButtonBar::BUTTON_POSITION_LEFT);
}
}
Expand Down
17 changes: 17 additions & 0 deletions Classes/Controller/ClientController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/

use T3Monitor\T3monitoring\Domain\Model\Client;
use T3Monitor\T3monitoring\Domain\Repository\TaskRepository;
use T3Monitor\T3monitoring\Service\Import\ClientImport;
use TYPO3\CMS\Core\Utility\GeneralUtility;

Expand All @@ -19,6 +20,21 @@
class ClientController extends BaseController
{

/**
* @var \T3Monitor\T3monitoring\Domain\Repository\TaskRepository
*/
protected $taskRepository = null;

/**
* Constructor for new client controller objects
*
* @param TaskRepository $taskRepository The task repository
*/
public function __construct(TaskRepository $taskRepository)
{
$this->taskRepository = $taskRepository;
}

/**
* Show client
*
Expand All @@ -35,6 +51,7 @@ public function showAction(Client $client = null)

$this->view->assignMultiple([
'client' => $client,
'tasks' => $this->taskRepository->findByClientId($client->getUid())
]);
}

Expand Down
42 changes: 42 additions & 0 deletions Classes/Controller/TaskController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

namespace T3Monitor\T3monitoring\Controller;

use T3Monitor\T3monitoring\Domain\Repository\TaskRepository;

/*
* This file is part of the t3monitoring extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*/

/**
* TaskController
*/
class TaskController extends BaseController
{
/**
* The task repository
*
* @var TaskRepository
*/
protected $taskRepository = null;

public function injectTaskRepository(TaskRepository $taskRepository)
{
$this->taskRepository = $taskRepository;
}

/**
* List action shows all tasks
*
* @return void
*/
protected function listAction(): void
{
$this->view->assignMultiple([
'tasks' => $this->taskRepository->findAll()
]);
}
}
17 changes: 16 additions & 1 deletion Classes/Domain/Model/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
* LICENSE.txt file that was distributed with this source code.
*/

use T3Monitor\T3monitoring\Domain\Repository\TaskRepository;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
use TYPO3\CMS\Extbase\Persistence\Generic\LazyLoadingProxy;
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;

/**
* Client
Expand Down Expand Up @@ -772,4 +775,16 @@ public function getExtraDangerAsArray()
}
return [];
}

/**
* Return the overall task status for a client.
*
* @return int
*/
public function getTaskStatus(): int
{
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
$taskRepository = $objectManager->get(TaskRepository::class);
return $taskRepository->getTaskStatusForClientId($this->uid);
}
}
Loading