Changeset 6588


Ignore:
Timestamp:
06/22/12 17:32:11 (7 years ago)
Author:
eduardow
Message:

Ticket #2864 - Problema com os eventos que contém repetição.

Location:
branches/2.4/prototype/modules/calendar
Files:
3 edited

Legend:

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

    r6584 r6588  
    147147                        .'(range_start >= \'' . $start[1] . '\' AND range_start <= \'' . $end[1] . '\') OR ' 
    148148                        .'(range_start <= \'' . $start[2] . '\' AND range_end >= \'' . $end[2] . '\')) ' 
    149                 .(!empty($ids) ? ' ' .'AND calendar_object.id NOT IN (\'' . implode('\',\'', $ids) . '\') ' : ' '); 
    150  
     149                .(!empty($ids) ? ' ' .'AND calendar_object.id NOT IN (\'' . implode('\',\'', $ids) . '\') ' : ' ')  
     150                .'AND calendar_object.dtstart NOT IN (SELECT calendar_repeat_occurrence.occurrence from calendar_repeat_occurrence, '  
     151                .'calendar_repeat where (calendar_repeat_occurrence.repeat_id = calendar_repeat.id) '  
     152                .'AND (calendar_repeat.object_id = calendar_object.id))'; 
    151153 
    152154                $params = Controller::service('PostgreSQL')->execResultSql($sql.$where); 
     
    204206        //Recurepa as execeções anteriores caso exista 
    205207        if (isset($lastExceptions) && count($lastExceptions) && $lastExceptions) 
    206             foreach ($lastExceptions as $key => $value) 
    207                 array_push($exceptions, $lastExceptions[$key]['occurrence']); 
     208            foreach ($lastExceptions as $value)  
     209                array_push($exceptions, $value['occurrence']); 
    208210 
    209211        $params = array_diff(self::decodeRepeat($repeat, $ranges[0]['rangeStart'], $ranges[0]['rangeEnd']), $exceptions); 
     
    213215        if (!empty($params)) 
    214216            Controller::service('PostgreSQL')->execResultSql("INSERT INTO calendar_repeat_occurrence(repeat_id,exception,occurrence)VALUES('" . $id . "','0','" . implode("'),('" . $id . "','0','", $params) . "')" . ( empty($exceptions) ? "" : ",('" . $id . "','1','" . implode("'),('" . $id . "','1','", $exceptions) . "')" )); 
    215     } 
     217        else if(!empty($exceptions))  
     218            Controller::service('PostgreSQL')->execResultSql("INSERT INTO calendar_repeat_occurrence(repeat_id,exception,occurrence)VALUES ('" . $id . "','1','" . implode("'),('" . $id . "','1','", $exceptions) . "')" );  
     219   } 
    216220 
    217221    public function checkOccurrences($start, $end, $calendarIds) { 
  • branches/2.4/prototype/modules/calendar/js/calendar.codecs.js

    r6453 r6588  
    499499 
    500500            var isShared = !objEvent.id ? false : (!!objEvent.calendar) && parseInt(Calendar.signatureOf[objEvent.calendar].isOwner) ? false : true; 
    501  
     501            var limitAttendee = false;  
    502502 
    503503            return { 
     
    587587                me: me, 
    588588                delegatedFrom: delegatedFrom, 
    589                 statusParticipants: statusParticipants 
     589                statusParticipants: (objEvent.sizeAttendees != "") ? objEvent.statusAttendees : statusParticipants,  
     590                sizeAttendeeLimit: (objEvent.sizeAttendees != "") ? objEvent.sizeAttendees : false  
    590591            }; 
    591592        }); 
     
    642643    var formatString = User.preferences.dateFormat + " " + User.preferences.hourFormat;  
    643644   
    644     patati['startTime'] = Date.parseExact( form.startDate + " "+$.trim(form.startHour) , formatString ).toString(!!form.allDay ? 'yyyy-MM-dd 00:00:00' : 'yyyy-MM-dd HH:mm:00');  
    645          
     645    var date = Date.parseExact( form.startDate + " "+$.trim(form.startHour) , formatString )  
     646              
     647    patati['startTime'] = date.toString(!!form.allDay ? 'yyyy-MM-dd 00:00:00' : 'yyyy-MM-dd HH:mm:00'); 
     648 
    646649    if( !patati['byday'] ) 
    647650        switch(form.frequency) { 
  • branches/2.4/prototype/modules/calendar/js/calendar.contentMenu.js

    r6462 r6588  
    2626                var schedulable = DataLayer.get('schedulable', idEvent); 
    2727 
    28                 var isRecurrence = DataLayer.get('repeat', schedulable.repeat).frequency; 
    29   
    30                 var top;  
    31                 var elementId = document.getElementById("divAppbox");  
    32                    
    33                 top = elementId.scrollTop;  
     28                var isRecurrence = DataLayer.get('repeat', schedulable.repeat).frequency || false;  
     29                  
     30                var top = $('#divAppbox').scrollTop();   
    3431                   
    3532                var template = DataLayer.render( 'templates/menu_context_event.ejs', {event: schedulable.id , 
    3633                    top: (event.clientY - 135 + top), left: (event.clientX - 445),   
    37                                          signature: Calendar.signatureOf[idCalendar],  
    38                     calendars: Calendar.calendars, isRecurrence: isRecurrence == 'none' ? false : true, 
     34                    signature: Calendar.signatureOf[idCalendar],  
     35                    calendars: Calendar.calendars, isRecurrence: (!isRecurrence || isRecurrence == 'none') ? false : true, 
    3936                    idRecurrence: idRecurrence 
    4037                }); 
Note: See TracChangeset for help on using the changeset viewer.