public function tasklistOnRow($row) { $task = $row->getDataItem(); $row->add(new RedirectLink('code', "\\ZippyERP\\ERP\\Pages\\Register\\TaskList", array($task->task_id)))->setValue($task->task_id); $row->add(new Label('name', $task->taskname)); $row->add(new Label('projectname', $task->projectname)); if ($task->start_date > 0) { $row->add(new Label('startdate', date('Y-m-d', $task->start_date))); } $row->add(new Label('hours', $task->hours)); $statuslist = Task::getStatusList(); $row->add(new Label('status', $statuslist[$task->status])); $row->add(new Label('assignedtoname', $task->assignedtoname)); if ($task->updated > 0) { $row->add(new Label('updated', date('Y-m-d H:i', $task->updated))); } $row->add(new ClickLink('edit'))->setClickHandler($this, 'editOnClick'); }
public function OnGantt($sender, $eventdata) { $action = $eventdata['action']; $task = Task::load($eventdata['id']); if ($action == "drag") { $task->start_date = $eventdata['start']; $task->end_date = $eventdata['end']; $task->save(); } if ($action == "resize") { $task->start_date = $eventdata['start']; $task->end_date = $eventdata['end']; $task->hours = ($task->end_date - $task->start_date) / 3600; $task->updated = time(); $task->save(); } }