예제 #1
0
 /**
  * @return string
  */
 function __toString()
 {
     if (!empty($this->Category)) {
         /** @var Category $Category */
         foreach ((array) $this->Category as $Category) {
             $this->Status->addPlan($Category->getStatus()->getPlan());
             $this->Status->addWork($Category->getStatus()->getWork());
             $this->Status->addDone($Category->getStatus()->getDone());
         }
     } else {
         if ($this->isDone === true) {
             $this->Status->addDone();
         } else {
             if ($this->isDone === false) {
                 $this->Status->addWork();
             } else {
                 $this->Status->addPlan();
             }
         }
     }
     switch ($this->Status->getState()) {
         case Status::STATE_PLAN:
             $this->isDone = null;
             break;
         case Status::STATE_WORK:
             $this->isDone = false;
             break;
         case Status::STATE_DONE:
             $this->isDone = true;
             break;
     }
     $Toggle = uniqid();
     $Content = new Title($this->isDone === true ? new Success(new TileBig() . ' Release: ' . $this->Version) : ($this->isDone === false ? new Danger(new TileBig() . ' Release: ' . $this->Version) : new Muted(new TileBig() . ' Release: ' . $this->Version)), $this->Description) . new Small($this->isDone === true ? '' : ($this->isDone === false ? new Danger(new CogWheels() . ' In Entwicklung ' . number_format($this->Status->getDonePercent(), 1, ',', '') . '%') : new Muted(new Disable() . ' In Planung ' . number_format($this->Status->getDonePercent(), 1, ',', '') . '%'))) . ($this->isDone === true ? '<button type="button" class="btn btn-default" data-toggle="collapse" data-target="#' . $Toggle . '">' . new Ok() . ' Entwicklung abgeschlossen' . '</button>' : $this->Status);
     return (string) new Layout(new LayoutGroup(array(new LayoutRow(array(new LayoutColumn(array(null === $this->isDone ? new Well($Content) : (false === $this->isDone ? new Info($Content) : new Warning($Content)))))), new LayoutRow(array(new LayoutColumn($this->isDone !== true ? new Well(implode($this->Category)) : '<span id="' . $Toggle . '" class="collapse">' . new Warning(implode($this->Category)) . '</span>'))))));
 }
예제 #2
0
 /**
  * @param string    $Content
  * @param null|bool $isDone
  *
  * @return Task
  */
 public function createDuty($Content, $isDone = null)
 {
     if ($isDone === true) {
         $this->Status->addDone();
         $Content = new Success(new Small(new Ok() . ' ' . $Content));
     } else {
         if ($isDone === false) {
             $this->Status->addWork();
             $Content = new Danger(new Small(new CogWheels() . ' ' . $Content));
         } else {
             $this->Status->addPlan();
             $Content = new Muted(new Small(new Disable() . ' ' . $Content));
         }
     }
     array_push($this->Duty, $Content);
     switch ($this->Status->getState()) {
         case Status::STATE_PLAN:
             $this->isDone = null;
             break;
         case Status::STATE_WORK:
             $this->isDone = false;
             break;
         case Status::STATE_DONE:
             $this->isDone = true;
             break;
     }
     return $this;
 }
예제 #3
0
 /**
  * @return string
  */
 function __toString()
 {
     switch ($this->Status->getState()) {
         case Status::STATE_PLAN:
             $this->isDone = null;
             break;
         case Status::STATE_WORK:
             $this->isDone = false;
             break;
         case Status::STATE_DONE:
             $this->isDone = true;
             break;
     }
     if ($this->isDone === true) {
         $Toggle = uniqid();
         return (string) new Layout(new LayoutGroup(array(new LayoutRow(array(new LayoutColumn(array(new Header(new Success(new TileList() . ' Kategorie: ' . $this->Name), $this->Description)), 11), new LayoutColumn(!empty($this->Feature) ? new PullRight('<button type="button" class="btn btn-default" data-toggle="collapse" data-target="#' . $Toggle . '">' . new TileList() . '</button>') : '', 1))), new LayoutRow(array(new LayoutColumn('<hr/>', 12))), new LayoutRow(new LayoutColumn('<span id="' . $Toggle . '" class="collapse">' . implode('', $this->Feature) . '</span>')))));
     } else {
         return (string) new Layout(new LayoutGroup(array(new LayoutRow(array(new LayoutColumn(array(new Header($this->isDone === false ? new Danger(new TileList() . ' Kategorie: ' . $this->Name) : new Muted(new TileList() . ' Kategorie: ' . $this->Name), $this->Description)), 6), new LayoutColumn(array(new Small($this->isDone === false ? new Danger(new CogWheels() . ' In Entwicklung ' . number_format($this->Status->getDonePercent(), 1, ',', '') . '%') : new Muted(new Disable() . ' In Planung ' . number_format($this->Status->getDonePercent(), 1, ',', '') . '%')) . $this->Status), 6))), new LayoutRow(array(new LayoutColumn('<hr/>'))), new LayoutRow(array(new LayoutColumn($this->Feature))))));
     }
 }