public function action_filter() { $user_id = \Fuel\Core\Input::param('user_id', 0); $client_id = Fuel\Core\Input::param('client_id', 0); $project_id = \Fuel\Core\Input::param('project_id', 0); $month = Fuel\Core\Input::param('month', '00'); $year = Fuel\Core\Input::param('year', date('Y')); $status = 0; $data['open_tasks'] = THelper::get_tasks($user_id, $client_id, $project_id, $month, $year, $status, array(\Fuel\Core\Input::param('sort', 'priority') => \Fuel\Core\Input::param('order', 0))); $view = \Fuel\Core\View::forge('admin/tasks/index'); $view->set_global('clients', Model_Customer::find('all', array('order_by' => array('name' => 'asc')))); $view->set_global('users', Model_User::find('all', array('order_by' => array('username' => 'asc')))); $view->set_global('years', range(2015, date('Y'))); $view->set_global('months', THelper::get_months_array()); $view->set_global('open_tasks', $data['open_tasks']); $view->set_global('admin', true); $this->template->title = 'Open Tasks'; $this->template->content = $view; }
$order_by_priority = \Fuel\Core\Input::param('sort', 'priority') == 'priority' ? \Fuel\Core\Input::param('order', 0) == 1 ? 0 : 1 : 1; echo \Fuel\Core\Html::anchor($action . 'user_id=' . \Fuel\Core\Input::param('user_id', 0) . '&project_id=' . \Fuel\Core\Input::param('project-id', 0) . '&client_id=' . \Fuel\Core\Input::param('client_id', 0) . '&year=' . \Fuel\Core\Input::param('year', date('Y')) . '&month=' . \Fuel\Core\Input::param('month', date('m')) . '&sort=priority' . '&order=' . $order_by_priority, $order_by_priority == 1 ? '<span class="glyphicon icon-sort-by-alphabet"></span> Priority' : '<span class="glyphicon icon-sort-by-alphabet-alt"></span> Priority', array('style' => 'color: black')); ?> </th> <th>Hours Spent</th> <th style="width: 80px;"> </th> </tr> </thead> <tbody> <?php if ($open_tasks) { ?> <?php $row_counter = 0; $datestart_timestamp = strtotime(Fuel\Core\Input::param('year', date('Y')) . '-' . Fuel\Core\Input::param('month', date('m')) . '-01'); $dateend_timestamp = strtotime(date(Fuel\Core\Input::param('year', date('Y')) . '-' . Fuel\Core\Input::param('month', date('m')) . '-t')); ?> <?php foreach ($open_tasks as $task) { ?> <tr> <td><?php echo ++$row_counter . '. ' . \Fuel\Core\Html::anchor(isset($admin) && $admin ? 'admin/projects/view/' . $task->project_id : 'user/timesheets/logtimes/' . strtotime(date('Y-m-d')) . '?id=' . $task->id, trim(date('d-m-Y', strtotime($task->task_due)))); ?> </td> <td><?php echo \Fuel\Core\Html::anchor(isset($admin) && $admin ? 'admin/projects/view/' . $task->project_id : 'user/timesheets/logtimes/' . strtotime(date('Y-m-d')) . '?id=' . $task->id, trim($task->project->name) . ' [ ' . trim(strtoupper($task->project->customer->name)) . ' ] '); ?> </td> <td><?php echo \Fuel\Core\Html::anchor(isset($admin) && $admin ? 'admin/projects/view/' . $task->project_id : 'user/timesheets/logtimes/' . strtotime(date('Y-m-d')) . '?id=' . $task->id, strtoupper(trim($task->user->username)));