* code for task #8496.
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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'] = '关闭的区块';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
foreach($lang->custom->object as $object => $name)
|
||||
{
|
||||
if(strpos('project|product', $object) !== false) common::printLink('custom', $object, "", "<span class='text'>{$lang->custom->$object}</span>", '', "class='btn btn-link' id='{$object}Tab'");
|
||||
if(strpos('project|product', $object) === false) common::printLink('custom', 'set', "module=$object", "<span class='text'>{$name}</span>", '', "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), "<span class='text'>{$name}</span>", '', "class='btn btn-link' id='{$object}Tab'");
|
||||
}
|
||||
|
||||
foreach($lang->custom->system as $sysObject)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user