evaluate not operator for id filter
authorMichael Spahn <m.spahn@metaways.de>
Mon, 17 Jul 2017 12:29:48 +0000 (14:29 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 17 Jul 2017 13:52:44 +0000 (15:52 +0200)
Change-Id: I19d07150064b7cf4400e783d7bde177b7daf479c
Reviewed-on: http://gerrit.tine20.com/customers/5210
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/Model/Filter/Id.php

index 155aeb2..f5e12da 100644 (file)
@@ -65,7 +65,11 @@ class Tinebase_Model_Filter_Id extends Tinebase_Model_Filter_Abstract
                      . ' Empty value with "' . $this->_operator . '"" operator (model: '
                      . (isset($this->_options['modelName']) ? $this->_options['modelName'] : 'unknown / no modelName defined in filter options'). ')');
                  $_select->where('1=0');
-             }
+             } else if ($this->_operator == 'not') {
+
+                 $field = $this->_getQuotedFieldName($_backend);
+                 $_select->where($field . " != '' AND " . $field . " IS NOT NULL");
+            }
         } else if ($this->_operator == 'equals' && is_array($this->_value)) {
              if (Tinebase_Core::isLogLevel(Zend_Log::NOTICE)) Tinebase_Core::getLogger()->notice(__METHOD__ . '::' . __LINE__ 
                  . ' Unexpected array value with "equals" operator (model: '