Add the possibility to create external tasks
This commit is contained in:
@@ -2,13 +2,12 @@
|
||||
|
||||
namespace Kanboard\Core\ExternalTask;
|
||||
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Class AccessForbiddenException
|
||||
*
|
||||
* @package Kanboard\Core\ExternalTask
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class AccessForbiddenException extends Exception
|
||||
class AccessForbiddenException extends ExternalTaskException
|
||||
{
|
||||
}
|
||||
|
||||
15
app/Core/ExternalTask/ExternalTaskException.php
Normal file
15
app/Core/ExternalTask/ExternalTaskException.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Kanboard\Core\ExternalTask;
|
||||
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Class NotFoundException
|
||||
*
|
||||
* @package Kanboard\Core\ExternalTask
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class ExternalTaskException extends Exception
|
||||
{
|
||||
}
|
||||
26
app/Core/ExternalTask/ExternalTaskInterface.php
Normal file
26
app/Core/ExternalTask/ExternalTaskInterface.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Kanboard\Core\ExternalTask;
|
||||
|
||||
/**
|
||||
* Interface ExternalTaskInterface
|
||||
*
|
||||
* @package Kanboard\Core\ExternalTask
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
interface ExternalTaskInterface
|
||||
{
|
||||
/**
|
||||
* Return Uniform Resource Identifier for the task
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUri();
|
||||
|
||||
/**
|
||||
* Return a dict to populate the task form
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getFormValues();
|
||||
}
|
||||
@@ -10,15 +10,6 @@ namespace Kanboard\Core\ExternalTask;
|
||||
*/
|
||||
interface ExternalTaskProviderInterface
|
||||
{
|
||||
/**
|
||||
* Get templates
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreationFormTemplate();
|
||||
public function getModificationFormTemplate();
|
||||
public function getTaskViewTemplate();
|
||||
|
||||
/**
|
||||
* Get provider name (visible in the user interface)
|
||||
*
|
||||
@@ -34,17 +25,29 @@ interface ExternalTaskProviderInterface
|
||||
* @throws \Kanboard\Core\ExternalTask\AccessForbiddenException
|
||||
* @throws \Kanboard\Core\ExternalTask\NotFoundException
|
||||
* @param string $uri
|
||||
* @return array Dict that will populate the form
|
||||
* @return ExternalTaskInterface
|
||||
*/
|
||||
public function retrieve($uri);
|
||||
|
||||
/**
|
||||
* Save the task to the external system and/or update the cache
|
||||
* Get task import template name
|
||||
*
|
||||
* @access public
|
||||
* @param string $uri
|
||||
* @param array $data
|
||||
* @return bool
|
||||
* @return string
|
||||
*/
|
||||
public function persist($uri, array $data);
|
||||
public function getImportFormTemplate();
|
||||
|
||||
/**
|
||||
* Get creation form template
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreationFormTemplate();
|
||||
|
||||
/**
|
||||
* Build external task URI based on import form values
|
||||
*
|
||||
* @param array $values
|
||||
* @return string
|
||||
*/
|
||||
public function buildTaskUri(array $values);
|
||||
}
|
||||
|
||||
@@ -2,14 +2,12 @@
|
||||
|
||||
namespace Kanboard\Core\ExternalTask;
|
||||
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Class NotFoundException
|
||||
*
|
||||
* @package Kanboard\Core\ExternalTask
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class NotFoundException extends Exception
|
||||
class NotFoundException extends ExternalTaskException
|
||||
{
|
||||
}
|
||||
|
||||
@@ -2,14 +2,12 @@
|
||||
|
||||
namespace Kanboard\Core\ExternalTask;
|
||||
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Class ProviderNotFoundException
|
||||
*
|
||||
* @package Kanboard\Core\ExternalTask
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class ProviderNotFoundException extends Exception
|
||||
class ProviderNotFoundException extends ExternalTaskException
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user