This commit is contained in:
wangyidong
2022-04-26 13:55:15 +08:00
9 changed files with 33 additions and 20 deletions
+7 -8
View File
@@ -311,8 +311,6 @@ try {
},
current: {
handler(val) {
// console.log(val)
/* handle level field data. */
const attr = [];
val.forEach((item) => {
if (item.sub == 1) {
@@ -394,13 +392,11 @@ try {
})
},
addSub(current, key, s) {
sub = current.sub ? current.sub : 1;
sub += 1
sub = current.sub ? current.sub + 1 : 2;
if (s.sub) {
sub = s.sub + 1
}
fieldKey = s.key
// console.log('添加子字段', JSON.stringify(s), fieldKey)
const field = {
...this.getInitField(),
parentKey: fieldKey,
@@ -408,11 +404,14 @@ try {
}
current.splice(key + 1, 0, field)
},
add(data, sub) {
add(data, key, sub) {
const field = this.getInitField();
field.sub = sub.sub;
field.parentKey = sub.parentKey;
data.push({...field});
for(let index = key+1; index < data.length; index++) {
if(data[index].sub <= field.sub) return data.splice(index, 0, field);
}
data.splice(data.length, 0, field)
},
del(data, index) {
if(data.length <= 1) return;
@@ -451,7 +450,7 @@ try {
</thead>
<tbody>
<template v-for="(item,key) in current">
<param-field :current="current" :ckey="key" :value.sync="item" @add="add(current, $event)" @del="del(current, key)" @sub="addSub(current, key, $event)"></param-field>
<param-field :current="current" :ckey="key" :value.sync="item" @add="add(current, key, $event)" @del="del(current, key)" @sub="addSub(current, key, $event)"></param-field>
</template>
</tbody>
</table>
Regular → Executable
+2
View File
@@ -2120,6 +2120,7 @@ class bug extends control
$relatedBuilds = array('trunk' => $this->lang->trunk) + $this->dao->select('id, name')->from(TABLE_BUILD)->where('id')->in($relatedBuildIdList)->fetchPairs();
$relatedFiles = $this->dao->select('id, objectID, pathname, title')->from(TABLE_FILE)->where('objectType')->eq('bug')->andWhere('objectID')->in(@array_keys($bugs))->andWhere('extra')->ne('editor')->fetchGroup('objectID');
$relatedModules = $this->loadModel('tree')->getAllModulePairs('bug');
if($this->config->edition == 'max') $reviews = $this->loadModel('review')->getPairs(0, $productID);
foreach($bugs as $bug)
{
@@ -2137,6 +2138,7 @@ class bug extends control
$bug->story = !isset($relatedStories[$bug->story]) ? '' : $relatedStories[$bug->story] . "(#$bug->story)";
$bug->task = !isset($relatedTasks[$bug->task]) ? '' : $relatedTasks[$bug->task] . "($bug->task)";
$bug->case = !isset($relatedCases[$bug->case]) ? '' : $relatedCases[$bug->case] . "($bug->case)";
if($this->config->edition == 'max' and isset($reviews)) $bug->identify = !isset($reviews[$bug->identify]) ? '' : $reviews[$bug->identify] . "(#$bug->identify)";
if(isset($relatedModules[$bug->module])) $bug->module = $relatedModules[$bug->module] . "(#$bug->module)";
if(isset($relatedBugs[$bug->duplicateBug])) $bug->duplicateBug = $relatedBugs[$bug->duplicateBug] . "($bug->duplicateBug)";
+3 -3
View File
@@ -2670,7 +2670,7 @@ EOD;
if($isFreepasswd) return print(js::locate($this->config->webRoot));
$this->session->set('ENTRY_CODE', $this->get->code);
$this->session->set('VALID_ENTRY', md5(md5($this->get->code) . $this->server->remote_addr));
$this->session->set('VALID_ENTRY', md5(md5($this->get->code) . helper::getRemoteIp()));
$this->loadModel('entry')->saveLog($entry->id, $this->server->request_uri);
/* Add for task #5384. */
@@ -2837,7 +2837,7 @@ EOD;
commonModel::$requestErrors = array();
if(!is_array($headers)) $headers = (array)$headers;
$headers[] = "API-RemoteIP: " . zget($_SERVER, 'REMOTE_ADDR', '');
$headers[] = "API-RemoteIP: " . helper::getRemoteIp();
$curl = curl_init();
curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
@@ -2924,7 +2924,7 @@ EOD;
commonModel::$requestErrors = array();
if(!is_array($headers)) $headers = (array)$headers;
$headers[] = "API-RemoteIP: " . zget($_SERVER, 'REMOTE_ADDR', '');
$headers[] = "API-RemoteIP: " . helper::getRemoteIp();
if($dataType == 'json')
{
$headers[] = 'Content-Type: application/json;charset=utf-8';
+7 -4
View File
@@ -599,11 +599,11 @@ class extensionModel extends model
$file = $appRoot . $file;
if(!file_exists($file)) continue;
if(md5_file($file) != $savedMD5)
if(!is_writable($file) or @md5_file($file) != $savedMD5)
{
$removeCommands[] = PHP_OS == 'Linux' ? "rm -fr $file #changed" : "del $file :changed";
}
elseif(!@unlink($file))
elseif(!is_writable($file) or !@unlink($file))
{
$removeCommands[] = PHP_OS == 'Linux' ? "rm -fr $file" : "del $file";
}
@@ -617,7 +617,7 @@ class extensionModel extends model
foreach($dirs as $dir)
{
if(!is_dir($appRoot . $dir)) continue;
if(!rmdir($appRoot . $dir)) $removeCommands[] = PHP_OS == 'Linux' ? "rm -fr $appRoot$dir" : "rmdir $appRoot$dir /s /q";
if(!is_writable($appRoot . $dir) or !rmdir($appRoot . $dir)) $removeCommands[] = PHP_OS == 'Linux' ? "rm -fr $appRoot$dir" : "rmdir $appRoot$dir /s /q";
}
}
@@ -636,7 +636,10 @@ class extensionModel extends model
public function cleanModelCache()
{
$modelCacheFiles = glob($this->app->getTmpRoot() . 'model/*');
foreach($modelCacheFiles as $cacheFile) @unlink($cacheFile);
foreach($modelCacheFiles as $cacheFile)
{
if(is_writable($cacheFile) and !is_dir($cacheFile)) @unlink($cacheFile);
}
}
/**
+6
View File
@@ -49,6 +49,12 @@ class file extends control
public function ajaxUpload($uid = '')
{
$file = $this->file->getUpload('imgFile');
if(!isset($file[0]) or !in_array($file[0]['extension'], $this->config->file->imageExtensions))
{
return print(json_encode(array('result' => 'fail', 'message' => $this->lang->file->errorFileFormate)));
}
$file = $file[0];
if($file)
{
+1
View File
@@ -50,6 +50,7 @@ form {display: block; margin-top: 0em; margin-block-end: 1em;}
.gantt_task_link.start_to_finish .gantt_line_wrapper div { background-color: #975000; }
.gantt_task_link.start_to_finish:hover .gantt_line_wrapper div { box-shadow: 0 0 5px 0px #975000; }
.gantt_task_link.start_to_finish .gantt_link_arrow_left { border-right-color: #975000; }
.gantt_marker .gantt_marker_content {left: -15px; background-color: #f51e1e;}
</style>
<?php js::set('customUrl', $this->createLink('programplan', 'ajaxCustom'));?>
<?php js::set('dateDetails', $dateDetails);?>
+3 -3
View File
@@ -26,7 +26,7 @@ class sso extends control
$this->app->loadConfig('sso');
if(!$this->config->sso->turnon) return print($this->locate($locate));
$userIP = $this->server->remote_addr;
$userIP = helper::getRemoteIp();
$code = $this->config->sso->code;
$key = $this->config->sso->key;
if($type != 'return')
@@ -135,7 +135,7 @@ class sso extends control
if($type != 'return')
{
$code = $this->config->sso->code;
$userIP = $this->server->remote_addr;
$userIP = helper::getRemoteIp();
$token = $this->get->token;
$key = $this->config->sso->key;
$auth = md5($code . $userIP . $token . $key);
@@ -199,7 +199,7 @@ class sso extends control
if(!$this->session->ssoData) return;
$ssoData = $this->session->ssoData;
$userIP = $this->server->remote_addr;
$userIP = helper::getRemoteIp();
$code = $this->config->sso->code;
$key = $this->config->sso->key;
if($ssoData->auth != md5($code . $userIP . $ssoData->token . $key)) return;
+3 -1
View File
@@ -68,7 +68,9 @@ class stageModel extends model
$stage->createdDate = helper::today();
$this->dao->insert(TABLE_STAGE)->data($stage)->autoCheck()->checkIF($stage->percent != '', 'percent', 'float')->exec();
if(dao::isError()) return false;
$stageID = $this->dao->lastInsertID();
$this->action->create('stage', $stageID, 'Opened');
}
+1 -1
View File
@@ -888,7 +888,7 @@ class userModel extends model
if($user)
{
$ip = $this->server->remote_addr;
$ip = helper::getRemoteIp();
$last = $this->server->request_time;
$user->lastTime = $user->last;