Move dashboard menu for calendar and activity stream
This commit is contained in:
parent
cfd3000d83
commit
8f6b3295e8
|
|
@ -10,6 +10,22 @@ namespace Kanboard\Controller;
|
|||
*/
|
||||
class ActivityController extends BaseController
|
||||
{
|
||||
/**
|
||||
* Activity page for a user
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function user()
|
||||
{
|
||||
$user = $this->getUser();
|
||||
|
||||
$this->response->html($this->helper->layout->dashboard('activity/user', array(
|
||||
'title' => t('Activity stream for %s', $this->helper->user->getFullname($user)),
|
||||
'events' => $this->helper->projectActivity->getProjectsEvents($this->projectPermissionModel->getActiveProjectIds($user['id']), 100),
|
||||
'user' => $user,
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Activity page for a project
|
||||
*
|
||||
|
|
@ -20,9 +36,9 @@ class ActivityController extends BaseController
|
|||
$project = $this->getProject();
|
||||
|
||||
$this->response->html($this->helper->layout->app('activity/project', array(
|
||||
'events' => $this->helper->projectActivity->getProjectEvents($project['id']),
|
||||
'title' => t('%s\'s activity', $project['name']),
|
||||
'events' => $this->helper->projectActivity->getProjectEvents($project['id']),
|
||||
'project' => $project,
|
||||
'title' => t('%s\'s activity', $project['name'])
|
||||
)));
|
||||
}
|
||||
|
||||
|
|
@ -36,11 +52,11 @@ class ActivityController extends BaseController
|
|||
$task = $this->getTask();
|
||||
|
||||
$this->response->html($this->helper->layout->task('activity/task', array(
|
||||
'title' => $task['title'],
|
||||
'task' => $task,
|
||||
'title' => $task['title'],
|
||||
'task' => $task,
|
||||
'project' => $this->projectModel->getById($task['project_id']),
|
||||
'events' => $this->helper->projectActivity->getTaskEvents($task['id']),
|
||||
'tags' => $this->taskTagModel->getList($task['id']),
|
||||
'events' => $this->helper->projectActivity->getTaskEvents($task['id']),
|
||||
'tags' => $this->taskTagModel->getList($task['id']),
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,17 +17,31 @@ use Kanboard\Model\TaskModel;
|
|||
class CalendarController extends BaseController
|
||||
{
|
||||
/**
|
||||
* Show calendar view for projects
|
||||
* Show calendar view for a user
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function show()
|
||||
public function user()
|
||||
{
|
||||
$user = $this->getUser();
|
||||
|
||||
$this->response->html($this->helper->layout->app('calendar/user', array(
|
||||
'user' => $user,
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show calendar view for a project
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function project()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
|
||||
$this->response->html($this->helper->layout->app('calendar/show', array(
|
||||
'project' => $project,
|
||||
'title' => $project['name'],
|
||||
$this->response->html($this->helper->layout->app('calendar/project', array(
|
||||
'project' => $project,
|
||||
'title' => $project['name'],
|
||||
'description' => $this->helper->projectHeader->getDescription($project),
|
||||
)));
|
||||
}
|
||||
|
|
@ -37,7 +51,7 @@ class CalendarController extends BaseController
|
|||
*
|
||||
* @access public
|
||||
*/
|
||||
public function project()
|
||||
public function projectEvents()
|
||||
{
|
||||
$project_id = $this->request->getIntegerParam('project_id');
|
||||
$start = $this->request->getStringParam('start');
|
||||
|
|
@ -62,7 +76,7 @@ class CalendarController extends BaseController
|
|||
*
|
||||
* @access public
|
||||
*/
|
||||
public function user()
|
||||
public function userEvents()
|
||||
{
|
||||
$user_id = $this->request->getIntegerParam('user_id');
|
||||
$start = $this->request->getStringParam('start');
|
||||
|
|
|
|||
|
|
@ -75,35 +75,4 @@ class DashboardController extends BaseController
|
|||
'user' => $user,
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* My activity stream
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function activity()
|
||||
{
|
||||
$user = $this->getUser();
|
||||
|
||||
$this->response->html($this->helper->layout->dashboard('dashboard/activity', array(
|
||||
'title' => t('Activity stream for %s', $this->helper->user->getFullname($user)),
|
||||
'events' => $this->helper->projectActivity->getProjectsEvents($this->projectPermissionModel->getActiveProjectIds($user['id']), 100),
|
||||
'user' => $user,
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* My calendar
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function calendar()
|
||||
{
|
||||
$user = $this->getUser();
|
||||
|
||||
$this->response->html($this->helper->layout->dashboard('dashboard/calendar', array(
|
||||
'title' => t('Calendar for %s', $this->helper->user->getFullname($user)),
|
||||
'user' => $user,
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
<?= $this->projectHeader->render($project, 'CalendarController', 'show') ?>
|
||||
|
||||
<?= $this->calendar->render(
|
||||
$this->url->href('CalendarController', 'projectEvents', array('project_id' => $project['id'])),
|
||||
$this->url->href('CalendarController', 'save', array('project_id' => $project['id']))
|
||||
) ?>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<section id="main">
|
||||
<?= $this->projectHeader->render($project, 'CalendarController', 'show') ?>
|
||||
|
||||
<?= $this->calendar->render(
|
||||
$this->url->href('CalendarController', 'project', array('project_id' => $project['id'])),
|
||||
$this->url->href('CalendarController', 'save', array('project_id' => $project['id']))
|
||||
) ?>
|
||||
|
||||
</section>
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
<?= $this->calendar->render(
|
||||
$this->url->href('CalendarController', 'userEvents', array('user_id' => $user['id'])),
|
||||
$this->url->href('CalendarController', 'save')
|
||||
) ?>
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
<?= $this->calendar->render(
|
||||
$this->url->href('CalendarController', 'user', array('user_id' => $user['id'])),
|
||||
$this->url->href('CalendarController', 'save')
|
||||
) ?>
|
||||
|
|
@ -12,10 +12,13 @@
|
|||
</li>
|
||||
<?php endif ?>
|
||||
<li>
|
||||
<?= $this->url->icon('search', t('Search'), 'SearchController', 'index') ?>
|
||||
<?= $this->url->icon('folder', t('Project management'), 'ProjectListController', 'show') ?>
|
||||
</li>
|
||||
<li>
|
||||
<?= $this->url->icon('folder', t('Project management'), 'ProjectListController', 'show') ?>
|
||||
<?= $this->modal->medium('dashboard', t('My activity stream'), 'ActivityController', 'user') ?>
|
||||
</li>
|
||||
<li>
|
||||
<?= $this->modal->medium('calendar', t('My calendar'), 'CalendarController', 'user') ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -12,12 +12,6 @@
|
|||
<li <?= $this->app->checkMenuSelection('DashboardController', 'subtasks') ?>>
|
||||
<?= $this->url->link(t('My subtasks'), 'DashboardController', 'subtasks', array('user_id' => $user['id'])) ?>
|
||||
</li>
|
||||
<li <?= $this->app->checkMenuSelection('DashboardController', 'calendar') ?>>
|
||||
<?= $this->url->link(t('My calendar'), 'DashboardController', 'calendar', array('user_id' => $user['id'])) ?>
|
||||
</li>
|
||||
<li <?= $this->app->checkMenuSelection('DashboardController', 'activity') ?>>
|
||||
<?= $this->url->link(t('My activity stream'), 'DashboardController', 'activity', array('user_id' => $user['id'])) ?>
|
||||
</li>
|
||||
<?= $this->hook->render('template:dashboard:sidebar', array('user' => $user)) ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<?= $this->url->icon('th', t('Board'), 'BoardViewController', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-board', t('Keyboard shortcut: "%s"', 'v b')) ?>
|
||||
</li>
|
||||
<li <?= $this->app->checkMenuSelection('CalendarController') ?>>
|
||||
<?= $this->url->icon('calendar', t('Calendar'), 'CalendarController', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-calendar', t('Keyboard shortcut: "%s"', 'v c')) ?>
|
||||
<?= $this->url->icon('calendar', t('Calendar'), 'CalendarController', 'project', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-calendar', t('Keyboard shortcut: "%s"', 'v c')) ?>
|
||||
</li>
|
||||
<li <?= $this->app->checkMenuSelection('TaskListController') ?>>
|
||||
<?= $this->url->icon('list', t('List'), 'TaskListController', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-listing', t('Keyboard shortcut: "%s"', 'v l')) ?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue