From fc21d3873e3ac63222ad4065a593c715bef4c251 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 31 Jan 2016 17:46:19 -0500 Subject: When creating a new project, have the possibility to select another project to duplicate --- app/Template/project_creation/create.php | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 app/Template/project_creation/create.php (limited to 'app/Template/project_creation/create.php') diff --git a/app/Template/project_creation/create.php b/app/Template/project_creation/create.php new file mode 100644 index 00000000..6caa36af --- /dev/null +++ b/app/Template/project_creation/create.php @@ -0,0 +1,42 @@ +
+ +
+ + form->csrf() ?> + form->hidden('is_private', $values) ?> + + form->label(t('Name'), 'name') ?> + form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> + + 1): ?> + form->label(t('Create from another project'), 'src_project_id') ?> + form->select('src_project_id', $projects_list, $values) ?> + + +
0 ? '' : 'style="display: none"' ?>> +

+ + + form->checkbox('projectPermission', t('Permissions'), 1, true) ?> + + + form->checkbox('category', t('Categories'), 1, true) ?> + form->checkbox('action', t('Actions'), 1, true) ?> + form->checkbox('swimlane', t('Swimlanes'), 1, true) ?> + form->checkbox('task', t('Tasks'), 1, false) ?> +
+ +
+ +
+
+ +
+

+
+ +
\ No newline at end of file -- cgit v1.2.3 From 271543431e999032d6e91197633119309fa6c622 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 31 Jan 2016 20:14:51 -0500 Subject: Make project creation form a inline popup --- app/Controller/Base.php | 3 +-- app/Controller/ProjectCreation.php | 3 +-- app/Core/Helper.php | 1 + app/Helper/Layout.php | 32 ++++++++++++++++++++++++++++++++ app/Template/app/layout.php | 4 ++-- app/Template/header.php | 4 ++-- app/Template/project_creation/create.php | 4 +--- 7 files changed, 40 insertions(+), 11 deletions(-) create mode 100644 app/Helper/Layout.php (limited to 'app/Template/project_creation/create.php') diff --git a/app/Controller/Base.php b/app/Controller/Base.php index 02d87aae..0939f44c 100644 --- a/app/Controller/Base.php +++ b/app/Controller/Base.php @@ -189,10 +189,9 @@ abstract class Base extends \Kanboard\Core\Base */ protected function taskLayout($template, array $params) { - $params['ajax'] = $this->request->isAjax(); $content = $this->template->render($template, $params); - if ($params['ajax']) { + if ($this->request->isAjax()) { return $content; } diff --git a/app/Controller/ProjectCreation.php b/app/Controller/ProjectCreation.php index a3154034..61ea2586 100644 --- a/app/Controller/ProjectCreation.php +++ b/app/Controller/ProjectCreation.php @@ -20,8 +20,7 @@ class ProjectCreation extends Base $is_private = isset($values['is_private']) && $values['is_private'] == 1; $projects_list = array(0 => t('Do not duplicate anything')) + $this->projectUserRole->getActiveProjectsByUser($this->userSession->getId()); - $this->response->html($this->template->layout('project_creation/create', array( - 'board_selector' => $this->projectUserRole->getActiveProjectsByUser($this->userSession->getId()), + $this->response->html($this->helper->layout->app('project_creation/create', array( 'values' => $values, 'errors' => $errors, 'is_private' => $is_private, diff --git a/app/Core/Helper.php b/app/Core/Helper.php index 5edaa3f0..bf71769f 100644 --- a/app/Core/Helper.php +++ b/app/Core/Helper.php @@ -20,6 +20,7 @@ use Pimple\Container; * @property \Helper\Text $text * @property \Helper\Url $url * @property \Helper\User $user + * @property \Helper\Layout $layout */ class Helper { diff --git a/app/Helper/Layout.php b/app/Helper/Layout.php new file mode 100644 index 00000000..685c7b84 --- /dev/null +++ b/app/Helper/Layout.php @@ -0,0 +1,32 @@ +request->isAjax()) { + return $this->template->render($template, $params); + } + + $params['board_selector'] = $this->projectUserRole->getActiveProjectsByUser($this->userSession->getId()); + return $this->template->layout($template, $params); + } +} diff --git a/app/Template/app/layout.php b/app/Template/app/layout.php index 8a745327..d54b1da7 100644 --- a/app/Template/app/layout.php +++ b/app/Template/app/layout.php @@ -4,12 +4,12 @@ user->hasAccess('ProjectCreation', 'create')): ?>
  • - url->link(t('New project'), 'ProjectCreation', 'create') ?> + url->link(t('New project'), 'ProjectCreation', 'create', array(), false, 'popover') ?>
  • - url->link(t('New private project'), 'ProjectCreation', 'createPrivate') ?> + url->link(t('New private project'), 'ProjectCreation', 'createPrivate', array(), false, 'popover') ?>
  • diff --git a/app/Template/header.php b/app/Template/header.php index 36db54d5..fd9ff24d 100644 --- a/app/Template/header.php +++ b/app/Template/header.php @@ -42,10 +42,10 @@
      user->hasAccess('ProjectCreation', 'create')): ?> -
    • url->link(t('New project'), 'ProjectCreation', 'create') ?>
    • +
    • url->link(t('New project'), 'ProjectCreation', 'create', array(), false, 'popover') ?>
    • - url->link(t('New private project'), 'ProjectCreation', 'createPrivate') ?> + url->link(t('New private project'), 'ProjectCreation', 'createPrivate', array(), false, 'popover') ?>
    diff --git a/app/Template/project_creation/create.php b/app/Template/project_creation/create.php index 6caa36af..387f0ff4 100644 --- a/app/Template/project_creation/create.php +++ b/app/Template/project_creation/create.php @@ -1,8 +1,6 @@
    -- cgit v1.2.3 From b5e1deeaa84c792b1a0523d1f9038955e7745025 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Mon, 1 Feb 2016 18:25:38 -0500 Subject: Improve project creation popover --- app/Template/project_creation/create.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/Template/project_creation/create.php') diff --git a/app/Template/project_creation/create.php b/app/Template/project_creation/create.php index 387f0ff4..46ec5d1e 100644 --- a/app/Template/project_creation/create.php +++ b/app/Template/project_creation/create.php @@ -2,7 +2,7 @@ - + form->csrf() ?> form->hidden('is_private', $values) ?> @@ -30,6 +30,8 @@
    + + url->link(t('cancel'), 'project', 'index', array(), false, 'close-popover') ?>
    -- cgit v1.2.3