Пример #1
0
    }
}
$tpl = new HTML_Template_IT("./");
$tpl->loadTemplatefile("admin_users.tpl.html", true, true);
SetCommonLoginStatus($tpl);
SetAdminToolbar($tpl);
SetCommonFooter($tpl);
$users = GetUsersInfos();
$tpl->setCurrentBlock("users_table");
if (is_array($users)) {
    foreach ($users as $user) {
        // Assign data to the delete projects list
        $tpl->setCurrentBlock("delete_users");
        $tpl->setVariable("USER_ID", $user["Id"]);
        $tpl->setVariable("USER_USERNAME", $user["username"]);
        $tpl->setVariable("USER_FULLNAME", EncodeString($user["FullName"]));
        $tpl->setVariable("USER_EMAIL", ObfuscateEmail($user["email"]));
        $tpl->setVariable("USER_CAN_UPLOAD", $user["CanUpload"]);
        $tpl->setVariable("USER_IS_POWER", $user["IsPower"]);
        $tpl->setVariable("USER_IS_ADMIN", $user["IsAdmin"]);
        $projectsNames = GetProjectsNamesListFromIds($user["ProjectsList"]);
        if (is_string($projectsNames)) {
            die($projectsNames);
        }
        $tpl->setVariable("USER_PROJECTS_LIST", implode(", ", $projectsNames));
        $tpl->parseCurrentBlock("delete_users");
    }
} else {
    if ($msg != "") {
        $msg .= "<br>";
    }
Пример #2
0
        // this marker MUST not be called UNIT_ID or the first replacement above will be reversed to ""
        $tpl->setVariable("CANCEL_UNIT_ID", $unitInfos["Id"]);
        $tpl->parseCurrentBlock("cancel_unit");
        // build a "blank" item
        $itemInfos["Summary"] = "Write here a summary (1 line)";
        $itemInfos["Parameters"] = "";
        $itemInfos["ReturnValue"] = "";
        $itemInfos["Description"] = "Write here a description";
        $itemInfos["Extras"] = "";
        $seeAlsoList = "List here other properties, methods (comma seperated) " . "Remove the 'See Also' section if there are no references";
        $itemInfos["JVCLInfo"] = "";
    }
    // Assign data to the various variables
    $tpl->setVariable("SUMMARY", EncodeString(FixQuotes($itemInfos["Summary"])));
    $tpl->setVariable("PARAMETERS", $itemInfos["Parameters"]);
    $tpl->setVariable("RETURN_VALUE", FixQuotes($itemInfos["ReturnValue"]));
    $tpl->setVariable("DESCRIPTION", EncodeString($itemInfos["Description"]));
    $tpl->setVariable("EXTRAS", FixQuotes($itemInfos["Extras"]));
    $tpl->setVariable("SEE_ALSO_LIST", FixQuotes($seeAlsoList));
    $tpl->setVariable("JVCL_INFO", FixQuotes($itemInfos["JVCLInfo"]));
    // set the visibility of the different parts
    SetBlockVisibility("summary", $itemInfos["Summary"], $tpl);
    SetBlockVisibility("parameters", $itemInfos["Parameters"], $tpl);
    SetBlockVisibility("return_value", $itemInfos["ReturnValue"], $tpl);
    SetBlockVisibility("description", $itemInfos["Description"], $tpl);
    SetBlockVisibility("extras", $itemInfos["Extras"], $tpl);
    SetBlockVisibility("see_also", $seeAlsoList, $tpl);
    SetBlockVisibility("jvcl_info", $itemInfos["JVCLInfo"], $tpl);
}
$tpl->show();
EndAccessToDB();
Пример #3
0
        if ($projectUnits == "") {
            die("Project " . $_GET["Id"] . " does not exist in the database.");
        } else {
            die($projectUnits);
        }
    } elseif (count($projectUnits) > 0) {
        $tpl->setVariable("TYPES", "");
        $tpl->setCurrentBlock("by_units");
        foreach ($projectUnits as $unit) {
            $unitName = str_replace(".dtx", ".pas", $unit["Name"]);
            $summary = $unit["Description"];
            if (!(strpos($summary, "\r\n") === 0)) {
                $summary = substr($summary, 0, strpos($summary, "\r\n"));
            }
            // Assign data to the unit list block
            $tpl->setCurrentBlock("unit_list");
            $tpl->setVariable("UNIT_ID", $unit["Id"]);
            $tpl->setVariable("UNIT_NAME", $unitName);
            $tpl->setVariable("UNIT_SUMMARY", EncodeString($summary));
            $tpl->setVariable("UNIT_AUTHOR", EncodeString($unit["Author"]));
            $tpl->parseCurrentBlock("unit_list");
        }
        $tpl->parseCurrentBlock("by_units");
    } else {
        $tpl->setCurrentBlock("no_units");
        $tpl->touchBlock("no_units");
        $tpl->parseCurrentBlock("no_units");
    }
}
$tpl->show();
EndAccessToDB();
Пример #4
0
        }
        EndAccessToDB();
    } else {
        $msg = "Error: Please select a project to delete";
    }
}
$tpl = new HTML_Template_IT("./");
$tpl->loadTemplatefile("admin_projects.tpl.html", true, true);
SetCommonLoginStatus($tpl);
SetAdminToolbar($tpl);
SetCommonFooter($tpl);
$projects = GetProjectsInfos();
$tpl->setCurrentBlock("projects_table");
if (is_array($projects)) {
    foreach ($projects as $project) {
        // Assign data to the delete projects list
        $tpl->setCurrentBlock("delete_projects");
        $tpl->setVariable("PROJECT_ID", $project["Id"]);
        $tpl->setVariable("PROJECT_NAME", $project["Name"]);
        $tpl->setVariable("PROJECT_DESCRIPTION", EncodeString($project["Description"]));
        $tpl->parseCurrentBlock("delete_projects");
    }
} else {
    if ($msg != "") {
        $msg .= "<br>";
    }
    $msg .= "Warning: There are no projects in the system, use the link above to add one.";
}
$tpl->parseCurrentBlock("projects_table");
$tpl->setVariable("MESSAGE", $msg);
$tpl->show();
Пример #5
0
        die(GetNoAccessToProjectPage($projectId));
    }
} else {
    $projectId = "";
}
$tpl = new HTML_Template_IT("./");
$tpl->loadTemplatefile("admin_edit_project.tpl.html", true, true);
SetCommonLoginStatus($tpl);
SetAdminToolbar($tpl);
SetCommonFooter($tpl);
if (is_numeric($projectId)) {
    // here we edit an existing project
    $tpl->setVariable("ACTION", "modify");
    $project = GetProjectInfos($projectId);
    $tpl->setVariable("ID", $project["Id"]);
    $tpl->setVariable("NAME", $project["Name"]);
    $tpl->setVariable("DESCRIPTION", EncodeString(trim($project["Description"])));
    $tpl->setVariable("REVIEWERS_EMAILS", $project["ReviewersEmails"]);
    $tpl->setVariable("ADMIN_EMAIL", $project["AdminEmail"]);
    $tpl->setVariable("SEND_NOTIFICATIONS_CHECKED", $project["SendNotifications"] == 1 ? "checked" : "");
} else {
    // here we add a project
    $tpl->setVariable("ACTION", "add");
    $tpl->setVariable("ID", "");
    $tpl->setVariable("NAME", "");
    $tpl->setVariable("DESCRIPTION", "");
    $tpl->setVariable("REVIEWERS_EMAILS", "");
    $tpl->setVariable("ADMIN_EMAIL", "");
    $tpl->setVariable("SEND_NOTIFICATIONS_CHECKED", "");
}
$tpl->Show();
$tpl->setVariable("PARAMETERS", UnescapeCharsFromMySQL($itemInfos["Parameters"]));
$tpl->setVariable("RETURN_VALUE", UnescapeCharsFromMySQL($itemInfos["ReturnValue"]));
$tpl->setVariable("DESCRIPTION", EncodeString(UnescapeCharsFromMySQL($itemInfos["Description"])));
$tpl->setVariable("EXTRAS", UnescapeCharsFromMySQL($itemInfos["Extras"]));
$tpl->setVariable("SEE_ALSO_LIST", UnescapeCharsFromMySQL($itemInfos["SeeAlsoList"]));
$tpl->setVariable("JVCL_INFO", UnescapeCharsFromMySQL($itemInfos["JVCLInfo"]));
// Set values from the original item (if any)
if ($originalItemId > 0) {
    $originalItemInfos = GetItemInfos($originalItemId);
    $baseclass = trim(substr($originalItemInfos["Name"], 0, strpos($originalItemInfos["Name"], ".")));
    $tpl->setVariable("ORIGINAL_ITEM_ID", $originalItemId);
    $tpl->setVariable("ORIGINAL_ITEM_NAME", $originalItemInfos["Name"]);
    $tpl->setVariable("ORIGINAL_SUMMARY", EncodeString(FormatEndLines($originalItemInfos["Summary"])));
    $tpl->setVariable("ORIGINAL_PARAMETERS", FormatEndLines($originalItemInfos["Parameters"]));
    $tpl->setVariable("ORIGINAL_RETURN_VALUE", FormatEndLines($originalItemInfos["ReturnValue"]));
    $tpl->setVariable("ORIGINAL_DESCRIPTION", EncodeString(FormatEndLines($originalItemInfos["Description"])));
    $tpl->setVariable("ORIGINAL_EXTRAS", FormatEndLines(ProcessExtras($originalItemInfos["Extras"], $baseclass)));
    // build the see also information
    $seeAlsoList = "";
    if ($originalItemInfos["SeeAlsoInternal"] != "") {
        // start with the internal: the value in the DB is a comma separated list
        // of IDs, so we get the required infos from the database
        $sa_items = GetListOfItems($originalItemInfos["SeeAlsoInternal"]);
        foreach ($sa_items as $sa_item) {
            $tpl->setCurrentBlock("see_also_internal");
            if ($sa_item == $sa_items[0]) {
                $seeAlsoList .= RemoveBaseClass(trim($sa_item["Name"]), $baseclass);
            } else {
                $seeAlsoList .= ", " . RemoveBaseClass(trim($sa_item["Name"]), $baseclass);
            }
        }
Пример #7
0
        break;
}
$tpl = new HTML_Template_IT("./");
$tpl->loadTemplatefile("admin_seealso.tpl.html", true, true);
SetCommonLoginStatus($tpl);
SetAdminToolbar($tpl);
SetCommonFooter($tpl);
if ($itemsLeft) {
    $tpl->setCurrentBlock("auto_refresher");
    $tpl->touchBlock("auto_refresher");
    $tpl->parseCurrentBlock("auto_refresher");
}
$tpl->setVariable("MESSAGE", $msg);
$externalItems = GetExternalItemsInfos();
if (is_array($externalItems)) {
    $tpl->setCurrentBlock("external_items_sections");
    foreach ($externalItems as $externalItem) {
        // Assign data to the external items deletion list
        $tpl->setCurrentBlock("delete_external_items");
        $tpl->setVariable("EXTERNAL_ITEM_ID", $externalItem["Id"]);
        $tpl->setVariable("EXTERNAL_ITEM_NAME", $externalItem["Name"]);
        $tpl->setVariable("EXTERNAL_ITEM_DESCRIPTION", EncodeString($externalItem["Description"]));
        $tpl->parseCurrentBlock("delete_external_items");
    }
    $tpl->setCurrentBlock("external_items_sections");
} else {
    $tpl->setCurrentBlock("no_external_items");
    $tpl->setVariable("NO_EXTERNAL_ITEMS_MESSAGE", "There are no external items in the system, use the form below to add one.");
    $tpl->parseCurrentBlock("no_external_items");
}
$tpl->show();
Пример #8
0
    } else {
        $tpl->setCurrentBlock("cancel_project");
        // this marker MUST NOT be called PROJECT_ID or the first replacement above will be reversed to ""
        $tpl->setVariable("CANCEL_PROJECT_ID", $unitInfos["ProjectId"]);
        $tpl->parseCurrentBlock("cancel_project");
    }
} else {
    $unitItems = GetItemsInUnit($unitInfos["Id"], "ORDER BY Name");
    if (count($unitItems) > 0) {
        foreach ($unitItems as $item) {
            // Assign data to the line in the item list
            $tpl->setCurrentBlock("item_list");
            $tpl->setVariable("ITEM_ID", $item["Id"]);
            $name = trim($item["Name"]);
            if ($pos = strpos($name, "@")) {
                $name = substr($name, 0, $pos) . "<div style=\"margin-left: 25px; margin-top: -2px;\">@" . substr($name, $pos + 1);
                $name = str_replace("@", "</div><br><div style=\"margin-left: 25px; margin-top: -8px;\">@", $name);
                $name .= "</div>";
            }
            $tpl->setVariable("ITEM_NAME", $name);
            $tpl->setVariable("ITEM_SUMMARY", EncodeString(GetSummaryFromItem($item)));
            $tpl->parseCurrentBlock("item_list");
        }
    } else {
        $tpl->setCurrentBlock("no_items");
        $tpl->setVariable("ADD_UNIT_ID", $unitInfos["Id"]);
        $tpl->parseCurrentBlock("no_items");
    }
}
$tpl->show();
EndAccessToDB();
Пример #9
0
    } elseif ($_POST["email"] == "") {
        $result = "The E-Mail cannot be blank";
    } else {
        $result = ModifyMyDetails(GetLoggedUserId(), $_POST["md5_hash"], $_POST["full_name"], $_POST["email"]);
    }
    if ($result == "") {
        $msg = "Details set successfully";
    } else {
        $msg = "Error while setting details: " . $result;
    }
}
$userId = GetLoggedUserId();
$tpl = new HTML_Template_IT("./");
$tpl->loadTemplatefile("edit_my_details.tpl.html", true, true);
SetCommonLoginStatus($tpl);
SetCommonToolbar($tpl);
SetCommonFooter($tpl);
$userInfos = GetUserInfosById($userId);
$ProjectsList = GetProjectsNamesListFromIds($userInfos["ProjectsList"]);
if (is_string($ProjectsList)) {
    die($ProjectsList);
}
$tpl->setVariable("NAME", $userInfos["username"]);
$tpl->setVariable("FULL_NAME", EncodeString(trim($userInfos["FullName"])));
$tpl->setVariable("EMAIL", trim($userInfos["email"]));
$tpl->setVariable("CAN_UPLOAD", $userInfos["CanUpload"]);
$tpl->setVariable("IS_POWER", $userInfos["IsPower"]);
$tpl->setVariable("IS_ADMIN", $userInfos["IsAdmin"]);
$tpl->setVariable("PROJECTS_LIST", implode(", ", $ProjectsList));
$tpl->setVariable("MESSAGE", $msg);
$tpl->Show();
Пример #10
0
        $msg = "Error: Please select an item to reject";
    }
}
$tpl = new HTML_Template_IT("./");
$tpl->loadTemplatefile("admin_submitted_items.tpl.html", true, true);
SetCommonLoginStatus($tpl);
SetAdminToolbar($tpl);
SetCommonFooter($tpl);
$items = GetSubmittedItemsInfos();
$tpl->setCurrentBlock("items_table");
if (is_array($items) && count($items) > 0) {
    foreach ($items as $item) {
        // get project infos from UnitId
        $unitInfos = GetUnitInfos($item["UnitId"]);
        $projectInfos = GetProjectInfos($unitInfos["ProjectId"]);
        // Assign data to the items list
        $tpl->setCurrentBlock("items");
        $tpl->setVariable("ID", $item["Id"]);
        $tpl->setVariable("NAME", $item["Name"]);
        $tpl->setVariable("SUMMARY", EncodeString($item["Summary"]));
        $tpl->setVariable("SUBMITTED_ON", $item["CreatedOn"]);
        $tpl->setVariable("PROJECT_NAME", $projectInfos["Name"]);
        $tpl->parseCurrentBlock("items");
    }
} else {
    $tpl->touchBlock("no_items");
}
$tpl->parseCurrentBlock("items_table");
$tpl->setVariable("MESSAGE", $msg);
$tpl->show();
EndAccessToDB();