Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms
This commit is contained in:
@@ -15,6 +15,15 @@ unset($lang->action->dynamicAction->case);
|
||||
unset($lang->action->dynamicAction->testreport);
|
||||
unset($lang->action->dynamicAction->testsuite);
|
||||
unset($lang->action->dynamicAction->caselib);
|
||||
unset($lang->action->dynamicAction->issue);
|
||||
unset($lang->action->dynamicAction->risk);
|
||||
unset($lang->action->dynamicAction->opportunity);
|
||||
unset($lang->action->dynamicAction->researchplan);
|
||||
unset($lang->action->dynamicAction->researchreport);
|
||||
unset($lang->action->dynamicAction->meeting);
|
||||
unset($lang->action->dynamicAction->auditplan);
|
||||
unset($lang->action->dynamicAction->pssp);
|
||||
unset($lang->action->dynamicAction->nc);
|
||||
|
||||
$lang->action->dynamicAction->task = array();
|
||||
$lang->action->dynamicAction->task['opened'] = 'Create Task';
|
||||
|
||||
@@ -15,6 +15,15 @@ unset($lang->action->dynamicAction->case);
|
||||
unset($lang->action->dynamicAction->testreport);
|
||||
unset($lang->action->dynamicAction->testsuite);
|
||||
unset($lang->action->dynamicAction->caselib);
|
||||
unset($lang->action->dynamicAction->issue);
|
||||
unset($lang->action->dynamicAction->risk);
|
||||
unset($lang->action->dynamicAction->opportunity);
|
||||
unset($lang->action->dynamicAction->researchplan);
|
||||
unset($lang->action->dynamicAction->researchreport);
|
||||
unset($lang->action->dynamicAction->meeting);
|
||||
unset($lang->action->dynamicAction->auditplan);
|
||||
unset($lang->action->dynamicAction->pssp);
|
||||
unset($lang->action->dynamicAction->nc);
|
||||
|
||||
$lang->action->dynamicAction->task = array();
|
||||
$lang->action->dynamicAction->task['opened'] = '创建任务';
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
$lang->feedback->typeList = array();
|
||||
$lang->feedback->typeList[''] = '';
|
||||
$lang->feedback->typeList['story'] = '目标';
|
||||
$lang->feedback->typeList['task'] = '任务';
|
||||
$lang->feedback->typeList['todo'] = '待办';
|
||||
@@ -5,6 +5,6 @@ $config->task->datatable->defaultField = array('id', 'pri', 'name', 'status', 'a
|
||||
|
||||
$config->task->datatable->fieldList['lane']['title'] = 'lane';
|
||||
$config->task->datatable->fieldList['lane']['fixed'] = 'no';
|
||||
$config->task->datatable->fieldList['lane']['width'] = 'auto';
|
||||
$config->task->datatable->fieldList['lane']['width'] = '100';
|
||||
$config->task->datatable->fieldList['lane']['required'] = 'no';
|
||||
$config->task->datatable->fieldList['lane']['sort'] = 'no';
|
||||
@@ -1660,7 +1660,9 @@ class baseRouter
|
||||
$modelLines .= "class $tmpModelClass extends $modelClass \n{\n";
|
||||
|
||||
/* 将扩展文件的代码合并到代码中。Cycle all the extension files and merge them into model lines. */
|
||||
foreach($extFiles as $extFile) $modelLines .= self::removePHPTAG($extFile);
|
||||
$extModels = array();
|
||||
foreach($extFiles as $extFile) $extModels[basename($extFile)] = $extFile;
|
||||
foreach($extModels as $extModel) $modelLines .= self::removePHPTAG($extModel);
|
||||
|
||||
/* 做个标记,方便后面替换代码使用。Make a mark for replacing codes. */
|
||||
$replaceMark = '//**//';
|
||||
|
||||
@@ -137,7 +137,7 @@ class control extends baseControl
|
||||
{
|
||||
$installedVersion = $this->loadModel('setting')->getVersion();
|
||||
|
||||
if(is_numeric($installedVersion[0]) and $this->config->edition == 'max')
|
||||
if($installedVersion[0] != 'm' and $this->config->edition == 'max')
|
||||
{
|
||||
if($this->config->systemMode == 'classic' and $this->app->getModuleName() != 'upgrade')
|
||||
{
|
||||
@@ -393,7 +393,7 @@ class control extends baseControl
|
||||
if($action->extensionType == 'none' and $action->buildin == 1) return false;
|
||||
|
||||
$flow = $this->dao->select('*')->from(TABLE_WORKFLOW)->where('module')->eq($this->moduleName)->fetch();
|
||||
$fields = $this->workflowaction->getFields($this->moduleName, $this->methodName);
|
||||
$fields = $this->loadModel('workflowaction')->getFields($this->moduleName, $this->methodName);
|
||||
$layouts = $this->loadModel('workflowlayout')->getFields($this->moduleName, $this->methodName);
|
||||
$rules = $this->dao->select('*')->from(TABLE_WORKFLOWRULE)->orderBy('id_desc')->fetchAll('id');
|
||||
|
||||
|
||||
@@ -359,6 +359,7 @@ function loadExecutionRelated(executionID)
|
||||
loadTestTasks($('#product').val());
|
||||
loadProjectTeamMembers($('#project').val());
|
||||
}
|
||||
notice();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -615,7 +616,6 @@ function loadTestTasks(productID, executionID)
|
||||
*/
|
||||
function notice()
|
||||
{
|
||||
$('#buildBoxActions').empty().hide();
|
||||
if($('#openedBuild').find('option').length <= 1)
|
||||
{
|
||||
var html = '';
|
||||
@@ -642,7 +642,6 @@ function notice()
|
||||
if($bba.length)
|
||||
{
|
||||
$bba.html(html);
|
||||
$bba.show();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -364,7 +364,7 @@ if($this->app->tab == 'project') js::set('objectID', $projectID);
|
||||
</div>
|
||||
</div>
|
||||
<?php js::set('bugModule', $lang->bug->module);?>
|
||||
<?php js::set('bugExecution', $lang->bug->execution);?>
|
||||
<?php js::set('bugExecution', (isset($project->model) and $project->model == 'kanban') ? $lang->bug->kanban : $lang->bug->execution);?>
|
||||
<?php js::set('systemMode', $config->systemMode);?>
|
||||
<script>
|
||||
$(function(){parent.$('body.hide-modal-close').removeClass('hide-modal-close');})
|
||||
|
||||
@@ -117,3 +117,5 @@
|
||||
.kanban-card .releaseTitle .icon, .kanban-card .title .icon, .kanban-card .productplanTitle .icon, .kanban-card .title .icon, .kanban-card .buildTitle .icon{padding-right: 5px;}
|
||||
.kanban-card .label-finish {margin-right: 7px; margin-top: -1px; padding: 3px 5px; float: left; background-color:#2a5f29;}
|
||||
.kanban-card .releaseTitle, .kanban-card .productplanTitle {width: 100%; float: left;}
|
||||
|
||||
@-moz-document url-prefix(){ .region .kanban-lane-items{scrollbar-width:thin; padding:5px 0px 5px 5px !important;} .region .kanban-card .info .user{right: -6px !important;}}
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
foreach($assignedToList as $account)
|
||||
{
|
||||
if($count > 2) continue;
|
||||
echo html::smallAvatar(array('avatar' => $usersAvatar[$account], 'account' => $account), 'avatar-circle avatar-' . zget($userIdPairs, $account));
|
||||
echo html::smallAvatar(array('avatar' => $usersAvatar[$account], 'account' => $account, 'name' => $users[$account]), 'avatar-circle');
|
||||
$count ++;
|
||||
}
|
||||
?>
|
||||
|
||||
+12
-2
@@ -408,13 +408,23 @@ EOF;
|
||||
/* Get tasks. */
|
||||
$tasks = $this->loadModel('task')->getUserTasks($this->app->user->account, $type, 0, $pager, $sort);
|
||||
|
||||
$parents = array();
|
||||
$parents = array();
|
||||
$executionIDList = array();
|
||||
foreach($tasks as $task)
|
||||
{
|
||||
if($this->config->systemMode == 'new') $executionIDList[$task->execution] = $task->execution;
|
||||
if($task->parent > 0) $parents[$task->parent] = $task->parent;
|
||||
}
|
||||
$parents = $this->dao->select('*')->from(TABLE_TASK)->where('id')->in($parents)->fetchAll('id');
|
||||
|
||||
if($this->config->systemMode == 'new')
|
||||
{
|
||||
$projects = $this->dao->select('t1.id,t1.name,t2.id as execution')->from(TABLE_PROJECT)->alias('t1')
|
||||
->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.id=t2.parent')
|
||||
->where('t2.id')->in($executionIDList)
|
||||
->fetchAll('execution');
|
||||
}
|
||||
|
||||
foreach($tasks as $task)
|
||||
{
|
||||
if($task->parent > 0)
|
||||
@@ -447,10 +457,10 @@ EOF;
|
||||
$this->view->recPerPage = $recPerPage;
|
||||
$this->view->pageID = $pageID;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->projects = $this->loadModel('project')->getPairsByProgram();
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->pager = $pager;
|
||||
$this->view->mode = 'task';
|
||||
$this->view->projects = isset($projects) ? $projects : array();
|
||||
|
||||
if($this->app->viewType == 'json') $this->view->tasks = array_values($this->view->tasks);
|
||||
$this->display();
|
||||
|
||||
@@ -10,8 +10,8 @@ $lang->my->work = 'Work';
|
||||
$lang->my->contribute = 'Contribute';
|
||||
$lang->my->task = 'My Tasks';
|
||||
$lang->my->bug = 'My Bugs';
|
||||
$lang->my->testTask = 'My Builds';
|
||||
$lang->my->testCase = 'My Cases';
|
||||
$lang->my->myTestTask = 'My Builds';
|
||||
$lang->my->myTestCase = 'My Cases';
|
||||
$lang->my->story = 'My Stories';
|
||||
$lang->my->doc = "My Docs";
|
||||
$lang->my->createProgram = 'Create Program';
|
||||
|
||||
@@ -100,7 +100,11 @@
|
||||
<?php if(!empty($task->children)) echo '<a class="task-toggle" data-id="' . $task->id . '"><i class="icon icon-angle-double-right"></i></a>';?>
|
||||
</td>
|
||||
<?php if($config->systemMode == 'new'):?>
|
||||
<td class='c-project' title="<?php echo $task->projectName;?>"><?php echo html::a($this->createLink('project', 'index', "projectID=$task->project"), $task->projectName);?></td>
|
||||
<?php $projectName = isset($projects[$task->execution]->name) ? $projects[$task->execution]->name : '';?>
|
||||
<?php $projectID = isset($projects[$task->execution]->id) ? $projects[$task->execution]->id : 0;?>
|
||||
<td class='c-project' title="<?php echo $projectName?>">
|
||||
<?php echo ($projectName and $projectID) ? html::a($this->createLink('project', 'index', "projectID=$projectID"), $projectName) : '';?>
|
||||
</td>
|
||||
<?php endif;?>
|
||||
<td class='c-project' title="<?php echo $task->executionName;?>"><?php echo html::a($this->createLink('execution', 'task', "executionID=$task->execution"), $task->executionName, '');?></td>
|
||||
<?php if($type != 'openedBy'): ?>
|
||||
@@ -166,7 +170,11 @@
|
||||
<?php echo html::a($this->createLink('task', 'view', "taskID=$child->id", '', '', $child->project), $child->name, null, "style='color: $child->color'");?>
|
||||
</td>
|
||||
<?php if($config->systemMode == 'new'):?>
|
||||
<td class='c-project' title="<?php echo $child->projectName;?>"><?php echo html::a($this->createLink('project', 'view', "projectID=$child->project"), $child->projectName);?></td>
|
||||
<?php $projectName = isset($projects[$child->execution]->name) ? $projects[$child->execution]->name : '';?>
|
||||
<?php $projectID = isset($projects[$child->execution]->id) ? $projects[$child->execution]->id : 0;?>
|
||||
<td class='c-project' title="<?php echo $projectName;?>">
|
||||
<?php echo ($projectName and $projectID) ? html::a($this->createLink('project', 'view', "projectID=$projectID"), $projectName) : '';?>
|
||||
</td>
|
||||
<?php endif;?>
|
||||
<td class='c-project' title="<?php echo $child->projectName;?>"><?php echo html::a($this->createLink('execution', 'task', "executionID=$child->project"), $child->executionName, '');?></td>
|
||||
<?php if($type != 'openedBy'): ?>
|
||||
|
||||
@@ -973,6 +973,12 @@ class product extends control
|
||||
*/
|
||||
public function ajaxGetExecutions($productID, $projectID = 0, $branch = 0, $number = '', $executionID = 0)
|
||||
{
|
||||
if($this->app->tab == 'execution' and $this->session->execution)
|
||||
{
|
||||
$execution = $this->loadModel('execution')->getByID($this->session->execution);
|
||||
if($execution->type == 'kanban') $projectID = $execution->project;
|
||||
}
|
||||
|
||||
$executions = $this->product->getExecutionPairsByProduct($productID, $branch, 'id_desc', $projectID);
|
||||
if($this->app->getViewType() == 'json') return print(json_encode($executions));
|
||||
|
||||
|
||||
@@ -1227,7 +1227,7 @@ class productModel extends model
|
||||
$executions = $this->dao->select('t2.id,t2.project,t2.name,t2.grade,t2.parent')->from(TABLE_PROJECTPRODUCT)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
|
||||
->where('t1.product')->eq($productID)
|
||||
->andWhere('t2.type')->in('stage,sprint')
|
||||
->andWhere('t2.type')->in('stage,sprint,kanban')
|
||||
->beginIF($branch)->andWhere('t1.branch')->in($branch)->fi()
|
||||
->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->sprints)->fi()
|
||||
->andWhere('t2.deleted')->eq('0')
|
||||
@@ -1712,7 +1712,7 @@ class productModel extends model
|
||||
$executionListKey = $this->config->systemMode == 'new' ? 'project' : 'productID';
|
||||
$executionList = $this->dao->select('t1.product as productID,t2.*')->from(TABLE_PROJECTPRODUCT)->alias('t1')
|
||||
->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.project=t2.id')
|
||||
->where('type')->in('stage,sprint')
|
||||
->where('type')->in('stage,sprint,kanban')
|
||||
->beginIF($this->config->systemMode == 'new')->andWhere('t2.project')->in(array_keys($projectList))->fi()
|
||||
->beginIF(!$this->app->user->admin)->andWhere('t1.project')->in($this->app->user->view->sprints)->fi()
|
||||
->andWhere('t1.product')->in(array_keys($productList))
|
||||
|
||||
@@ -82,6 +82,7 @@ class programModel extends model
|
||||
/* When mode equals assign and programID equals 0, you can query the standalone product. */
|
||||
$products = $this->dao->select('*')->from(TABLE_PRODUCT)
|
||||
->where('deleted')->eq(0)
|
||||
->andWhere('vision')->eq($this->config->vision)
|
||||
->beginIF($mode == 'assign')->andWhere('program')->eq($programID)->fi()
|
||||
->beginIF(strpos($status, 'noclosed') !== false)->andWhere('status')->ne('closed')->fi()
|
||||
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->products)->fi()
|
||||
|
||||
@@ -118,15 +118,16 @@
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php $class = $program->model == 'kanban' ? 'disabled' : '';?>
|
||||
<?php common::printIcon('project', 'edit', "projectID=$program->id", $program, 'list', 'edit', '', 'iframe', true, '', '', $program->id);?>
|
||||
<?php common::printIcon('project', 'manageMembers', "projectID=$program->id", $program, 'list', 'group', '', '', '', 'data-app="project"', '', $program->id);?>
|
||||
<?php common::printIcon('project', 'group', "projectID=$program->id", $program, 'list', 'lock', '', '', '', 'data-app="project"', '', $program->id);?>
|
||||
<?php common::printIcon('project', 'manageMembers', "projectID=$program->id", $program, 'list', 'group', '', "$class", '', 'data-app="project"', '', $program->id);?>
|
||||
<?php common::printIcon('project', 'group', "projectID=$program->id", $program, 'list', 'lock', '', "$class", '', 'data-app="project"', '', $program->id);?>
|
||||
<?php if(common::hasPriv('project', 'manageProducts') || common::hasPriv('project', 'whitelist') || common::hasPriv('project', 'delete')):?>
|
||||
<div class='btn-group'>
|
||||
<button type='button' class='btn dropdown-toggle' data-toggle='dropdown' title="<?php echo $this->lang->more;?>"><i class='icon-more-alt'></i></button>
|
||||
<ul class='dropdown-menu pull-right text-center' role='menu'>
|
||||
<?php common::printIcon('project', 'manageProducts', "projectID=$program->id&from=browse", $program, 'list', 'link', '', '', '', "data-app='project'", '', $program->id);?>
|
||||
<?php common::printIcon('project', 'whitelist', "projectID=$program->id&module=project&from=browse", $program, 'list', 'shield-check', '', '', '', "data-app='project'", '', $program->id);?>
|
||||
<?php common::printIcon('project', 'manageProducts', "projectID=$program->id&from=browse", $program, 'list', 'link', '', "$class", '', "data-app='project'", '', $program->id);?>
|
||||
<?php common::printIcon('project', 'whitelist', "projectID=$program->id&module=project&from=browse", $program, 'list', 'shield-check', '', "$class", '', "data-app='project'", '', $program->id);?>
|
||||
<?php if(common::hasPriv('project','delete')) echo html::a($this->createLink("project", "delete", "projectID=$program->id"), "<i class='icon-trash'></i>", 'hiddenwin', "class='btn' title='{$this->lang->delete}' data-group='program'");?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -326,7 +326,7 @@ class taskModel extends model
|
||||
$data[$i]->openedBy = $this->app->user->account;
|
||||
$data[$i]->openedDate = $now;
|
||||
$data[$i]->parent = $tasks->parent[$i];
|
||||
$data[$i]->vision = isset($tasks->vision[$i]) ? $tasks->vision[$i] : 'common';
|
||||
$data[$i]->vision = isset($tasks->vision[$i]) ? $tasks->vision[$i] : 'rnd';
|
||||
if($story) $data[$i]->storyVersion = $this->loadModel('story')->getVersion($data[$i]->story);
|
||||
if($assignedTo) $data[$i]->assignedDate = $now;
|
||||
if(strpos($this->config->task->create->requiredFields, 'estStarted') !== false and empty($estStarted)) $data[$i]->estStarted = '';
|
||||
@@ -3152,6 +3152,7 @@ class taskModel extends model
|
||||
$value = round($task->$id, 1);
|
||||
$title = " title='{$value} {$this->lang->execution->workHour}'";
|
||||
}
|
||||
if($id == 'lane') $title = " title='{$task->lane}'";
|
||||
|
||||
echo "<td class='" . $class . "'" . $title . ">";
|
||||
if($this->config->edition != 'open') $this->loadModel('flow')->printFlowCell('task', $task, $id);
|
||||
@@ -3220,7 +3221,7 @@ class taskModel extends model
|
||||
$this->printAssignedHtml($task, $users);
|
||||
break;
|
||||
case 'lane':
|
||||
echo trim($task->lane);
|
||||
echo mb_substr($task->lane, 0, 8);
|
||||
break;
|
||||
case 'assignedDate':
|
||||
echo substr($task->assignedDate, 5, 11);
|
||||
|
||||
@@ -780,7 +780,7 @@ class testcase extends control
|
||||
{
|
||||
$changes = array();
|
||||
$files = array();
|
||||
if($comment == false)
|
||||
if($comment == false or $comment == 'false')
|
||||
{
|
||||
$changes = $this->testcase->update($caseID);
|
||||
if(dao::isError()) return print(js::error(dao::getError()));
|
||||
|
||||
@@ -367,10 +367,15 @@ function loadStories(productID, moduleID, num)
|
||||
$.get(storyLink, function(stories)
|
||||
{
|
||||
if(!stories) modules = '<select id="story' + num + '" name="story[' + num + ']" class="form-control"></select>';
|
||||
$('#story' + num).replaceWith(stories);
|
||||
$('#story' + num + "_chosen").remove();
|
||||
$('#story' + num).next('.picker').remove();
|
||||
$('#story' + num).attr('name', 'story[' + num + ']');
|
||||
$('#story' + num).chosen();
|
||||
for(var i = num; i < 10 ; i ++)
|
||||
{
|
||||
if(i != num && $('#module' + i).val() != 'ditto') break;
|
||||
var nowStories = stories.replaceAll('story' + num, 'story' + i);
|
||||
$('#story' + i).replaceWith(nowStories);
|
||||
$('#story' + i + "_chosen").remove();
|
||||
$('#story' + i).next('.picker').remove();
|
||||
$('#story' + i).attr('name', 'story[' + i + ']');
|
||||
$('#story' + i).chosen();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ $lang->testreport->legacyBugTip = "Bug状态是激活,或Bug的解决时间
|
||||
$lang->testreport->activatedBugTip = "在测试单时间范围内被激活的Bug数量。";
|
||||
$lang->testreport->fromCaseBugTip = "测试时间范围内,用例执行失败后创建的Bug。";
|
||||
$lang->testreport->errorTrunk = "主干版本不能创建测试报告,请修改关联版本!";
|
||||
$lang->testreport->noTestTask = "该{$lang->productCommon}下还没有关联非Trunk的测试单,不能创建报告。请先创建测试单,再创建。";
|
||||
$lang->testreport->noTestTask = "该{$lang->productCommon}下还没有关联的测试单,不能创建报告。请先创建测试单,再创建。";
|
||||
$lang->testreport->noObjectID = "没有选定测试单或{$lang->executionCommon},无法创建测试报告!";
|
||||
$lang->testreport->moreProduct = "只能对同一个{$lang->productCommon}生成测试报告。";
|
||||
$lang->testreport->hiddenCase = "隐藏 %s 个用例";
|
||||
|
||||
@@ -50,9 +50,10 @@ function loadList(type, id)
|
||||
$(divClass).html($(divID).html());
|
||||
}
|
||||
|
||||
if(nameBoxLabel)
|
||||
|
||||
if(typeof(nameBoxLabel) != "undefined")
|
||||
{
|
||||
if(type == 'custom')
|
||||
if(type == 'custom' || (typeof(vision) != "undefined" && vision == 'rnd'))
|
||||
{
|
||||
$('#nameBoxLabel').text(nameBoxLabel.custom);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<?php js::set('moduleList', $config->todo->moduleList)?>
|
||||
<?php js::set('objectsMethod', $config->todo->getUserObjectsMethod)?>
|
||||
<?php js::set('nameBoxLabel', array('custom' => $lang->todo->name, 'idvalue' => $lang->todo->idvalue));?>
|
||||
<?php js::set('vision', $config->vision);?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<?php js::set('objectsMethod', $config->todo->getUserObjectsMethod)?>
|
||||
<?php js::set('idvalue', $todo->idvalue);?>
|
||||
<?php js::set('nameBoxLabel', array('custom' => $lang->todo->name, 'idvalue' => $lang->todo->idvalue));?>
|
||||
<?php js::set('vision', $config->vision);?>
|
||||
<?php if(common::checkNotCN()):?>
|
||||
<style> label.col-sm-1{width:100px;} </style>
|
||||
<?php endif;?>
|
||||
@@ -128,7 +129,7 @@
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<div class="row form-group">
|
||||
<label id='nameBoxLabel' class="col-sm-1"><?php echo $todo->type == 'custom' ? $lang->todo->name : $lang->todo->idvalue;?></label>
|
||||
<label id='nameBoxLabel' class="col-sm-1"><?php echo ($todo->type == 'custom' or $config->vision == 'rnd') ? $lang->todo->name : $lang->todo->idvalue;?></label>
|
||||
<div class="col-sm-10">
|
||||
<div id='nameBox' class='hidden'><?php echo html::input('name', $todo->name, "class='form-control'");?></div>
|
||||
<div class='input-group title-group required'>
|
||||
|
||||
@@ -220,6 +220,7 @@ $lang->user->error = new stdclass();
|
||||
$lang->user->error->account = "ID %s,account must be >= 3 letters, underline or numbers";
|
||||
$lang->user->error->accountDupl = "ID %s,account is used.";
|
||||
$lang->user->error->realname = "ID %s,must be real name";
|
||||
$lang->user->error->visions = "ID %s,must be version type";
|
||||
$lang->user->error->password = "ID %s,password must be >= 6 characters.";
|
||||
$lang->user->error->mail = "ID %s,enter valid Email address";
|
||||
$lang->user->error->reserved = "ID %s,account is reserved.";
|
||||
|
||||
@@ -220,6 +220,7 @@ $lang->user->error = new stdclass();
|
||||
$lang->user->error->account = "【ID %s】的用户名应该为:三位以上的英文、数字或下划线的组合";
|
||||
$lang->user->error->accountDupl = "【ID %s】的用户名已经存在";
|
||||
$lang->user->error->realname = "【ID %s】的真实姓名必须填写";
|
||||
$lang->user->error->visions = "【ID %s】的版本类型必须填写";
|
||||
$lang->user->error->password = "【ID %s】的密码必须为六位以上";
|
||||
$lang->user->error->mail = "【ID %s】的邮箱地址不正确";
|
||||
$lang->user->error->reserved = "【ID %s】的用户名已被系统预留";
|
||||
|
||||
+14
-12
@@ -102,6 +102,7 @@ class userModel extends model
|
||||
->beginIF(strpos($params, 'nodeleted') !== false or empty($this->config->user->showDeleted))->andWhere('deleted')->eq('0')->fi()
|
||||
->beginIF(strpos($params, 'all') === false)->andWhere('type')->eq($type)->fi()
|
||||
->beginIF($accounts)->andWhere('account')->in($accounts)->fi()
|
||||
->beginIF($this->config->vision)->andWhere("CONCAT(',', visions, ',')")->like("%,{$this->config->vision},%")->fi()
|
||||
->orderBy($orderBy)
|
||||
->beginIF($maxCount)->limit($maxCount)->fi()
|
||||
->fetchAll($keyField);
|
||||
@@ -375,7 +376,7 @@ class userModel extends model
|
||||
*/
|
||||
public function batchCreate()
|
||||
{
|
||||
if(empty($_POST['verifyPassword']) or $this->post->verifyPassword != md5($this->app->user->password . $this->session->rand)) return print(js::alert($this->lang->user->error->verifyPassword));
|
||||
if(empty($_POST['verifyPassword']) or $this->post->verifyPassword != md5($this->app->user->password . $this->session->rand)) helper::end(js::alert($this->lang->user->error->verifyPassword));
|
||||
|
||||
$users = fixer::input('post')->get();
|
||||
$data = array();
|
||||
@@ -385,24 +386,25 @@ class userModel extends model
|
||||
$users->account[$i] = trim($users->account[$i]);
|
||||
if($users->account[$i] != '')
|
||||
{
|
||||
if(strtolower($users->account[$i]) == 'guest') return print(js::error(sprintf($this->lang->user->error->reserved, $i + 1)));
|
||||
if(strtolower($users->account[$i]) == 'guest') helper::end(js::error(sprintf($this->lang->user->error->reserved, $i + 1)));
|
||||
$account = $this->dao->select('account')->from(TABLE_USER)->where('account')->eq($users->account[$i])->fetch();
|
||||
if($account) return print(js::error(sprintf($this->lang->user->error->accountDupl, $i + 1)));
|
||||
if(in_array($users->account[$i], $accounts)) return print(js::error(sprintf($this->lang->user->error->accountDupl, $i + 1)));
|
||||
if(!validater::checkAccount($users->account[$i])) return print(js::error(sprintf($this->lang->user->error->account, $i + 1)));
|
||||
if($users->realname[$i] == '') return print(js::error(sprintf($this->lang->user->error->realname, $i + 1)));
|
||||
if($users->email[$i] and !validater::checkEmail($users->email[$i])) return print(js::error(sprintf($this->lang->user->error->mail, $i + 1)));
|
||||
if($account) helper::end(js::error(sprintf($this->lang->user->error->accountDupl, $i + 1)));
|
||||
if(in_array($users->account[$i], $accounts)) helper::end(js::error(sprintf($this->lang->user->error->accountDupl, $i + 1)));
|
||||
if(!validater::checkAccount($users->account[$i])) helper::end(js::error(sprintf($this->lang->user->error->account, $i + 1)));
|
||||
if($users->realname[$i] == '') helper::end(js::error(sprintf($this->lang->user->error->realname, $i + 1)));
|
||||
if($users->visions[$i] == '') helper::end(js::error(sprintf($this->lang->user->error->visions, $i + 1)));
|
||||
if($users->email[$i] and !validater::checkEmail($users->email[$i])) helper::end(js::error(sprintf($this->lang->user->error->mail, $i + 1)));
|
||||
$users->password[$i] = (isset($prev['password']) and $users->ditto[$i] == 'on' and !$this->post->password[$i]) ? $prev['password'] : $this->post->password[$i];
|
||||
if(!validater::checkReg($users->password[$i], '|(.){6,}|')) return print(js::error(sprintf($this->lang->user->error->password, $i + 1)));
|
||||
if(!validater::checkReg($users->password[$i], '|(.){6,}|')) helper::end(js::error(sprintf($this->lang->user->error->password, $i + 1)));
|
||||
$role = $users->role[$i] == 'ditto' ? (isset($prev['role']) ? $prev['role'] : '') : $users->role[$i];
|
||||
$visions = in_array('ditto', $users->visions[$i]) ? (isset($prev['visions']) ? $prev['visions'] : array()) : $users->visions[$i];
|
||||
|
||||
/* Check weak and common weak password. */
|
||||
if(isset($this->config->safe->mode) and $this->computePasswordStrength($users->password[$i]) < $this->config->safe->mode) return print(js::error(sprintf($this->lang->user->error->weakPassword, $i + 1)));
|
||||
if(isset($this->config->safe->mode) and $this->computePasswordStrength($users->password[$i]) < $this->config->safe->mode) helper::end(js::error(sprintf($this->lang->user->error->weakPassword, $i + 1)));
|
||||
if(!empty($this->config->safe->changeWeak))
|
||||
{
|
||||
if(!isset($this->config->safe->weak)) $this->app->loadConfig('admin');
|
||||
if(strpos(",{$this->config->safe->weak},", ",{$users->password[$i]},") !== false) return print(js::error(sprintf($this->lang->user->error->dangerPassword, $i + 1, $this->config->safe->weak)));
|
||||
if(strpos(",{$this->config->safe->weak},", ",{$users->password[$i]},") !== false) helper::end(js::error(sprintf($this->lang->user->error->dangerPassword, $i + 1, $this->config->safe->weak)));
|
||||
}
|
||||
|
||||
$data[$i] = new stdclass();
|
||||
@@ -438,7 +440,7 @@ class userModel extends model
|
||||
if(!isset($data[$i]->$field)) continue;
|
||||
if(!empty($data[$i]->$field)) continue;
|
||||
|
||||
return print(js::error(sprintf($this->lang->error->notempty, $this->lang->user->$field)));
|
||||
helper::end(js::error(sprintf($this->lang->error->notempty, $this->lang->user->$field)));
|
||||
}
|
||||
|
||||
/* Change for append field, such as feedback. */
|
||||
@@ -485,7 +487,7 @@ class userModel extends model
|
||||
if(dao::isError())
|
||||
{
|
||||
echo js::error(dao::getError());
|
||||
return print(js::reload('parent'));
|
||||
helper::end(js::reload('parent'));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user