/** * Performed when the stop buzzer is hit. * * @param integer $id id of the entry to stop * @author th, sl * @return boolean */ public function stopRecorder($id) { $table = $this->getTimeSheetTable(); $activity = $this->timeSheet_get_data($id); $filter['timeEntryID'] = $activity['timeEntryID']; $filter['end'] = 0; // only update running activities $rounded = Kimai_Rounding::roundTimespan($activity['start'], time(), $this->kga->getRoundPrecisionRecorderTimes(), $this->kga->isRoundDownRecorderTimes()); $values['start'] = $rounded['start']; $values['end'] = $rounded['end']; $values['duration'] = $values['end'] - $values['start']; $query = MySQL::BuildSQLUpdate($table, $values, $filter); return $this->conn->Query($query); }