diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php
index 12db180906..85f118b02c 100755
--- a/module/common/lang/zh-cn.php
+++ b/module/common/lang/zh-cn.php
@@ -492,6 +492,7 @@ $lang->admin->menu = new stdclass();
$lang->admin->menu->index = array('link' => '首页|admin|index', 'alias' => 'register,certifytemail,certifyztmobile,ztcompany');
$lang->admin->menu->company = array('link' => '人员|company|browse|', 'subModule' => ',user,dept,group,', 'alias' => ',dynamic,view,');
$lang->admin->menu->message = array('link' => '通知|message|index', 'subModule' => 'message,mail,webhook');
+$lang->admin->menu->custom = array('link' => '自定义|custom|index', 'subModule' => 'custom');
$lang->admin->menu->data = array('link' => '数据|backup|index', 'subModule' => 'backup,action');
$lang->admin->menu->safe = array('link' => '安全|admin|safe', 'alias' => 'checkweak');
$lang->admin->menu->system = array('link' => '系统|cron|index', 'subModule' => 'cron,search');
diff --git a/module/custom/control.php b/module/custom/control.php
index ba819e2221..31ca3af33c 100644
--- a/module/custom/control.php
+++ b/module/custom/control.php
@@ -19,9 +19,9 @@ class custom extends control
*/
public function index()
{
+ if(common::hasPriv('custom', 'set')) die(js::locate(inlink('set', "module=program&field=" . key($this->lang->custom->program->fields))));
if(common::hasPriv('custom', 'product')) die(js::locate(inlink('product')));
if(common::hasPriv('custom', 'project')) die(js::locate(inlink('project')));
- if(common::hasPriv('custom', 'set')) die(js::locate(inlink('set')));
foreach($this->lang->custom->system as $sysObject)
{
@@ -41,7 +41,7 @@ class custom extends control
public function set($module = 'story', $field = 'priList', $lang = '')
{
if(empty($lang)) $lang = $this->app->getClientLang();
- if($module == 'user' and $field == 'priList') $field = 'roleList';
+ if($module == 'user' and $field == 'priList') $field = 'statusList';
if($module == 'block' and $field == 'priList')$field = 'closed';
$currentLang = $this->app->getClientLang();
diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php
index b06e07ab56..1c0809b32f 100644
--- a/module/custom/lang/zh-cn.php
+++ b/module/custom/lang/zh-cn.php
@@ -125,12 +125,11 @@ $lang->custom->todo->fields['typeList'] = '类型';
$lang->custom->todo->fields['statusList'] = '状态';
$lang->custom->user = new stdClass();
-$lang->custom->user->fields['roleList'] = '职位';
$lang->custom->user->fields['statusList'] = '状态';
$lang->custom->user->fields['contactField'] = '可用联系方式';
$lang->custom->user->fields['deleted'] = '列出已删除用户';
-$lang->custom->system = array('flow', 'working', 'required', 'score', 'estimate');
+$lang->custom->system = array('required', 'score', 'estimate');
$lang->custom->block->fields['closed'] = '关闭的区块';
diff --git a/module/custom/view/header.html.php b/module/custom/view/header.html.php
index 5d505b1c84..f2644be41e 100644
--- a/module/custom/view/header.html.php
+++ b/module/custom/view/header.html.php
@@ -5,7 +5,7 @@
foreach($lang->custom->object as $object => $name)
{
if(strpos('project|product', $object) !== false) common::printLink('custom', $object, "", "{$lang->custom->$object}", '', "class='btn btn-link' id='{$object}Tab'");
- if(strpos('project|product', $object) === false) common::printLink('custom', 'set', "module=$object", "{$name}", '', "class='btn btn-link' id='{$object}Tab'");
+ if(strpos('project|product', $object) === false) common::printLink('custom', 'set', "module=$object&field=" . key($lang->custom->{$object}->fields), "{$name}", '', "class='btn btn-link' id='{$object}Tab'");
}
foreach($lang->custom->system as $sysObject)
diff --git a/module/testcase/model.php b/module/testcase/model.php
index 1c0048ec8d..f96178707b 100644
--- a/module/testcase/model.php
+++ b/module/testcase/model.php
@@ -1275,6 +1275,7 @@ class testcaseModel extends model
$libCases = $this->dao->select('*')->from(TABLE_CASE)->where('deleted')->eq(0)->andWhere('id')->in($data->caseIdList)->fetchAll('id');
$libSteps = $this->dao->select('*')->from(TABLE_CASESTEP)->where('`case`')->in($data->caseIdList)->orderBy('id')->fetchGroup('case');
+ $libFiles = $this->dao->select('*')->from(TABLE_FILE)->where('objectID')->in($data->caseIdList)->andWhere('objectType')->eq('testcase')->fetchGroup('objectID', 'id');
foreach($libCases as $libCaseID => $case)
{
$case->fromCaseID = $case->id;
@@ -1298,16 +1299,17 @@ class testcaseModel extends model
$this->dao->insert(TABLE_CASESTEP)->data($step)->exec();
}
}
+
/* Fix bug #1518. */
- $oldFile = $this->dao->select('*')->from(TABLE_FILE)->where('objectID')->eq($case->fromCaseID)->fetchAll();
- foreach($oldFile as $fileID => $File)
+ $oldFiles = zget($libFiles, $libCaseID, array());
+ foreach($oldFiles as $fileID => $file)
{
- $File->objectID = $caseID;
- $File->addedBy = $this->app->user->account;
- $File->addedDate = helper::today();
- $File->downloads = 0;
- unset($File->id);
- $this->dao->insert(TABLE_FILE)->data($File)->exec();
+ $file->objectID = $caseID;
+ $file->addedBy = $this->app->user->account;
+ $file->addedDate = helper::now();
+ $file->downloads = 0;
+ unset($file->id);
+ $this->dao->insert(TABLE_FILE)->data($file)->exec();
}
$this->loadModel('action')->create('case', $caseID, 'fromlib', '', $case->lib);
}