Changeset 4316


Ignore:
Timestamp:
05/10/11 15:42:04 (13 years ago)
Author:
airton
Message:

Ticket #1820 - Opcao nos agendamentos para enviar notificacoes como dono - r4217

Location:
sandbox/2.2.0.2/calendar
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • sandbox/2.2.0.2/calendar/inc/class.bocalendar.inc.php

    r4159 r4316  
    11891189                                $this->so->set_description($l_cal['description']); 
    11901190                                $this->so->set_observations($l_cal['observations']); 
    1191                                 $this->so->set_attachment($l_cal['attachment']); 
     1191                                $this->so->set_notifications_owner($l_cal['notifications_owner']) 
     1192                                $this->so->set_attachment($l_cal['attachment']); 
    11921193                                $this->so->set_ex_participants($l_cal['ex_participants']); 
    11931194                                $this->so->set_start($l_start['year'],$l_start['month'],$l_start['mday'],$l_start['hour'],$l_start['min'],0); 
     
    31103111 
    31113112                        $GLOBALS['phpgw_info']['user']['preferences'] = $GLOBALS['phpgw']->preferences->create_email_preferences(); 
    3112                         $sender = $GLOBALS['phpgw_info']['user']['email']; 
    3113  
    3114                         $temp_tz_offset = $this->prefs['common']['tz_offset']; 
     3113 
     3114                    $preferences = CreateObject('phpgwapi.preferences',(int)$this->owner);  
     3115                    $GLOBALS['phpgw']->accounts->get_account_name((int)$owner,$lid,$fname,$lname);  
     3116                  
     3117                        if($new_event['notifications_owner'] == '1'){  
     3118                        $sender = $preferences->email_address((int)$owner);  
     3119                        $sender_name = $fname.' '.$lname;  
     3120                    }else{  
     3121                        $sender = $GLOBALS['phpgw_info']['user']['email'];  
     3122                        $sender_name = $GLOBALS['phpgw_info']['user']['fullname'];  
     3123                        }  
     3124                  
     3125                    $temp_tz_offset = $this->prefs['common']['tz_offset']; 
     3126                         
    31153127                        $temp_timeformat = $this->prefs['common']['timeformat']; 
    31163128                        $temp_dateformat = $this->prefs['common']['dateformat']; 
     
    32523264                                        continue;       // dont notify rejected participants 
    32533265                                } 
    3254                                 if($userid != $GLOBALS['phpgw_info']['user']['account_id'] ||  $msg_type == MSG_ALARM || isset($new_event['attachment'])) 
     3266                                if($userid != $owner ||  $msg_type == MSG_ALARM || isset($new_event['attachment'])) 
    32553267                                { 
    32563268                                        print_debug('Msg Type',$msg_type); 
     
    35123524                                        $mail->Body .= "\n--01BD3665.3AF0D360--\n"; 
    35133525                                        $mail->From = $sender; 
    3514                                         $mail->FromName = $GLOBALS['phpgw_info']['user']['fullname']; 
     3526                                        $mail->FromName = $sender_name; 
    35153527                                        $mail->Sender = $mail->From; 
    35163528                                        $mail->SenderName = $mail->FromName; 
     
    36053617                                 
    36063618                                $mail->From = $sender; 
    3607                                 $mail->FromName = $GLOBALS['phpgw_info']['user']['fullname']; 
     3619                                $mail->FromName = $sender_name; 
    36083620                                $mail->Sender = $mail->From; 
    36093621                                $mail->SenderName = $mail->FromName; 
     
    36623674                                $mail->Port = $emailadmin['smtpPort']; 
    36633675                                $mail->From = $sender; 
    3664                                 $mail->FromName = $GLOBALS['phpgw_info']['user']['fullname']; 
     3676                                $mail->FromName = $sender_name; 
    36653677                                $mail->Sender = $mail->From; 
    36663678                                $mail->SenderName = $mail->FromName; 
  • sandbox/2.2.0.2/calendar/inc/class.bocustom_fields.inc.php

    r3976 r4316  
    3434                        'observations' => 'Observations', 
    3535                        'alter_by'   =>  'Alter by', 
    36                         'attachment' => 'attachment' 
     36            'attachment' => 'attachment', 
     37                        'notifications_owner' => 'notifications_owner' 
    3738                ); 
    3839 
  • sandbox/2.2.0.2/calendar/inc/class.socalendar.inc.php

    r4024 r4316  
    380380                } 
    381381 
     382                function set_notifications_owner($notifications_owner='')  
     383                {  
     384                $this->cal->set_notifications_owner($notifications_owner);  
     385            } 
     386                 
    382387                function set_ex_participants($ex_participants='') 
    383388                { 
  • sandbox/2.2.0.2/calendar/inc/class.socalendar__.inc.php

    r3976 r4316  
    107107                } 
    108108 
     109                unction set_notifications_owner($notifications_owner='')  
     110                {  
     111                $this->add_attribute('notifications_owner',$notifications_owner);  
     112            }  
     113                 
    109114                function set_alter_by($alter_by='') 
    110115                { 
  • sandbox/2.2.0.2/calendar/inc/class.socalendar_sql.inc.php

    r4147 r4316  
    570570                                $this->set_description(stripslashes($GLOBALS['phpgw']->strip_html($this->stream->f('description')))); 
    571571                                $this->set_observations(stripslashes($GLOBALS['phpgw']->strip_html($this->stream->f('observations')))); 
     572                                $this->set_notifications_owner(stripslashes($GLOBALS['phpgw']->strip_html($this->stream->f('notifications_owner')))); 
    572573                                $this->set_alter_by(stripslashes($GLOBALS['phpgw']->strip_html($this->stream->f('alter_by')))); 
    573574                                $this->set_attachment(stripslashes($GLOBALS['phpgw']->strip_html($this->stream->f('attachment')))); 
     
    986987                                        . "description='".$this->stream->db_addslashes($event['description'])."', " 
    987988                                        . "observations='".$this->stream->db_addslashes($event['observations'])."', " 
    988                                         . "attachment='".$this->stream->db_addslashes($sattach)."', " 
     989                    . 'notifications_owner='.(int)$event['notifications_owner'].',' 
     990                                        . "attachment='".$this->stream->db_addslashes($sattach)."', " 
    989991                                        . "alter_by='".$this->stream->db_addslashes($GLOBALS['phpgw_info']['user']['fullname'])."', " 
    990992                                        . "ex_participants='".$this->stream->db_addslashes($event['ex_participants'])."', " 
  • sandbox/2.2.0.2/calendar/inc/class.uicalendar.inc.php

    r4195 r4316  
    60986098                        ); 
    60996099 
     6100                        $preferences = CreateObject('phpgwapi.preferences',(int)$this->owner); 
     6101            $selected_creator = $selected_owner = ''; 
     6102            if($event['notifications_owner'] == 1) 
     6103                $selected_owner = ' selected'; 
     6104            else 
     6105                $selected_creator = ' selected'; 
     6106                      
     6107            $option = '<option value="0" '.$selected_creator.' >'.$GLOBALS['phpgw']->common->grab_owner_name((int)$_SESSION['phpgw_session']['account_id']).'</option>'; 
     6108            if($_SESSION['phpgw_session']['account_id'] != $event['owner']){ 
     6109                $option .= '<option value="1" '.$selected_owner.' >'.$GLOBALS['phpgw']->common->grab_owner_name((int)$event['owner']).'</option>'; 
     6110            } 
     6111            $var['notifications_owner'] = Array( 
     6112                'field' => lang('Send notificatios as'), 
     6113                'data'  => '<select name="cal[notifications_owner]" >'.$option.'</select>' 
     6114                ); 
     6115                                 
    61006116                        if($event['recur_enddate']['year'] != 0 && $event['recur_enddate']['month'] != 0 && $event['recur_enddate']['mday'] != 0) 
    61016117                        { 
  • sandbox/2.2.0.2/calendar/setup/tables_current.inc.php

    r4128 r4316  
    2727                                'title' => array('type' => 'varchar','precision' => '300','nullable' => False,'default' => '1'), 
    2828                                'description' => array('type' => 'text','nullable' => True), 
     29                                'notifications_owner' => array('type' => 'int','precision' => '1','nullable' => False,'default' => '0'), 
    2930                                'observations' => array('type' => 'text','nullable' => True), 
    3031                                'attachment' => array('type' => 'text','nullable' => True), 
  • sandbox/2.2.0.2/calendar/setup/tables_update.inc.php

    r4186 r4316  
    8383        function calendar_upgrade2_2_000() 
    8484        { 
    85             $GLOBALS['phpgw_setup']->db->query("ALTER TABLE phpgw_cal ADD COLUMN observations text"); 
     85            $GLOBALS['phpgw_setup']->db->query("ALTER TABLE phpgw_cal ADD COLUMN notifications_owner INT NOT NULL deafult '0'"); 
     86                $GLOBALS['phpgw_setup']->db->query("ALTER TABLE phpgw_cal ADD COLUMN observations text"); 
    8687            $GLOBALS['phpgw_setup']->db->query("ALTER TABLE phpgw_cal ADD COLUMN alter_by varchar(160)"); 
    8788            $GLOBALS['phpgw_setup']->db->query("ALTER TABLE phpgw_cal ADD COLUMN attachment text"); 
Note: See TracChangeset for help on using the changeset viewer.