function stopRecorder() { ## stop running recording | global $kga, $conn; $table = $kga['server_prefix'] . "zef"; $last_task = get_event_last(); // aktuelle vorgangs-ID auslesen $filter['zef_ID'] = $last_task['zef_ID']; $rounded = roundTimespan($last_task['zef_in'], time(), $kga['conf']['roundPrecision']); $values['zef_in'] = $rounded['start']; $values['zef_out'] = $rounded['end']; $values['zef_time'] = $values['zef_out'] - $values['zef_in']; $query = MySQL::BuildSQLUpdate($table, $values, $filter); logfile($query); return $conn->Query($query); }
* along with Kimai; If not, see <http://www.gnu.org/licenses/>. */ // insert KSPI $isCoreProcessor = 0; $dir_templates = "templates/floaters/"; require "../../includes/kspi.php"; switch ($axAction) { // ================================================= // = displays edit comment dialog for running task = // ================================================= case 'edit_running_comment': if (isset($kga['customer'])) { die; } $tpl->assign('langs', langs()); $last_event = get_event_last(); $tpl->assign('id', $last_event['zef_ID']); $tpl->assign('comment', $last_event['zef_comment']); $tpl->assign('comment_active', $last_event['zef_comment_type']); $tpl->assign('comment_types', $comment_types); $tpl->assign('comment_values', array('0', '1', '2')); $tpl->display("edit_running_comment.tpl"); break; case "add_edit_record": if (isset($kga['customer'])) { die; } // ============================================== // = display edit dialog for timesheet record = // ============================================== $selected = explode('|', $axValue);
/** * performed when the stop buzzer is hit. * Checks which record is currently recording and * writes the end time into that entry. * if the measured timevalue is longer than one calendar day * it is split up and stored in the DB by days * * @global array $kga kimai-global-array * @param integer $user ID of user * @author th * */ function stopRecorder() { ## stop running recording global $kga, $pdo_conn; $p = $kga['server_prefix']; $last_task = get_event_last(); // aktuelle vorgangs-ID auslesen $zef_ID = $last_task['zef_ID']; $rounded = roundTimespan($last_task['zef_in'], time(), $kga['conf']['roundPrecision']); $difference = $rounded['end'] - $rounded['start']; $pdo_query = $pdo_conn->prepare("UPDATE {$p}zef SET zef_in = ?, zef_out = ?, zef_time = ? WHERE zef_ID = ?;"); $pdo_query->execute(array($rounded['start'], $rounded['end'], $difference, $zef_ID)); }