Changeset 3989


Ignore:
Timestamp:
04/12/11 10:46:02 (13 years ago)
Author:
rafaelraymundo
Message:

Ticket #1611 - Seleção de campos para impressão agenda

Location:
branches/2.2.0.1/calendar
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.0.1/calendar/inc/class.uicalendar.inc.php

    r3978 r3989  
    34683468 
    34693469                        $titleView = $account_prefs['calendar']['title_view']; 
    3470                         if($titleView == "1"){ 
    3471                                 $textdesc = ''; 
    3472                         }else{ 
    3473                         $textdesc=(!$is_private && $event['description'] ? $this->bo->get_short_field($event,$is_private,'description'):''); 
    3474                         $textdesc=nl2br($textdesc); 
     3470                        if($titleView == "1") 
     3471                        { 
     3472                            $textdesc = ''; 
     3473                        } 
     3474                        else 
     3475                        { 
     3476                            $textdesc = (!$is_private && $event['description'] ? $this->bo->get_short_field($event,$is_private,'description'):''); 
     3477                            $textdesc=nl2br($textdesc); 
    34753478                        } 
    34763479 
    34773480                        // added $textlocation but this must be activated in the actual pict_link.tpl file of the used template set 
    3478                         $textlocation=$this->bo->get_short_field($event,$is_private,'location'); 
     3481                        $textlocation= $event['location']?"<br/><b>Local:</b> ".$this->bo->get_short_field($event,$is_private,'location'):''; 
    34793482 
    34803483                        if ($viewable) 
     
    35903593                                        'users_status'=>$textstatus, 
    35913594                                        'desc'=> $textdesc, 
    3592                                         'location'=> "<br><b>Local:</b> ".$textlocation 
     3595                                        'location'=> $textlocation 
    35933596                                ); 
    35943597                                $this->output_template_array($this->link_tpl,'picture','link_text',$var); 
     
    36553658                        } 
    36563659                         
    3657                         $texttitle = $texttime = $textdesc = $textlocation = $textstatus = ''; 
    3658  
    3659                          
    3660                          
     3660                        $textTitlePrint = $textTimePrint = $textDescPrint = $textLocationPrint = $textObservationsPrint = $textstatus = ''; 
     3661 
    36613662                        if(!$is_private) 
    36623663                        { 
    3663                                 //$text .= $this->bo->display_status($event['users_status']); 
    3664                                  
    36653664                                // split text for better display by templates, also see $texttime $texttitle $textdesc $textlocation     
    36663665                                $textstatus=$this->bo->display_status($event['users_status']);  
     
    36683667                        } 
    36693668 
    3670                         $text = '<nobr>&nbsp;'.$time.'&nbsp;</nobr> '.$this->bo->get_short_field($event,$is_private,'title').$text. 
     3669                        $account_name = $_POST['user'] ? 
     3670                                                        $_POST['user'] : 
     3671                                                        ($_GET['account_name'] ? 
     3672                                                         $_GET['account_name'] : ''); 
    36713673                         
    3672                         $texttime=$time; 
    3673                         $texttitle=$this->bo->get_short_field($event,$is_private,'title'); 
    3674                         $textdesc=(!$is_private && $event['description'] ? $this->bo->get_short_field($event,$is_private,'description'):''); 
     3674                        $accounts = CreateObject('phpgwapi.accounts'); 
     3675                        $accountId = $accounts->name2id($account_name); 
     3676 
     3677                        $prefs = CreateObject('phpgwapi.preferences', $accountId); 
     3678                        $account_prefs = $prefs->read(); 
     3679 
     3680 
     3681                        $textTimePrint = $time; 
     3682                        $textTitlePrint = $is_private ? lang('Private event. You are not allowed to print it.') : ( $event['type'] == 'H' ? 'Apontamento de horas' : $this->bo->get_short_field($event,$is_private,'title' ) ); 
     3683 
     3684                        $fieldsToPrint = $account_prefs['calendar']['fields_to_print']; 
     3685                        if($fieldsToPrint == "0") 
     3686                        { 
     3687                            $textDescPrint = ''; 
     3688                        } 
     3689                        elseif($fieldsToPrint == "1") 
     3690                        { 
     3691                            $textDescPrint = (!$is_private && $event['description'] ? $this->bo->get_short_field($event,$is_private,'description'):''); 
     3692                        } 
     3693                        else 
     3694                        { 
     3695                            $textDescPrint = (!$is_private && $event['description'] ? $this->bo->get_short_field($event,$is_private,'description'):''); 
     3696                            $textObservationsPrint = $event['observations']?"<br /><b>Observações:</b> ".$this->bo->get_short_field($event,$is_private,'observations'):''; 
     3697                        } 
     3698 
    36753699                        // added $textlocation but this must be activated in the actual pict_link.tpl file of the used template set 
    3676                         $textlocation=$this->bo->get_short_field($event,$is_private,'location'); 
     3700                        $textLocationPrint = $event['location']?"<br /><b>Local:</b> ".$this->bo->get_short_field($event,$is_private,'location'):''; 
    36773701 
    36783702                        if ($viewable) 
     
    36813705                                $this->event_tpl->set_var('link_link',$this->page('view','&cal_id='.$event['id'].'&date='.$date)); 
    36823706                                $this->event_tpl->set_var('lang_view',lang('View this entry')); 
    3683                                 $this->event_tpl->set_var('desc', $textdesc); 
    3684                                 $this->event_tpl->set_var('location', $textlocation); 
     3707                                $this->event_tpl->set_var('desc', $textDescPrint); 
     3708                                $this->event_tpl->set_var('location', $textLocationPrint); 
     3709                                $this->event_tpl->set_var('observations', $textObservationsPrint); 
    36853710                                $this->event_tpl->parse('picture','link_event_open',True); 
    36863711                        } 
     3712 
    36873713                        if (!$is_private) 
    36883714                        { 
     
    37153741                                } 
    37163742                        } 
     3743 
    37173744                        $participants = $this->planner_participants($event['participants']); 
    37183745                        if(count($event['participants']) > 1) 
     
    37433770                                ); 
    37443771                        } 
     3772 
    37453773                        if(@isset($event['alarm']) && count($event['alarm']) >= 1 && !$is_private) 
    37463774                        { 
     
    37703798                                $this->output_template_array($this->event_tpl,'picture','event_pict',$var); 
    37713799                        } 
    3772                         if ($texttitle) 
     3800 
     3801                        if ($textTitlePrint) 
    37733802                        { 
    37743803                                $var = Array( 
    37753804                        //              'text' => $text, 
    3776                                         'time'=> $texttime, 
    3777                                         'title'=> $texttitle, 
     3805                                        'time'=> $textTimePrint, 
     3806                                        'title'=> $textTitlePrint, 
    37783807                                        'users_status'=>$textstatus, 
    3779                                         'desc'=> $textdesc, 
    3780                                         'location'=> "<br><b>Local:</b> ".$textlocation 
     3808                                        'desc'=> $textDescPrint, 
     3809                                        'location'=> $textLocationPrint, 
     3810                                        'observations'=> $textObservationsPrint 
    37813811                                ); 
    37823812                                $this->output_template_array($this->event_tpl,'picture','link_event_text',$var); 
  • branches/2.2.0.1/calendar/inc/hook_settings.inc.php

    r1703 r3989  
    198198                        '1' => lang('Only Title') 
    199199                ),'This option enable or disable the meeting description view your calendar in readmode.'); 
     200        create_select_box('Choose fields to print','fields_to_print',array( 
     201                        '0' => lang('Only Title'), 
     202                        '1' => lang('Title and Description'), 
     203                        '2' => lang('Title, description and observations') 
     204                ),'This option enables the choice of fields to print.'); 
  • branches/2.2.0.1/calendar/templates/default/event_link.tpl

    r855 r3989  
    3232                        <span>{location}</span> 
    3333                        <br /> 
     34                        <span>{observations}</span> 
    3435                </td> 
    3536        </tr> 
Note: See TracChangeset for help on using the changeset viewer.