Ignore:
Timestamp:
09/14/10 16:31:39 (14 years ago)
Author:
rafaelraymundo
Message:

Ticket #799 - Erro ao delegar um evento sem selecionar usuario

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/calendar/inc/class.bocalendar.inc.php

    r3196 r3244  
    384384                        $this->so->cal->stream->lock(array("phpgw_cal_user")); 
    385385                        $sql = "SELECT * FROM phpgw_cal_user where cal_id=$idEvento and cal_login=$idDelegado"; 
    386                          
    387                         $this->so->cal->stream->query($sql,__LINE__,__FILE__); 
    388                         if($this->so->cal->stream->next_record()) 
    389                         { 
    390                                 throw new Exception("The selected User is already included in this event"); 
    391                         }else{ 
    392                                 $sql = "update phpgw_cal_user set cal_login = $idDelegado,cal_status='U' where cal_id=$idEvento  
     386 
     387                        if($idDelegado != '') 
     388                        { 
     389                                $this->so->cal->stream->query($sql,__LINE__,__FILE__); 
     390                                if($this->so->cal->stream->next_record()) 
     391                                { 
     392                                        throw new Exception("The selected User is already included in this event"); 
     393                                }else{ 
     394                                        $sql = "update phpgw_cal_user set cal_login = $idDelegado,cal_status='U' where cal_id=$idEvento  
    393395                                                and cal_login=$idDelegador"; 
    394396 
    395                                 $this->so->cal->stream->query($sql,__LINE__,__FILE__,0,-1,true); 
     397                                        $this->so->cal->stream->query($sql,__LINE__,__FILE__,0,-1,true); 
    396398                                 
    397                                 $event = $this->so->read_entry($idEvento); 
    398  
    399                                 $this->send_update(MSG_ADDED,array($idDelegado => 'U'),$event,$event); 
    400                         } 
     399                                        $event = $this->so->read_entry($idEvento); 
     400 
     401                                        $this->send_update(MSG_ADDED,array($idDelegado => 'U'),$event,$event); 
     402                                } 
     403                        }else { 
     404                                throw new Exception('999'); 
     405                        } 
     406 
    401407                        $this->so->cal->stream->unlock(); 
    402408                } 
    403  
    404409 
    405410          function load_lang() { 
Note: See TracChangeset for help on using the changeset viewer.