Ejemplo n.º 1
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if ($context->isRunning()) {
         return $context->dataview()->jdIntensityWithStresscolor();
     }
     return '';
 }
Ejemplo n.º 2
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if ($context->isRunning() && $context->dataview()->usedVdot() > 0) {
         return $context->dataview()->vdotIcon();
     }
     return '';
 }
Ejemplo n.º 3
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if ($context->isRunning()) {
         return $context->dataview()->fitVO2maxEstimate();
     }
     return '';
 }
Ejemplo n.º 4
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if ($context->activity()->hrAvg() > 0) {
         return $context->dataview()->hrAvg()->string();
     }
     return '';
 }
Ejemplo n.º 5
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if (!$context->activity()->weather()->temperature()->isUnknown() && !($context->hasSport() && !$context->sport()->isOutside())) {
         return \Runalyze\Activity\Temperature::format($context->activity()->weather()->temperature()->value(), true, false);
     }
     return '';
 }
Ejemplo n.º 6
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if (!$context->activity()->weather()->condition()->isUnknown() && ($context->hasSport() || $context->sport()->isOutside())) {
         return $context->activity()->weather()->condition()->icon()->code();
     }
     return '';
 }
Ejemplo n.º 7
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if (!$context->activity()->weather()->pressure()->isUnknown() && !($context->hasSport() && !$context->sport()->isOutside())) {
         return $context->activity()->weather()->pressure()->string();
     }
     return '';
 }
Ejemplo n.º 8
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if ($context->hasData(self::ROUTE_NAME_KEY) && $context->data(self::ROUTE_NAME_KEY) != '') {
         return \Helper::Cut($context->data(self::ROUTE_NAME_KEY), self::DEFAULT_CUT);
     }
     return '';
 }
Ejemplo n.º 9
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if ($context->activity()->get(Activity\Entity::ROUTEID) > 0) {
         return \Helper::Cut($context->factory()->route($context->activity()->get(Activity\Entity::ROUTEID))->name(), self::DEFAULT_CUT);
     }
     return '';
 }
Ejemplo n.º 10
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if ($context->activity()->isPublic()) {
         return '<a href="' . $context->linker()->publicUrl() . '" target="_blank">' . Icon::$ATTACH . '</a>';
     }
     return '';
 }
Ejemplo n.º 11
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if ($context->hasSport()) {
         return $context->sport()->icon()->code();
     }
     return '';
 }
Ejemplo n.º 12
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     $weather = $context->activity()->weather();
     if ((!$weather->windSpeed()->isUnknown() || !$weather->windDegree()->isUnknown()) && !($context->hasSport() && !$context->sport()->isOutside())) {
         return (new WindIcon($weather->windSpeed(), $weather->windDegree()))->code();
     }
     return '';
 }
Ejemplo n.º 13
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if ($context->hasType()) {
         if ($context->type()->isQualitySession()) {
             return '<strong>' . $context->type()->abbreviation() . '</strong>';
         }
         return $context->type()->abbreviation();
     }
     return '';
 }
Ejemplo n.º 14
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     $string = '';
     if ($context->hasData(self::CONCAT_TAGIDS_KEY) && $context->data(self::CONCAT_TAGIDS_KEY) != '') {
         $ids = explode(',', $context->data(self::CONCAT_TAGIDS_KEY));
         $Factory = new \Runalyze\Model\Factory(\SessionAccountHandler::getId());
         foreach ($ids as $id) {
             $string .= '#' . $Factory->tag($id)->tag() . ' ';
         }
     }
     return $string;
 }
Ejemplo n.º 15
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if ($context->hasData(parent::CONCAT_EQUIPMENT_KEY) && $context->data(parent::CONCAT_EQUIPMENT_KEY) != '') {
         $ids = explode(',', $context->data(parent::CONCAT_EQUIPMENT_KEY));
         $Factory = new \Runalyze\Model\Factory(\SessionAccountHandler::getId());
         $names = array();
         foreach (array_unique($ids) as $id) {
             $names[] = $Factory->equipment($id)->name();
         }
         $Icon = new \Runalyze\View\Icon('fa-cubes');
         $Icon->setTooltip(implode(', ', $names));
         return $Icon->code();
     }
     return '';
 }
Ejemplo n.º 16
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if ($context->hasData(parent::CONCAT_EQUIPMENT_KEY) && $context->data(parent::CONCAT_EQUIPMENT_KEY) != '') {
         $ids = explode(',', $context->data(parent::CONCAT_EQUIPMENT_KEY));
         $Factory = new \Runalyze\Model\Factory(\SessionAccountHandler::getId());
         $mainTypeID = $context->sport()->mainEquipmentTypeID();
         $names = array();
         foreach (array_unique($ids) as $id) {
             $Equipment = $Factory->equipment($id);
             if ($Equipment->typeid() == $mainTypeID) {
                 $names[] = $Factory->equipment($id)->name();
             }
         }
         return implode(', ', $names);
     }
     return '';
 }
