<?php //ini_set('display_errors',1); $case = new cases(); $global_tasks = new GlobalTask(); $sql = $case->search_query(array('case_id' => $options['case_id'])); $array = $this->db->fetch_assoc($this->db->query($sql)); $array['tasks'] = array(); $tasks = $global_tasks->search_flow_chart_tasks(array('module' => 'cases', 'module_id' => $options['case_id'])); foreach ($tasks as $n => $v) { //$v['name'] = $v['subject']; $v['task_type'] = 'global_task'; $v['task_id'] = $v['chart_assign_id']; $v['access'] = $global_tasks->check_permitions($v); $v['options'] = $global_tasks->get_flowchart_options($v['flow_chart_id']); $array['tasks'][] = $v; } $array['activity'] = $this->get_activity_log_by_module('cases', $options['case_id']); $array['followers'] = $this->follow->get_followers_by_module('cases', $options['case_id']); if (array_key_exists($_SESSION['user_id'], $array['followers'])) { $array['following'] = true; } else { $array['following'] = false; } $time = new TimeTracker(); $time->setModuleName('cases'); $time->setModuleID($options['case_id']); $array['time'] = array(); $array['time']['entries'] = $time->getTimeEntries(); $array['time']['open'] = $time->getOpenEntryId($array['time']['entries']);
<?php $array = array(); $time = new TimeTracker(); $time->setModuleName($options['module_name']); $time->setModuleID($options['module_id']); $checktime = $time->getOpenEntryId($time->getTimeEntries()); if ($checktime) { $array['time_tracker_id'] = $checktime; } else { $id = $time->newTimeEntry($_SESSION['user_id'], $options['module_name'], $options['module_id'], date('Y-m-d H:i:s')); $array['time_tracker_id'] = $id; }
echo $tt_id; ?> );" /></td> </tr> <?php } break; case 'setTimeEnd': $end_time = date('Y-m-d H:i:s'); $result = $timetracker->setTimeEnd($_REQUEST['module_name'], $_REQUEST['module_id'], $end_time); if ($result) { echo 'pass'; } break; case 'getUpdatedEntries': $timetracker->setModuleName($_REQUEST['module_name']); $timetracker->setModuleID($_REQUEST['module_id']); $entries = $timetracker->getTimeEntries(); foreach ($entries as $entry) { $start_stt = strtotime($entry['start_time']); $start_time = date('g:i', $start_stt); $start_date = date('n/j', $start_stt); if ($entry['end_time'] == '0000-00-00 00:00:00') { $end_time = '--'; $diff = '--'; } else { $end_stt = strtotime($entry['end_time']); $end_time = date('g:i', $end_stt); $diff_time = $end_stt - $start_stt; if ($diff_time < 60) { $diff_time = 60;