respect deleted attendee in event search
authorPhilipp Schüle <p.schuele@metaways.de>
Thu, 13 Nov 2014 11:20:48 +0000 (12:20 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 13 Nov 2014 20:18:03 +0000 (21:18 +0100)
Change-Id: Iefb36a421ad124c694e947cbbb99fffc6b9e7ea1
Reviewed-on: http://gerrit.tine20.com/customers/1354
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Calendar/Backend/Sql.php

index 08577d7..23d94c1 100644 (file)
@@ -175,6 +175,8 @@ class Calendar_Backend_Sql extends Tinebase_Backend_Sql_Abstract
             /* table  */ array('attendee' => $this->_tablePrefix . 'cal_attendee'),
             /* on     */ $this->_db->quoteIdentifier('attendee.cal_event_id') . ' = ' . $this->_db->quoteIdentifier('cal_events.id'),
             /* select */ array());
+        // TODO move this to join?
+        $select->where($this->_db->quoteIdentifier('attendee.is_deleted') . ' = 0 OR ' . $this->_db->quoteIdentifier('attendee.is_deleted') . 'IS NULL');
         
         if (! $getDeleted) {
             $select->joinLeft(
@@ -182,6 +184,7 @@ class Calendar_Backend_Sql extends Tinebase_Backend_Sql_Abstract
                 /* on     */ $this->_db->quoteIdentifier('dispcontainer.id') . ' = ' . $this->_db->quoteIdentifier('attendee.displaycontainer_id'),
                 /* select */ array());
             
+            // TODO move this to join?
             $select->where($this->_db->quoteIdentifier('dispcontainer.is_deleted') . ' = 0 OR ' . $this->_db->quoteIdentifier('dispcontainer.is_deleted') . 'IS NULL');
         }