$df = $AppUI->getPref('SHDATEFORMAT'); // pull users // pull users $q = new DBQuery(); $q->addTable('tasks', 't'); $q->addTable('projects', 'p'); $q->addTable('user_tasks', 'u'); $q->addQuery('t.task_id'); $q->addQuery('CONCAT_WS(" - ",p.project_short_name, t.task_name)'); $q->addOrder('p.project_short_name, t.task_name'); $q->addWhere('t.task_project = p.project_id and t.task_dynamic = 0 and t.task_percent_complete!=100 and u.task_id=t.task_id and u.user_id=' . $user_id); //Devido a possibilidade de edição de registros, as tarefas de projetos arquivados e em espera serão apresentadas. //$q->addWhere('p.project_status!=7 and p.project_status!=4');//[7] Projetos Arquivados e [4] Projetos Em Espera $tasks = $q->loadHashList(); // load the record data in case of that this script is used to edit the log qith task_log_id (transmitted via GET) if (!$obj->load($task_log_id, false) && $task_log_id > 0) { // show some error messages using the dPFramework if loadOperation failed // these error messages are nicely integrated with the frontend of dP // use detailed error messages as often as possible $AppUI->setMsg('Timesheet'); $AppUI->setMsg("invalidID", UI_MSG_ERROR, true); $AppUI->redirect(); // go back to the calling location } // check if this record has dependancies to prevent deletion $msg = ''; // setup the title block // Fill the title block either with 'Edit' or with 'New' depending on if task_log_id has been transmitted via GET or is empty $ttl = $task_log_id > 0 ? "Edit Log" : "New Log"; $titleBlock = new CTitleBlock($ttl, 'timesheet.png', $m, "{$m}.{$a}"); // also have a breadcrumb here
echo $next; ?> </a> <?php } ?> </td> </tr> </table> <?php $timesheetId = 0; $status = 1; $timesheet = new CTimesheet($user_id, $time_set->format('%Y%m%d')); if ($timesheet->load()) { $timesheetId = $timesheet->getTimesheetId(); $activities = $timesheet->getActivities(); } ?> <!-- Create timesheet form --> <form name="timesheetActivities" action="./index.php?m=activity&a=dosql" method="post"> <input name='timesheetId' type='hidden' value=<?php echo $timesheetId; ?> /> <input name='timeset' type='hidden' value=<?php echo $time_set->format('%Y%m%d'); ?> /> <input name='userId' type='hidden' value=<?php