Add email notifications
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Controller;
|
||||
|
||||
use Core\Tool;
|
||||
use Core\Registry;
|
||||
use Core\Security;
|
||||
use Core\Translator;
|
||||
@@ -24,6 +25,7 @@ use Model\LastLogin;
|
||||
* @property \Model\GitHub $gitHub
|
||||
* @property \Model\LastLogin $lastLogin
|
||||
* @property \Model\Ldap $ldap
|
||||
* @property \Model\Notification $notification
|
||||
* @property \Model\Project $project
|
||||
* @property \Model\RememberMe $rememberMe
|
||||
* @property \Model\ReverseProxyAuth $reverseProxyAuth
|
||||
@@ -93,9 +95,7 @@ abstract class Base
|
||||
*/
|
||||
public function __get($name)
|
||||
{
|
||||
$class = '\Model\\'.ucfirst($name);
|
||||
$this->registry->$name = new $class($this->registry->shared('db'), $this->registry->shared('event'));
|
||||
return $this->registry->shared($name);
|
||||
return Tool::loadModel($this->registry, $name);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -157,6 +157,7 @@ abstract class Base
|
||||
$this->action->attachEvents();
|
||||
$this->project->attachEvents();
|
||||
$this->webhook->attachEvents();
|
||||
$this->notification->attachEvents();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -373,7 +373,7 @@ class Board extends Base
|
||||
}
|
||||
|
||||
if (isset($values['positions'])) {
|
||||
$this->board->saveTasksPosition($values['positions']);
|
||||
$this->board->saveTasksPosition($values['positions'], $values['selected_task_id']);
|
||||
}
|
||||
|
||||
$this->response->html(
|
||||
|
||||
@@ -20,7 +20,8 @@ class Config extends Base
|
||||
$this->response->html($this->template->layout('config_index', array(
|
||||
'db_size' => $this->config->getDatabaseSize(),
|
||||
'user' => $_SESSION['user'],
|
||||
'projects' => $this->project->getList(),
|
||||
'user_projects' => $this->project->getAvailableList($this->acl->getUserId()),
|
||||
'notifications' => $this->notification->readSettings($this->acl->getUserId()),
|
||||
'languages' => $this->config->getLanguages(),
|
||||
'values' => $this->config->getAll(),
|
||||
'errors' => array(),
|
||||
@@ -32,6 +33,13 @@ class Config extends Base
|
||||
)));
|
||||
}
|
||||
|
||||
public function notifications()
|
||||
{
|
||||
$values = $this->request->getValues();
|
||||
$this->notification->saveSettings($this->acl->getUserId(), $values);
|
||||
$this->response->redirect('?controller=config#notifications');
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate and save settings
|
||||
*
|
||||
@@ -57,7 +65,8 @@ class Config extends Base
|
||||
$this->response->html($this->template->layout('config_index', array(
|
||||
'db_size' => $this->config->getDatabaseSize(),
|
||||
'user' => $_SESSION['user'],
|
||||
'projects' => $this->project->getList(),
|
||||
'user_projects' => $this->project->getAvailableList($this->acl->getUserId()),
|
||||
'notifications' => $this->notification->readSettings($this->acl->getUserId()),
|
||||
'languages' => $this->config->getLanguages(),
|
||||
'values' => $values,
|
||||
'errors' => $errors,
|
||||
|
||||
Reference in New Issue
Block a user