Fix
This commit is contained in:
37
controller/DeckflowController.php
Normal file
37
controller/DeckflowController.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
namespace OCA\Deckflow\Controller;
|
||||
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\IRequest;
|
||||
use OCA\Deckflow\WorkflowRepository;
|
||||
use OCP\User\CurrentUser;
|
||||
|
||||
class DeckflowController extends Controller {
|
||||
|
||||
private $workflowRepo;
|
||||
|
||||
public function __construct($appName, IRequest $request) {
|
||||
parent::__construct($appName, $request);
|
||||
$this->workflowRepo = new WorkflowRepository();
|
||||
}
|
||||
|
||||
// Zeigt alle Workflows des Benutzers an
|
||||
public function getWorkflows() {
|
||||
$user_id = \OC::$server->getUserManager()->getUser()->getUID();
|
||||
$workflows = $this->workflowRepo->getWorkflowsForUser($user_id);
|
||||
return $this->render('main.php', ['workflows' => $workflows]);
|
||||
}
|
||||
|
||||
// Workflow erstellen
|
||||
public function createWorkflow($deck_id, $source_stack_id, $target_stack_id) {
|
||||
$user_id = \OC::$server->getUserManager()->getUser()->getUID();
|
||||
$this->workflowRepo->createWorkflow($user_id, $deck_id, $source_stack_id, $target_stack_id);
|
||||
return $this->getWorkflows();
|
||||
}
|
||||
|
||||
// Workflow löschen
|
||||
public function deleteWorkflow($workflow_id) {
|
||||
$this->workflowRepo->deleteWorkflow($workflow_id);
|
||||
return $this->getWorkflows();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user