Merge branch 'master' of github.com:easysoft/zentaopms

This commit is contained in:
leiyong
2020-11-24 16:49:32 +08:00
13 changed files with 77 additions and 36 deletions
+1
View File
@@ -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');
+7 -2
View File
@@ -12,6 +12,7 @@ $config->custom->canAdd['program'] = 'unitList';
$config->custom->noModuleMenu = array();
$config->custom->requiredModules[10] = 'program';
$config->custom->requiredModules[15] = 'product';
$config->custom->requiredModules[20] = 'story';
$config->custom->requiredModules[25] = 'productplan';
@@ -32,8 +33,12 @@ $config->custom->requiredModules[80] = 'doc';
$config->custom->requiredModules[85] = 'user';
$config->custom->fieldList['product']['create'] = 'line,PO,QD,RD,type,desc';
$config->custom->fieldList['product']['edit'] = 'line,PO,QD,RD,type,desc,status';
$config->custom->fieldList['program']['PGMCreate'] = 'budget,PM,desc';
$config->custom->fieldList['program']['PGMEdit'] = 'budget,PM,desc';
$config->custom->fieldList['program']['PRJCreate'] = 'budget,PM,desc';
$config->custom->fieldList['program']['PRJEdit'] = 'budget,PM,desc';
$config->custom->fieldList['product']['create'] = 'PO,QD,RD,type,desc';
$config->custom->fieldList['product']['edit'] = 'PO,QD,RD,type,desc,status';
$config->custom->fieldList['story']['create'] = 'module,plan,source,pri,estimate,keywords';
$config->custom->fieldList['story']['change'] = 'comment';
$config->custom->fieldList['story']['close'] = 'comment';
+2 -2
View File
@@ -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();
+1 -2
View File
@@ -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'] = '关闭的区块';
+6 -1
View File
@@ -476,6 +476,12 @@ class customModel extends model
if($moduleName == 'user' and $method == 'edit' and strpos($this->config->user->contactField, $fieldName) === false) continue;
if($fieldName == 'comment') $fields[$fieldName] = $this->lang->comment;
if(isset($moduleLang->$fieldName) and is_string($moduleLang->$fieldName)) $fields[$fieldName] = $moduleLang->$fieldName;
if($moduleName == 'program')
{
$fieldKey = substr($method, 0, 3) . ucfirst($fieldName);
if(isset($moduleLang->$fieldKey) and is_string($moduleLang->$fieldKey)) $fields[$fieldName] = $moduleLang->$fieldKey;
}
}
}
return $fields;
@@ -502,7 +508,6 @@ class customModel extends model
{
foreach($data->requiredFields as $method => $fields)
{
$method = strtolower($method);
$systemField = $this->config->$moduleName->$method->requiredFields;
$fields = join(',', $fields);
+1 -1
View File
@@ -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)
+23 -8
View File
@@ -145,8 +145,11 @@ class programModel extends model
}
/* Redefines the language entries for the fields in the project table. */
$this->lang->project->code = $this->lang->program->PGMCode;
$this->lang->project->name = $this->lang->program->PGMName;
foreach(explode(',', $this->config->program->PGMCreate->requiredFields) as $fieldName)
{
$fieldKey = 'PGM' . ucfirst($fieldName);
if(isset($this->lang->program->$fieldKey)) $this->lang->project->$fieldName = $this->lang->program->$fieldKey;
}
$program = $this->loadModel('file')->processImgURL($program, $this->config->program->editor->pgmcreate['id'], $this->post->uid);
$this->dao->insert(TABLE_PROGRAM)->data($program)
@@ -246,8 +249,12 @@ class programModel extends model
if(dao::isError()) return false;
/* Redefines the language entries for the fields in the project table. */
$this->lang->project->code = $this->lang->program->PGMCode;
$this->lang->project->name = $this->lang->program->PGMName;
foreach(explode(',', $this->config->program->PGMCreate->requiredFields) as $fieldName)
{
$fieldKey = 'PGM' . ucfirst($fieldName);
if(isset($this->lang->program->$fieldKey)) $this->lang->project->$fieldName = $this->lang->program->$fieldKey;
}
$this->dao->update(TABLE_PROGRAM)->data($program)
->autoCheck($skipFields = 'begin,end')
->batchcheck($this->config->program->PGMEdit->requiredFields, 'notempty')
@@ -1226,8 +1233,12 @@ class programModel extends model
if($this->post->delta == 999) $requiredFields = trim(str_replace(',end,', ',', ",{$requiredFields},"), ',');
/* Redefines the language entries for the fields in the project table. */
$this->lang->project->name = $this->lang->program->PRJName;
$this->lang->project->code = $this->lang->program->PRJCode;
foreach(explode(',', $requiredFields) as $fieldName)
{
$fieldKey = 'PRJ' . ucfirst($fieldName);
if(isset($this->lang->program->$fieldKey)) $this->lang->project->$fieldName = $this->lang->program->$fieldKey;
}
$project = $this->loadModel('file')->processImgURL($project, $this->config->program->editor->prjcreate['id'], $this->post->uid);
$this->dao->insert(TABLE_PROJECT)->data($project)
->autoCheck()
@@ -1361,8 +1372,12 @@ class programModel extends model
if($this->post->delta == 999) $requiredFields = trim(str_replace(',end,', ',', ",{$requiredFields},"), ',');
/* Redefines the language entries for the fields in the project table. */
$this->lang->project->name = $this->lang->program->PRJName;
$this->lang->project->code = $this->lang->program->PRJCode;
foreach(explode(',', $requiredFields) as $fieldName)
{
$fieldKey = 'PRJ' . ucfirst($fieldName);
if(isset($this->lang->program->$fieldKey)) $this->lang->project->$fieldName = $this->lang->program->$fieldKey;
}
$this->dao->update(TABLE_PROJECT)->data($project)
->autoCheck($skipFields = 'begin,end')
->batchcheck($requiredFields, 'notempty')
+4 -3
View File
@@ -34,6 +34,7 @@
<?php js::set('weekend', $config->project->weekend);?>
<?php js::set('holders', $lang->project->placeholder);?>
<?php js::set('errorSameProducts', $lang->project->errorSameProducts);?>
<?php $requiredFields = $config->program->PGMCreate->requiredFields;?>
<div id='mainContent' class='main-content'>
<div class='center-block'>
<div class='main-header'>
@@ -57,7 +58,7 @@
</tr>
<tr>
<th><?php echo $lang->program->PGMPM;?></th>
<td><?php echo html::select('PM', $pmUsers, '', "class='form-control chosen'");?></td>
<td><?php echo html::select('PM', $pmUsers, '', "class='form-control chosen'" . (strpos($requiredFields, 'PM') !== false ? ' required' : ''));?></td>
</tr>
<tr>
<th><?php echo $lang->program->PO;?></th>
@@ -67,7 +68,7 @@
<th><?php echo $lang->program->PGMBudget;?></th>
<td>
<div class='input-group'>
<?php echo html::input('budget', '', "class='form-control'");?>
<?php echo html::input('budget', '', "class='form-control'" . (strpos($requiredFields, 'budget') !== false ? ' required' : ''));?>
<span class='input-group-addon'></span>
<?php echo html::select('budgetUnit', $lang->program->unitList, empty($parentProgram->budgetUnit) ? 'yuan' : $parentProgram->budgetUnit, "class='form-control'");?>
</div>
@@ -97,7 +98,7 @@
<th><?php echo $lang->program->PGMDesc;?></th>
<td colspan='3'>
<?php echo $this->fetch('user', 'ajaxPrintTemplates', 'type=project&link=desc');?>
<?php echo html::textarea('desc', '', "rows='6' class='form-control kindeditor' hidefocus='true'");?>
<?php echo html::textarea('desc', '', "rows='6' class='form-control kindeditor' hidefocus='true'" . (strpos($requiredFields, 'desc') !== false ? ' required' : ''));?>
</td>
</tr>
<tr>
+4 -3
View File
@@ -14,6 +14,7 @@
<?php include '../../common/view/kindeditor.html.php';?>
<?php js::set('weekend', $config->project->weekend);?>
<?php $aclList = $program->parent ? $lang->program->subPGMAclList : $lang->program->PGMAclList;?>
<?php $requiredFields = $config->program->PGMEdit->requiredFields;?>
<div id='mainContent' class='main-content'>
<div class='center-block'>
<div class='main-header'>
@@ -36,7 +37,7 @@
</tr>
<tr>
<th><?php echo $lang->program->PGMPM;?></th>
<td><?php echo html::select('PM', $pmUsers, $program->PM, "class='form-control chosen'");?></td>
<td><?php echo html::select('PM', $pmUsers, $program->PM, "class='form-control chosen'" . (strpos($requiredFields, 'PM') !== false ? ' required' : ''));?></td>
</tr>
<tr>
<th><?php echo $lang->program->PO;?></th>
@@ -44,7 +45,7 @@
</tr>
<tr>
<th><?php echo $lang->program->PGMBudget;?></th>
<td><?php echo html::input('budget', $program->budget, "class='form-control'");?></td>
<td><?php echo html::input('budget', $program->budget, "class='form-control'" . (strpos($requiredFields, 'budget') !== false ? ' required' : ''));?></td>
<td style='float:left'><?php echo html::select('budgetUnit', $lang->program->unitList, $program->budgetUnit, "class='form-control'");?></td><td></td>
</tr>
<tr>
@@ -68,7 +69,7 @@
<th><?php echo $lang->program->PGMDesc;?></th>
<td colspan='3'>
<?php echo $this->fetch('user', 'ajaxPrintTemplates', 'type=program&link=desc');?>
<?php echo html::textarea('desc', $program->desc, "rows='6' class='form-control kindeditor' hidefocus='true'");?>
<?php echo html::textarea('desc', $program->desc, "rows='6' class='form-control kindeditor' hidefocus='true'" . (strpos($requiredFields, 'desc') !== false ? ' required' : ''));?>
</td>
</tr>
<tr>
+4 -3
View File
@@ -45,6 +45,7 @@ else
<?php js::set('from', $from);?>
<?php js::set('weekend', $config->project->weekend);?>
<?php js::set('errorSameProducts', $lang->program->errorSameProducts);?>
<?php $requiredFields = $config->program->PRJCreate->requiredFields;?>
<div id='mainContent' class='main-content'>
<div class='center-block'>
<div class='main-header'>
@@ -120,13 +121,13 @@ else
</tr>
<tr>
<th><?php echo $lang->program->PRJPM;?></th>
<td><?php echo html::select('PM', $pmUsers, '', "class='form-control chosen'");?></td>
<td><?php echo html::select('PM', $pmUsers, '', "class='form-control chosen'" . (strpos($requiredFields, 'PM') !== false ? ' required' : ''));?></td>
</tr>
<tr>
<th><?php echo $lang->program->PRJBudget;?></th>
<td>
<div class='input-group'>
<?php echo html::input('budget', '', "class='form-control'");?>
<?php echo html::input('budget', '', "class='form-control'" . (strpos($requiredFields, 'budget') !== false ? ' required' : ''));?>
<span class='input-group-addon'></span>
<?php echo html::select('budgetUnit', $lang->program->unitList, empty($parentProgram->budgetUnit) ? 'yuan' : $parentProgram->budgetUnit, "class='form-control'");?>
</div>
@@ -160,7 +161,7 @@ else
<th><?php echo $lang->program->PRJDesc;?></th>
<td colspan='3'>
<?php echo $this->fetch('user', 'ajaxPrintTemplates', 'type=project&link=desc');?>
<?php echo html::textarea('desc', '', "rows='6' class='form-control kindeditor' hidefocus='true'");?>
<?php echo html::textarea('desc', '', "rows='6' class='form-control kindeditor' hidefocus='true'" . (strpos($requiredFields, 'desc') !== false ? ' required' : ''));?>
</td>
</tr>
<tr>
+4 -3
View File
@@ -19,6 +19,7 @@
<?php js::set('projectID', $project->id);?>
<?php js::set('PGMChangeTips', $lang->program->PGMChangeTips);?>
<?php $aclList = $project->parent ? $lang->program->PGMPRJAclList : $lang->program->PRJAclList;?>
<?php $requiredFields = $config->program->PRJEdit->requiredFields;?>
<div id='mainContent' class='main-content'>
<div class='center-block'>
<div class='main-header'>
@@ -91,13 +92,13 @@
</tr>
<tr>
<th><?php echo $lang->program->PRJPM;?></th>
<td><?php echo html::select('PM', $PMUsers, $project->PM, "class='form-control chosen'");?></td>
<td><?php echo html::select('PM', $PMUsers, $project->PM, "class='form-control chosen'" . (strpos($requiredFields, 'PM') !== false ? ' required' : ''));?></td>
</tr>
<tr>
<th><?php echo $lang->program->PRJBudget;?></th>
<td>
<div class='input-group'>
<?php echo html::input('budget', $project->budget, "class='form-control'");?>
<?php echo html::input('budget', $project->budget, "class='form-control'" . (strpos($requiredFields, 'budget') !== false ? ' required' : ''));?>
<span class='input-group-addon'></span>
<?php echo html::select('budgetUnit', $lang->program->unitList, $project->budgetUnit, "class='form-control'");?>
</div>
@@ -136,7 +137,7 @@
<th><?php echo $lang->program->PRJDesc;?></th>
<td colspan='3'>
<?php echo $this->fetch('user', 'ajaxPrintTemplates', 'type=project&link=desc');?>
<?php echo html::textarea('desc', $project->desc, "rows='6' class='form-control kindeditor' hidefocus='true'");?>
<?php echo html::textarea('desc', $project->desc, "rows='6' class='form-control kindeditor' hidefocus='true'" . (strpos($requiredFields, 'desc') !== false ? ' required' : ''));?>
</td>
</tr>
<tr>
+10 -8
View File
@@ -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);
}
+10
View File
@@ -632,6 +632,16 @@ class upgradeModel extends model
$this->setWork2Full();
$this->initUserView();
$this->appendExec('20_0_alpha');
case '20_0_alpha1':
$this->saveLogs('Execute 20_0_alpha1');
if(strpos($fromVersion, '20') !== 0)
{
$this->execSQL($this->getUpgradeFile('12.4.4'));
$this->adjustPriv12_5();
}
$this->appendExec('20_0_alpha1');
}
$this->deletePatch();