Ejemplo n.º 17
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if ($context->activity()->distance() > 0) {
         if ($context->hasData(self::DURATION_SUM_WITH_DISTANCE_KEY)) {
             if ($context->data(self::DURATION_SUM_WITH_DISTANCE_KEY) > 0) {
                 $Pace = new Activity\Pace($context->data(self::DURATION_SUM_WITH_DISTANCE_KEY), $context->activity()->distance(), $context->hasSport() ? $context->sport()->paceUnitEnum() : Activity\Pace::STANDARD);
                 return $Pace->valueWithAppendix();
             }
             return '';
         }
         return $context->dataview()->pace()->valueWithAppendix();
     }
     return '';
 }
Ejemplo n.º 18
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if (!$context->activity()->splits()->isEmpty()) {
         if ($context->activity()->splits()->hasActiveAndInactiveLaps() || round($context->activity()->splits()->totalDistance()) != round($context->activity()->distance()) || $context->hasType() && $context->type()->id() == Configuration::General()->competitionType()) {
             $Icon = new Icon(Icon::CLOCK);
             $Icon->setTooltip($this->stringForActiveLaps($context->activity()->splits()));
             return $Icon->code();
         }
     }
     return '';
 }
Ejemplo n.º 19
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if ($context->hasData(self::KEY_DISTANCE_COMPARISON)) {
         return $context->dataview()->distance() . $this->distanceComparison($context->activity()->distance(), $context->data(self::KEY_DISTANCE_COMPARISON));
     }
     return $context->dataview()->distance();
 }
Ejemplo n.º 20
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if (!$context->activity()->weather()->temperature()->isUnknown() && !$context->activity()->weather()->windSpeed()->isUnknown() && !($context->hasSport() && !$context->sport()->isOutside())) {
         return $context->dataview()->windChillFactor()->string();
     }
     return '';
 }
Ejemplo n.º 21
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if ($context->isRunning() && $context->dataview()->usedVdot() > 0) {
         if (!$context->activity()->usesVDOT()) {
             return '<span class="unimportant">' . $context->dataview()->vdot()->value() . '</span>';
         }
         return $context->dataview()->vdot()->value();
     }
     return '';
 }
Ejemplo n.º 22
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     return $context->dataview()->fitRecoveryTime();
 }
Ejemplo n.º 23
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     return $context->dataview()->fitHRVscore();
 }
Ejemplo n.º 24
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     return $context->activity()->totalStrokes();
 }
Ejemplo n.º 25
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     return \Helper::Cut($context->activity()->comment(), 20);
 }
Ejemplo n.º 26
0
 /**
  * Display table body
  */
 protected function displayTableBody()
 {
     $maxIndex = ceil(($this->TimeEnd - $this->TimeStart) / $this->Timerange) - 1;
     $CompleteData = array();
     $CompleteResult = $this->DatasetQuery->fetchSummaryForTimerange($this->Sportid, $this->Timerange, $this->TimeStart, $this->TimeEnd);
     $Context = new Dataset\Context(new Runalyze\Model\Activity\Entity(), $this->AccountID);
     $hiddenKeys = array(Dataset\Keys::SPORT);
     foreach ($CompleteResult as $Data) {
         $CompleteData[$Data['timerange']] = $Data;
     }
     for ($index = 0; $index <= $maxIndex; ++$index) {
         echo '<tr><td class="l"><span class="b">' . $this->rowHead($index) . '</span></td>';
         if (isset($CompleteData[$index]) && !empty($CompleteData[$index])) {
             echo '<td class="small">' . $CompleteData[$index]['num'] . 'x</td>';
             $this->displayAdditionalColumns($CompleteData[$index]);
             if ($this->CompareKilometers) {
                 $value = isset($CompleteData[$index + 1]) ? $CompleteData[$index + 1]['distance'] : 0;
                 $CompleteData[$index][Dataset\Keys\Distance::KEY_DISTANCE_COMPARISON] = $value;
             }
             $Context->setActivityData($CompleteData[$index]);
             echo $this->DatasetTable->codeForColumns($Context, $hiddenKeys);
         } else {
             echo HTML::emptyTD($this->DatasetTable->numColumns() + 1 + $this->AdditionalColumns, '<em>' . __('No activities') . '</em>', 'c small');
         }
         echo '</tr>';
     }
 }
Ejemplo n.º 27
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     return $context->dataview()->duration()->string();
 }
Ejemplo n.º 28
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     return \Helper::Cut($context->activity()->partner()->asString(), 20);
 }
Ejemplo n.º 29
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     return $context->dataview()->verticalOscillation();
 }
Ejemplo n.º 30
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     return $context->dataview()->power();
 }