Merge branch 'sprint/217_zg_61182' into 'master'
* Finish task#61182,61168 See merge request easycorp/zentaopms!4615
This commit is contained in:
@@ -139,14 +139,69 @@ class action extends control
|
|||||||
*
|
*
|
||||||
* @param int $actionID
|
* @param int $actionID
|
||||||
* @param string $browseType
|
* @param string $browseType
|
||||||
|
* @param string $confirmChange
|
||||||
* @access public
|
* @access public
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function undelete($actionID, $browseType = 'all')
|
public function undelete($actionID, $browseType = 'all', $confirmChange = 'no')
|
||||||
{
|
{
|
||||||
$oldAction = $this->action->getById($actionID);
|
$oldAction = $this->action->getById($actionID);
|
||||||
$extra = $oldAction->extra == ACTIONMODEL::BE_HIDDEN ? 'hidden' : 'all';
|
$extra = $oldAction->extra == ACTIONMODEL::BE_HIDDEN ? 'hidden' : 'all';
|
||||||
|
|
||||||
|
if(in_array($oldAction->objectType, array('program', 'project', 'execution', 'product')))
|
||||||
|
{
|
||||||
|
if($oldAction->objectType == 'product')
|
||||||
|
{
|
||||||
|
$product = $this->dao->select('*')->from(TABLE_PRODUCT)->where('id')->eq($oldAction->objectID)->fetch();
|
||||||
|
$programID = isset($product->program) ? $product->program : 0;
|
||||||
|
$repeatObject = $this->dao->select('*')->from(TABLE_PRODUCT)
|
||||||
|
->where('id')->ne($oldAction->objectID)
|
||||||
|
->andWhere("(name = '{$product->name}' and program = {$programID})", true)
|
||||||
|
->orWhere("code = '{$product->code}'")
|
||||||
|
->markRight(1)
|
||||||
|
->andWhere('deleted')->eq('0')
|
||||||
|
->fetch();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$project = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($oldAction->objectID)->fetch();
|
||||||
|
$sprintProject = isset($project->project) ? $project->project : '0';
|
||||||
|
$repeatObject = $this->dao->select('*')->from(TABLE_PROJECT)
|
||||||
|
->where('id')->ne($oldAction->objectID)
|
||||||
|
->beginIF($oldAction->objectType == 'program' or $oldAction->objectType == 'project')->andWhere("(name = '{$project->name}' and parent = {$project->parent})", true)->fi()
|
||||||
|
->beginIF($oldAction->objectType == 'execution')->andWhere("(name = '{$project->name}' and project = {$sprintProject})", true)->fi()
|
||||||
|
->beginIF($oldAction->objectType == 'project')->orWhere("(code = '{$project->code}' and model = '$project->model')")->fi()
|
||||||
|
->beginIF($oldAction->objectType == 'execution')->orWhere("code = '{$project->code}'")->fi()
|
||||||
|
->markRight(1)
|
||||||
|
->beginIF($oldAction->objectType == 'program')->andWhere('type')->eq('program')->fi()
|
||||||
|
->beginIF($oldAction->objectType == 'project')->andWhere('type')->eq('project')->fi()
|
||||||
|
->beginIF($oldAction->objectType == 'execution')->andWhere('type')->in('sprint,stage,kanban')->fi()
|
||||||
|
->andWhere('deleted')->eq('0')
|
||||||
|
->fetch();
|
||||||
|
}
|
||||||
|
|
||||||
|
if($repeatObject)
|
||||||
|
{
|
||||||
|
$table = $oldAction->objectType == 'product' ? TABLE_PRODUCT : TABLE_PROJECT;
|
||||||
|
$object = $oldAction->objectType == 'product' ? $product : $project;
|
||||||
|
if($repeatObject->name == $object->name and $repeatObject->code and $repeatObject->code == $object->code)
|
||||||
|
{
|
||||||
|
if($confirmChange == 'no') return print(js::confirm(sprintf($this->lang->action->repeatChange, $this->lang->{$oldAction->objectType}->common, $repeatObject->name, $repeatObject->code), $this->createLink('action', 'undelete', "action={$actionID}&browseType={$browseType}&confirmChange=yes")));
|
||||||
|
if($confirmChange == 'yes') $this->dao->update($table)->set('name')->eq($object->name . '_')->set('code')->eq($object->code . '_')->where('id')->eq($oldAction->objectID)->exec();
|
||||||
|
}
|
||||||
|
elseif($repeatObject->name == $object->name)
|
||||||
|
{
|
||||||
|
if($confirmChange == 'no') return print(js::confirm(sprintf($this->lang->action->nameRepeatChange, $this->lang->{$oldAction->objectType}->common, $repeatObject->name), $this->createLink('action', 'undelete', "action={$actionID}&browseType={$browseType}&confirmChange=yes")));
|
||||||
|
if($confirmChange == 'yes') $this->dao->update($table)->set('name')->eq($object->name . '_')->where('id')->eq($oldAction->objectID)->exec();
|
||||||
|
}
|
||||||
|
elseif($repeatObject->code and $repeatObject->code == $object->code)
|
||||||
|
{
|
||||||
|
if($confirmChange == 'no') return print(js::confirm($this->lang->{$oldAction->objectType}->codeRepeatChange, $this->createLink('action', 'undelete', "action={$actionID}&browseType={$browseType}&confirmChange=yes")));
|
||||||
|
if($confirmChange == 'yes') $this->dao->update($table)->set('code')->eq($object->code . '_')->where('id')->eq($oldAction->objectID)->exec();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->action->undelete($actionID);
|
$this->action->undelete($actionID);
|
||||||
|
|
||||||
$sameTypeObjects = $this->action->getTrashes($oldAction->objectType, $extra, 'id_desc', null);
|
$sameTypeObjects = $this->action->getTrashes($oldAction->objectType, $extra, 'id_desc', null);
|
||||||
|
|||||||
@@ -58,6 +58,10 @@ $lang->action->noDynamic = 'Kein Verlauf. ';
|
|||||||
$lang->action->undeletedTips = 'This data did not participate in the merging process during the version upgrade process, so restore is not supported.';
|
$lang->action->undeletedTips = 'This data did not participate in the merging process during the version upgrade process, so restore is not supported.';
|
||||||
$lang->action->executionNoProject = 'The execution does not belong to a project,please restore the project first';
|
$lang->action->executionNoProject = 'The execution does not belong to a project,please restore the project first';
|
||||||
|
|
||||||
|
$lang->action->repeatChange = '%s with the same name and code already exists in the system. After recovery, the name and code are %s_,%s_';
|
||||||
|
$lang->action->nameRepeatChange = '%s with the same name already exists in the system. After recovery, the name are %s_';
|
||||||
|
$lang->action->codeRepeatChange = '%s with the same code already exists in the system. After recovery, the code are %s_';
|
||||||
|
|
||||||
$lang->action->history = new stdclass();
|
$lang->action->history = new stdclass();
|
||||||
$lang->action->history->action = 'Link';
|
$lang->action->history->action = 'Link';
|
||||||
$lang->action->history->field = 'Feld';
|
$lang->action->history->field = 'Feld';
|
||||||
|
|||||||
@@ -58,6 +58,10 @@ $lang->action->noDynamic = 'No dynamics. ';
|
|||||||
$lang->action->undeletedTips = 'This data did not participate in the merging process during the version upgrade process, so restore is not supported.';
|
$lang->action->undeletedTips = 'This data did not participate in the merging process during the version upgrade process, so restore is not supported.';
|
||||||
$lang->action->executionNoProject = 'The execution does not belong to a project,please restore the project first';
|
$lang->action->executionNoProject = 'The execution does not belong to a project,please restore the project first';
|
||||||
|
|
||||||
|
$lang->action->repeatChange = '%s with the same name and code already exists in the system. After recovery, the name and code are %s_,%s_';
|
||||||
|
$lang->action->nameRepeatChange = '%s with the same name already exists in the system. After recovery, the name are %s_';
|
||||||
|
$lang->action->codeRepeatChange = '%s with the same code already exists in the system. After recovery, the code are %s_';
|
||||||
|
|
||||||
$lang->action->history = new stdclass();
|
$lang->action->history = new stdclass();
|
||||||
$lang->action->history->action = 'Link';
|
$lang->action->history->action = 'Link';
|
||||||
$lang->action->history->field = 'Field';
|
$lang->action->history->field = 'Field';
|
||||||
|
|||||||
@@ -58,6 +58,10 @@ $lang->action->noDynamic = "Pas d'historique.";
|
|||||||
$lang->action->undeletedTips = 'This data did not participate in the merging process during the version upgrade process, so restore is not supported.';
|
$lang->action->undeletedTips = 'This data did not participate in the merging process during the version upgrade process, so restore is not supported.';
|
||||||
$lang->action->executionNoProject = 'The execution does not belong to a project,please restore the project first';
|
$lang->action->executionNoProject = 'The execution does not belong to a project,please restore the project first';
|
||||||
|
|
||||||
|
$lang->action->repeatChange = '%s with the same name and code already exists in the system. After recovery, the name and code are %s_,%s_';
|
||||||
|
$lang->action->nameRepeatChange = '%s with the same name already exists in the system. After recovery, the name are %s_';
|
||||||
|
$lang->action->codeRepeatChange = '%s with the same code already exists in the system. After recovery, the code are %s_';
|
||||||
|
|
||||||
$lang->action->history = new stdclass();
|
$lang->action->history = new stdclass();
|
||||||
$lang->action->history->action = 'Lien';
|
$lang->action->history->action = 'Lien';
|
||||||
$lang->action->history->field = 'Champ';
|
$lang->action->history->field = 'Champ';
|
||||||
|
|||||||
@@ -58,6 +58,10 @@ $lang->action->noDynamic = '暂时没有动态。';
|
|||||||
$lang->action->undeletedTips = '该数据在版本升级过程中未参与数据归并流程,不支持还原。';
|
$lang->action->undeletedTips = '该数据在版本升级过程中未参与数据归并流程,不支持还原。';
|
||||||
$lang->action->executionNoProject = '该执行没有所属的项目,请先还原项目再还原执行';
|
$lang->action->executionNoProject = '该执行没有所属的项目,请先还原项目再还原执行';
|
||||||
|
|
||||||
|
$lang->action->repeatChange = '系统内已有同名、同代号的%s。恢复后名称和代号为%s_、%s_';
|
||||||
|
$lang->action->nameRepeatChange = '系统内已有同名的%s。恢复后名称为%s_';
|
||||||
|
$lang->action->codeRepeatChange = '系统内已有同代号的%s。恢复后代号为%s_';
|
||||||
|
|
||||||
$lang->action->history = new stdclass();
|
$lang->action->history = new stdclass();
|
||||||
$lang->action->history->action = '关联日志';
|
$lang->action->history->action = '关联日志';
|
||||||
$lang->action->history->field = '字段';
|
$lang->action->history->field = '字段';
|
||||||
|
|||||||
@@ -383,8 +383,8 @@ class executionModel extends model
|
|||||||
$this->dao->insert(TABLE_EXECUTION)->data($sprint)
|
$this->dao->insert(TABLE_EXECUTION)->data($sprint)
|
||||||
->autoCheck($skipFields = 'begin,end')
|
->autoCheck($skipFields = 'begin,end')
|
||||||
->batchcheck($this->config->execution->create->requiredFields, 'notempty')
|
->batchcheck($this->config->execution->create->requiredFields, 'notempty')
|
||||||
->checkIF((!empty($sprint->name) and $this->config->systemMode == 'new'), 'name', 'unique', "`type` in ('sprint','stage', 'kanban') and `project` = $sprintProject")
|
->checkIF((!empty($sprint->name) and $this->config->systemMode == 'new'), 'name', 'unique', "`type` in ('sprint','stage', 'kanban') and `project` = $sprintProject and `deleted` = '0'")
|
||||||
->checkIF(!empty($sprint->code), 'code', 'unique', "`type` in ('sprint','stage', 'kanban')")
|
->checkIF(!empty($sprint->code), 'code', 'unique', "`type` in ('sprint','stage', 'kanban') and `deleted` = '0'")
|
||||||
->checkIF($sprint->begin != '', 'begin', 'date')
|
->checkIF($sprint->begin != '', 'begin', 'date')
|
||||||
->checkIF($sprint->end != '', 'end', 'date')
|
->checkIF($sprint->end != '', 'end', 'date')
|
||||||
->checkIF($sprint->end != '', 'end', 'ge', $sprint->begin)
|
->checkIF($sprint->end != '', 'end', 'ge', $sprint->begin)
|
||||||
@@ -535,8 +535,8 @@ class executionModel extends model
|
|||||||
->checkIF($execution->begin != '', 'begin', 'date')
|
->checkIF($execution->begin != '', 'begin', 'date')
|
||||||
->checkIF($execution->end != '', 'end', 'date')
|
->checkIF($execution->end != '', 'end', 'date')
|
||||||
->checkIF($execution->end != '', 'end', 'ge', $execution->begin)
|
->checkIF($execution->end != '', 'end', 'ge', $execution->begin)
|
||||||
->checkIF((!empty($execution->name) and $this->config->systemMode == 'new'), 'name', 'unique', "id != $executionID and type in ('sprint','stage', 'kanban') and `project` = $executionProject")
|
->checkIF((!empty($execution->name) and $this->config->systemMode == 'new'), 'name', 'unique', "id != $executionID and type in ('sprint','stage', 'kanban') and `project` = $executionProject and `deleted` = '0'")
|
||||||
->checkIF(!empty($execution->code), 'code', 'unique', "id != $executionID and type in ('sprint','stage', 'kanban')")
|
->checkIF(!empty($execution->code), 'code', 'unique', "id != $executionID and type in ('sprint','stage', 'kanban') and `deleted` = '0'")
|
||||||
->checkFlow()
|
->checkFlow()
|
||||||
->where('id')->eq($executionID)
|
->where('id')->eq($executionID)
|
||||||
->limit(1)
|
->limit(1)
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
.group-item {display: block; width: 100px; float: left; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
|
.group-item {display: block; width: 100px; float: left; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default;}
|
||||||
|
.group-item .checkbox-primary>input {cursor: pointer;}
|
||||||
.table th {vertical-align: top;}
|
.table th {vertical-align: top;}
|
||||||
.main-table tbody>tr>td {border-bottom: 0px;}
|
.main-table tbody>tr>td {border-bottom: 0px;}
|
||||||
|
|||||||
@@ -675,8 +675,8 @@ class productModel extends model
|
|||||||
$programID = isset($product->program) ? $product->program : 0;
|
$programID = isset($product->program) ? $product->program : 0;
|
||||||
$this->dao->insert(TABLE_PRODUCT)->data($product)->autoCheck()
|
$this->dao->insert(TABLE_PRODUCT)->data($product)->autoCheck()
|
||||||
->batchCheck($this->config->product->create->requiredFields, 'notempty')
|
->batchCheck($this->config->product->create->requiredFields, 'notempty')
|
||||||
->checkIF((!empty($product->name) and $this->config->systemMode == 'new'), 'name', 'unique', "`program` = $programID")
|
->checkIF((!empty($product->name) and $this->config->systemMode == 'new'), 'name', 'unique', "`program` = $programID and `deleted` = '0'")
|
||||||
->checkIF(!empty($product->code), 'code', 'unique')
|
->checkIF(!empty($product->code), 'code', 'unique', "`deleted` = '0'")
|
||||||
->checkFlow()
|
->checkFlow()
|
||||||
->exec();
|
->exec();
|
||||||
|
|
||||||
@@ -767,8 +767,8 @@ class productModel extends model
|
|||||||
$programID = isset($product->program) ? $product->program : '';
|
$programID = isset($product->program) ? $product->program : '';
|
||||||
$this->dao->update(TABLE_PRODUCT)->data($product)->autoCheck()
|
$this->dao->update(TABLE_PRODUCT)->data($product)->autoCheck()
|
||||||
->batchCheck($this->config->product->edit->requiredFields, 'notempty')
|
->batchCheck($this->config->product->edit->requiredFields, 'notempty')
|
||||||
->checkIF((!empty($product->name) and $this->config->systemMode == 'new'), 'name', 'unique', "id != $productID and `program` = $programID")
|
->checkIF((!empty($product->name) and $this->config->systemMode == 'new'), 'name', 'unique', "id != $productID and `program` = $programID and `deleted` = '0'")
|
||||||
->checkIF(!empty($product->code), 'code', 'unique', "id != $productID")
|
->checkIF(!empty($product->code), 'code', 'unique', "id != $productID and `deleted` = '0'")
|
||||||
->checkFlow()
|
->checkFlow()
|
||||||
->where('id')->eq($productID)
|
->where('id')->eq($productID)
|
||||||
->exec();
|
->exec();
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ class program extends control
|
|||||||
*/
|
*/
|
||||||
public function browse($status = 'all', $orderBy = 'order_asc', $recTotal = 0, $recPerPage = 10, $pageID = 1, $param = 0)
|
public function browse($status = 'all', $orderBy = 'order_asc', $recTotal = 0, $recPerPage = 10, $pageID = 1, $param = 0)
|
||||||
{
|
{
|
||||||
$this->lang->program->featureBar = array('all' => $this->lang->program->featureBar['all']);
|
|
||||||
if(common::hasPriv('program', 'create')) $this->lang->pageActions = html::a($this->createLink('program', 'create'), "<i class='icon icon-plus'></i> " . $this->lang->program->create, '', "class='btn btn-primary create-program-btn'");
|
if(common::hasPriv('program', 'create')) $this->lang->pageActions = html::a($this->createLink('program', 'create'), "<i class='icon icon-plus'></i> " . $this->lang->program->create, '', "class='btn btn-primary create-program-btn'");
|
||||||
|
|
||||||
$this->session->set('programList', $this->app->getURI(true), 'program');
|
$this->session->set('programList', $this->app->getURI(true), 'program');
|
||||||
@@ -54,8 +53,8 @@ class program extends control
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Get top programs and projects. */
|
/* Get top programs and projects. */
|
||||||
$topObjects = $this->program->getList($status, $orderBy, $pager, 'top');
|
$topObjects = $this->program->getList($status == 'unclosed' ? 'doing,suspended,wait' : $status, $orderBy, $pager, 'top');
|
||||||
$programs = $this->program->getList($status, $orderBy, NULL, 'child', array_keys($topObjects));
|
$programs = $this->program->getList($status == 'closed' ? 'closed' : 'all', $orderBy, NULL, 'child', array_keys($topObjects));
|
||||||
|
|
||||||
/* Get summary. */
|
/* Get summary. */
|
||||||
$topCount = $indCount = 0;
|
$topCount = $indCount = 0;
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ $lang->program->statusList['suspended'] = 'Suspended';
|
|||||||
$lang->program->statusList['closed'] = 'Closed';
|
$lang->program->statusList['closed'] = 'Closed';
|
||||||
|
|
||||||
$lang->program->featureBar['all'] = 'All';
|
$lang->program->featureBar['all'] = 'All';
|
||||||
$lang->program->featureBar['undone'] = 'Unfinished';
|
$lang->program->featureBar['unclosed'] = 'Unclosed';
|
||||||
$lang->program->featureBar['wait'] = 'Waiting';
|
$lang->program->featureBar['wait'] = 'Waiting';
|
||||||
$lang->program->featureBar['doing'] = 'Doing';
|
$lang->program->featureBar['doing'] = 'Doing';
|
||||||
$lang->program->featureBar['suspended'] = 'Suspended';
|
$lang->program->featureBar['suspended'] = 'Suspended';
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ $lang->program->statusList['suspended'] = 'Suspended';
|
|||||||
$lang->program->statusList['closed'] = 'Closed';
|
$lang->program->statusList['closed'] = 'Closed';
|
||||||
|
|
||||||
$lang->program->featureBar['all'] = 'All';
|
$lang->program->featureBar['all'] = 'All';
|
||||||
$lang->program->featureBar['undone'] = 'Unfinished';
|
$lang->program->featureBar['unclosed'] = 'Unclosed';
|
||||||
$lang->program->featureBar['wait'] = 'Waiting';
|
$lang->program->featureBar['wait'] = 'Waiting';
|
||||||
$lang->program->featureBar['doing'] = 'Doing';
|
$lang->program->featureBar['doing'] = 'Doing';
|
||||||
$lang->program->featureBar['suspended'] = 'Suspended';
|
$lang->program->featureBar['suspended'] = 'Suspended';
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ $lang->program->statusList['suspended'] = 'Suspended';
|
|||||||
$lang->program->statusList['closed'] = 'Closed';
|
$lang->program->statusList['closed'] = 'Closed';
|
||||||
|
|
||||||
$lang->program->featureBar['all'] = 'All';
|
$lang->program->featureBar['all'] = 'All';
|
||||||
$lang->program->featureBar['undone'] = 'Non Terminées';
|
$lang->program->featureBar['unclosed'] = 'Unclosed';
|
||||||
$lang->program->featureBar['wait'] = 'En Attente';
|
$lang->program->featureBar['wait'] = 'En Attente';
|
||||||
$lang->program->featureBar['doing'] = 'En Cours';
|
$lang->program->featureBar['doing'] = 'En Cours';
|
||||||
$lang->program->featureBar['suspended'] = 'Suspendues';
|
$lang->program->featureBar['suspended'] = 'Suspendues';
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ $lang->program->accessDenied = '你无权访问该项目集';
|
|||||||
$lang->program->beyondParentBudget = '已超出所属项目集的剩余预算';
|
$lang->program->beyondParentBudget = '已超出所属项目集的剩余预算';
|
||||||
$lang->program->checkedProjects = '已选择%s项';
|
$lang->program->checkedProjects = '已选择%s项';
|
||||||
|
|
||||||
|
|
||||||
$lang->program->endList[31] = '一个月';
|
$lang->program->endList[31] = '一个月';
|
||||||
$lang->program->endList[93] = '三个月';
|
$lang->program->endList[93] = '三个月';
|
||||||
$lang->program->endList[186] = '半年';
|
$lang->program->endList[186] = '半年';
|
||||||
@@ -140,7 +141,7 @@ $lang->program->statusList['suspended'] = '已挂起';
|
|||||||
$lang->program->statusList['closed'] = '已关闭';
|
$lang->program->statusList['closed'] = '已关闭';
|
||||||
|
|
||||||
$lang->program->featureBar['all'] = '所有';
|
$lang->program->featureBar['all'] = '所有';
|
||||||
$lang->program->featureBar['undone'] = '未完成';
|
$lang->program->featureBar['unclosed'] = '未关闭';
|
||||||
$lang->program->featureBar['wait'] = '未开始';
|
$lang->program->featureBar['wait'] = '未开始';
|
||||||
$lang->program->featureBar['doing'] = '进行中';
|
$lang->program->featureBar['doing'] = '进行中';
|
||||||
$lang->program->featureBar['suspended'] = '已挂起';
|
$lang->program->featureBar['suspended'] = '已挂起';
|
||||||
|
|||||||
@@ -166,8 +166,8 @@ class programModel extends model
|
|||||||
->where('type')->in('program,project')
|
->where('type')->in('program,project')
|
||||||
->andWhere('deleted')->eq(0)
|
->andWhere('deleted')->eq(0)
|
||||||
->andWhere('vision')->eq($this->config->vision)
|
->andWhere('vision')->eq($this->config->vision)
|
||||||
->beginIF($status != 'all')->andWhere('status')->eq($status)->fi()
|
->beginIF($status != 'all')->andWhere('status')->in($status)->fi()
|
||||||
->beginIF(!$this->cookie->showClosed)->andWhere('status')->ne('closed')->fi()
|
->beginIF(!$this->cookie->showClosed and $status == 'all')->andWhere('status')->ne('closed')->fi()
|
||||||
->beginIF($this->app->rawMethod == 'browse' and $type === 'top')->andWhere('parent')->eq(0)->fi()
|
->beginIF($this->app->rawMethod == 'browse' and $type === 'top')->andWhere('parent')->eq(0)->fi()
|
||||||
->beginIF($this->app->rawMethod == 'browse' and ($type === 'child' or !$this->app->user->admin))->andWhere('id')->in($objectIdList)->fi()
|
->beginIF($this->app->rawMethod == 'browse' and ($type === 'child' or !$this->app->user->admin))->andWhere('id')->in($objectIdList)->fi()
|
||||||
->beginIF(!$this->app->user->admin and $this->app->rawMethod != 'browse')->andWhere('id')->in($userViewIdList)->fi()
|
->beginIF(!$this->app->user->admin and $this->app->rawMethod != 'browse')->andWhere('id')->in($userViewIdList)->fi()
|
||||||
@@ -760,7 +760,7 @@ class programModel extends model
|
|||||||
->checkIF($program->begin != '', 'begin', 'date')
|
->checkIF($program->begin != '', 'begin', 'date')
|
||||||
->checkIF($program->end != '', 'end', 'date')
|
->checkIF($program->end != '', 'end', 'date')
|
||||||
->checkIF($program->end != '', 'end', 'gt', $program->begin)
|
->checkIF($program->end != '', 'end', 'gt', $program->begin)
|
||||||
->checkIF(!empty($program->name), 'name', 'unique', "`type`='program' and `parent` = $program->parent")
|
->checkIF(!empty($program->name), 'name', 'unique', "`type`='program' and `parent` = $program->parent and `deleted` = '0'")
|
||||||
->checkFlow()
|
->checkFlow()
|
||||||
->exec();
|
->exec();
|
||||||
|
|
||||||
@@ -866,7 +866,7 @@ class programModel extends model
|
|||||||
->checkIF($program->begin != '', 'begin', 'date')
|
->checkIF($program->begin != '', 'begin', 'date')
|
||||||
->checkIF($program->end != '', 'end', 'date')
|
->checkIF($program->end != '', 'end', 'date')
|
||||||
->checkIF($program->end != '', 'end', 'gt', $program->begin)
|
->checkIF($program->end != '', 'end', 'gt', $program->begin)
|
||||||
->checkIF(!empty($program->name), 'name', 'unique', "id!=$programID and `type`='program' and `parent` = $program->parent")
|
->checkIF(!empty($program->name), 'name', 'unique', "id!=$programID and `type`='program' and `parent` = $program->parent and `deleted` = '0'")
|
||||||
->checkFlow()
|
->checkFlow()
|
||||||
->where('id')->eq($programID)
|
->where('id')->eq($programID)
|
||||||
->limit(1)
|
->limit(1)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
<?php $label = "<span class='text'>$label</span>";?>
|
<?php $label = "<span class='text'>$label</span>";?>
|
||||||
<?php echo html::a(inlink('browse', "status=$key&orderBy=$orderBy"), $label, '', "class='btn btn-link $active'");?>
|
<?php echo html::a(inlink('browse', "status=$key&orderBy=$orderBy"), $label, '', "class='btn btn-link $active'");?>
|
||||||
<?php endforeach;?>
|
<?php endforeach;?>
|
||||||
<?php echo html::checkbox('showClosed', array('1' => $lang->program->showClosed), '', $this->cookie->showClosed ? 'checked=checked' : '');?>
|
<?php if($status == 'all' or $status == 'bySearch') echo html::checkbox('showClosed', array('1' => $lang->program->showClosed), '', $this->cookie->showClosed ? 'checked=checked' : '');?>
|
||||||
<?php if(common::hasPriv('project', 'batchEdit') and $programType != 'bygrid' and $hasProject === true) echo html::checkbox('editProject', array('1' => $lang->project->edit), '', $this->cookie->editProject ? 'checked=checked' : '');?>
|
<?php if(common::hasPriv('project', 'batchEdit') and $programType != 'bygrid' and $hasProject === true) echo html::checkbox('editProject', array('1' => $lang->project->edit), '', $this->cookie->editProject ? 'checked=checked' : '');?>
|
||||||
<a class="btn btn-link querybox-toggle" id='bysearchTab'><i class="icon icon-search muted"></i> <?php echo $lang->user->search;?></a>
|
<a class="btn btn-link querybox-toggle" id='bysearchTab'><i class="icon icon-search muted"></i> <?php echo $lang->user->search;?></a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1183,8 +1183,8 @@ class projectModel extends model
|
|||||||
$this->dao->insert(TABLE_PROJECT)->data($project)
|
$this->dao->insert(TABLE_PROJECT)->data($project)
|
||||||
->autoCheck()
|
->autoCheck()
|
||||||
->batchcheck($requiredFields, 'notempty')
|
->batchcheck($requiredFields, 'notempty')
|
||||||
->checkIF(!empty($project->name), 'name', 'unique', "`type`='project' and `parent` = $project->parent and `model` = '{$project->model}'")
|
->checkIF(!empty($project->name), 'name', 'unique', "`type`='project' and `parent` = $project->parent and `model` = '{$project->model}' and `deleted` = '0'")
|
||||||
->checkIF(!empty($project->code), 'code', 'unique', "`type`='project' and `model` = '{$project->model}'")
|
->checkIF(!empty($project->code), 'code', 'unique', "`type`='project' and `model` = '{$project->model}' and `deleted` = '0'")
|
||||||
->checkIF($project->end != '', 'end', 'gt', $project->begin)
|
->checkIF($project->end != '', 'end', 'gt', $project->begin)
|
||||||
->checkFlow()
|
->checkFlow()
|
||||||
->exec();
|
->exec();
|
||||||
@@ -1431,8 +1431,8 @@ class projectModel extends model
|
|||||||
->checkIF($project->begin != '', 'begin', 'date')
|
->checkIF($project->begin != '', 'begin', 'date')
|
||||||
->checkIF($project->end != '', 'end', 'date')
|
->checkIF($project->end != '', 'end', 'date')
|
||||||
->checkIF($project->end != '', 'end', 'gt', $project->begin)
|
->checkIF($project->end != '', 'end', 'gt', $project->begin)
|
||||||
->checkIF(!empty($project->name), 'name', 'unique', "id != $projectID and `type` = 'project' and `parent` = $project->parent and `model` = '{$project->model}'")
|
->checkIF(!empty($project->name), 'name', 'unique', "id != $projectID and `type` = 'project' and `parent` = $project->parent and `model` = '{$project->model}' and `deleted` = '0'")
|
||||||
->checkIF(!empty($project->code), 'code', 'unique', "id != $projectID and `type` = 'project' and `model` = '{$project->model}'")
|
->checkIF(!empty($project->code), 'code', 'unique', "id != $projectID and `type` = 'project' and `model` = '{$project->model}' and `deleted` = '0'")
|
||||||
->checkFlow()
|
->checkFlow()
|
||||||
->where('id')->eq($projectID)
|
->where('id')->eq($projectID)
|
||||||
->exec();
|
->exec();
|
||||||
|
|||||||
Reference in New Issue
Block a user