$cf_1_type = $custom_fields->fields[0]['type'];
if ($cf_1_type == CustomFields::TYPE_TEXT) {
$custom_field_1 = ', cfl.value as cf_1_value';
$cf_1_type = $custom_fields->fields[0]['type'];
if ($cf_1_type == CustomFields::TYPE_TEXT) {
$custom_field_1 = ', cfl.value as cf_1_value';
- $records = ttWeekViewHelper::getRecordsForInterval($user->getActiveUser(), $pastWeekStartDate, $pastWeekEndDate);
+ $records = ttWeekViewHelper::getRecordsForInterval($user->getUser(), $pastWeekStartDate, $pastWeekEndDate);
// Handle potential situation of no records by re-trying for up to 4 more previous weeks (after a long vacation, etc.).
if (!$records) {
for ($i = 0; $i < 4; $i++) {
// Handle potential situation of no records by re-trying for up to 4 more previous weeks (after a long vacation, etc.).
if (!$records) {
for ($i = 0; $i < 4; $i++) {
- $records = ttWeekViewHelper::getRecordsForInterval($user->getActiveUser(), $pastWeekStartDate, $pastWeekEndDate);
+ $records = ttWeekViewHelper::getRecordsForInterval($user->getUser(), $pastWeekStartDate, $pastWeekEndDate);
- $fields4insert['user_id'] = $user->getActiveUser();
- $fields4insert['group_id'] = $user->getActiveGroup();
+ $fields4insert['user_id'] = $user->getUser();
+ $fields4insert['group_id'] = $user->getGroup();
+ $fields4insert['org_id'] = $user->org_id;
$fields4insert['date'] = $entry_date;
$fields4insert['duration'] = $fields['duration'];
$fields4insert['client'] = ttWeekViewHelper::parseFromWeekViewRow($fields['row_id'], 'cl');
$fields4insert['date'] = $entry_date;
$fields4insert['duration'] = $fields['duration'];
$fields4insert['client'] = ttWeekViewHelper::parseFromWeekViewRow($fields['row_id'], 'cl');
$sql = "update tt_log set duration = '$duration' where id = $tt_log_id and user_id = $user_id";
$affected = $mdb2->exec($sql);
if (is_a($affected, 'PEAR_Error'))
$sql = "update tt_log set duration = '$duration' where id = $tt_log_id and user_id = $user_id";
$affected = $mdb2->exec($sql);
if (is_a($affected, 'PEAR_Error'))
$sql = "update tt_log set comment = ".$mdb2->quote($fields['comment'])." where id = $tt_log_id and user_id = $user_id";
$affected = $mdb2->exec($sql);
if (is_a($affected, 'PEAR_Error'))
$sql = "update tt_log set comment = ".$mdb2->quote($fields['comment'])." where id = $tt_log_id and user_id = $user_id";
$affected = $mdb2->exec($sql);
if (is_a($affected, 'PEAR_Error'))