Example #1
0
 /**
  * Remove weather if sport is always inside
  */
 protected function removeWeatherIfInside()
 {
     if ($this->hasChanged(Entity::SPORTID)) {
         $Factory = \Runalyze\Context::Factory();
         if (!$Factory->sport($this->NewObject->sportid())->isOutside()) {
             $this->NewObject->weather()->clear();
             $this->NewObject->synchronize();
         }
     }
 }
Example #2
0
 /**
  * Remove data as weather, if sport is always inside
  */
 protected function removeDataIfInside()
 {
     if ($this->Object->sportid() > 0) {
         $Factory = \Runalyze\Context::Factory();
         if (!$Factory->sport($this->Object->sportid())->isOutside()) {
             $this->Object->weather()->clear();
             $this->Object->synchronize();
         }
     }
 }
Example #3
0
 /**
  * Remove data as weather, if sport is always inside
  */
 protected function removeDataIfInside()
 {
     if ($this->Object->sportid() > 0) {
         $Factory = \Runalyze\Context::Factory();
         if (!$Factory->sport($this->Object->sportid())->isOutside()) {
             $this->Object->weather()->condition()->set(\Runalyze\Data\Weather\Condition::UNKNOWN);
             $this->Object->weather()->temperature()->setTemperature(null);
             $this->Object->synchronize();
         }
     }
 }
    /**
     * Display table-row for a competition
     * @param array $data
     */
    private function displayWKTr(array $data)
    {
        $Activity = new Activity\Entity($data);
        $Linker = new Linker($Activity);
        $Dataview = new Dataview($Activity);
        echo '<tr class="r">
				<td>' . $this->getIconForCompetition($data['id']) . '</td>
				<td class="c small">' . $Linker->weekLink() . '</a></td>
				<td class="l"><strong>' . $Linker->linkWithComment() . '</strong></td>
				<td>' . $Dataview->distance(1) . '</td>
				<td>' . $Dataview->duration()->string(Duration::FORMAT_COMPETITION) . '</td>
				<td class="small">' . $Dataview->pace()->value() . '</td>
				<td class="small">' . Helper::Unknown($Activity->hrAvg()) . ' / ' . Helper::Unknown($Activity->hrMax()) . ' bpm</td>
				<td class="small">' . ($Activity->weather()->isEmpty() ? '' : $Activity->weather()->fullString($Activity->isNight())) . '</td>
			</tr>';
    }