From 08259d4f206438095308749b8cc2abbe629137da Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Mon, 6 Jul 2015 21:34:57 -0400 Subject: Add lead and cycle time for projects --- app/Console/ProjectDailyColumnStatsExport.php | 34 ++++++++++++++++++++++++++ app/Console/ProjectDailyStatsCalculation.php | 28 +++++++++++++++++++++ app/Console/ProjectDailySummaryCalculation.php | 27 -------------------- app/Console/ProjectDailySummaryExport.php | 34 -------------------------- 4 files changed, 62 insertions(+), 61 deletions(-) create mode 100644 app/Console/ProjectDailyColumnStatsExport.php create mode 100644 app/Console/ProjectDailyStatsCalculation.php delete mode 100644 app/Console/ProjectDailySummaryCalculation.php delete mode 100644 app/Console/ProjectDailySummaryExport.php (limited to 'app/Console') diff --git a/app/Console/ProjectDailyColumnStatsExport.php b/app/Console/ProjectDailyColumnStatsExport.php new file mode 100644 index 00000000..b9830662 --- /dev/null +++ b/app/Console/ProjectDailyColumnStatsExport.php @@ -0,0 +1,34 @@ +setName('export:daily-project-column-stats') + ->setDescription('Daily project column stats CSV export (number of tasks per column and per day)') + ->addArgument('project_id', InputArgument::REQUIRED, 'Project id') + ->addArgument('start_date', InputArgument::REQUIRED, 'Start date (YYYY-MM-DD)') + ->addArgument('end_date', InputArgument::REQUIRED, 'End date (YYYY-MM-DD)'); + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $data = $this->projectDailyColumnStats->getAggregatedMetrics( + $input->getArgument('project_id'), + $input->getArgument('start_date'), + $input->getArgument('end_date') + ); + + if (is_array($data)) { + Tool::csv($data); + } + } +} diff --git a/app/Console/ProjectDailyStatsCalculation.php b/app/Console/ProjectDailyStatsCalculation.php new file mode 100644 index 00000000..4b77c556 --- /dev/null +++ b/app/Console/ProjectDailyStatsCalculation.php @@ -0,0 +1,28 @@ +setName('projects:daily-stats') + ->setDescription('Calculate daily statistics for all projects'); + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $projects = $this->project->getAllByStatus(Project::ACTIVE); + + foreach ($projects as $project) { + $output->writeln('Run calculation for '.$project['name']); + $this->projectDailyColumnStats->updateTotals($project['id'], date('Y-m-d')); + $this->projectDailyStats->updateTotals($project['id'], date('Y-m-d')); + } + } +} diff --git a/app/Console/ProjectDailySummaryCalculation.php b/app/Console/ProjectDailySummaryCalculation.php deleted file mode 100644 index b2ada1b6..00000000 --- a/app/Console/ProjectDailySummaryCalculation.php +++ /dev/null @@ -1,27 +0,0 @@ -setName('projects:daily-summary') - ->setDescription('Calculate daily summary data for all projects'); - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $projects = $this->project->getAllByStatus(Project::ACTIVE); - - foreach ($projects as $project) { - $output->writeln('Run calculation for '.$project['name']); - $this->projectDailySummary->updateTotals($project['id'], date('Y-m-d')); - } - } -} diff --git a/app/Console/ProjectDailySummaryExport.php b/app/Console/ProjectDailySummaryExport.php deleted file mode 100644 index 07841d52..00000000 --- a/app/Console/ProjectDailySummaryExport.php +++ /dev/null @@ -1,34 +0,0 @@ -setName('export:daily-project-summary') - ->setDescription('Daily project summary CSV export (number of tasks per column and per day)') - ->addArgument('project_id', InputArgument::REQUIRED, 'Project id') - ->addArgument('start_date', InputArgument::REQUIRED, 'Start date (YYYY-MM-DD)') - ->addArgument('end_date', InputArgument::REQUIRED, 'End date (YYYY-MM-DD)'); - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $data = $this->projectDailySummary->getAggregatedMetrics( - $input->getArgument('project_id'), - $input->getArgument('start_date'), - $input->getArgument('end_date') - ); - - if (is_array($data)) { - Tool::csv($data); - } - } -} -- cgit v1.2.3 From c198dc1b44d11fd5297518c89e40a89b69209e4c Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Mon, 6 Jul 2015 21:55:26 -0400 Subject: Cosmetic fixes --- app/Console/Base.php | 21 +++++++++++---------- app/Model/TaskFilter.php | 18 +++++++++--------- app/Model/TaskLink.php | 1 - 3 files changed, 20 insertions(+), 20 deletions(-) (limited to 'app/Console') diff --git a/app/Console/Base.php b/app/Console/Base.php index 07243080..86d78ab3 100644 --- a/app/Console/Base.php +++ b/app/Console/Base.php @@ -11,16 +11,17 @@ use Symfony\Component\Console\Command\Command; * @package console * @author Frederic Guillot * - * @property \Model\Notification $notification - * @property \Model\Project $project - * @property \Model\ProjectPermission $projectPermission - * @property \Model\ProjectAnalytic $projectAnalytic - * @property \Model\ProjectDailySummary $projectDailySummary - * @property \Model\SubtaskExport $subtaskExport - * @property \Model\Task $task - * @property \Model\TaskExport $taskExport - * @property \Model\TaskFinder $taskFinder - * @property \Model\Transition $transition + * @property \Model\Notification $notification + * @property \Model\Project $project + * @property \Model\ProjectPermission $projectPermission + * @property \Model\ProjectAnalytic $projectAnalytic + * @property \Model\ProjectDailyColumnStats $projectDailyColumnStats + * @property \Model\ProjectDailyStats $projectDailyColumnStats + * @property \Model\SubtaskExport $subtaskExport + * @property \Model\Task $task + * @property \Model\TaskExport $taskExport + * @property \Model\TaskFinder $taskFinder + * @property \Model\Transition $transition */ abstract class Base extends Command { diff --git a/app/Model/TaskFilter.php b/app/Model/TaskFilter.php index 082318f1..377ec3c6 100644 --- a/app/Model/TaskFilter.php +++ b/app/Model/TaskFilter.php @@ -118,7 +118,7 @@ class TaskFilter extends Base * Exclude a list of task_id * * @access public - * @param array $task_ids + * @param integer[] $task_ids * @return TaskFilter */ public function excludeTasks(array $task_ids) @@ -634,10 +634,10 @@ class TaskFilter extends Base * Transform results to ical events * * @access public - * @param string $start_column Column name for the start date - * @param string $end_column Column name for the end date - * @param Eluceo\iCal\Component\Calendar $vCalendar Calendar object - * @return Eluceo\iCal\Component\Calendar + * @param string $start_column Column name for the start date + * @param string $end_column Column name for the end date + * @param Calendar $vCalendar Calendar object + * @return Calendar */ public function addDateTimeIcalEvents($start_column, $end_column, Calendar $vCalendar = null) { @@ -667,9 +667,9 @@ class TaskFilter extends Base * Transform results to all day ical events * * @access public - * @param string $column Column name for the date - * @param Eluceo\iCal\Component\Calendar $vCalendar Calendar object - * @return Eluceo\iCal\Component\Calendar + * @param string $column Column name for the date + * @param Calendar $vCalendar Calendar object + * @return Calendar */ public function addAllDayIcalEvents($column = 'date_due', Calendar $vCalendar = null) { @@ -699,7 +699,7 @@ class TaskFilter extends Base * @access protected * @param array $task * @param string $uid - * @return Eluceo\iCal\Component\Event + * @return Event */ protected function getTaskIcalEvent(array &$task, $uid) { diff --git a/app/Model/TaskLink.php b/app/Model/TaskLink.php index 7d3a8918..3fdbd04b 100644 --- a/app/Model/TaskLink.php +++ b/app/Model/TaskLink.php @@ -4,7 +4,6 @@ namespace Model; use SimpleValidator\Validator; use SimpleValidator\Validators; -use PicoDb\Table; /** * TaskLink model -- cgit v1.2.3