diff options
Diffstat (limited to 'app/Helper')
-rw-r--r-- | app/Helper/AppHelper.php | 6 | ||||
-rw-r--r-- | app/Helper/AssetHelper.php | 6 | ||||
-rw-r--r-- | app/Helper/CalendarHelper.php | 4 | ||||
-rw-r--r-- | app/Helper/DateHelper.php | 6 | ||||
-rw-r--r-- | app/Helper/LayoutHelper.php | 6 | ||||
-rw-r--r-- | app/Helper/ProjectActivityHelper.php | 12 | ||||
-rw-r--r-- | app/Helper/ProjectHeaderHelper.php | 6 | ||||
-rw-r--r-- | app/Helper/TaskHelper.php | 21 | ||||
-rw-r--r-- | app/Helper/UrlHelper.php | 4 | ||||
-rw-r--r-- | app/Helper/UserHelper.php | 6 |
10 files changed, 36 insertions, 41 deletions
diff --git a/app/Helper/AppHelper.php b/app/Helper/AppHelper.php index 1f497929..b738f85c 100644 --- a/app/Helper/AppHelper.php +++ b/app/Helper/AppHelper.php @@ -22,7 +22,7 @@ class AppHelper extends Base */ public function config($param, $default_value = '') { - return $this->config->get($param, $default_value); + return $this->configModel->get($param, $default_value); } /** @@ -90,7 +90,7 @@ class AppHelper extends Base */ public function jsLang() { - return $this->language->getJsLanguageCode(); + return $this->languageModel->getJsLanguageCode(); } /** @@ -101,7 +101,7 @@ class AppHelper extends Base */ public function getTimezone() { - return $this->timezone->getCurrentTimezone(); + return $this->timezoneModel->getCurrentTimezone(); } /** diff --git a/app/Helper/AssetHelper.php b/app/Helper/AssetHelper.php index b3dc711f..dad1448a 100644 --- a/app/Helper/AssetHelper.php +++ b/app/Helper/AssetHelper.php @@ -45,8 +45,8 @@ class AssetHelper extends Base */ public function customCss() { - if ($this->config->get('application_stylesheet')) { - return '<style>'.$this->config->get('application_stylesheet').'</style>'; + if ($this->configModel->get('application_stylesheet')) { + return '<style>'.$this->configModel->get('application_stylesheet').'</style>'; } return ''; @@ -60,6 +60,6 @@ class AssetHelper extends Base */ public function colorCss() { - return '<style>'.$this->color->getCss().'</style>'; + return '<style>'.$this->colorModel->getCss().'</style>'; } } diff --git a/app/Helper/CalendarHelper.php b/app/Helper/CalendarHelper.php index d5f4af21..b35c40f7 100644 --- a/app/Helper/CalendarHelper.php +++ b/app/Helper/CalendarHelper.php @@ -47,7 +47,7 @@ class CalendarHelper extends Base */ public function getTaskEvents(QueryBuilder $queryBuilder, $start, $end) { - $startColumn = $this->config->get('calendar_project_tasks', 'date_started'); + $startColumn = $this->configModel->get('calendar_project_tasks', 'date_started'); $queryBuilder->getQuery()->addCondition($this->getCalendarCondition( $this->dateParser->getTimestampFromIsoFormat($start), @@ -75,7 +75,7 @@ class CalendarHelper extends Base { $formatter = new SubtaskTimeTrackingCalendarFormatter($this->container); return $formatter - ->withQuery($this->subtaskTimeTracking->getUserQuery($user_id) + ->withQuery($this->subtaskTimeTrackingModel->getUserQuery($user_id) ->addCondition($this->getCalendarCondition( $this->dateParser->getTimestampFromIsoFormat($start), $this->dateParser->getTimestampFromIsoFormat($end), diff --git a/app/Helper/DateHelper.php b/app/Helper/DateHelper.php index 3844ce64..7e2ec79c 100644 --- a/app/Helper/DateHelper.php +++ b/app/Helper/DateHelper.php @@ -22,7 +22,7 @@ class DateHelper extends Base */ public function time($value) { - return date($this->config->get('application_time_format', 'H:i'), $value); + return date($this->configModel->get('application_time_format', 'H:i'), $value); } /** @@ -42,7 +42,7 @@ class DateHelper extends Base $value = strtotime($value); } - return date($this->config->get('application_date_format', 'm/d/Y'), $value); + return date($this->configModel->get('application_date_format', 'm/d/Y'), $value); } /** @@ -54,7 +54,7 @@ class DateHelper extends Base */ public function datetime($value) { - return date($this->config->get('application_datetime_format', 'm/d/Y H:i'), $value); + return date($this->configModel->get('application_datetime_format', 'm/d/Y H:i'), $value); } /** diff --git a/app/Helper/LayoutHelper.php b/app/Helper/LayoutHelper.php index aeb0c846..8ebb05d4 100644 --- a/app/Helper/LayoutHelper.php +++ b/app/Helper/LayoutHelper.php @@ -27,7 +27,7 @@ class LayoutHelper extends Base } if (! isset($params['no_layout']) && ! isset($params['board_selector'])) { - $params['board_selector'] = $this->projectUserRole->getActiveProjectsByUser($this->userSession->getId()); + $params['board_selector'] = $this->projectUserRoleModel->getActiveProjectsByUser($this->userSession->getId()); } return $this->pageLayout($template, $params); @@ -96,7 +96,7 @@ class LayoutHelper extends Base public function projectUser($template, array $params) { $params['filter'] = array('user_id' => $params['user_id']); - return $this->subLayout('project_user/layout', 'project_user/sidebar', $template, $params); + return $this->subLayout('project_user_overview/layout', 'project_user_overview/sidebar', $template, $params); } /** @@ -110,7 +110,7 @@ class LayoutHelper extends Base public function config($template, array $params) { if (! isset($params['values'])) { - $params['values'] = $this->config->getAll(); + $params['values'] = $this->configModel->getAll(); } if (! isset($params['errors'])) { diff --git a/app/Helper/ProjectActivityHelper.php b/app/Helper/ProjectActivityHelper.php index 0638a978..40f386db 100644 --- a/app/Helper/ProjectActivityHelper.php +++ b/app/Helper/ProjectActivityHelper.php @@ -7,7 +7,7 @@ use Kanboard\Filter\ProjectActivityProjectIdFilter; use Kanboard\Filter\ProjectActivityProjectIdsFilter; use Kanboard\Filter\ProjectActivityTaskIdFilter; use Kanboard\Formatter\ProjectActivityEventFormatter; -use Kanboard\Model\ProjectActivity; +use Kanboard\Model\ProjectActivityModel; /** * Project Activity Helper @@ -26,7 +26,7 @@ class ProjectActivityHelper extends Base */ public function searchEvents($search) { - $projects = $this->projectUserRole->getProjectsByUser($this->userSession->getId()); + $projects = $this->projectUserRoleModel->getProjectsByUser($this->userSession->getId()); $events = array(); if ($search !== '') { @@ -34,7 +34,7 @@ class ProjectActivityHelper extends Base $queryBuilder ->withFilter(new ProjectActivityProjectIdsFilter(array_keys($projects))) ->getQuery() - ->desc(ProjectActivity::TABLE.'.id') + ->desc(ProjectActivityModel::TABLE.'.id') ->limit(500) ; @@ -58,7 +58,7 @@ class ProjectActivityHelper extends Base ->withFilter(new ProjectActivityProjectIdFilter($project_id)); $queryBuilder->getQuery() - ->desc(ProjectActivity::TABLE.'.id') + ->desc(ProjectActivityModel::TABLE.'.id') ->limit($limit) ; @@ -79,7 +79,7 @@ class ProjectActivityHelper extends Base ->withFilter(new ProjectActivityProjectIdsFilter($project_ids)); $queryBuilder->getQuery() - ->desc(ProjectActivity::TABLE.'.id') + ->desc(ProjectActivityModel::TABLE.'.id') ->limit($limit) ; @@ -98,7 +98,7 @@ class ProjectActivityHelper extends Base $queryBuilder = $this->projectActivityQuery ->withFilter(new ProjectActivityTaskIdFilter($task_id)); - $queryBuilder->getQuery()->desc(ProjectActivity::TABLE.'.id'); + $queryBuilder->getQuery()->desc(ProjectActivityModel::TABLE.'.id'); return $queryBuilder->format(new ProjectActivityEventFormatter($this->container)); } diff --git a/app/Helper/ProjectHeaderHelper.php b/app/Helper/ProjectHeaderHelper.php index 19570059..9514f4f2 100644 --- a/app/Helper/ProjectHeaderHelper.php +++ b/app/Helper/ProjectHeaderHelper.php @@ -48,9 +48,9 @@ class ProjectHeaderHelper extends Base return $this->template->render('project_header/header', array( 'project' => $project, 'filters' => $filters, - 'categories_list' => $this->category->getList($project['id'], false), - 'users_list' => $this->projectUserRole->getAssignableUsersList($project['id'], false), - 'custom_filters_list' => $this->customFilter->getAll($project['id'], $this->userSession->getId()), + 'categories_list' => $this->categoryModel->getList($project['id'], false), + 'users_list' => $this->projectUserRoleModel->getAssignableUsersList($project['id'], false), + 'custom_filters_list' => $this->customFilterModel->getAll($project['id'], $this->userSession->getId()), 'board_view' => $boardView, )); } diff --git a/app/Helper/TaskHelper.php b/app/Helper/TaskHelper.php index 4857d0ee..e33438d6 100644 --- a/app/Helper/TaskHelper.php +++ b/app/Helper/TaskHelper.php @@ -22,27 +22,22 @@ class TaskHelper extends Base public function getColors() { - return $this->color->getList(); + return $this->colorModel->getList(); } public function recurrenceTriggers() { - return $this->task->getRecurrenceTriggerList(); + return $this->taskModel->getRecurrenceTriggerList(); } public function recurrenceTimeframes() { - return $this->task->getRecurrenceTimeframeList(); + return $this->taskModel->getRecurrenceTimeframeList(); } public function recurrenceBasedates() { - return $this->task->getRecurrenceBasedateList(); - } - - public function canRemove(array $task) - { - return $this->taskPermission->canRemoveTask($task); + return $this->taskModel->getRecurrenceBasedateList(); } public function selectAssignee(array $users, array $values, array $errors = array(), array $attributes = array()) @@ -142,7 +137,7 @@ class TaskHelper extends Base public function selectStartDate(array $values, array $errors = array(), array $attributes = array()) { - $placeholder = date($this->config->get('application_date_format', 'm/d/Y H:i')); + $placeholder = date($this->configModel->get('application_date_format', 'm/d/Y H:i')); $attributes = array_merge(array('tabindex="11"', 'placeholder="'.$placeholder.'"'), $attributes); $html = $this->helper->form->label(t('Start Date'), 'date_started'); @@ -153,7 +148,7 @@ class TaskHelper extends Base public function selectDueDate(array $values, array $errors = array(), array $attributes = array()) { - $placeholder = date($this->config->get('application_date_format', 'm/d/Y')); + $placeholder = date($this->configModel->get('application_date_format', 'm/d/Y')); $attributes = array_merge(array('tabindex="12"', 'placeholder="'.$placeholder.'"'), $attributes); $html = $this->helper->form->label(t('Due Date'), 'date_due'); @@ -178,9 +173,9 @@ class TaskHelper extends Base public function getProgress($task) { if (! isset($this->columns[$task['project_id']])) { - $this->columns[$task['project_id']] = $this->column->getList($task['project_id']); + $this->columns[$task['project_id']] = $this->columnModel->getList($task['project_id']); } - return $this->task->getProgress($task, $this->columns[$task['project_id']]); + return $this->taskModel->getProgress($task, $this->columns[$task['project_id']]); } } diff --git a/app/Helper/UrlHelper.php b/app/Helper/UrlHelper.php index 095c4af4..2127c69e 100644 --- a/app/Helper/UrlHelper.php +++ b/app/Helper/UrlHelper.php @@ -25,7 +25,7 @@ class UrlHelper extends Base */ public function doc($label, $file) { - return $this->link($label, 'doc', 'show', array('file' => $file), false, '', '', true); + return $this->link($label, 'DocumentationController', 'show', array('file' => $file), false, '', '', true); } /** @@ -109,7 +109,7 @@ class UrlHelper extends Base public function base() { if (empty($this->base)) { - $this->base = $this->config->get('application_url') ?: $this->server(); + $this->base = $this->configModel->get('application_url') ?: $this->server(); } return $this->base; diff --git a/app/Helper/UserHelper.php b/app/Helper/UserHelper.php index b39d7b62..5c466df3 100644 --- a/app/Helper/UserHelper.php +++ b/app/Helper/UserHelper.php @@ -21,7 +21,7 @@ class UserHelper extends Base */ public function hasNotifications() { - return $this->userUnreadNotification->hasNotifications($this->userSession->getId()); + return $this->userUnreadNotificationModel->hasNotifications($this->userSession->getId()); } /** @@ -50,7 +50,7 @@ class UserHelper extends Base */ public function getFullname(array $user = array()) { - return $this->user->getFullname(empty($user) ? $this->userSession->getAll() : $user); + return $this->userModel->getFullname(empty($user) ? $this->userSession->getAll() : $user); } /** @@ -157,7 +157,7 @@ class UserHelper extends Base */ public function getProjectUserRole($project_id) { - return $this->memoryCache->proxy($this->projectUserRole, 'getUserRole', $project_id, $this->userSession->getId()); + return $this->memoryCache->proxy($this->projectUserRoleModel, 'getUserRole', $project_id, $this->userSession->getId()); } /** |