* fix for undelete project.
This commit is contained in:
@@ -1027,7 +1027,7 @@ class actionModel extends model
|
||||
if($action->objectType == 'product')
|
||||
{
|
||||
$product = $this->dao->select('id,name,code,acl')->from(TABLE_PRODUCT)->where('id')->eq($action->objectID)->fetch();
|
||||
$count = $this->dao->select('COUNT(*) AS count')->from(TABLE_PRODUCT)->where('deleted')->eq('0')->andWhere("(`name`='{$product->name}' OR `code`='{$product->code}')")->fetch('count');
|
||||
$count = $this->dao->select('COUNT(*) AS count')->from(TABLE_PRODUCT)->where('deleted')->eq('0')->andWhere("(`name`='{$product->name}'" . ($product->code ? " OR `code`='{$product->code}'" : '') . ")")->fetch('count');
|
||||
if($count > 0)
|
||||
{
|
||||
echo js::alert(sprintf($this->lang->action->needEdit, $this->lang->action->objectTypes['product']));
|
||||
@@ -1038,7 +1038,7 @@ class actionModel extends model
|
||||
elseif($action->objectType == 'project')
|
||||
{
|
||||
$project = $this->dao->select('id,name,code,acl')->from(TABLE_PROJECT)->where('id')->eq($action->objectID)->fetch();
|
||||
$count = $this->dao->select('COUNT(*) AS count')->from(TABLE_PROJECT)->where('deleted')->eq('0')->andWhere("(`name`='{$project->name}' OR `code`='{$project->code}')")->fetch('count');
|
||||
$count = $this->dao->select('COUNT(*) AS count')->from(TABLE_PROJECT)->where('deleted')->eq('0')->andWhere("(`name`='{$project->name}'" . ($project->code ? " OR `code`='{$project->code}'" : '') . ")")->fetch('count');
|
||||
if($count > 0)
|
||||
{
|
||||
echo js::alert(sprintf($this->lang->action->needEdit, $this->lang->action->objectTypes['project']));
|
||||
|
||||
Reference in New Issue
Block a user