This commit is contained in:
Yagami
2019-01-25 15:16:55 +08:00
9 changed files with 50 additions and 22 deletions
+2 -1
View File
@@ -1836,7 +1836,8 @@
$v_memory_limit = ini_get('memory_limit');
$v_memory_limit = trim($v_memory_limit);
$last = strtolower(substr($v_memory_limit, -1));
$v_memory_limit = (int)$v_memory_limit;
if($last == 'g')
//$v_memory_limit = $v_memory_limit*1024*1024*1024;
$v_memory_limit = $v_memory_limit*1073741824;
+6 -9
View File
@@ -81,7 +81,7 @@ class backup extends control
public function backup($reload = 'no')
{
if($reload == 'yes') session_write_close();
set_time_limit(7200);
set_time_limit(0);
$nozip = strpos($this->config->backup->setting, 'nozip') !== false;
$nofile = strpos($this->config->backup->setting, 'nofile') !== false;
$nosafe = strpos($this->config->backup->setting, 'nosafe') !== false;
@@ -147,7 +147,7 @@ class backup extends control
}
/* Delete expired backup. */
$backupFiles = glob("{$this->backupPath}*.php");
$backupFiles = glob("{$this->backupPath}*.*");
if(!empty($backupFiles))
{
$time = time();
@@ -179,7 +179,7 @@ class backup extends control
{
if($confirm == 'no') $this->send(array('result' => 'fail', 'message' => $this->lang->backup->confirmRestore));
set_time_limit(7200);
set_time_limit(0);
/* Restore database. */
if(file_exists("{$this->backupPath}{$fileName}.sql.php"))
@@ -373,24 +373,21 @@ class backup extends control
if($sqlFileName)
{
$fileSize = $this->backup->getBackupSize($sqlFileName);
$fileSize = $fileSize / 1024 >= 1024 ? round($fileSize / 1024 / 1024, 2) . 'MB' : round($fileSize / 1024, 2) . 'KB';
$message = sprintf($this->lang->backup->progressSQL, $fileSize);
$message = sprintf($this->lang->backup->progressSQL, $this->backup->processFileSize($fileSize));
}
$attachFileName = $this->backup->getBackupFile($fileName, 'file');
if($attachFileName)
{
$fileSize = $this->backup->getBackupSize($attachFileName);
$fileSize = $fileSize / 1024 >= 1024 ? round($fileSize / 1024 / 1024, 2) . 'MB' : round($fileSize / 1024, 2) . 'KB';
$message = sprintf($this->lang->backup->progressAttach, $fileSize);
$message = sprintf($this->lang->backup->progressAttach, $this->backup->processFileSize($fileSize));
}
$codeFileName = $this->backup->getBackupFile($fileName, 'code');
if($codeFileName)
{
$fileSize = $this->backup->getBackupSize($codeFileName);
$fileSize = $fileSize / 1024 >= 1024 ? round($fileSize / 1024 / 1024, 2) . 'MB' : round($fileSize / 1024, 2) . 'KB';
$message = sprintf($this->lang->backup->progressCode, $fileSize);
$message = sprintf($this->lang->backup->progressCode, $this->backup->processFileSize($fileSize));
}
die($message);
}
+25
View File
@@ -311,4 +311,29 @@ class backupModel extends model
return false;
}
/**
* Process filesize.
*
* @param int $fileSize
* @access public
* @return string
*/
public function processFileSize($fileSize)
{
$bit = 'KB';
$fileSize = round($fileSize / 1024, 2);
if($fileSize >= 1024)
{
$bit = 'MB';
$fileSize = round($fileSize / 1024, 2);
}
if($fileSize >= 1024)
{
$bit = 'GB';
$fileSize = round($fileSize / 1024, 2);
}
return $fileSize . $bit;
}
}
+1 -1
View File
@@ -2667,7 +2667,7 @@ class bugModel extends model
$assignToLink = helper::createLink('bug', 'assignTo', "bugID=$bug->id", '', true);
$assignToHtml = html::a($assignToLink, "<i class='icon icon-hand-right'></i> <span title='$bug->assignedTo' class='{$btnTextClass}'>{$assignedToText}</span>", '', "class='$btnClass'");
echo !common::hasPriv('bug', 'assignTo') ? "<span style='padding-left: 21px' class='{$btnTextClass}'>{$assignedToText}</span>" : $assignToHtml;
echo !common::hasPriv('bug', 'assignTo', $bug) ? "<span style='padding-left: 21px' class='{$btnTextClass}'>{$assignedToText}</span>" : $assignToHtml;
}
/**
+1
View File
@@ -865,3 +865,4 @@ if(isset($config->global->flow) and $config->global->flow == 'onlyTest')
unset($lang->searchObjects['release']);
unset($lang->searchObjects['project']);
unset($lang->searchObjects['productplan']);
}
+3 -1
View File
@@ -14,7 +14,6 @@
$webRoot = $this->app->getWebRoot();
$jsRoot = $webRoot . "js/";
?>
<?php include '../../common/view/chosen.html.php';?>
<div class='modal-dialog w-500px'>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><i class="icon icon-close"></i></button>
@@ -44,3 +43,6 @@ $jsRoot = $webRoot . "js/";
</form>
</div>
</div>
<script>
$('#dataform .chosen').chosen();
</script>
+1 -1
View File
@@ -2646,7 +2646,7 @@ class taskModel extends model
$assignToLink = helper::createLink('task', 'assignTo', "projectID=$task->project&taskID=$task->id", '', true);
$assignToHtml = html::a($assignToLink, "<i class='icon icon-hand-right'></i> <span class='{$btnTextClass}'>{$assignedToText}</span>", '', "class='$btnClass'");
echo !common::hasPriv('task', 'assignTo') ? "<span style='padding-left: 21px' class='{$btnTextClass}'>{$assignedToText}</span>" : $assignToHtml;
echo !common::hasPriv('task', 'assignTo', $task) ? "<span style='padding-left: 21px' class='{$btnTextClass}'>{$assignedToText}</span>" : $assignToHtml;
}
/**
+11 -8
View File
@@ -252,15 +252,9 @@ class testcase extends control
}
if(empty($this->products)) $this->locate($this->createLink('product', 'create'));
/* Set productID and currentModuleID. */
/* Set productID and branch. */
$productID = $this->product->saveState($productID, $this->products);
if($branch === '') $branch = (int)$this->cookie->preBranch;
if($storyID and empty($moduleID))
{
$story = $this->loadModel('story')->getByID($storyID);
$moduleID = $story->module;
}
$currentModuleID = (int)$moduleID;
/* Set menu. */
$this->testcase->setMenu($this->products, $productID, $branch);
@@ -319,6 +313,14 @@ class testcase extends control
$position[] = $this->lang->testcase->common;
$position[] = $this->lang->testcase->create;
/* Set story and currentModuleID. */
if($storyID and empty($moduleID))
{
$story = $this->loadModel('story')->getByID($storyID);
$moduleID = $story->module;
}
$currentModuleID = (int)$moduleID;
/* Get the status of stories are not closed. */
$storyStatus = $this->lang->story->statusList;
$modules = array();
@@ -328,6 +330,7 @@ class testcase extends control
$modules = $this->tree->getAllChildID($modules);
}
$stories = $this->story->getProductStoryPairs($productID, $branch, $modules, array_keys($storyStatus), 'id_desc', 50);
if($storyID and !isset($stories[$storyID])) $stories = $this->story->formatStories(array($storyID => $story)) + $stories;//Fix bug #2406.
/* Set custom. */
foreach(explode(',', $this->config->testcase->customCreateFields) as $field) $customFields[$field] = $this->lang->testcase->$field;
@@ -339,7 +342,7 @@ class testcase extends control
$this->view->productID = $productID;
$this->view->productName = $this->products[$productID];
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0, $branch);
$this->view->currentModuleID = $currentModuleID ? $currentModuleID : (isset($story->module) ? $story->module : 0);
$this->view->currentModuleID = $currentModuleID;
$this->view->stories = $stories;
$this->view->caseTitle = $caseTitle;
$this->view->color = $color;
-1
View File
@@ -15,7 +15,6 @@ $webRoot = $this->app->getWebRoot();
$jsRoot = $webRoot . "js/";
js::set('type', $type);
?>
<?php include '../../common/view/chosen.html.php';?>
<div class='modal-dialog w-500px'>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><i class="icon icon-close"></i></button>