* Check product name when create project.
This commit is contained in:
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -91,6 +91,7 @@ $lang->program->PRJTeamCount = '项目成员';
|
||||
$lang->program->PRJLongTime = '长期';
|
||||
|
||||
$lang->program->productNotEmpty = '请关联产品或创建产品。';
|
||||
$lang->program->existProductName = '产品名称已存在。';
|
||||
|
||||
$lang->program->unitList[''] = '';
|
||||
$lang->program->unitList['yuan'] = '元';
|
||||
|
||||
@@ -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'] = '元';
|
||||
|
||||
@@ -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},"), ',');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user