Fixs after replacing the event dispatcher

This commit is contained in:
Frédéric Guillot
2014-12-27 19:23:51 -05:00
parent 17dc5bdc9e
commit 1522be603b
6 changed files with 22 additions and 18 deletions

View File

@@ -3,9 +3,7 @@
namespace Model; namespace Model;
use Core\Session; use Core\Session;
use Core\Translator;
use Core\Template; use Core\Template;
use Event\NotificationListener;
use Swift_Message; use Swift_Message;
use Swift_Mailer; use Swift_Mailer;
use Swift_TransportException; use Swift_TransportException;
@@ -29,8 +27,8 @@ class Notification extends Base
* Get a list of people with notifications enabled * Get a list of people with notifications enabled
* *
* @access public * @access public
* @param integer $project_id Project id * @param integer $project_id Project id
* @param array $exlude_users List of user_id to exclude * @param array $exclude_users List of user_id to exclude
* @return array * @return array
*/ */
public function getUsersWithNotification($project_id, array $exclude_users = array()) public function getUsersWithNotification($project_id, array $exclude_users = array())
@@ -61,8 +59,8 @@ class Notification extends Base
* Get the list of users to send the notification for a given project * Get the list of users to send the notification for a given project
* *
* @access public * @access public
* @param integer $project_id Project id * @param integer $project_id Project id
* @param array $exlude_users List of user_id to exclude * @param array $exclude_users List of user_id to exclude
* @return array * @return array
*/ */
public function getUsersList($project_id, array $exclude_users = array()) public function getUsersList($project_id, array $exclude_users = array())

View File

@@ -2,8 +2,6 @@
namespace Model; namespace Model;
use Core\Template;
/** /**
* Project daily summary * Project daily summary
* *

View File

@@ -24,7 +24,7 @@ class TaskCreation extends Base
$this->prepare($values); $this->prepare($values);
$task_id = $this->persist(Task::TABLE, $values); $task_id = $this->persist(Task::TABLE, $values);
if ($task_id) { if ($task_id !== false) {
$this->fireEvents($task_id, $values); $this->fireEvents($task_id, $values);
} }

View File

@@ -16,7 +16,7 @@ class DatabaseProvider implements ServiceProviderInterface
/** /**
* Setup the database driver and execute schema migration * Setup the database driver and execute schema migration
* *
* @return PicoDb\Database * @return \PicoDb\Database
*/ */
public function getInstance() public function getInstance()
{ {
@@ -49,7 +49,7 @@ class DatabaseProvider implements ServiceProviderInterface
/** /**
* Setup the Sqlite database driver * Setup the Sqlite database driver
* *
* @return PicoDb\Database * @return \PicoDb\Database
*/ */
function getSqliteInstance() function getSqliteInstance()
{ {
@@ -64,7 +64,7 @@ class DatabaseProvider implements ServiceProviderInterface
/** /**
* Setup the Mysql database driver * Setup the Mysql database driver
* *
* @return PicoDb\Database * @return \PicoDb\Database
*/ */
function getMysqlInstance() function getMysqlInstance()
{ {
@@ -83,7 +83,7 @@ class DatabaseProvider implements ServiceProviderInterface
/** /**
* Setup the Postgres database driver * Setup the Postgres database driver
* *
* @return PicoDb\Database * @return \PicoDb\Database
*/ */
public function getPostgresInstance() public function getPostgresInstance()
{ {

View File

@@ -2,8 +2,6 @@
namespace Subscriber; namespace Subscriber;
use Event\TaskEvent;
use Model\Task;
use Pimple\Container; use Pimple\Container;
/** /**
@@ -11,6 +9,16 @@ use Pimple\Container;
* *
* @package subscriber * @package subscriber
* @author Frederic Guillot * @author Frederic Guillot
*
* @property \Model\Config $config
* @property \Model\Notification $notification
* @property \Model\Project $project
* @property \Model\ProjectPermission $projectPermission
* @property \Model\ProjectAnalytic $projectAnalytic
* @property \Model\ProjectDailySummary $projectDailySummary
* @property \Model\Task $task
* @property \Model\TaskExport $taskExport
* @property \Model\TaskFinder $taskFinder
*/ */
abstract class Base abstract class Base
{ {

View File

@@ -23,15 +23,15 @@ class WebhookSubscriber extends Base implements EventSubscriberInterface
public function onTaskCreation(TaskEvent $event) public function onTaskCreation(TaskEvent $event)
{ {
$this->executeRequest('webhook_url_task_creation'); $this->executeRequest('webhook_url_task_creation', $event);
} }
public function onTaskModification(TaskEvent $event) public function onTaskModification(TaskEvent $event)
{ {
$this->executeRequest('webhook_url_task_modification'); $this->executeRequest('webhook_url_task_modification', $event);
} }
public function executeRequest($parameter) public function executeRequest($parameter, TaskEvent $event)
{ {
$url = $this->config->get($parameter); $url = $this->config->get($parameter);