<?php
|
include_once "/Common/Logging.php";
|
include_once "/Account/User.php";
|
include_once "/db/DBOper.php";
|
include_once "/Common/CommFunc.php";
|
include_once "/language/lang.php";
|
|
\Logging\CreateLogging("serverops.versionlog.php");
|
|
function VersionInfoEdit($opType)
|
{
|
global $alertMsg;
|
// echo "_POST: ", print_r($_POST, true), "<br/>";
|
$channel = $_SESSION['spid'];
|
$VerNum = $_POST["VerNum"];
|
$VerTitle = $_POST["VerTitle"];
|
$VerDetail = $_POST["VerDetail"];
|
|
$UpdDate = $_POST["UpdDate"];
|
$UpdHour = $_POST["UpdHour"];
|
$UpdMinute = $_POST["UpdMinute"];
|
$UpdSecond = $_POST["UpdSecond"];
|
|
$UpdTime = $UpdDate . " " . $UpdHour . ":" . $UpdMinute . ":" . $UpdSecond;
|
|
$find = array(
|
"Channel" => $channel,
|
"VerNum" => $VerNum
|
);
|
if ($opType == "del") {
|
if (!DBOper\Remove("Versionlog", $find)) {
|
$alertMsg = "删除版本失败!";
|
\Logging\LogError($alertMsg . print_r($find, true));
|
return false;
|
}
|
$alertMsg = "删除版本成功!";
|
\Logging\LogInfo($alertMsg . print_r($find, true));
|
return true;
|
}
|
|
$editArray = array(
|
"Channel" => $channel,
|
"UpdTime" => $UpdTime,
|
"VerNum" => $VerNum,
|
"VerTitle" => $VerTitle,
|
"VerDetail" => $VerDetail,
|
);
|
$opName = $opType == "add" ? "添加" : "修改";
|
if (!DBOper\Update("Versionlog", $find, $editArray, false, true)) {
|
$alertMsg = $opName . "版本失败!";
|
\Logging\LogError($alertMsg . " find=" . json_encode($find) . " set=" . json_encode($editArray));
|
return false;
|
}
|
$alertMsg = $opName . "版本成功!";
|
\Logging\LogInfo($alertMsg . " find=" . json_encode($find) . " set=" . json_encode($editArray));
|
return true;
|
}
|
|
$Permission = \User\Permission::P_VersionLog;
|
$channel = $_SESSION['spid'];
|
$user = new \User\User($_SESSION['UserAccount']);
|
if (!$user->HavePermission($Permission)) {
|
exit;
|
}
|
// echo "_POST:" . print_r($_POST, true) . "<br/>";
|
|
if ($_POST["opType"]) {
|
if (VersionInfoEdit($_POST["opType"])) {
|
}
|
if ($alertMsg) {
|
echo "<script>alert('" . $alertMsg . "')</script>";
|
}
|
}
|
|
\DBOper\Find("Versionlog", array("Channel" => $channel), $versions, null, array("UpdTime" => -1), 100);
|
|
?>
|
|
<html>
|
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<title>版本更新日志</title>
|
<link rel="stylesheet" type="text/css" href="/css/tableform.css">
|
</head>
|
|
<body>
|
<center>
|
<p><b>版本更新日志</b></P>
|
</center>
|
|
<input type="button" value="添加版本" onclick="window.location.href='versionEdit.php?opType=add'" />
|
<hr />
|
<?php
|
if (isset($versions) && count($versions)) {
|
$itemHtml = "<ul>";
|
$detalHtml = "";
|
$index = 0;
|
foreach ($versions as $vInfo) {
|
$VerNum = $vInfo["VerNum"];
|
$UpdTime = $vInfo["UpdTime"];
|
$VerTitle = $vInfo["VerTitle"];
|
$VerDetail = $vInfo["VerDetail"];
|
|
// 项目目录
|
$itemName = $VerNum . " (" . $UpdTime . ") " . $VerTitle;
|
$itemHtml .= '<li><a href="#' . $VerNum . '" id="I' . $VerNum . '">' . $itemName . '</a></li>';
|
|
// 明细
|
$detalHtml .= '<hr/>';
|
$detalHtml .= '<a href="#I' . $VerNum . '" id="' . $VerNum . '"><font style="font-size: 25px;"><b>' . $itemName . '</b></font></a>';
|
if ($index == 0) { // 仅最近一个可修改
|
$detalHtml .= ' <a href="versionEdit.php?VerNum=' . $VerNum . '">修改</a>';
|
}
|
$detalHtml .= '<br/>';
|
$detalHtml .= $vInfo["VerDetail"] . '<br/>';
|
$index++;
|
}
|
$itemHtml . "</ul>";
|
|
echo "版本记录<p/>";
|
echo $itemHtml;
|
echo "<br/><br/><br/>";
|
echo $detalHtml;
|
} else {
|
echo "没有版本更新日志";
|
}
|
?>
|
<hr />
|
</body>
|
|
</html>
|