diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/Controller/Project.php | 41 | ||||
-rw-r--r-- | app/Locale/da_DK/translations.php | 5 | ||||
-rw-r--r-- | app/Locale/de_DE/translations.php | 5 | ||||
-rw-r--r-- | app/Locale/es_ES/translations.php | 5 | ||||
-rw-r--r-- | app/Locale/fi_FI/translations.php | 5 | ||||
-rw-r--r-- | app/Locale/fr_FR/translations.php | 5 | ||||
-rw-r--r-- | app/Locale/it_IT/translations.php | 5 | ||||
-rw-r--r-- | app/Locale/ja_JP/translations.php | 5 | ||||
-rw-r--r-- | app/Locale/pl_PL/translations.php | 5 | ||||
-rw-r--r-- | app/Locale/pt_BR/translations.php | 5 | ||||
-rw-r--r-- | app/Locale/ru_RU/translations.php | 5 | ||||
-rw-r--r-- | app/Locale/sv_SE/translations.php | 5 | ||||
-rw-r--r-- | app/Locale/th_TH/translations.php | 5 | ||||
-rw-r--r-- | app/Locale/zh_CN/translations.php | 5 | ||||
-rw-r--r-- | app/Model/Acl.php | 4 | ||||
-rw-r--r-- | app/Template/project/export_daily_summary.php | 26 | ||||
-rw-r--r-- | app/Template/project/export_tasks.php (renamed from app/Template/project_export.php) | 0 | ||||
-rw-r--r-- | app/Template/project_sidebar.php | 15 |
18 files changed, 142 insertions, 9 deletions
diff --git a/app/Controller/Project.php b/app/Controller/Project.php index cac5e0b8..22139323 100644 --- a/app/Controller/Project.php +++ b/app/Controller/Project.php @@ -64,7 +64,7 @@ class Project extends Base * * @access public */ - public function export() + public function exportTasks() { $project = $this->getProjectManagement(); $from = $this->request->getStringParam('from'); @@ -72,14 +72,14 @@ class Project extends Base if ($from && $to) { $data = $this->taskExport->export($project['id'], $from, $to); - $this->response->forceDownload('Export_'.date('Y_m_d_H_i_S').'.csv'); + $this->response->forceDownload('Tasks_'.date('Y_m_d_H_i').'.csv'); $this->response->csv($data); } - $this->response->html($this->projectLayout('project_export', array( + $this->response->html($this->projectLayout('project/export_tasks', array( 'values' => array( 'controller' => 'project', - 'action' => 'export', + 'action' => 'exportTasks', 'project_id' => $project['id'], 'from' => $from, 'to' => $to, @@ -93,6 +93,39 @@ class Project extends Base } /** + * Daily project summary export + * + * @access public + */ + public function exportDailyProjectSummary() + { + $project = $this->getProjectManagement(); + $from = $this->request->getStringParam('from'); + $to = $this->request->getStringParam('to'); + + if ($from && $to) { + $data = $this->ProjectDailySummary->getAggregatedMetrics($project['id'], $from, $to); + $this->response->forceDownload('Daily_Summary_'.date('Y_m_d_H_i').'.csv'); + $this->response->csv($data); + } + + $this->response->html($this->projectLayout('project/export_daily_summary', array( + 'values' => array( + 'controller' => 'project', + 'action' => 'exportDailyProjectSummary', + 'project_id' => $project['id'], + 'from' => $from, + 'to' => $to, + ), + 'errors' => array(), + 'date_format' => $this->config->get('application_date_format'), + 'date_formats' => $this->dateParser->getAvailableFormats(), + 'project' => $project, + 'title' => t('Daily project summary export') + ))); + } + + /** * Public access management * * @access public diff --git a/app/Locale/da_DK/translations.php b/app/Locale/da_DK/translations.php index 34533e94..5c2002ec 100644 --- a/app/Locale/da_DK/translations.php +++ b/app/Locale/da_DK/translations.php @@ -594,4 +594,9 @@ return array( // 'Unable to create this task.' => '', // 'Cumulative flow diagram' => '', // 'Cumulative flow diagram for "%s"' => '', + // 'Daily project summary' => '', + // 'Daily project summary export' => '', + // 'Daily project summary export for "%s"' => '', + // 'Exports' => '', + // 'This export contains the number of tasks per column grouped per day.' => '', ); diff --git a/app/Locale/de_DE/translations.php b/app/Locale/de_DE/translations.php index bce2c233..b304fc18 100644 --- a/app/Locale/de_DE/translations.php +++ b/app/Locale/de_DE/translations.php @@ -594,4 +594,9 @@ return array( // 'Unable to create this task.' => '', // 'Cumulative flow diagram' => '', // 'Cumulative flow diagram for "%s"' => '', + // 'Daily project summary' => '', + // 'Daily project summary export' => '', + // 'Daily project summary export for "%s"' => '', + // 'Exports' => '', + // 'This export contains the number of tasks per column grouped per day.' => '', ); diff --git a/app/Locale/es_ES/translations.php b/app/Locale/es_ES/translations.php index e26be0a1..5740279c 100644 --- a/app/Locale/es_ES/translations.php +++ b/app/Locale/es_ES/translations.php @@ -594,4 +594,9 @@ return array( // 'Unable to create this task.' => '', // 'Cumulative flow diagram' => '', // 'Cumulative flow diagram for "%s"' => '', + // 'Daily project summary' => '', + // 'Daily project summary export' => '', + // 'Daily project summary export for "%s"' => '', + // 'Exports' => '', + // 'This export contains the number of tasks per column grouped per day.' => '', ); diff --git a/app/Locale/fi_FI/translations.php b/app/Locale/fi_FI/translations.php index 7af506a5..9565178f 100644 --- a/app/Locale/fi_FI/translations.php +++ b/app/Locale/fi_FI/translations.php @@ -594,4 +594,9 @@ return array( // 'Unable to create this task.' => '', // 'Cumulative flow diagram' => '', // 'Cumulative flow diagram for "%s"' => '', + // 'Daily project summary' => '', + // 'Daily project summary export' => '', + // 'Daily project summary export for "%s"' => '', + // 'Exports' => '', + // 'This export contains the number of tasks per column grouped per day.' => '', ); diff --git a/app/Locale/fr_FR/translations.php b/app/Locale/fr_FR/translations.php index ace478e2..b6735322 100644 --- a/app/Locale/fr_FR/translations.php +++ b/app/Locale/fr_FR/translations.php @@ -594,4 +594,9 @@ return array( 'Unable to create this task.' => 'Impossible de créer cette tâche', 'Cumulative flow diagram' => 'Diagramme de flux cumulé', 'Cumulative flow diagram for "%s"' => 'Diagramme de flux cumulé pour « %s »', + 'Daily project summary' => 'Résumé journalier du projet', + 'Daily project summary export' => 'Export du résumé journalier du projet', + 'Daily project summary export for "%s"' => 'Export du résumé quotidien du projet pour « %s »', + 'Exports' => 'Exports', + 'This export contains the number of tasks per column grouped per day.' => 'Cet export contient le nombre de tâches par colonne groupé par jour.', ); diff --git a/app/Locale/it_IT/translations.php b/app/Locale/it_IT/translations.php index 6630f7f7..9a0fd02e 100644 --- a/app/Locale/it_IT/translations.php +++ b/app/Locale/it_IT/translations.php @@ -594,4 +594,9 @@ return array( // 'Unable to create this task.' => '', // 'Cumulative flow diagram' => '', // 'Cumulative flow diagram for "%s"' => '', + // 'Daily project summary' => '', + // 'Daily project summary export' => '', + // 'Daily project summary export for "%s"' => '', + // 'Exports' => '', + // 'This export contains the number of tasks per column grouped per day.' => '', ); diff --git a/app/Locale/ja_JP/translations.php b/app/Locale/ja_JP/translations.php index 0312a402..1885d779 100644 --- a/app/Locale/ja_JP/translations.php +++ b/app/Locale/ja_JP/translations.php @@ -594,4 +594,9 @@ return array( // 'Unable to create this task.' => '', // 'Cumulative flow diagram' => '', // 'Cumulative flow diagram for "%s"' => '', + // 'Daily project summary' => '', + // 'Daily project summary export' => '', + // 'Daily project summary export for "%s"' => '', + // 'Exports' => '', + // 'This export contains the number of tasks per column grouped per day.' => '', ); diff --git a/app/Locale/pl_PL/translations.php b/app/Locale/pl_PL/translations.php index f48f0615..34ea087f 100644 --- a/app/Locale/pl_PL/translations.php +++ b/app/Locale/pl_PL/translations.php @@ -594,4 +594,9 @@ return array( // 'Unable to create this task.' => '', // 'Cumulative flow diagram' => '', // 'Cumulative flow diagram for "%s"' => '', + // 'Daily project summary' => '', + // 'Daily project summary export' => '', + // 'Daily project summary export for "%s"' => '', + // 'Exports' => '', + // 'This export contains the number of tasks per column grouped per day.' => '', ); diff --git a/app/Locale/pt_BR/translations.php b/app/Locale/pt_BR/translations.php index 647348b9..9aa52bc3 100644 --- a/app/Locale/pt_BR/translations.php +++ b/app/Locale/pt_BR/translations.php @@ -594,4 +594,9 @@ return array( // 'Unable to create this task.' => '', // 'Cumulative flow diagram' => '', // 'Cumulative flow diagram for "%s"' => '', + // 'Daily project summary' => '', + // 'Daily project summary export' => '', + // 'Daily project summary export for "%s"' => '', + // 'Exports' => '', + // 'This export contains the number of tasks per column grouped per day.' => '', ); diff --git a/app/Locale/ru_RU/translations.php b/app/Locale/ru_RU/translations.php index 1d220902..b584b759 100644 --- a/app/Locale/ru_RU/translations.php +++ b/app/Locale/ru_RU/translations.php @@ -594,4 +594,9 @@ return array( // 'Unable to create this task.' => '', // 'Cumulative flow diagram' => '', // 'Cumulative flow diagram for "%s"' => '', + // 'Daily project summary' => '', + // 'Daily project summary export' => '', + // 'Daily project summary export for "%s"' => '', + // 'Exports' => '', + // 'This export contains the number of tasks per column grouped per day.' => '', ); diff --git a/app/Locale/sv_SE/translations.php b/app/Locale/sv_SE/translations.php index ca79904a..e1997f6c 100644 --- a/app/Locale/sv_SE/translations.php +++ b/app/Locale/sv_SE/translations.php @@ -594,4 +594,9 @@ return array( // 'Unable to create this task.' => '', // 'Cumulative flow diagram' => '', // 'Cumulative flow diagram for "%s"' => '', + // 'Daily project summary' => '', + // 'Daily project summary export' => '', + // 'Daily project summary export for "%s"' => '', + // 'Exports' => '', + // 'This export contains the number of tasks per column grouped per day.' => '', ); diff --git a/app/Locale/th_TH/translations.php b/app/Locale/th_TH/translations.php index f5423c8e..a5c7a251 100644 --- a/app/Locale/th_TH/translations.php +++ b/app/Locale/th_TH/translations.php @@ -594,4 +594,9 @@ return array( // 'Unable to create this task.' => '', // 'Cumulative flow diagram' => '', // 'Cumulative flow diagram for "%s"' => '', + // 'Daily project summary' => '', + // 'Daily project summary export' => '', + // 'Daily project summary export for "%s"' => '', + // 'Exports' => '', + // 'This export contains the number of tasks per column grouped per day.' => '', ); diff --git a/app/Locale/zh_CN/translations.php b/app/Locale/zh_CN/translations.php index 1da74b13..d176b081 100644 --- a/app/Locale/zh_CN/translations.php +++ b/app/Locale/zh_CN/translations.php @@ -594,4 +594,9 @@ return array( // 'Unable to create this task.' => '', // 'Cumulative flow diagram' => '', // 'Cumulative flow diagram for "%s"' => '', + // 'Daily project summary' => '', + // 'Daily project summary export' => '', + // 'Daily project summary export for "%s"' => '', + // 'Exports' => '', + // 'This export contains the number of tasks per column grouped per day.' => '', ); diff --git a/app/Model/Acl.php b/app/Model/Acl.php index 25e98850..4a161714 100644 --- a/app/Model/Acl.php +++ b/app/Model/Acl.php @@ -33,7 +33,7 @@ class Acl extends Base private $user_actions = array( 'app' => array('index'), 'board' => array('index', 'show', 'save', 'check', 'changeassignee', 'updateassignee', 'changecategory', 'updatecategory', 'movecolumn', 'edit', 'update', 'add', 'confirm', 'remove'), - 'project' => array('index', 'show', 'export', 'share', 'edit', 'update', 'users', 'remove', 'duplicate', 'disable', 'enable', 'activity', 'search', 'tasks', 'create', 'save'), + 'project' => array('index', 'show', 'exporttasks', 'exportdaily', 'share', 'edit', 'update', 'users', 'remove', 'duplicate', 'disable', 'enable', 'activity', 'search', 'tasks', 'create', 'save'), 'user' => array('edit', 'forbidden', 'logout', 'show', 'external', 'unlinkgoogle', 'unlinkgithub', 'sessions', 'removesession', 'last', 'notifications', 'password'), 'comment' => array('create', 'save', 'confirm', 'remove', 'update', 'edit', 'forbidden'), 'file' => array('create', 'save', 'download', 'confirm', 'remove', 'open', 'image'), @@ -41,7 +41,7 @@ class Acl extends Base 'task' => array('show', 'create', 'save', 'edit', 'update', 'close', 'open', 'duplicate', 'remove', 'description', 'move', 'copy', 'time'), 'category' => array('index', 'save', 'edit', 'update', 'confirm', 'remove'), 'action' => array('index', 'event', 'params', 'create', 'confirm', 'remove'), - 'analytic' => array('tasks', 'users'), + 'analytic' => array('tasks', 'users', 'cfd'), ); /** diff --git a/app/Template/project/export_daily_summary.php b/app/Template/project/export_daily_summary.php new file mode 100644 index 00000000..763cd81c --- /dev/null +++ b/app/Template/project/export_daily_summary.php @@ -0,0 +1,26 @@ +<div class="page-header"> + <h2> + <?= t('Daily project summary export for "%s"', $project['name']) ?> + </h2> +</div> + +<p class="alert alert-info"><?= t('This export contains the number of tasks per column grouped per day.') ?></p> + +<form method="get" action="?" autocomplete="off"> + + <?= Helper\form_hidden('controller', $values) ?> + <?= Helper\form_hidden('action', $values) ?> + <?= Helper\form_hidden('project_id', $values) ?> + + <?= Helper\form_label(t('Start Date'), 'from') ?> + <?= Helper\form_text('from', $values, $errors, array('required', 'placeholder="'.Helper\in_list($date_format, $date_formats).'"'), 'form-date') ?><br/> + + <?= Helper\form_label(t('End Date'), 'to') ?> + <?= Helper\form_text('to', $values, $errors, array('required', 'placeholder="'.Helper\in_list($date_format, $date_formats).'"'), 'form-date') ?> + + <div class="form-help"><?= t('Others formats accepted: %s and %s', date('Y-m-d'), date('Y_m_d')) ?></div> + + <div class="form-actions"> + <input type="submit" value="<?= t('Execute') ?>" class="btn btn-blue"/> + </div> +</form>
\ No newline at end of file diff --git a/app/Template/project_export.php b/app/Template/project/export_tasks.php index 02eb389f..02eb389f 100644 --- a/app/Template/project_export.php +++ b/app/Template/project/export_tasks.php diff --git a/app/Template/project_sidebar.php b/app/Template/project_sidebar.php index 7d6e0bfb..bd56edaf 100644 --- a/app/Template/project_sidebar.php +++ b/app/Template/project_sidebar.php @@ -7,9 +7,6 @@ <?php if (Helper\is_admin() || $project['is_private']): ?> <li> - <a href="?controller=project&action=export&project_id=<?= $project['id'] ?>"><?= t('Tasks Export') ?></a> - </li> - <li> <a href="?controller=project&action=share&project_id=<?= $project['id'] ?>"><?= t('Public access') ?></a> </li> <li> @@ -44,4 +41,16 @@ </li> <?php endif ?> </ul> + + <?php if (Helper\is_admin() || $project['is_private']): ?> + <h2><?= t('Exports') ?></h2> + <ul> + <li> + <?= Helper\a(t('Tasks'), 'project', 'exportTasks', array('project_id' => $project['id'])) ?> + </li> + <li> + <?= Helper\a(t('Daily project summary'), 'project', 'exportDailyProjectSummary', array('project_id' => $project['id'])) ?> + </li> + </li> + <?php endif ?> </div>
\ No newline at end of file |