Changeset 5998


Ignore:
Timestamp:
04/23/12 15:34:17 (12 years ago)
Author:
cristiano
Message:

Ticket #2640 - Problemas com eventos no módulo ExpressoCalendar?

Location:
trunk/prototype
Files:
3 edited

Legend:

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

    r5953 r5998  
    761761 
    762762        $calendarsToSchedulable = self::schedulable2calendarToObject($uri['id']); 
    763         if( !self::ownerSchedulable($uri['id']) ) 
    764         {            
     763         
     764        if( !self::ownerSchedulable($uri['id']) && !self::isAllowDeleteInCalendar($calendarsToSchedulable[0]['calendar_id'])) 
     765        { 
     766             
    765767             foreach ($calendarsToSchedulable as $i => $v) 
    766768             { 
     
    10381040                .' AND calendar_to_calendar_object.calendar_object_id = '.addslashes($Schedulable)); 
    10391041    } 
    1040                     
     1042                 
     1043    protected static function isAllowDeleteInCalendar( $calendar ) { 
     1044         $f = Controller::find(array('concept' => 'calendarToPermission') , false , array('filter' => array('AND' , array('=', 'user' , Config::me('uidNumber') ) , array('=', 'calendar' , $calendar))));        
     1045         return (strpos($f[0]['acl'], CALENDAR_ACL_REMOVE) === false) ? false : true;         
     1046    } 
     1047     
    10411048} 
    10421049 
  • trunk/prototype/services/PostgreSQL.php

    r5971 r5998  
    3434 
    3535    public function delete ( $uri, $justthese = false, $criteria = false ){ 
     36            if(!isset($uri['id']) && !is_int($uri['id'])) return false; //Delete chamado apenas passando id inteiros 
    3637            $map = Config::get($uri['concept'], 'PostgreSQL.mapping'); 
    37             if(!self::parseCriteria ( $criteria , $map)) return false; //Validador para não apagar tabela inteira 
    3838            $criteria = ($criteria !== false) ? $this->parseCriteria ( $criteria , $map , ' WHERE '.$map['id'].' = \''.addslashes( $uri['id'] ).'\'') : ' WHERE '.$map['id'].' = \''.addslashes( $uri['id'] ).'\''; 
    3939            return $this->execSql('DELETE FROM '.(Config::get($uri['concept'],'PostgreSQL.concept')).$criteria); 
  • trunk/prototype/services/iCal.php

    r5947 r5998  
    6262                               if($rv) 
    6363                               { 
    64                                    if($ir == 'frequency') 
     64                                   if($ir == 'frequency' && $rv !== 'none') 
    6565                                      $repeat['FREQ'] =  $rv; 
    6666                                   else if($ir == 'endTime' ) 
     
    7676                               } 
    7777                           } 
    78                            
    79                            $vevent->setProperty('rrule' , $repeat); 
     78                                             
     79                           if(isset($repeat['FREQ'])) 
     80                                $vevent->setProperty('rrule' , $repeat); 
    8081                       } 
    8182                        
     
    135136                        $isResponseDelegated = false; 
    136137                        if(isset($pv['delegatedFrom']) && $pv['delegatedFrom'] == 0){ 
    137                                 if($pv['isOrganizer'] == 1) 
    138                                    $vevent->setProperty( 'organizer' , $pv['user']['mail'], array( 'CN' => $pv['user']['name'] ));   
     138                                if($pv['isOrganizer'] == 1){ 
     139                                   if($pv['user']['id'] == Config::me('uidNumber')) 
     140                                        $pv['user']['mail'] = str_replace('@correiolivre.caixa','@caixa.gov.br',$pv['user']['mail']);                                    
     141                                 
     142                                   $vevent->setProperty( 'organizer' , $pv['user']['mail'], array( 'CN' => $pv['user']['name'])); 
     143                                } 
     144                                 
    139145                                else 
    140146                                { 
     
    10731079} 
    10741080?> 
     1081 
     1082?> 
Note: See TracChangeset for help on using the changeset viewer.