소스 검색

Internal: fixed the verb DBObjectSearch::IsAny

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3886 a333f486-631f-4898-b8df-5754b55c2be0
romainq 9 년 전
부모
커밋
0dff1739a5
2개의 변경된 파일9개의 추가작업 그리고 5개의 파일을 삭제
  1. 3 3
      core/dbobjectsearch.class.php
  2. 6 2
      core/oql/expression.class.inc.php

+ 3 - 3
core/dbobjectsearch.class.php

@@ -1,5 +1,5 @@
 <?php
-// Copyright (C) 2010-2015 Combodo SARL
+// Copyright (C) 2010-2016 Combodo SARL
 //
 //   This file is part of iTop.
 //
@@ -20,7 +20,7 @@
 /**
  * Define filters for a given class of objects (formerly named "filter") 
  *
- * @copyright   Copyright (C) 2010-2015 Combodo SARL
+ * @copyright   Copyright (C) 2010-2016 Combodo SARL
  * @license     http://opensource.org/licenses/AGPL-3.0
  */
  
@@ -191,7 +191,7 @@ class DBObjectSearch extends DBSearch
 
 	public function IsAny()
 	{
-		// #@# todo - if (!$this->m_oSearchCondition->IsTrue()) return false;
+		if (!$this->m_oSearchCondition->IsTrue()) return false;
 		if (count($this->m_aFullText) > 0) return false;
 		if (count($this->m_aPointingTo) > 0) return false;
 		if (count($this->m_aReferencedBy) > 0) return false;

+ 6 - 2
core/oql/expression.class.inc.php

@@ -1,5 +1,5 @@
 <?php
-// Copyright (C) 2010-2015 Combodo SARL
+// Copyright (C) 2010-2016 Combodo SARL
 //
 //   This file is part of iTop.
 //
@@ -20,7 +20,7 @@
 /**
  * General definition of an expression tree (could be OQL, SQL or whatever) 
  *
- * @copyright   Copyright (C) 2010-2015 Combodo SARL
+ * @copyright   Copyright (C) 2010-2016 Combodo SARL
  * @license     http://opensource.org/licenses/AGPL-3.0
  */
 
@@ -215,6 +215,10 @@ class BinaryExpression extends Expression
 		{
 			if ($this->m_oLeftExpr->IsTrue() && $this->m_oRightExpr->IsTrue()) return true;
 		}
+		elseif ($this->m_sOperator == 'OR')
+		{
+			if ($this->m_oLeftExpr->IsTrue() || $this->m_oRightExpr->IsTrue()) return true;
+		}
 		return false;
 	}