Esempio n. 1
0
 protected function doListOverview()
 {
     try {
         $overtime = $this->phprojekt->getPtimecontrolApi()->getOvertimeOverall();
         $vacationDays = $this->phprojekt->getPtimecontrolApi()->getVacationDays();
         $table = new Table(new ConsoleOutput());
         $table->addRow(['Overtime hours', Convert::text2hours($overtime)]);
         $table->addRow(['Vacation days', $vacationDays]);
         return $table->render();
     } catch (InvalidArgumentException $e) {
         $this->error('[Response] No information retrieved.');
     }
 }
Esempio n. 2
0
 /**
  * @param Phprojekt $phprojekt
  */
 private function listProjects($phprojekt)
 {
     $projectApi = $phprojekt->getProjectsApi();
     $projectFavorites = $projectApi->getFavorites();
     $this->comment('Projects: ' . implode(', ', $projectFavorites));
     $timeCardApi = $phprojekt->getTimecardApi();
     $projectLog = $timeCardApi->getProjectBookings(new \DateTime());
     $table = new Table(new ConsoleOutput());
     $table->setHeaders(['Project', 'Description', 'Hours']);
     foreach ($projectLog as $log) {
         $table->addRow([sprintf("%s (%s)", $log->getName(), $log->getProjectIndex()), $log->getDescription(), $log->getHours()]);
         $table->addRow(new TableSeparator());
     }
     $table->addRow(['Noch zu buchen', '', $projectLog->getRemainingWorkLog()]);
     $table->addRow(['Overall', '', $projectLog->getBookedHours()]);
     echo $table->render();
 }