/** * Keys to insert * @return array */ protected function keys() { return array_merge(array(self::ACCOUNTID), Entity::allDatabaseProperties()); }
/** * Display table */ public function displayTable() { if (is_null($this->Equipment)) { $this->initTableData(); } echo '<table id="list-of-all-equipment" class="fullwidth zebra-style"> <thead> <tr> <th class="{sorter: \'x\'} small">' . __('x-times') . '</th> <th>' . __('Name') . '</th> <th class="{sorter: \'germandate\'} small">' . __('since') . '</th> <th class="{sorter: \'distance\'}">Ø ' . Runalyze\Configuration::General()->distanceUnitSystem()->distanceUnit() . '</th> <th>Ø ' . __('Pace') . '</th> <th class="{sorter: \'distance\'} small"><small>' . __('max.') . '</small> ' . Runalyze\Configuration::General()->distanceUnitSystem()->distanceUnit() . '</th> <th class="small"><small>' . __('min.') . '</small> ' . __('Pace') . '</th> <th class="{sorter: \'resulttime\'}">' . __('Time') . '</th> <th class="{sorter: \'distance\'}">' . __('Distance') . '</th> <th>' . __('Notes') . '</th> </tr> </thead> <tbody>'; if (!empty($this->Equipment)) { foreach ($this->Equipment as $data) { $Object = new Model\Equipment\Entity($data); $in_use = $Object->isInUse() ? '' : ' unimportant'; $Pace = new Pace($Object->duration(), $Object->distance()); $MaxPace = new Pace($data['pace_in_s'], 1); echo '<tr class="' . $in_use . ' r" style="position: relative"> <td class="small">' . $data['num'] . 'x</td> <td class="b l">' . SearchLink::to('equipmentid', $Object->id(), $Object->name()) . '</td> <td class="small">' . $this->formatData($Object->startDate()) . '</td> <td>' . ($data['num'] != 0 ? Distance::format($Object->distance() / $data['num']) : '-') . '</td> <td>' . ($Object->duration() > 0 ? $Pace->asMinPerKm() . '/km' : '-') . '</td> <td class="small">' . Distance::format($data['dist']) . '</td> <td class="small">' . $MaxPace->asMinPerKm() . '/km' . '</td> <td>' . Duration::format($Object->duration()) . '</td> <td>' . Distance::format($Object->totalDistance()) . '</td> <td class="small">' . $Object->notes() . '</td> </tr>'; } } else { echo '<tr><td colspan="9">' . __('You don\'t have any shoes') . '</td></tr>'; } echo '</tbody>'; echo '</table>'; Ajax::createTablesorterFor("#list-of-all-equipment", true); }