diff --git a/ChangeLog b/ChangeLog index f2c1a80be..9b36d5f93 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ Version 1.0.39 (unreleased) Improvements: +* Add email address field for projects * Improve forget password behaviour (notify the user that an email has been sent or not) * Do not display current project in board selector * Do not set default task assignee for team projects diff --git a/app/Api/Procedure/ProjectProcedure.php b/app/Api/Procedure/ProjectProcedure.php index a580c8d96..e8a34cd39 100644 --- a/app/Api/Procedure/ProjectProcedure.php +++ b/app/Api/Procedure/ProjectProcedure.php @@ -32,6 +32,13 @@ class ProjectProcedure extends BaseProcedure return $this->formatProject($project); } + public function getProjectByEmail($email) + { + $project = $this->formatProject($this->projectModel->getByEmail($email)); + ProjectAuthorization::getInstance($this->container)->check($this->getClassName(), 'getProjectByEmail', $project['id']); + return $this->formatProject($project); + } + public function getAllProjects() { return $this->formatProjects($this->projectModel->getAll()); diff --git a/app/Helper/AppHelper.php b/app/Helper/AppHelper.php index 3b48d7d30..3cefd1c5b 100644 --- a/app/Helper/AppHelper.php +++ b/app/Helper/AppHelper.php @@ -12,6 +12,11 @@ use Kanboard\Core\Base; */ class AppHelper extends Base { + public function isAjax() + { + return $this->request->isAjax(); + } + /** * Render Javascript component * diff --git a/app/Locale/bs_BA/translations.php b/app/Locale/bs_BA/translations.php index 3174d450e..9dfe2a3ec 100644 --- a/app/Locale/bs_BA/translations.php +++ b/app/Locale/bs_BA/translations.php @@ -1311,4 +1311,6 @@ return array( // 'Your profile must have a valid email address.' => '', // 'Unfortunately, we are unable to reset your password. Did you entered a valid username? Do you have an email address in your profile?' => '', // 'TRL - Turkish Lira' => '', + // 'The project email is optional and could be used by several plugins.' => '', + // 'The email project must be unique across all projects' => '', ); diff --git a/app/Locale/cs_CZ/translations.php b/app/Locale/cs_CZ/translations.php index e152db9f2..8ab5aa7fb 100644 --- a/app/Locale/cs_CZ/translations.php +++ b/app/Locale/cs_CZ/translations.php @@ -1311,4 +1311,6 @@ return array( // 'Your profile must have a valid email address.' => '', // 'Unfortunately, we are unable to reset your password. Did you entered a valid username? Do you have an email address in your profile?' => '', // 'TRL - Turkish Lira' => '', + // 'The project email is optional and could be used by several plugins.' => '', + // 'The email project must be unique across all projects' => '', ); diff --git a/app/Locale/da_DK/translations.php b/app/Locale/da_DK/translations.php index a38a20d7d..eeb02e1d5 100644 --- a/app/Locale/da_DK/translations.php +++ b/app/Locale/da_DK/translations.php @@ -1311,4 +1311,6 @@ return array( // 'Your profile must have a valid email address.' => '', // 'Unfortunately, we are unable to reset your password. Did you entered a valid username? Do you have an email address in your profile?' => '', // 'TRL - Turkish Lira' => '', + // 'The project email is optional and could be used by several plugins.' => '', + // 'The email project must be unique across all projects' => '', ); diff --git a/app/Locale/de_DE/translations.php b/app/Locale/de_DE/translations.php index 13cdf6bfd..9d1ff3bff 100644 --- a/app/Locale/de_DE/translations.php +++ b/app/Locale/de_DE/translations.php @@ -1311,4 +1311,6 @@ return array( // 'Your profile must have a valid email address.' => '', // 'Unfortunately, we are unable to reset your password. Did you entered a valid username? Do you have an email address in your profile?' => '', // 'TRL - Turkish Lira' => '', + // 'The project email is optional and could be used by several plugins.' => '', + // 'The email project must be unique across all projects' => '', ); diff --git a/app/Locale/el_GR/translations.php b/app/Locale/el_GR/translations.php index c27604077..a4750705a 100644 --- a/app/Locale/el_GR/translations.php +++ b/app/Locale/el_GR/translations.php @@ -1311,4 +1311,6 @@ return array( // 'Your profile must have a valid email address.' => '', // 'Unfortunately, we are unable to reset your password. Did you entered a valid username? Do you have an email address in your profile?' => '', // 'TRL - Turkish Lira' => '', + // 'The project email is optional and could be used by several plugins.' => '', + // 'The email project must be unique across all projects' => '', ); diff --git a/app/Locale/es_ES/translations.php b/app/Locale/es_ES/translations.php index 3fa4c3a80..f84f1db1c 100644 --- a/app/Locale/es_ES/translations.php +++ b/app/Locale/es_ES/translations.php @@ -1311,4 +1311,6 @@ return array( // 'Your profile must have a valid email address.' => '', // 'Unfortunately, we are unable to reset your password. Did you entered a valid username? Do you have an email address in your profile?' => '', // 'TRL - Turkish Lira' => '', + // 'The project email is optional and could be used by several plugins.' => '', + // 'The email project must be unique across all projects' => '', ); diff --git a/app/Locale/fi_FI/translations.php b/app/Locale/fi_FI/translations.php index f37abc55a..40fddda4f 100644 --- a/app/Locale/fi_FI/translations.php +++ b/app/Locale/fi_FI/translations.php @@ -1311,4 +1311,6 @@ return array( // 'Your profile must have a valid email address.' => '', // 'Unfortunately, we are unable to reset your password. Did you entered a valid username? Do you have an email address in your profile?' => '', // 'TRL - Turkish Lira' => '', + // 'The project email is optional and could be used by several plugins.' => '', + // 'The email project must be unique across all projects' => '', ); diff --git a/app/Locale/fr_FR/translations.php b/app/Locale/fr_FR/translations.php index ce2e8a460..54df0379c 100644 --- a/app/Locale/fr_FR/translations.php +++ b/app/Locale/fr_FR/translations.php @@ -961,7 +961,7 @@ return array( 'Do you really want to close all tasks of this column?' => 'Voulez-vous vraiment fermer toutes les tâches de cette colonne ?', '%d task(s) in the column "%s" and the swimlane "%s" will be closed.' => '%d tâche(s) dans la colonne « %s » et la swimlane « %s » seront fermées.', 'Close all tasks of this column' => 'Fermer toutes les tâches de cette colonne', - 'No plugin has registered a project notification method. You can still configure individual notifications in your user profile.' => 'Aucun plugin n\'a enregistré une méthode de notification de projet. Vous pouvez toujours configurer les notifications individuelles dans votre profil d\'utilisateur.', + 'No plugin has registered a project notification method. You can still configure individual notifications in your user profile.' => 'Aucun plugin n\'a enregistré une méthode de notification de projet. Vous pouvez toujours configurer les notifications individuelles dans votre profil utilisateur.', 'My dashboard' => 'Mon tableau de bord', 'My profile' => 'Mon profil', 'Project owner: ' => 'Responsable du projet : ', @@ -1311,4 +1311,6 @@ return array( 'Your profile must have a valid email address.' => 'Votre profil doit avoir une adresse e-mail valide.', 'Unfortunately, we are unable to reset your password. Did you entered a valid username? Do you have an email address in your profile?' => 'Malheureusement, nous ne pouvons pas réinitialiser votre mot de passe. Avez-vous saisi un nom d\'utilisateur valide ? Avez-vous une adresse e-mail dans votre profil ?', 'TRL - Turkish Lira' => 'TRL - Livre turque', + 'The project email is optional and could be used by several plugins.' => 'L\'adresse email d\'un projet est optionnel et pourrait être utilisé par plusieurs extensions.', + 'The email project must be unique across all projects' => 'L\'adresse email d\'un projet doit être unique pour tous les projets', ); diff --git a/app/Locale/hu_HU/translations.php b/app/Locale/hu_HU/translations.php index 57bea2470..2ad209a72 100644 --- a/app/Locale/hu_HU/translations.php +++ b/app/Locale/hu_HU/translations.php @@ -1311,4 +1311,6 @@ return array( // 'Your profile must have a valid email address.' => '', // 'Unfortunately, we are unable to reset your password. Did you entered a valid username? Do you have an email address in your profile?' => '', // 'TRL - Turkish Lira' => '', + // 'The project email is optional and could be used by several plugins.' => '', + // 'The email project must be unique across all projects' => '', ); diff --git a/app/Locale/id_ID/translations.php b/app/Locale/id_ID/translations.php index 4c2bab4ff..938c6bd7f 100644 --- a/app/Locale/id_ID/translations.php +++ b/app/Locale/id_ID/translations.php @@ -1311,4 +1311,6 @@ return array( // 'Your profile must have a valid email address.' => '', // 'Unfortunately, we are unable to reset your password. Did you entered a valid username? Do you have an email address in your profile?' => '', // 'TRL - Turkish Lira' => '', + // 'The project email is optional and could be used by several plugins.' => '', + // 'The email project must be unique across all projects' => '', ); diff --git a/app/Locale/it_IT/translations.php b/app/Locale/it_IT/translations.php index 8a73ceeb1..6d4ceaf91 100644 --- a/app/Locale/it_IT/translations.php +++ b/app/Locale/it_IT/translations.php @@ -1311,4 +1311,6 @@ return array( // 'Your profile must have a valid email address.' => '', // 'Unfortunately, we are unable to reset your password. Did you entered a valid username? Do you have an email address in your profile?' => '', // 'TRL - Turkish Lira' => '', + // 'The project email is optional and could be used by several plugins.' => '', + // 'The email project must be unique across all projects' => '', ); diff --git a/app/Locale/ja_JP/translations.php b/app/Locale/ja_JP/translations.php index 8ce0c9fa0..1c69d8093 100644 --- a/app/Locale/ja_JP/translations.php +++ b/app/Locale/ja_JP/translations.php @@ -1311,4 +1311,6 @@ return array( // 'Your profile must have a valid email address.' => '', // 'Unfortunately, we are unable to reset your password. Did you entered a valid username? Do you have an email address in your profile?' => '', // 'TRL - Turkish Lira' => '', + // 'The project email is optional and could be used by several plugins.' => '', + // 'The email project must be unique across all projects' => '', ); diff --git a/app/Locale/ko_KR/translations.php b/app/Locale/ko_KR/translations.php index b3fe859e4..1bf456336 100644 --- a/app/Locale/ko_KR/translations.php +++ b/app/Locale/ko_KR/translations.php @@ -1311,4 +1311,6 @@ return array( // 'Your profile must have a valid email address.' => '', // 'Unfortunately, we are unable to reset your password. Did you entered a valid username? Do you have an email address in your profile?' => '', // 'TRL - Turkish Lira' => '', + // 'The project email is optional and could be used by several plugins.' => '', + // 'The email project must be unique across all projects' => '', ); diff --git a/app/Locale/my_MY/translations.php b/app/Locale/my_MY/translations.php index 0d6947822..588829d20 100644 --- a/app/Locale/my_MY/translations.php +++ b/app/Locale/my_MY/translations.php @@ -1311,4 +1311,6 @@ return array( // 'Your profile must have a valid email address.' => '', // 'Unfortunately, we are unable to reset your password. Did you entered a valid username? Do you have an email address in your profile?' => '', // 'TRL - Turkish Lira' => '', + // 'The project email is optional and could be used by several plugins.' => '', + // 'The email project must be unique across all projects' => '', ); diff --git a/app/Locale/nb_NO/translations.php b/app/Locale/nb_NO/translations.php index 7f563358f..04d7c7183 100644 --- a/app/Locale/nb_NO/translations.php +++ b/app/Locale/nb_NO/translations.php @@ -1311,4 +1311,6 @@ return array( // 'Your profile must have a valid email address.' => '', // 'Unfortunately, we are unable to reset your password. Did you entered a valid username? Do you have an email address in your profile?' => '', // 'TRL - Turkish Lira' => '', + // 'The project email is optional and could be used by several plugins.' => '', + // 'The email project must be unique across all projects' => '', ); diff --git a/app/Locale/nl_NL/translations.php b/app/Locale/nl_NL/translations.php index 37427071f..3bc9e51d7 100644 --- a/app/Locale/nl_NL/translations.php +++ b/app/Locale/nl_NL/translations.php @@ -1311,4 +1311,6 @@ return array( // 'Your profile must have a valid email address.' => '', // 'Unfortunately, we are unable to reset your password. Did you entered a valid username? Do you have an email address in your profile?' => '', // 'TRL - Turkish Lira' => '', + // 'The project email is optional and could be used by several plugins.' => '', + // 'The email project must be unique across all projects' => '', ); diff --git a/app/Locale/pl_PL/translations.php b/app/Locale/pl_PL/translations.php index a3b0018d7..fdca3f07b 100644 --- a/app/Locale/pl_PL/translations.php +++ b/app/Locale/pl_PL/translations.php @@ -1311,4 +1311,6 @@ return array( // 'Your profile must have a valid email address.' => '', // 'Unfortunately, we are unable to reset your password. Did you entered a valid username? Do you have an email address in your profile?' => '', // 'TRL - Turkish Lira' => '', + // 'The project email is optional and could be used by several plugins.' => '', + // 'The email project must be unique across all projects' => '', ); diff --git a/app/Locale/pt_BR/translations.php b/app/Locale/pt_BR/translations.php index 0de6ab2bd..e709bb4a6 100644 --- a/app/Locale/pt_BR/translations.php +++ b/app/Locale/pt_BR/translations.php @@ -1311,4 +1311,6 @@ return array( // 'Your profile must have a valid email address.' => '', // 'Unfortunately, we are unable to reset your password. Did you entered a valid username? Do you have an email address in your profile?' => '', // 'TRL - Turkish Lira' => '', + // 'The project email is optional and could be used by several plugins.' => '', + // 'The email project must be unique across all projects' => '', ); diff --git a/app/Locale/pt_PT/translations.php b/app/Locale/pt_PT/translations.php index 6bf04605a..b70d97d9e 100644 --- a/app/Locale/pt_PT/translations.php +++ b/app/Locale/pt_PT/translations.php @@ -1311,4 +1311,6 @@ return array( 'Your profile must have a valid email address.' => 'O seu perfil deve ter um endereço de email válido.', 'Unfortunately, we are unable to reset your password. Did you entered a valid username? Do you have an email address in your profile?' => 'Infelizmente, não conseguimos redefinir a sua password. Colocou um utilizador válido? Tem um endereço de email definido no seu perfil?', 'TRL - Turkish Lira' => 'TRL - Lira Turca', + // 'The project email is optional and could be used by several plugins.' => '', + // 'The email project must be unique across all projects' => '', ); diff --git a/app/Locale/ru_RU/translations.php b/app/Locale/ru_RU/translations.php index d9b9d4d2d..680340b1d 100644 --- a/app/Locale/ru_RU/translations.php +++ b/app/Locale/ru_RU/translations.php @@ -1311,4 +1311,6 @@ return array( // 'Your profile must have a valid email address.' => '', // 'Unfortunately, we are unable to reset your password. Did you entered a valid username? Do you have an email address in your profile?' => '', // 'TRL - Turkish Lira' => '', + // 'The project email is optional and could be used by several plugins.' => '', + // 'The email project must be unique across all projects' => '', ); diff --git a/app/Locale/sr_Latn_RS/translations.php b/app/Locale/sr_Latn_RS/translations.php index 2f22774e5..75678bca7 100644 --- a/app/Locale/sr_Latn_RS/translations.php +++ b/app/Locale/sr_Latn_RS/translations.php @@ -1311,4 +1311,6 @@ return array( // 'Your profile must have a valid email address.' => '', // 'Unfortunately, we are unable to reset your password. Did you entered a valid username? Do you have an email address in your profile?' => '', // 'TRL - Turkish Lira' => '', + // 'The project email is optional and could be used by several plugins.' => '', + // 'The email project must be unique across all projects' => '', ); diff --git a/app/Locale/sv_SE/translations.php b/app/Locale/sv_SE/translations.php index 17e60c03a..3f901a093 100644 --- a/app/Locale/sv_SE/translations.php +++ b/app/Locale/sv_SE/translations.php @@ -1311,4 +1311,6 @@ return array( // 'Your profile must have a valid email address.' => '', // 'Unfortunately, we are unable to reset your password. Did you entered a valid username? Do you have an email address in your profile?' => '', // 'TRL - Turkish Lira' => '', + // 'The project email is optional and could be used by several plugins.' => '', + // 'The email project must be unique across all projects' => '', ); diff --git a/app/Locale/th_TH/translations.php b/app/Locale/th_TH/translations.php index f8ecd0d29..26497b0a6 100644 --- a/app/Locale/th_TH/translations.php +++ b/app/Locale/th_TH/translations.php @@ -1311,4 +1311,6 @@ return array( // 'Your profile must have a valid email address.' => '', // 'Unfortunately, we are unable to reset your password. Did you entered a valid username? Do you have an email address in your profile?' => '', // 'TRL - Turkish Lira' => '', + // 'The project email is optional and could be used by several plugins.' => '', + // 'The email project must be unique across all projects' => '', ); diff --git a/app/Locale/tr_TR/translations.php b/app/Locale/tr_TR/translations.php index 7c8a74539..c3947fed5 100644 --- a/app/Locale/tr_TR/translations.php +++ b/app/Locale/tr_TR/translations.php @@ -1311,4 +1311,6 @@ return array( // 'Your profile must have a valid email address.' => '', // 'Unfortunately, we are unable to reset your password. Did you entered a valid username? Do you have an email address in your profile?' => '', // 'TRL - Turkish Lira' => '', + // 'The project email is optional and could be used by several plugins.' => '', + // 'The email project must be unique across all projects' => '', ); diff --git a/app/Locale/zh_CN/translations.php b/app/Locale/zh_CN/translations.php index 76c51a621..5f45188bf 100644 --- a/app/Locale/zh_CN/translations.php +++ b/app/Locale/zh_CN/translations.php @@ -1311,4 +1311,6 @@ return array( // 'Your profile must have a valid email address.' => '', // 'Unfortunately, we are unable to reset your password. Did you entered a valid username? Do you have an email address in your profile?' => '', // 'TRL - Turkish Lira' => '', + // 'The project email is optional and could be used by several plugins.' => '', + // 'The email project must be unique across all projects' => '', ); diff --git a/app/Model/ProjectModel.php b/app/Model/ProjectModel.php index aba5eee25..080217cb3 100644 --- a/app/Model/ProjectModel.php +++ b/app/Model/ProjectModel.php @@ -105,6 +105,22 @@ class ProjectModel extends Base return $this->db->table(self::TABLE)->eq('identifier', strtoupper($identifier))->findOne(); } + /** + * Get a project by the email address + * + * @access public + * @param string $email + * @return array|boolean + */ + public function getByEmail($email) + { + if (empty($email)) { + return false; + } + + return $this->db->table(self::TABLE)->eq('email', $email)->findOne(); + } + /** * Fetch project data by using the token * diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index 7771440e7..ca9f45adb 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -6,7 +6,12 @@ use PDO; use Kanboard\Core\Security\Token; use Kanboard\Core\Security\Role; -const VERSION = 120; +const VERSION = 121; + +function version_121(PDO $pdo) +{ + $pdo->exec('ALTER TABLE projects ADD COLUMN email VARCHAR(255)'); +} function version_120(PDO $pdo) { diff --git a/app/Schema/Postgres.php b/app/Schema/Postgres.php index 8054340cc..cbea908f0 100644 --- a/app/Schema/Postgres.php +++ b/app/Schema/Postgres.php @@ -6,7 +6,12 @@ use PDO; use Kanboard\Core\Security\Token; use Kanboard\Core\Security\Role; -const VERSION = 99; +const VERSION = 100; + +function version_100(PDO $pdo) +{ + $pdo->exec('ALTER TABLE "projects" ADD COLUMN email VARCHAR(255)'); +} function version_99(PDO $pdo) { diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php index 87630b1aa..a68ed4185 100644 --- a/app/Schema/Sqlite.php +++ b/app/Schema/Sqlite.php @@ -6,7 +6,12 @@ use Kanboard\Core\Security\Token; use Kanboard\Core\Security\Role; use PDO; -const VERSION = 110; +const VERSION = 111; + +function version_111(PDO $pdo) +{ + $pdo->exec('ALTER TABLE "projects" ADD COLUMN email TEXT'); +} function version_110(PDO $pdo) { diff --git a/app/Template/project_edit/show.php b/app/Template/project_edit/show.php index 46cdb8fab..074f1d37e 100644 --- a/app/Template/project_edit/show.php +++ b/app/Template/project_edit/show.php @@ -1,6 +1,12 @@ -