Changeset 6200


Ignore:
Timestamp:
05/15/12 18:10:19 (12 years ago)
Author:
acoutinho
Message:

Ticket #2741 - Duplicacao de eventos com repeticao que comecao no mesmo dia da ocorrencia

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/prototype/modules/calendar/interceptors/DBMapping.php

    r6190 r6200  
    122122                .'calendar FROM calendar_to_calendar_object , calendar_object ' 
    123123                .'WHERE ( calendar_to_calendar_object.calendar_id IN (\'' . implode('\',\'', $criteria['filter'][2][2]) . '\')) ' 
    124                 .'AND calendar_to_calendar_object.calendar_object_id = calendar_object.id' . (!empty($ids) ? ' ' 
    125                 .'AND calendar_object.id NOT IN (\'' . implode('\',\'', $ids) . '\') ' : ' ');   
     124                .'AND calendar_to_calendar_object.calendar_object_id = calendar_object.id ';     
    126125             
    127126            if(isset($criteria['searchEvent']) && $criteria['searchEvent']){ 
     
    144143                $where = 'AND ((range_end >= \'' . $start[0] . '\' AND range_end <= \'' . $end[0] . '\') OR ' 
    145144                        .'(range_start >= \'' . $start[1] . '\' AND range_start <= \'' . $end[1] . '\') OR ' 
    146                         .'(range_start <= \'' . $start[2] . '\' AND range_end >= \'' . $end[2] . '\')) '; 
    147  
     145                        .'(range_start <= \'' . $start[2] . '\' AND range_end >= \'' . $end[2] . '\')) ' 
     146                .(!empty($ids) ? ' ' .'AND calendar_object.id NOT IN (\'' . implode('\',\'', $ids) . '\') ' : ' '); 
     147 
     148                 
     149                ob_start(); 
     150                print_r($sql.$where); 
     151 
     152                $output = ob_get_clean(); 
     153                file_put_contents( "/tmp/acoutinho.log",  $output , FILE_APPEND); 
     154 
     155                 
    148156                $params = Controller::service('PostgreSQL')->execResultSql($sql.$where); 
    149                 $params = array_merge($params, $occ); 
     157                $params = array_merge($params, $occ);            
    150158            } 
    151159            $params = self::deepnessFindEvent($uri, $params, $criteria, $original); 
Note: See TracChangeset for help on using the changeset viewer.