Changeset 4707 for trunk/calendar


Ignore:
Timestamp:
07/13/11 17:29:49 (13 years ago)
Author:
roberto.santosjunior
Message:

Ticket #1820 - Itens ausentes na agenda - preferencia da agenda. r4557

Location:
trunk/calendar
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/calendar/inc/class.uicalendar.inc.php

    r4705 r4707  
    477477                        if($this->bo->printer_friendly || $_GET['plain'] == 'True') 
    478478                        {        
    479                                 $app_css_path = $_SESSION['phpgw_info']['calendar']['user']['preferences']['common']['template_set'];  
    480                     $app_print_css_path = $app_css_path;  
    481                     if (!file_exists($GLOBALS['phpgw_info']['server']['webserver_url'].'/calendar/templates/'.$app_css_path.'/app.css'))  
    482                                         $app_css_path = 'default';  
    483                     if (!file_exists($GLOBALS['phpgw_info']['server']['webserver_url'].'/calendar/templates/'.$app_print_css_path.'/app_print.css'))  
     479                                $app_css_path = $_SESSION['phpgw_info']['calendar']['user']['preferences']['common']['template_set']; 
     480                                $app_print_css_path = $app_css_path; 
     481                                if (!file_exists($GLOBALS['phpgw_info']['server']['webserver_url'].'/calendar/templates/'.$app_css_path.'/app.css')) 
     482                                        $app_css_path = 'default'; 
     483                                if (!file_exists($GLOBALS['phpgw_info']['server']['webserver_url'].'/calendar/templates/'.$app_print_css_path.'/app_print.css')) 
    484484                                        $app_print_css_path = 'default'; 
    485                          
    486                          
     485 
    487486                                $new_body = '<html>'."\n" 
    488487                                        .'<head>'."\n" 
     
    531530 
    532531                        }else{ 
    533                             $params['day'] = $_POST['date']?(int)substr($_POST['date'] , 6, 2):(int)substr($_GET['date'] , 6, 2);  
    534                                 $params['month'] = $_POST['date']?(int)substr($_POST['date'] , 4, 2):(int)substr($_GET['date'] , 4, 2);  
    535                                                         $params['year'] = $_POST['date']?(int)substr($_POST['date'] , 0, 4):(int)substr($_GET['date'] , 0, 4);  
     532                            $params['day'] = $_POST['date']?(int)substr($_POST['date'] , 6, 2):(int)substr($_GET['date'] , 6, 2); 
     533                            $params['month'] = $_POST['date']?(int)substr($_POST['date'] , 4, 2):(int)substr($_GET['date'] , 4, 2); 
     534                            $params['year'] = $_POST['date']?(int)substr($_POST['date'] , 0, 4):(int)substr($_GET['date'] , 0, 4); 
    536535 
    537536                        } 
     
    705704                            $params['month'] = $_GET['month']?(int)$_GET['month']:(int)$_POST['month']; 
    706705                            $params['year'] = $_GET['year']?(int)$_GET['year']:(int)$_POST['year']; 
    707                             $params['day'] = $_GET['day']?(int)$_GET['day']:(int)$_POST['day'];; 
     706                            $params['day'] = $_GET['day']?(int)$_GET['day']:(int)$_POST['day']; 
    708707 
    709708                        }else{ 
    710                             $params['day'] = $_POST['date']?(int)substr($_POST['date'] , 6, 2):(int)substr($_GET['date'] , 6, 2);  
    711                                                         $params['month'] = $_POST['date']?(int)substr($_POST['date'] , 4, 2):(int)substr($_GET['date'] , 4, 2);  
    712                                 $params['year'] = $_POST['date']?(int)substr($_POST['date'] , 0, 4):(int)substr($_GET['date'] , 0, 4); 
     709                            $params['day'] = $_POST['date']?(int)substr($_POST['date'] , 6, 2):(int)substr($_GET['date'] , 6, 2); 
     710                            $params['month'] = $_POST['date']?(int)substr($_POST['date'] , 4, 2):(int)substr($_GET['date'] , 4, 2); 
     711                            $params['year'] = $_POST['date']?(int)substr($_POST['date'] , 0, 4):(int)substr($_GET['date'] , 0, 4); 
    713712 
    714713                        } 
     
    36593658                        } 
    36603659                        else 
    3661                         { if ($texttitle) 
     3660                        {if ($texttitle) 
    36623661                                $picture[] = Array( 
    36633662                                        'pict'  =>  $GLOBALS['phpgw']->common->image('calendar','single'), 
     
    50885087                        if(isset($_GET['date'])) 
    50895088                        { 
    5090                 $dia = substr($_GET['date'],-2); 
    5091             } 
    5092             elseif(isset($_POST['day'])) 
    5093             { 
    5094                 $dia = $_POST['day']; 
    5095             } 
    5096             else 
    5097             { 
    5098                 $dia = $params['day']; 
    5099             } 
    5100                          
    5101             $print =  '<a href="javascript:void(0)" id="printFriendly">['.lang('Printer Friendly').']</a>'; 
    5102             $param = '&year='.$this->bo->year.'&month='.$this->bo->month.'&friendly=1'.'&day_ini='.$dia.'&num_dias=1'.'&d=1'; 
     5089                            $dia = substr($_GET['date'],-2); 
     5090                        } 
     5091                        elseif(isset($_POST['day'])) 
     5092                        { 
     5093                            $dia = $_POST['day']; 
     5094                        } 
     5095                        else 
     5096                        { 
     5097                            $dia = $params['day']; 
     5098                        } 
    51035099                         
    5104                          
     5100                        $print =  '<a href="javascript:void(0)" id="printFriendly">['.lang('Printer Friendly').']</a>'; 
     5101                        $param = '&year='.$this->bo->year.'&month='.$this->bo->month.'&friendly=1'.'&day_ini='.$dia.'&num_dias=1'.'&d=1'; 
     5102 
    51055103                        $p->set_file($templates); 
    51065104                        $p->set_block('day_cal','day','day'); 
     
    51105108                        $p->set_var('date',$result_events_json['date_events_json']); 
    51115109                        $p->set_var('templateSet',$templateSet); 
    5112                         $p->set_var('iprint',$print);  
    5113                 $p->set_var('param',$param);             
     5110                        $p->set_var('iprint',$print); 
     5111                        $p->set_var('param',$param); 
    51145112                        $p->set_var('hora_final',$result_events_json['hora_final']); 
    51155113                        $p->set_var('hora_inicial',$result_events_json['hora_inicial']); 
     
    53985396 
    53995397                        $events_to_show_json = array(); 
    5400                                                 $templateSet = $GLOBALS['phpgw_info']['server']['template_set']; 
    5401                                                  
     5398                        $templateSet = $GLOBALS['phpgw_info']['server']['template_set']; 
    54025399                        foreach($dates as $day) 
    54035400                        { 
     
    54245421                                } 
    54255422 
    5426  
    54275423                                $isPublic = 1; 
    54285424                                if(($event['type'] == E && $event['public'] == 0)) 
    54295425                                { 
    54305426                                    $isPublic = 0; 
    5431                                     $isPublicTitle = lang('private'); 
     5427                                    $isPublicTitle = lang('restrict'); 
    54325428                                } 
    54335429 
     
    54355431                                { 
    54365432                                    $isPublic = 0; 
    5437                                     $isPublicTitle = "Privado"; 
     5433                                    $isPublicTitle = lang('private'); 
    54385434                                } 
    54395435 
     
    54585454                                } 
    54595455                                if($event['users_status'] == 'R') 
    5460                                                                 { 
     5456                                { 
    54615457                                    $rejected = TRUE; 
    5462                                 } 
    5463                                                                 else 
    5464                                                                 { 
     5458                                } 
     5459                                else 
     5460                                { 
    54655461                                    $rejected = FALSE; 
    5466                                                                 } 
    5467                                                                  
    5468                                 if($title_view == 0)  
    5469                                 {  
    5470                                     if($_GET['menuaction'] ==  'calendar.uicalendar.day') 
    5471                                     { 
    5472                                         $text = $event['description'];  
    5473                                                     }  
    5474                                                     elseif($_GET['menuaction'] ==  'calendar.uicalendar.week')  
    5475                                                     {  
    5476                                                 $text = ' - '.$event['end']['hour'].':'.$event['end']['min'];  
    5477           
    5478                                                 //is recurrent?  
    5479                                                         $text .= (isset($recur) && $recur != false) ? ' ' . '<img width="10px" height="10px" border="0" title="'.lang('recurring event').'" src="calendar/templates/'.$templateSet.'/images/recur.png"/>' : '' ;  
    5480                   
    5481                                                         //participants?  
    5482                                                 if(count($event['participants']) > 1)  
    5483                                                         {  
    5484                                                             $text .= " " . '<img width="11px" height="10px" border="0" title="'.$participants.'" src="calendar/templates/'.$templateSet.'/images/multi_3.png"/>';  
    5485                                                         }  
    5486                                                         else  
    5487                                                         {  
    5488                                                             $text .= " " . '<img width="11px" height="10px" border="0" title="'.$participants.'" src="calendar/templates/'.$templateSet.'/images/single.png"/>';  
    5489                                                         }  
    5490                   
    5491                                                         //has attachments?  
    5492                                                         $text .= (isset($event['attachment']) && $event['attachment'] != '') ? ' ' . '<img width="10px" height="10px" border="0" title="'.lang('email notifications with attachments has been sent').'" src="calendar/templates/'.$templateSet.'/images/clip.png"/>' : '' ;  
    5493                   
    5494                                                         //is public?  
    5495                                                         $text .= $isPublic == 0 ? ' ' . '<img width="11px" height="10px" border="0" title="'.$isPublicTitle.'" src="calendar/templates/'.$templateSet.'/images/private.png"/>' : '' ;  
    5496                   
    5497                                                         //has alarm?  
    5498                                                         $text .= (isset($event['alarm']) && count($event['alarm']) >= 1) ? ' ' . '<img width="11px" height="10px" border="0" title="'.lang('alarm').'" src="calendar/templates/'.$templateSet.'/images/alarm.png"/>' : '' ;  
    5499                   
    5500                                                         $text .= ' - ' . $event['title']." - ".$event['description']; 
    5501                                     } 
    5502                                     else 
    5503                                     { 
    5504                                         $text = ' - '.$event['end']['hour'].':'.$event['end']['min'] . ' - '. $event['title']." - ".$event['description']; 
    5505                                     } 
    5506  
    5507                                 } 
    5508                                 else 
    5509                                 { 
    5510                                     $text = ''; 
    5511                                 } 
    5512                                                                  
    5513                                                                  
    5514                                                                  
     5462                                } 
     5463 
     5464                                $evDescription = ''; 
     5465                                if($title_view == 0) 
     5466                                { 
     5467                                    $evDescription = " - ".$event['description']; 
     5468                                } 
     5469 
     5470                                if($_GET['menuaction'] ==  'calendar.uicalendar.day') 
     5471                                { 
     5472                                    $text = $event['description']; 
     5473                                } 
     5474                                elseif($_GET['menuaction'] ==  'calendar.uicalendar.week') 
     5475                                { 
     5476                                     
     5477                                    $text = ' - '.$event['end']['hour'].':'.$event['end']['min']; 
     5478 
     5479                                    //is recurrent? 
     5480                                    $text .= (isset($recur) && $recur != false) ? ' ' . '<img width="10px" height="10px" border="0" title="'.lang('recurring event').'" src="calendar/templates/'.$templateSet.'/images/recur.png"/>' : '' ; 
     5481 
     5482                                    //participants? 
     5483                                    if(count($event['participants']) > 1) 
     5484                                    { 
     5485                                        $text .= " " . '<img width="11px" height="10px" border="0" title="'.$participants.'" src="calendar/templates/'.$templateSet.'/images/multi_3.png"/>'; 
     5486                                    } 
     5487                                    else 
     5488                                    { 
     5489                                        $text .= " " . '<img width="11px" height="10px" border="0" title="'.$participants.'" src="calendar/templates/'.$templateSet.'/images/single.png"/>'; 
     5490                                    } 
     5491 
     5492                                    //has attachments? 
     5493                                    $text .= (isset($event['attachment']) && $event['attachment'] != '') ? ' ' . '<img width="10px" height="10px" border="0" title="'.lang('email notifications with attachments has been sent').'" src="calendar/templates/'.$templateSet.'/images/clip.png"/>' : '' ; 
     5494 
     5495                                    //is public? 
     5496                                    $text .= $isPublic == 0 ? ' ' . '<img width="11px" height="10px" border="0" title="'.$isPublicTitle.'" src="calendar/templates/'.$templateSet.'/images/private.png"/>' : '' ; 
     5497 
     5498                                    //has alarm? 
     5499                                    $text .= (isset($event['alarm']) && count($event['alarm']) >= 1) ? ' ' . '<img width="11px" height="10px" border="0" title="'.lang('alarm').'" src="calendar/templates/'.$templateSet.'/images/alarm.png"/>' : '' ; 
     5500 
     5501                                    $text .= ' - ' . $event['title'].$evDescription; 
     5502                                } 
     5503                                else 
     5504                                { 
     5505                                    $text = ' - '.$event['end']['hour'].':'.$event['end']['min'] . ' - '. $event['title'].$evDescription; 
     5506                                } 
     5507 
    55155508                                $events_to_show_json[] = array( 
    55165509                                    start_date              => $event['start']['year'].'-'.$event['start']['month'].'-'.$event['start']['mday'].' '.$event['start']['hour'].':'.$event['start']['min'], 
    55175510                                    end_date                => $event['end']['year'].'-'.$event['end']['month'].'-'.$event['end']['mday'].' '.$event['end']['hour'].':'.$event['end']['min'] . ' - ' . utf8_encode($event['title']), 
    55185511                                    text                    => utf8_encode($text), 
    5519                                     textTitle               => utf8_encode($event['description']), 
    5520                                     descOnTitle             => ($eventTime <= 30) ? 1 : 0, 
     5512                                    textTitle               => utf8_encode($event['description']), //week and month tooltip 
     5513                                    descOnTitle             => ($eventTime <= 57) ? 1 : 0, 
    55215514                                    title                   => utf8_encode($event['title']), 
    55225515                                    observation             => utf8_encode($event['observations']), 
     
    55265519                                    participants_title      => $participants, 
    55275520                                    attachments             => $event['attachment'] ? 1 : 0 , 
    5528                                                                         attachmentsTitle        => utf8_encode(lang('email notifications with attachments has been sent')), 
     5521                                    attachmentsTitle        => utf8_encode(lang('email notifications with attachments has been sent')), 
    55295522                                    isPublic                => $isPublic, 
    55305523                                    isPublicTitle           => utf8_encode($isPublicTitle), 
    55315524                                    alarm                   => (isset($event['alarm']) && count($event['alarm']) >= 1) ? 1 : 0, 
    5532                                                                         alarmTitle              => utf8_encode(lang('alarm')), 
     5525                                    alarmTitle              => utf8_encode(lang('alarm')), 
    55335526                                    recur                   => $recur, 
    5534                                                                         recurTitle              => utf8_encode(lang('recurring event')), 
     5527                                    recurTitle              => utf8_encode(lang('recurring event')), 
    55355528                                    intersection            => $intersection, 
    55365529                                    rejected                => $rejected, 
    5537                                     title_view              => $title_view 
     5530                                    title_view              => $title_view 
    55385531                                ); 
    55395532 
     
    60136006                                                                        // End load array_lang 
    60146007                                                                } 
    6015                                                                  
    6016                                                                 $edit_js_path = 'calendar/templates/'.$_SESSION['phpgw_info']['calendar']['user']['preferences']['common']['template_set'];  
    6017                                     if (!file_exists($GLOBALS['phpgw_info']['server']['webserver_url'].$edit_js_path.'/js/edit.js'))  
    6018                                         $edit_js_path = 'calendar';  
     6008 
     6009                                                                $edit_js_path = 'calendar/templates/'.$_SESSION['phpgw_info']['calendar']['user']['preferences']['common']['template_set']; 
     6010                                                                if (!file_exists($GLOBALS['phpgw_info']['server']['webserver_url'].$edit_js_path.'/js/edit.js')) 
     6011                                                                        $edit_js_path = 'calendar'; 
    60196012 
    60206013                                                                $var['participants'] = array 
     
    61076100                        } 
    61086101 
    6109 // Reminder 
     6102                        // Reminder 
    61106103                        // The user must use "Alarm Management" to change/modify an alarm 
    61116104                        // so only display the email reminder fields if this is a new event 
     
    61906183                        ); 
    61916184 
    6192                         $preferences = CreateObject('phpgwapi.preferences',(int)$this->owner); 
    6193             $selected_creator = $selected_owner = ''; 
    6194             if($event['notifications_owner'] == 1) 
    6195                 $selected_owner = ' selected'; 
    6196             else 
    6197                 $selected_creator = ' selected'; 
    6198                       
    6199             $option = '<option value="0" '.$selected_creator.' >'.$GLOBALS['phpgw']->common->grab_owner_name((int)$_SESSION['phpgw_session']['account_id']).'</option>'; 
    6200             if($_SESSION['phpgw_session']['account_id'] != $event['owner']){ 
    6201                 $option .= '<option value="1" '.$selected_owner.' >'.$GLOBALS['phpgw']->common->grab_owner_name((int)$event['owner']).'</option>'; 
    6202             } 
    6203             $var['notifications_owner'] = Array( 
    6204                 'field' => lang('Send notificatios as'), 
    6205                 'data'  => '<select name="cal[notifications_owner]" >'.$option.'</select>' 
    6206                 ); 
    6207                                  
     6185 
     6186                        $preferences = CreateObject('phpgwapi.preferences',(int)$this->owner); 
     6187                       $selected_creator = $selected_owner = ''; 
     6188                       if($event['notifications_owner'] == 1) 
     6189                           $selected_owner = ' selected'; 
     6190                       else 
     6191                           $selected_creator = ' selected'; 
     6192                       
     6193                       $option = '<option value="0" '.$selected_creator.' >'.$GLOBALS['phpgw']->common->grab_owner_name((int)$_SESSION['phpgw_session']['account_id']).'</option>'; 
     6194                       if($_SESSION['phpgw_session']['account_id'] != $event['owner']){ 
     6195                           $option .= '<option value="1" '.$selected_owner.' >'.$GLOBALS['phpgw']->common->grab_owner_name((int)$event['owner']).'</option>'; 
     6196                       } 
     6197 
     6198 
     6199                       $var['notifications_owner'] = Array( 
     6200                                'field' => lang('Send notificatios as'), 
     6201                                'data'  => '<select name="cal[notifications_owner]" >'.$option.'</select>' 
     6202                        ); 
     6203 
     6204 
    62086205                        if($event['recur_enddate']['year'] != 0 && $event['recur_enddate']['month'] != 0 && $event['recur_enddate']['mday'] != 0) 
    62096206                        { 
  • trunk/calendar/js/dhtmlx/codebase/dhtmlxscheduler_debug.js

    r4554 r4707  
    31733173        if (cse) cs=cs+" "+cse; 
    31743174//alert(h); 
     3175//alert(title_view); 
     3176        var evDescription = contentB; 
     3177 
    31753178        var html = ''; 
    31763179        if(h == 41) 
     
    31863189        else 
    31873190        { 
     3191            //hide/show event description according to the preference title_view 
     3192            if(ev.title_view == 1) 
     3193            { 
     3194                evDescription = ''; 
     3195            } 
     3196             
    31883197            html='<div event_id="'+id+'" class="'+cs+'" ondblclick="javascript:callViewEvent(\''+id+'\');" title="'+contentB+'" style="position:absolute; top:'+y+'px; left:'+x+'px; width:'+(w-4)+'px; height:'+h+'px;'+(style||"")+'">'; 
    31893198            //var html='<div event_id="'+id+'" class="'+cs+'" ondblclick="javascript:callViewEvent(\''+id+'\');" title="'+contentB+'" style="position:absolute; top:'+y+'px; left:'+x+'px; width:'+(w-4)+'px; height:'+(h-(this._quirks?15:25))+'px;">'; 
     
    31913200            html+='<div class="dhx_title">'+contentA+'</div>'; 
    31923201            //html+='<div class="dhx_title" style="height:'+(h-(this._quirks?15:25))+'px;">'+contentA+'</div>'; 
    3193             html+='<div class="dhx_body" style=" width:'+(w-(this._quirks?4:14))+'px; height:'+(h-(this._quirks?20:30))+'px;">'+contentB+'</div>'; 
     3202            html+='<div class="dhx_body" style=" width:'+(w-(this._quirks?4:14))+'px; height:'+(h-(this._quirks?20:30))+'px;">'+evDescription+'</div>'; 
    31943203            html+='<div class="dhx_footer" style=" width:'+(w-8)+'px;'+(bottom?' margin-top:-1px;':'')+'" ></div></div>'; 
    31953204        } 
  • trunk/calendar/templates/default/day_cal.tpl

    r4565 r4707  
    150150            } 
    151151 
    152             if(event.title_view == 0)  
    153                             {  
    154                                 if(event.descOnTitle == 1)  
    155                                 {  
    156                                     var eventDescOnTitle = (" - ") + event.text;  
    157                                 }  
    158                                 else  
    159                                 {  
    160                                     var eventDescOnTitle = '';  
    161                                 } 
     152            //hide/show event description according to the preference title_view 
     153            if(event.title_view == 0) 
     154            { 
     155                if(event.descOnTitle == 1) //to show, or not, description beside the title 
     156                { 
     157                    var eventDescOnTitle = (" - ") + event.text; 
     158                } 
     159                else 
     160                { 
     161                    var eventDescOnTitle = ''; 
     162                } 
    162163            } 
    163164            else 
     
    209210<!-- END day --> 
    210211<!-- BEGIN day_event_off --> 
    211         <!--<font class="event-on">{event}</font>--> 
     212        <!--<font class="event-on">{event}</font>--> 
    212213<!-- END day_event_off --> 
    213214<!-- BEGIN day_time --> 
    214         <!--{time}--> 
     215        <!--{time}--> 
    215216     <!--<td class="time" nowrap>{open_link}{time}{close_link}</td>--> 
    216217<!-- END day_time --> 
     
    219220<!-- END day_row --> 
    220221<!-- BEGIN day_event_on --> 
    221         <!--<font class="event-on">{event}</font>--> 
     222        <!--<font class="event-on">{event}</font>--> 
    222223<!-- END day_event_on --> 
    223224<!-- BEGIN day_event_holiday --> 
    224         <!--{event}--> 
     225        <!--{event}--> 
    225226<!-- END day_event_holiday --> 
Note: See TracChangeset for help on using the changeset viewer.