Changeset 7789


Ignore:
Timestamp:
01/23/13 17:03:48 (7 years ago)
Author:
acoutinho
Message:

Ticket #3359 - Inconsistencia com icones e telas de edicao no Expresso Calendar

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/prototype/modules/calendar/schedules.php

    r7702 r7789  
    3131                .'calendar_object.range_end as "rangeEnd", calendar_object.last_update as "lastUpdate", ' 
    3232                .'calendar_object.dtstamp as "dtstamp", calendar_object.sequence as "sequence", ' 
     33 
     34                .'count(calendar_task_to_activity_object.id) as "tasks", ' 
     35 
    3336                .'calendar_object.tzid as "timezone" ,calendar_to_calendar_object.calendar_id as ' 
    34                 .'calendar FROM calendar_to_calendar_object , calendar_object ' 
     37                .'calendar FROM calendar_object left join calendar_task_to_activity_object on ( calendar_object.id = calendar_task_to_activity_object.calendar_object_activity_id  ), calendar_to_calendar_object ' 
     38 
    3539                .'WHERE ( calendar_to_calendar_object.calendar_id IN (\'' . implode('\',\'', $calendars) . '\')) ' 
    3640                .'AND calendar_to_calendar_object.calendar_object_id = calendar_object.id ' 
     
    5357                .'AND calendar_object.dtstart NOT IN (SELECT calendar_repeat_occurrence.occurrence from calendar_repeat_occurrence, ' 
    5458                .'calendar_repeat where (calendar_repeat_occurrence.repeat_id = calendar_repeat.id) ' 
    55                 .'AND (calendar_repeat.object_id = calendar_object.id))'; 
     59                .'AND (calendar_repeat.object_id = calendar_object.id)) group by calendar_object.id, calendar_to_calendar_object.calendar_id'; 
    5660 
    5761        $params = Controller::service('PostgreSQL')->execResultSql($sql.$where); 
     
    7377            .'calendar_object.range_end as "rangeEnd", calendar_object.last_update as "lastUpdate", ' 
    7478            .'calendar_object.dtstamp as "dtstamp", calendar_object.sequence as "sequence", ' 
     79 
     80            .'count(calendar_task_to_activity_object.id) as "tasks", ' 
     81 
    7582            .'calendar_object.tzid as "timezone" ,calendar_to_calendar_object.calendar_id as ' 
    76             .'calendar FROM calendar_to_calendar_object , calendar_object ' 
     83            .'calendar FROM calendar_object left join calendar_task_to_activity_object on ( calendar_object.id = calendar_task_to_activity_object.calendar_object_activity_id  ), calendar_to_calendar_object ' 
    7784            .'WHERE ( calendar_to_calendar_object.calendar_id IN (\'' . implode('\',\'', $calendars) . '\')) ' 
    7885            .'AND calendar_to_calendar_object.calendar_object_id = calendar_object.id ' 
     
    8087 
    8188 
    82             $where = 'AND (((upper("summary") like upper(\'%'.$summary.'%\') OR upper("description") like upper(\'%'.$description.'%\')))) ORDER BY dtstart LIMIT '.$limit.'  OFFSET '.$offset.' '; 
     89            $where = 'AND (((upper("summary") like upper(\'%'.$summary.'%\') OR upper("description") like upper(\'%'.$description.'%\')))) group by calendar_object.id, calendar_to_calendar_object.calendar_id ORDER BY dtstart LIMIT '.$limit.'  OFFSET '.$offset.' '; 
    8390            $params = Controller::service('PostgreSQL')->execResultSql($sql.$where); 
    84  
    85  
    8691 
    8792        return $this->normalizeEvents( $params, $timezones ); 
     
    137142                    $attend = $attend[0]; 
    138143 
    139                 $result[$i]['editable'] = (strstr($attend['acl'],"w") || strstr($attend['acl'],"o")) ? 1 : 0; 
     144                $result[$i]['editable'] = (strstr($attend['acl'],"w") || strstr($attend['acl'],"o") || $attend['isOrganizer'] == '1') ? 1 : 0; 
    140145 
    141146            }else{ 
     
    144149 
    145150            } 
     151            if( $v['type'] == 2 && $v['tasks'] > 0) 
     152                $result[$i]['type'] = 3; 
    146153        } 
    147154 
Note: See TracChangeset for help on using the changeset viewer.