}
return false;
}
+
// getReport - returns a report identified by its id.
// TODO: get rid of this function by encapsulating all cron related tasks in its own class.
// Because cron works for all orgs and we want this class to always work in context of
if (!$bean->getAttribute('chtotalsonly')) $bean->setAttribute('chtotalsonly', 0);
- $users_in_bean = $bean->getAttribute('users');
- if ($users_in_bean && is_array($users_in_bean)) {
- $users = join(',', $users_in_bean);
+ $active_users_in_bean = $bean->getAttribute('users_active');
+ if ($active_users_in_bean && is_array($active_users_in_bean)) {
+ $users = join(',', $active_users_in_bean);
+ }
+ $inactive_users_in_bean = $bean->getAttribute('users_inactive');
+ if ($inactive_users_in_bean && is_array($inactive_users_in_bean)) {
+ if ($users) $users .= ',';
+ $users .= join(',', $inactive_users_in_bean);
}
+
if ($bean->getAttribute('start_date')) {
$dt = new DateAndTime($user->getDateFormat(), $bean->getAttribute('start_date'));
$from = $dt->toString(DB_DATEFORMAT);
$bean->setAttribute('invoice', $val['invoice']);
$bean->setAttribute('paid_status', $val['paid_status']);
$bean->setAttribute('timesheet', $val['timesheet']);
- $bean->setAttribute('users', explode(',', $val['users']));
+ $bean->setAttribute('users_active', explode(',', $val['users']));
+ $bean->setAttribute('users_inactive', explode(',', $val['users']));
$bean->setAttribute('period', $val['period']);
if ($val['period_start']) {
$dt = new DateAndTime(DB_DATEFORMAT, $val['period_start']);
$user_ids[] = $single_user['id'];
}
foreach ($users_to_adjust as $user_to_adjust) {
- if (in_array($user_to_adjust['id'], $user_ids)) {
- $adjusted_user_ids[] = $user_to_adjust['id'];
+ if (in_array($user_to_adjust, $user_ids)) {
+ $adjusted_user_ids[] = $user_to_adjust;
}
}
$options['users'] = implode(',', $adjusted_user_ids);