Esempio n. 1
0
<?php

include_once "functions/include_all.php";
if (!$_SESSION["superUser"]) {
    header("Location: index.php");
    die;
}
include "design_head.php";
$lookup_pr = "<table cellpadding=0 cellspacing=0 border=0>";
$lookup_pr .= "<form method=\"post\" action=\"admin_lookup_pr.php\"><tr><td>";
$lookup_pr .= "&raquo; Lookup PR: <input type=\"text\" name=\"pr\" size=6> <input type=\"submit\" value=\"Go\">";
$lookup_pr .= "</td></tr></form></table>";
if (isset($_GET["id"])) {
    /* Show a specific item */
    $itemId = $_GET["id"];
    $item = getTodoItem($db, $itemId);
    if (isset($_POST["changestatus"])) {
        /* Change item status */
        setTodoItemStatus($db, $itemId, $_POST["changestatus"]);
        if ($_POST["changestatus"] == TODO_ITEM_ASSIGNED) {
            assignTodoItem($db, $itemId, $_SESSION["userId"]);
            $comment = "Status changed from " . $todo_item_status[$item["itemStatus"]] . " to " . $todo_item_status[$_POST["changestatus"]] . " by " . $_SESSION["userName"] . ".<br>";
            $comment .= "(Meaning item is now assigned to " . $_SESSION["userName"] . ").";
            $item["assignedTo"] = $_SESSION["userId"];
            //update changes
        } else {
            $comment = "Status changed from " . $todo_item_status[$item["itemStatus"]] . " to " . $todo_item_status[$_POST["changestatus"]] . " by " . $_SESSION["userName"] . ".";
        }
        $item["itemStatus"] = $_POST["changestatus"];
        //update changes
        addTodoItemComment($db, 0, $itemId, $comment);
Esempio n. 2
0
<?php

include_once "functions/include_all.php";
if (!$_SESSION["superUser"]) {
    header("Location: index.php");
    die;
}
if (!isset($_POST["pr"]) || !$_POST["pr"]) {
    header("Location: admin.php");
    die;
}
$pr = $_POST["pr"];
$prData = getTodoItem($db, $pr);
if (!$prData) {
    include "design_head.php";
    echo "PR " . $pr . " not found.<br><br>";
    echo "<a href=\"admin.php\">&raquo; Go back to Administration screen</a><br>";
    include "design_foot.php";
} else {
    header("Location: admin_todo_lists.php?id=" . $prData["itemId"]);
    die;
}