Merge branch 'sprint224_26389' into 'master'
* Fix bug#26389,26333,26328 See merge request easycorp/zentaopms!4947
This commit is contained in:
@@ -396,7 +396,7 @@ class executionModel extends model
|
||||
$this->dao->insert(TABLE_EXECUTION)->data($sprint)
|
||||
->autoCheck($skipFields = 'begin,end')
|
||||
->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 and `deleted` = '0'")
|
||||
->checkIF(!empty($sprint->name), 'name', 'unique', "`type` in ('sprint','stage', 'kanban') and `project` = $sprintProject and `deleted` = '0'")
|
||||
->checkIF(!empty($sprint->code), 'code', 'unique', "`type` in ('sprint','stage', 'kanban') and `deleted` = '0'")
|
||||
->checkIF($sprint->begin != '', 'begin', 'date')
|
||||
->checkIF($sprint->end != '', 'end', 'date')
|
||||
@@ -551,7 +551,7 @@ class executionModel extends model
|
||||
->checkIF($execution->begin != '', 'begin', 'date')
|
||||
->checkIF($execution->end != '', 'end', 'date')
|
||||
->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 and `deleted` = '0'")
|
||||
->checkIF(!empty($execution->name), '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') and `deleted` = '0'")
|
||||
->checkFlow()
|
||||
->where('id')->eq($executionID)
|
||||
|
||||
@@ -680,7 +680,7 @@ class productModel extends model
|
||||
$programID = isset($product->program) ? $product->program : 0;
|
||||
$this->dao->insert(TABLE_PRODUCT)->data($product)->autoCheck()
|
||||
->batchCheck($this->config->product->create->requiredFields, 'notempty')
|
||||
->checkIF((!empty($product->name) and $this->config->systemMode == 'new'), 'name', 'unique', "`program` = $programID and `deleted` = '0'")
|
||||
->checkIF(!empty($product->name), 'name', 'unique', "`program` = $programID and `deleted` = '0'")
|
||||
->checkIF(!empty($product->code), 'code', 'unique', "`deleted` = '0'")
|
||||
->checkFlow()
|
||||
->exec();
|
||||
@@ -770,10 +770,10 @@ class productModel extends model
|
||||
|
||||
$this->lang->error->unique = $this->lang->error->repeat;
|
||||
$product = $this->loadModel('file')->processImgURL($product, $this->config->product->editor->edit['id'], $this->post->uid);
|
||||
$programID = isset($product->program) ? $product->program : '';
|
||||
$programID = isset($product->program) ? $product->program : 0;
|
||||
$this->dao->update(TABLE_PRODUCT)->data($product)->autoCheck()
|
||||
->batchCheck($this->config->product->edit->requiredFields, 'notempty')
|
||||
->checkIF((!empty($product->name) and $this->config->systemMode == 'new'), 'name', 'unique', "id != $productID and `program` = $programID and `deleted` = '0'")
|
||||
->checkIF(!empty($product->name), 'name', 'unique', "id != $productID and `program` = $programID and `deleted` = '0'")
|
||||
->checkIF(!empty($product->code), 'code', 'unique', "id != $productID and `deleted` = '0'")
|
||||
->checkFlow()
|
||||
->where('id')->eq($productID)
|
||||
|
||||
@@ -231,10 +231,11 @@ class search extends control
|
||||
$pager = new pager(0, $this->config->search->recPerPage, $pageID);
|
||||
$results = $this->search->getList($words, $type, $pager);
|
||||
|
||||
$typeCount = $this->search->getListCount('');
|
||||
$typeCount = $this->search->getListCount();
|
||||
$typeList = array('all' => $this->lang->search->modules['all']);
|
||||
foreach($typeCount as $objectType => $count)
|
||||
{
|
||||
if(!isset($this->lang->search->modules[$objectType])) continue;
|
||||
$typeList[$objectType] = $this->lang->search->modules[$objectType];
|
||||
}
|
||||
|
||||
|
||||
@@ -647,7 +647,7 @@ class searchModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getListCount($keywords, $type = 'all')
|
||||
public function getListCount($keywords = '', $type = 'all')
|
||||
{
|
||||
list($words, $againstCond, $likeCondition, $allowedObject) = $this->getSqlParams($keywords, $type);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user