Add daily project summary export
This commit is contained in:
@@ -64,7 +64,7 @@ class Project extends Base
|
|||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
public function export()
|
public function exportTasks()
|
||||||
{
|
{
|
||||||
$project = $this->getProjectManagement();
|
$project = $this->getProjectManagement();
|
||||||
$from = $this->request->getStringParam('from');
|
$from = $this->request->getStringParam('from');
|
||||||
@@ -72,14 +72,14 @@ class Project extends Base
|
|||||||
|
|
||||||
if ($from && $to) {
|
if ($from && $to) {
|
||||||
$data = $this->taskExport->export($project['id'], $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->csv($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->response->html($this->projectLayout('project_export', array(
|
$this->response->html($this->projectLayout('project/export_tasks', array(
|
||||||
'values' => array(
|
'values' => array(
|
||||||
'controller' => 'project',
|
'controller' => 'project',
|
||||||
'action' => 'export',
|
'action' => 'exportTasks',
|
||||||
'project_id' => $project['id'],
|
'project_id' => $project['id'],
|
||||||
'from' => $from,
|
'from' => $from,
|
||||||
'to' => $to,
|
'to' => $to,
|
||||||
@@ -92,6 +92,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
|
* Public access management
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -594,4 +594,9 @@ return array(
|
|||||||
// 'Unable to create this task.' => '',
|
// 'Unable to create this task.' => '',
|
||||||
// 'Cumulative flow diagram' => '',
|
// 'Cumulative flow diagram' => '',
|
||||||
// 'Cumulative flow diagram for "%s"' => '',
|
// '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.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -594,4 +594,9 @@ return array(
|
|||||||
// 'Unable to create this task.' => '',
|
// 'Unable to create this task.' => '',
|
||||||
// 'Cumulative flow diagram' => '',
|
// 'Cumulative flow diagram' => '',
|
||||||
// 'Cumulative flow diagram for "%s"' => '',
|
// '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.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -594,4 +594,9 @@ return array(
|
|||||||
// 'Unable to create this task.' => '',
|
// 'Unable to create this task.' => '',
|
||||||
// 'Cumulative flow diagram' => '',
|
// 'Cumulative flow diagram' => '',
|
||||||
// 'Cumulative flow diagram for "%s"' => '',
|
// '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.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -594,4 +594,9 @@ return array(
|
|||||||
// 'Unable to create this task.' => '',
|
// 'Unable to create this task.' => '',
|
||||||
// 'Cumulative flow diagram' => '',
|
// 'Cumulative flow diagram' => '',
|
||||||
// 'Cumulative flow diagram for "%s"' => '',
|
// '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.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -594,4 +594,9 @@ return array(
|
|||||||
'Unable to create this task.' => 'Impossible de créer cette tâche',
|
'Unable to create this task.' => 'Impossible de créer cette tâche',
|
||||||
'Cumulative flow diagram' => 'Diagramme de flux cumulé',
|
'Cumulative flow diagram' => 'Diagramme de flux cumulé',
|
||||||
'Cumulative flow diagram for "%s"' => 'Diagramme de flux cumulé pour « %s »',
|
'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.',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -594,4 +594,9 @@ return array(
|
|||||||
// 'Unable to create this task.' => '',
|
// 'Unable to create this task.' => '',
|
||||||
// 'Cumulative flow diagram' => '',
|
// 'Cumulative flow diagram' => '',
|
||||||
// 'Cumulative flow diagram for "%s"' => '',
|
// '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.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -594,4 +594,9 @@ return array(
|
|||||||
// 'Unable to create this task.' => '',
|
// 'Unable to create this task.' => '',
|
||||||
// 'Cumulative flow diagram' => '',
|
// 'Cumulative flow diagram' => '',
|
||||||
// 'Cumulative flow diagram for "%s"' => '',
|
// '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.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -594,4 +594,9 @@ return array(
|
|||||||
// 'Unable to create this task.' => '',
|
// 'Unable to create this task.' => '',
|
||||||
// 'Cumulative flow diagram' => '',
|
// 'Cumulative flow diagram' => '',
|
||||||
// 'Cumulative flow diagram for "%s"' => '',
|
// '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.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -594,4 +594,9 @@ return array(
|
|||||||
// 'Unable to create this task.' => '',
|
// 'Unable to create this task.' => '',
|
||||||
// 'Cumulative flow diagram' => '',
|
// 'Cumulative flow diagram' => '',
|
||||||
// 'Cumulative flow diagram for "%s"' => '',
|
// '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.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -594,4 +594,9 @@ return array(
|
|||||||
// 'Unable to create this task.' => '',
|
// 'Unable to create this task.' => '',
|
||||||
// 'Cumulative flow diagram' => '',
|
// 'Cumulative flow diagram' => '',
|
||||||
// 'Cumulative flow diagram for "%s"' => '',
|
// '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.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -594,4 +594,9 @@ return array(
|
|||||||
// 'Unable to create this task.' => '',
|
// 'Unable to create this task.' => '',
|
||||||
// 'Cumulative flow diagram' => '',
|
// 'Cumulative flow diagram' => '',
|
||||||
// 'Cumulative flow diagram for "%s"' => '',
|
// '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.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -594,4 +594,9 @@ return array(
|
|||||||
// 'Unable to create this task.' => '',
|
// 'Unable to create this task.' => '',
|
||||||
// 'Cumulative flow diagram' => '',
|
// 'Cumulative flow diagram' => '',
|
||||||
// 'Cumulative flow diagram for "%s"' => '',
|
// '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.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -594,4 +594,9 @@ return array(
|
|||||||
// 'Unable to create this task.' => '',
|
// 'Unable to create this task.' => '',
|
||||||
// 'Cumulative flow diagram' => '',
|
// 'Cumulative flow diagram' => '',
|
||||||
// 'Cumulative flow diagram for "%s"' => '',
|
// '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.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class Acl extends Base
|
|||||||
private $user_actions = array(
|
private $user_actions = array(
|
||||||
'app' => array('index'),
|
'app' => array('index'),
|
||||||
'board' => array('index', 'show', 'save', 'check', 'changeassignee', 'updateassignee', 'changecategory', 'updatecategory', 'movecolumn', 'edit', 'update', 'add', 'confirm', 'remove'),
|
'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'),
|
'user' => array('edit', 'forbidden', 'logout', 'show', 'external', 'unlinkgoogle', 'unlinkgithub', 'sessions', 'removesession', 'last', 'notifications', 'password'),
|
||||||
'comment' => array('create', 'save', 'confirm', 'remove', 'update', 'edit', 'forbidden'),
|
'comment' => array('create', 'save', 'confirm', 'remove', 'update', 'edit', 'forbidden'),
|
||||||
'file' => array('create', 'save', 'download', 'confirm', 'remove', 'open', 'image'),
|
'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'),
|
'task' => array('show', 'create', 'save', 'edit', 'update', 'close', 'open', 'duplicate', 'remove', 'description', 'move', 'copy', 'time'),
|
||||||
'category' => array('index', 'save', 'edit', 'update', 'confirm', 'remove'),
|
'category' => array('index', 'save', 'edit', 'update', 'confirm', 'remove'),
|
||||||
'action' => array('index', 'event', 'params', 'create', 'confirm', 'remove'),
|
'action' => array('index', 'event', 'params', 'create', 'confirm', 'remove'),
|
||||||
'analytic' => array('tasks', 'users'),
|
'analytic' => array('tasks', 'users', 'cfd'),
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
26
app/Template/project/export_daily_summary.php
Normal file
26
app/Template/project/export_daily_summary.php
Normal file
@@ -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>
|
||||||
@@ -6,9 +6,6 @@
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
<?php if (Helper\is_admin() || $project['is_private']): ?>
|
<?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>
|
<li>
|
||||||
<a href="?controller=project&action=share&project_id=<?= $project['id'] ?>"><?= t('Public access') ?></a>
|
<a href="?controller=project&action=share&project_id=<?= $project['id'] ?>"><?= t('Public access') ?></a>
|
||||||
</li>
|
</li>
|
||||||
@@ -44,4 +41,16 @@
|
|||||||
</li>
|
</li>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</ul>
|
</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>
|
</div>
|
||||||
@@ -1145,7 +1145,7 @@ tr td.task-orange,
|
|||||||
padding: 10px;
|
padding: 10px;
|
||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
background: #fefefe;
|
background: #fdfdfd;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
padding: 10px;
|
padding: 10px;
|
||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
background: #fefefe;
|
background: #fdfdfd;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user