Code Duplication    Length = 9-12 lines in 8 locations

app/Http/Controllers/ActivityController.php 1 location

@@ 22-31 (lines=10) @@
19
    /**
20
     * Activity page for a project.
21
     */
22
    public function project()
23
    {
24
        $project = $this->getProject();
25
26
        $this->response->html($this->helper->layout->app('activity/project', [
27
            'events'  => $this->helper->projectActivity->getProjectEvents($project['id']),
28
            'project' => $project,
29
            'title'   => t('%s\'s activity', $project['name']),
30
        ]));
31
    }
32
33
    /**
34
     * Display task activities.

app/Http/Controllers/Manage/ProjectSettingsController.php 2 locations

@@ 121-132 (lines=12) @@
118
    /**
119
     * Integrations page.
120
     */
121
    public function integrations()
122
    {
123
        $project = $this->getProject();
124
125
        $this->response->html($this->helper->layout->project('manage/project_settings/integrations', [
126
            'project'       => $project,
127
            'title'         => t('Integrations'),
128
            'webhook_token' => $this->settingModel->get('webhook_token'),
129
            'values'        => $this->projectMetadataModel->getAll($project['id']),
130
            'errors'        => [],
131
        ]));
132
    }
133
134
    /**
135
     * Update integrations.
@@ 151-161 (lines=11) @@
148
    /**
149
     * Display project notifications.
150
     */
151
    public function notifications()
152
    {
153
        $project = $this->getProject();
154
155
        $this->response->html($this->helper->layout->project('manage/project_settings/notifications', [
156
            'notifications' => $this->projectNotificationModel->readSettings($project['id']),
157
            'types'         => $this->projectNotificationTypeModel->getTypes(),
158
            'project'       => $project,
159
            'title'         => t('Notifications'),
160
        ]));
161
    }
162
163
    /**
164
     * Update notifications.

app/Http/Controllers/Profile/ProfileController.php 2 locations

@@ 107-115 (lines=9) @@
104
    /**
105
     * Generate the api token.
106
     */
107
    public function generateApiToken()
108
    {
109
        $user = $this->getUser();
110
        $this->userModel->update([
111
            'id'        => $user['id'],
112
            'api_token' => Token::getToken(),
113
        ]);
114
        $this->response->redirect($this->helper->url->to('Profile/ProfileController', 'api', ['user_id' => $user['id']]));
115
    }
116
117
    /**
118
     * Remove the api token.
@@ 120-128 (lines=9) @@
117
    /**
118
     * Remove the api token.
119
     */
120
    public function removeApiToken()
121
    {
122
        $user = $this->getUser();
123
        $this->userModel->update([
124
            'id'        => $user['id'],
125
            'api_token' => null,
126
        ]);
127
        $this->response->redirect($this->helper->url->to('Profile/ProfileController', 'api', ['user_id' => $user['id']]));
128
    }
129
130
    /**
131
     * Display external accounts.

app/Http/Controllers/Project/Column/ColumnController.php 1 location

@@ 25-35 (lines=11) @@
22
    /**
23
     * Display columns list.
24
     */
25
    public function index()
26
    {
27
        $project = $this->getProject();
28
        $columns = $this->columnModel->getAll($project['id']);
29
30
        $this->response->html($this->helper->layout->project('project/column/index', [
31
            'columns' => $columns,
32
            'project' => $project,
33
            'title'   => t('Edit columns'),
34
        ]));
35
    }
36
37
    /**
38
     * Show form to create a new column.

app/Http/Controllers/Dashboard/DashboardController.php 2 locations

@@ 87-96 (lines=10) @@
84
    /**
85
     * My activities.
86
     */
87
    public function activities()
88
    {
89
        $user = $this->getUser();
90
91
        $this->response->html($this->helper->layout->dashboard('dashboard/activities', [
92
            'title'  => t('My activities'),
93
            'events' => $this->helper->projectActivity->getProjectsEvents($this->projectPermissionModel->getActiveProjectIds($user['id']), 100),
94
            'user'   => $user,
95
        ]));
96
    }
97
98
    /**
99
     * My calendar.
@@ 114-124 (lines=11) @@
111
    /**
112
     * My slider.
113
     */
114
    public function slider()
115
    {
116
        $user = $this->getUser();
117
118
        $this->response->html($this->helper->layout->app('dashboard/slider', [
119
            'title'            => t('My slider'),
120
            'starred_projects' => $this->prepareForSlider($this->projectStarModel->getProjectIds($user['id'])),
121
            'recent_projects'  => $this->prepareForSlider($this->userSession->getRecentProjects()),
122
            'user'             => $user,
123
        ]));
124
    }
125
126
    /**
127
     * Prepare data for slider.