* Check product name when create project.

This commit is contained in:
qiyu-xie
2020-12-10 14:51:31 +08:00
parent 5182c4ed3b
commit 9cbec051b2
7 changed files with 18 additions and 5 deletions
+2 -1
View File
@@ -89,7 +89,8 @@ $lang->program->cv = 'CV%';
$lang->program->PRJTeamCount = 'Team';
$lang->program->PRJLongTime = 'Long-Term Project';
$lang->program->productNotEmpty = 'Please link products or create products.';
$lang->program->productNotEmpty = 'Please link products or create products.';
$lang->program->existProductName = 'Product name already exists.';
$lang->program->unitList[''] = '';
$lang->program->unitList['yuan'] = 'Yuan';
+2 -1
View File
@@ -89,7 +89,8 @@ $lang->program->cv = 'CV%';
$lang->program->PRJTeamCount = 'Team';
$lang->program->PRJLongTime = 'Long-Term Project';
$lang->program->productNotEmpty = 'Please link products or create products.';
$lang->program->productNotEmpty = 'Please link products or create products.';
$lang->program->existProductName = 'Product name already exists.';
$lang->program->unitList[''] = '';
$lang->program->unitList['yuan'] = 'Yuan';
+2 -1
View File
@@ -89,7 +89,8 @@ $lang->program->cv = 'CV%';
$lang->program->PRJTeamCount = 'Team';
$lang->program->PRJLongTime = 'Long-Term Project';
$lang->program->productNotEmpty = 'Please link products or create products.';
$lang->program->productNotEmpty = 'Please link products or create products.';
$lang->program->existProductName = 'Product name already exists.';
$lang->program->unitList[''] = '';
$lang->program->unitList['yuan'] = 'Yuan';
+2 -1
View File
@@ -89,7 +89,8 @@ $lang->program->cv = 'CV%';
$lang->program->PRJTeamCount = 'Team';
$lang->program->PRJLongTime = 'Long-Term Project';
$lang->program->productNotEmpty = 'Please link products or create products.';
$lang->program->productNotEmpty = 'Please link products or create products.';
$lang->program->existProductName = 'Product name already exists.';
$lang->program->unitList[''] = '';
$lang->program->unitList['yuan'] = 'Yuan';
+1
View File
@@ -91,6 +91,7 @@ $lang->program->PRJTeamCount = '项目成员';
$lang->program->PRJLongTime = '长期';
$lang->program->productNotEmpty = '请关联产品或创建产品。';
$lang->program->existProductName = '产品名称已存在。';
$lang->program->unitList[''] = '';
$lang->program->unitList['yuan'] = '元';
+2 -1
View File
@@ -91,7 +91,8 @@ $lang->program->cv = 'CV%';
$lang->program->PRJTeamCount = '項目成員';
$lang->program->PRJLongTime = '長期';
$lang->program->productNotEmpty = '請關聯產品或創建產品。';
$lang->program->productNotEmpty = '請關聯產品或創建產品。';
$lang->program->existProductName = '產品名稱已存在。';
$lang->program->unitList[''] = '';
$lang->program->unitList['yuan'] = '元';
+7
View File
@@ -1244,6 +1244,13 @@ class programModel extends model
return false;
}
$existProductName = $this->dao->select('name')->from(TABLE_PRODUCT)->where('name')->eq($_POST['productName'])->fetch('name');
if(!empty($existProductName))
{
dao::$errors[] = $this->lang->program->existProductName;
return false;
}
$requiredFields = $this->config->program->PRJCreate->requiredFields;
if($this->post->delta == 999) $requiredFields = trim(str_replace(',end,', ',', ",{$requiredFields},"), ',');