Example #1
0
    fclose($excelFile);
    $loc = $url . "files/" . CL_CONFIG . "/ics/user-{$id}-timetrack.csv";
    header("Location: {$loc}");
} elseif ($action == "userpdf") {
    if (!empty($start) and !empty($end)) {
        $track = $tracker->getUserTrack($id, $fproject, $taski, $start, $end, false);
    } else {
        $track = $tracker->getUserTrack($id, $fproject, $taski, 0, 0, false);
    }
    $thetrack = array();
    $totaltime = $tracker->getTotalTrackTime($track);
    $totaltime = str_replace(".", ",", $totaltime);
    $uname = $conn->query("SELECT name FROM user WHERE ID = {$conn->quote($id)}")->fetch();
    $uname = $uname[0];
    $pdf = new MYPDF("P", PDF_UNIT, "A4", true);
    $pdf->setup($langfile["timetable"] . " " . $uname, array(239, 232, 229));
    $headers = array($langfile["project"], $langfile["task"], $langfile["comment"], $langfile["started"] . " - " . $langfile["ended"], $langfile["hours"]);
    $thetrack = array();
    if (!empty($track)) {
        foreach ($track as $tra) {
            if (empty($tra["tname"])) {
                $tra["tname"] = "";
            }
            $hrs = round($tra["hours"], 2);
            $hrs = number_format($hrs, 2, ",", ".");
            $tra["comment"] = strip_tags($tra["comment"]);
            array_push($thetrack, array($tra["pname"], $tra["tname"], $tra["comment"], $tra["daystring"] . "/" . $tra["startstring"] . "-" . $tra["endstring"], $hrs));
        }
        $totaltime = $tracker->getTotalTrackTime($track);
        $totaltime = str_replace(".", ",", $totaltime);
        $pdf->table($headers, $thetrack);
Example #2
0
        } else {
            header("Location: manageuser.php?action=showproject&id={$id}&mode=deassigned");
        }
    }
} elseif ($action == "projectlogpdf") {
    if (!$userpermissions["admin"]["add"]) {
        $errtxt = $langfile["nopermission"];
        $noperm = $langfile["accessdenied"];
        $template->assign("errortext", "{$errtxt}<br>{$noperm}");
        $template->display("error.tpl");
        die;
    }
    $pdf = new MYPDF("P", PDF_UNIT, "A4", true);
    $tproject = $project->getProject($id);
    $headstr = $tproject["name"] . " " . $activity;
    $pdf->setup($headstr, array(235, 234, 234));
    $headers = array($langfile["action"], $langfile["day"], $langfile["user"]);
    $thelog = new mylog();
    $datlog = array();
    $tlog = $thelog->getProjectLog($id, 100000);
    $tlog = $thelog->formatdate($tlog, CL_DATEFORMAT . " / H:i:s");
    if (!empty($tlog)) {
        $i = 0;
        foreach ($tlog as $logged) {
            if ($logged["action"] == 1) {
                $actstr = $langfile["added"];
            } elseif ($logged["action"] == 2) {
                $actstr = $langfile["edited"];
            } elseif ($logged["action"] == 3) {
                $actstr = $langfile["deleted"];
            } elseif ($logged["action"] == 4) {
Example #3
0
                $tasknum = $tasknum + $tcount;
                array_push($alltasks, $tasks);
            }
            $cou = $cou + 1;
        }
    }
    $etasks = reduceArray($alltasks);
    $title = $langfile['mytasks'];
    $template->assign("title", $title);
    $template->assign("tasks", $etasks);
    $template->assign("tasknum", count($etasks));
    $template->assign("myprojects", $myprojects);
    $template->display("mytasks.tpl");
} elseif ($action == "pdf") {
    $pdf = new MYPDF("P", PDF_UNIT, "A4", true);
    $pdf->setup($langfile["mytasks"], array(229, 235, 235));
    $headers = array($langfile["title"], $langfile["project"], $langfile["daysleft"]);
    $mtask = new task();
    $msg = new message();
    $myprojects = $project->getMyProjects($userid);
    $messages = array();
    $milestones = array();
    $tasks = array();
    if (!empty($myprojects)) {
        foreach ($myprojects as $proj) {
            $task = $mtask->getAllMyProjectTasks($proj["ID"], 100);
            if (!empty($task)) {
                array_push($tasks, $task);
            }
        }
    }