$block1->closeForm(); $block2 = new block(); $block2->form = "ahT"; $block2->openForm("../tasks/addtasktime.php?id={$id}#" . $block2->form . "Anchor"); $block2->heading($strings["task_time"] . ' : ' . $strings["details"]); $block2->openPaletteIcon(); $block2->paletteIcon(0, "remove", $strings["delete"]); $block2->paletteIcon(1, "edit", $strings["edit"]); $block2->closePaletteIcon(); $block2->borne = $blockPage->returnBorne("1"); $block2->rowsLimit = "20"; $block2->sorting('tasks_time', $sortingUser->sor_tasks_time[0], 'tim.date ASC', $sortingFields = array(0 => 'mem.name', 1 => 'tim.date', 2 => 'tim.hours', 3 => 'tim.created', 4 => 'tim.modified', 5 => 'tim.comments')); $tmpquery = "WHERE tim.task = '{$id}' ORDER BY {$block2->sortingValue}"; $block2->recordsTotal = compt($initrequest["tasks_time"] . " " . $tmpquery); $listTaskTimes = new request(); $listTaskTimes->openTaskTime($tmpquery, $block2->borne, $block2->rowsLimit); $comptListTaskTimes = count($listTaskTimes->tim_id); if ($comptListTaskTimes != "0") { $block2->openResults(); $block2->labels($labels = array(0 => $strings["owner"], 1 => $strings["date"], 2 => ucfirst($strings["hours"]), 3 => $strings["created"], 4 => $strings["modified"], 5 => $strings['comment']), "true"); // display logged hours for project for ($i = 0; $i < $comptListTaskTimes; $i++) { // only PM, PMA, and OWNERS can modify/delete if ($_SESSION['profilSession'] == 1 or $_SESSION['profilSession'] == 5 or $_SESSION['idSession'] == $listTaskTimes->tim_owner[$i]) { $block2->openRow($listTaskTimes->tim_id[$i]); $block2->checkboxRow($listTaskTimes->tim_id[$i], 'true'); $block2->cellRow($listTaskTimes->tim_mem_name[$i]); $block2->cellRow($listTaskTimes->tim_date[$i]); $block2->cellRow($listTaskTimes->tim_hours[$i]); $block2->cellRow($listTaskTimes->tim_created[$i]); $block2->cellRow($listTaskTimes->tim_modified[$i]);
if ($teamMember == "false" && $projectsFilter == "true") { header("Location:../general/permissiondenied.php"); exit; } //--- header --- $breadcrumbs[] = buildLink("../projects/listprojects.php?", $strings["projects"], LINK_INSIDE); $breadcrumbs[] = buildLink("../projects/viewproject.php?id=" . $projectDetail->pro_id[0], $projectDetail->pro_name[0], LINK_INSIDE); $breadcrumbs[] = buildLink("../tasks/listtasks.php?project=" . $projectDetail->pro_id[0], $strings["tasks"], LINK_INSIDE); $breadcrumbs[] = buildLink("../tasks/viewtask.php?id=" . $taskDetail->tas_id[0], $taskDetail->tas_name[0], LINK_INSIDE); $breadcrumbs[] = $strings["delete_task_time"]; require_once "../themes/" . THEME . "/header.php"; //--- content --- $block1 = new block(); $block1->form = 'saP'; $block1->openForm("../tasks/deletetasktime.php?task={$task}&action=delete&id={$id}"); $block1->headingForm($strings["delete_task_time"]); $block1->openContent(); $block1->contentTitle($strings["delete_following"]); $id = str_replace("**", ",", $id); $tmpquery = "WHERE tim.id IN({$id}) ORDER BY tim.id"; $listTaskTime = new request(); $listTaskTime->openTaskTime($tmpquery); $comptListTaskTime = count($listTaskTime->tim_id); for ($i = 0; $i < $comptListTaskTime; $i++) { echo "<tr class='odd'><td valign='top' class='leftvalue'>#" . $listTaskTime->tim_id[$i] . "</td><td> : " . $strings['worked_hours'] . " = " . $listTaskTime->tim_hours[$i] . ", " . $listTaskTime->tim_comments[$i] . "</td></tr>"; } echo "\r\n<tr class='odd'>\r\n <td valign='top' class='leftvalue'> </td>\r\n <td><input type='submit' name='delete' value='" . $strings['delete'] . "'> \r\n <input type='button' name='cancel' value='" . $strings['cancel'] . "' onClick='history.back();'></td></tr>"; $block1->closeContent(); $block1->headingForm_close(); $block1->closeForm(); require_once "../themes/" . THEME . "/footer.php";
} else { $query .= "WHERE (tim.date >= '{$s_sdate2}' AND tim.date <= '{$s_edate2}')"; } $reportHeader = "\"Tracking hours from {$s_sdate2} to {$s_edate2}\"" . $crlf; } // a member selection was made if ($S_mem != 'ALL' && $S_mem != "") { if ($query != "") { $query .= " AND tim.owner IN({$S_mem})"; } else { $query .= "WHERE tim.owner IN({$S_mem})"; } } $tmpquery = "{$query} ORDER BY org.name,pro.name,mem.name,tim.date"; $listHours = new request(); $listHours->openTaskTime($tmpquery); $comptListHours = count($listHours->tim_id); $dump_buffer = $reportHeader . $crlf; if ($comptListHours != "0") { /** * Construct the header row */ $dump_buffer .= "\"" . $strings["organization"] . "\",\"" . $strings["project"] . "\",\"" . $strings["name"] . "\",\"" . $strings["date"] . "\",\"" . $strings["type"] . "\",\"" . $strings["service"] . "\",\"" . $strings['hours'] . "\"" . $crlf; for ($i = 0; $i < $comptListHours; $i++) { /** * The individual fields */ // organization name $dump_buffer .= "\"" . $listHours->tim_org_name[$i] . "\","; // project name $dump_buffer .= "\"" . $listHours->tim_pro_name[$i] . "\",";
//} // Task Detail $tmpquery = "WHERE tas.id = '{$task}'"; $taskDetail = new request(); $taskDetail->openTasks($tmpquery); if ($taskDetail->tas_estimated_time[0] < 1) { $taskDetail->tas_estimated_time[0] = 0; } // Project Detail $tmpquery = "WHERE pro.id = '" . $taskDetail->tas_project[0] . "'"; $projectDetail = new request(); $projectDetail->openProjects($tmpquery); // Task Time Detail $tmpquery = "WHERE tim.id = '{$id}'"; $taskTimeDetail = new request(); $taskTimeDetail->openTaskTime($tmpquery); // Check field values if ($_GET['action'] == 'edit') { $msgLabel .= ''; // init // make sure we have the required information if (!empty($hr)) { if (!is_numeric($hr)) { // we need this to be numeric $msgLabel = '<b>' . $strings['attention'] . '</b> : ' . $strings['worked_hours'] . ' ' . $strings['error_numerical']; } } else { // we need this to be numeric $msgLabel = '<b>' . $strings['attention'] . '</b> : ' . $strings['worked_hours'] . ' ' . $strings['error_required']; } // update task time in database