Changeset 4098


Ignore:
Timestamp:
04/20/11 14:23:50 (13 years ago)
Author:
brunocosta
Message:

Ticket #1745 - Ajustes na interface das novas visões semanal e mensal da agenda.

Location:
branches/2.2.0.1/calendar
Files:
4 edited

Legend:

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

    r4049 r4098  
    506506 
    507507                        } 
    508  
    509                         echo $this->printer_friendly($this->print_month_new($params),lang('Weekview')); 
     508                        if($_GET['friendly']==1) 
     509                            echo $this->printer_friendly($this->get_month(),lang('Monthview')); 
     510                        else 
     511                            echo $this->printer_friendly($this->print_month_new($params),lang('Weekview')); 
    510512                        $GLOBALS['phpgw']->common->phpgw_footer(); 
    511513                } 
     
    51435145                        $m = mktime(0,0,0,$this->bo->month,1,$this->bo->year); 
    51445146 
     5147                        $next = $GLOBALS['phpgw']->datetime->makegmttime(0,0,0,$this->bo->month,$this->bo->day + 7,$this->bo->year); 
     5148                        $prev = $GLOBALS['phpgw']->datetime->makegmttime(0,0,0,$this->bo->month,$this->bo->day - 7,$this->bo->year); 
     5149                        $prev_week_link = '<a href="'.$this->page('week','&date='.$prev['full']).'">&lt;&lt;</a>'; 
     5150                        $next_week_link = '<a href="'.$this->page('week','&date='.$next['full']).'">&gt;&gt;</a>'; 
     5151 
     5152 
    51455153                        $templates = Array( 
    51465154                                'new_week'   => $tpl, 
     
    51545162                        $p->set_var('hora_final',$result_events_json['hora_final']); 
    51555163                        $p->set_var('hora_inicial',$result_events_json['hora_inicial']); 
    5156                           $p->set_var('minical',$minical_prev.'<br>'.$minical_next.'<br>'.$minical_next1); 
    5157                         $p->set_var('title',lang(strftime("%B",$m)).' '.$this->bo->year); 
    5158                         $p->set_var('user',$GLOBALS['phpgw']->common->grab_owner_name($this->bo->owner)); 
     5164                        $p->set_var('minical',$minical_prev.'<br>'.$minical_next.'<br>'.$minical_next1); 
     5165                        $p->set_var('title',$this->bo->get_week_label()); 
     5166                        $p->set_var('user',$prev_week_link.' '.$GLOBALS['phpgw']->common->grab_owner_name($this->bo->owner).' '.$next_week_link); 
    51595167                        $p->set_var('events_json',json_encode($result_events_json['events_to_show_json'])?json_encode($result_events_json['events_to_show_json']):'null'); 
    51605168                        return $p->fp('out','day'); 
     
    52095217                                        ) 
    52105218                                ); 
     5219 
     5220                        $next = $this->bo->month + 1; 
     5221                        $prev = $this->bo->month - 1; 
     5222                        $nextyear = $this->bo->year; 
     5223                        $prevyear = $this->bo->year; 
     5224                        if ($this->bo->month == 12) 
     5225                        { 
     5226                                $next = 1; 
     5227                                $nextyear = $nextyear + 1; 
     5228                        } 
     5229                        elseif ($this->bo->month == 1) 
     5230                        { 
     5231                                $prev = 12; 
     5232                                $prevyear = $prevyear - 1; 
     5233                        } 
     5234 
    52115235                        $m = mktime(0,0,0,$this->bo->month,1,$this->bo->year); 
    52125236                        $p->set_file($templates); 
     
    52145238                        $params['period'] = 3; 
    52155239                        $result_events_json = $this->print_events_to_show_json($params); 
     5240                        $prev_month_link = '<a href="'.$this->page('month','&year='.$prevyear.'&month='.$prev.'&sday='.$sday).'">&lt;&lt;</a>'; 
     5241                        $next_month_link = '<a href="'.$this->page('month','&year='.$nextyear.'&month='.$next.'&sday='.$sday).'">&gt;&gt;</a>'; 
    52165242                        $p->set_var('date',$result_events_json['date_events_json']); 
    52175243                        $p->set_var('hora_final',$result_events_json['hora_final']); 
     
    52195245                        $p->set_var('minical',$minical_prev.'<br>'.$minical_next.'<br>'.$minical_next1); 
    52205246                        $p->set_var('title',lang(strftime("%B",$m)).' '.$this->bo->year); 
    5221                         $p->set_var('user',$GLOBALS['phpgw']->common->grab_owner_name($this->bo->owner)); 
     5247                        $p->set_var('user',$prev_month_link." ".$GLOBALS['phpgw']->common->grab_owner_name($this->bo->owner).' '.$next_month_link); 
    52225248                        $p->set_var('events_json',json_encode($result_events_json['events_to_show_json'])?json_encode($result_events_json['events_to_show_json']):'null'); 
    52235249                        return $p->fp('out','day'); 
     
    53375363                                else 
    53385364                                { 
    5339                                     $text = $event['title']." - ".$event['description']; 
     5365                                        $text = ' - '.$event['end']['hour'].':'.$event['end']['min'].' - '.$event['title']." - ".$event['description']; 
    53405366                                } 
    53415367 
  • branches/2.2.0.1/calendar/js/dhtmlx/sources/ext/ext_new_week.js

    r4049 r4098  
    174174        return pos; 
    175175} 
     176 
     177scheduler._pre_render_events=function(evs,hold){ 
     178        var hb = this.xy.bar_height; 
     179        var h_old = this._colsS.heights; 
     180        var h=this._colsS.heights=[0,0,0,0,0,0,0]; 
     181 
     182        if (!this._table_view) evs=this._pre_render_events_line(evs,hold); //ignore long events for now 
     183        else evs=this._pre_render_events_table(evs,hold); 
     184 
     185        if (this._table_view){ 
     186                if (hold) 
     187                        this._colsS.heights = h_old; 
     188                else { 
     189                        var evl = this._els["dhx_cal_data"][0].firstChild; 
     190                        if (evl.rows){ 
     191                                for (var i=0; i<evl.rows.length; i++){ 
     192                                        h[i]++; 
     193                                        if ((h[i])*hb > this._colsS.height-22){ // 22 - height of cell's header 
     194                                                //we have overflow, update heights 
     195                                                var cells = evl.rows[i].cells; 
     196                                                for (var j=0; j < cells.length; j++) { 
     197                                                        cells[j].childNodes[1].style.height = h[i]*hb+"px"; 
     198                                                } 
     199                                                h[i]=(h[i-1]||0)+cells[0].offsetHeight; 
     200                                        } 
     201                                        h[i]=(h[i-1]||0)+evl.rows[i].cells[0].offsetHeight; 
     202                                } 
     203                                h.unshift(0); 
     204                                if (evl.parentNode.offsetHeight<evl.parentNode.scrollHeight && !evl._h_fix){ 
     205                                        //we have v-scroll, decrease last day cell 
     206                                        for (var i=0; i<evl.rows.length; i++){ 
     207                                            if(this._mode=='month'){ 
     208                                                var cell = evl.rows[i].cells[6].childNodes[0]; 
     209                                                var w = cell.offsetWidth-scheduler.xy.scroll_width+"px"; 
     210                                                cell.style.width = w; 
     211                                                cell.nextSibling.style.width = w; 
     212                                            } 
     213                                        } 
     214                                        evl._h_fix=true; 
     215                                } 
     216                        } else{ 
     217 
     218                                if (!evs.length && this._els["dhx_multi_day"][0].style.visibility == "visible") 
     219                                        h[0]=-1; 
     220                                if (evs.length || h[0]==-1){ 
     221                                        //shift days to have space for multiday events 
     222                                        var childs = evl.parentNode.childNodes; 
     223                                        var dh = (h[0]+1)*hb+"px"; 
     224                                        for (var i=0; i<childs.length; i++) 
     225                                                if (this._colsS[i]) 
     226                                                        childs[i].style.top=dh; 
     227                                        var last = this._els["dhx_multi_day"][0]; 
     228                                        last.style.top = "0px"; 
     229                                        last.style.height=dh; 
     230                                        last.style.visibility=(h[0]==-1?"hidden":"visible"); 
     231                                        last=this._els["dhx_multi_day"][1]; 
     232                                        last.style.height=dh; 
     233                                        last.style.visibility=(h[0]==-1?"hidden":"visible"); 
     234                                        last.className=h[0]?"dhx_multi_day_icon":"dhx_multi_day_icon_small"; 
     235 
     236                                        this._dy_shift=(h[0]+1)*hb; 
     237                                        h[0] = 0; 
     238                                } 
     239 
     240                        } 
     241                } 
     242        } 
     243 
     244        return evs; 
     245}; 
  • branches/2.2.0.1/calendar/templates/default/new_month.tpl

    r4049 r4098  
    3030<link rel="stylesheet" href="calendar/js/dhtmlx/codebase/dhtmlxscheduler.css" type="text/css" charset="utf-8"> 
    3131 
     32 
     33 
     34<div  id='conteiner' class="th" style='width:100px; height:650px;margin-left:50px;margin-right:50px;float:left;'> 
    3235<div class='calendar_month_identifier' style='background-color:white;padding-bottom:2px;text-align:center'>{title}</div> 
    3336<div class='calendar_user_identifier' style='background-color:white;padding-bottom:2px;text-align:center'>:&nbsp;{user}&nbsp;:</div> 
    34  
    35 <div  id='conteiner' class="th" style='width:100px; height:650px;margin-left:50px;margin-right:50px;float:left;'> 
    36  
    37 <div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:100%; border-left: 1px dotted #586A7E;'> 
     37<div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:95%; border-left: 1px dotted #586A7E;'> 
    3838                <div class="dhx_cal_navline" style="display: none;"> 
    3939                        <div class="dhx_cal_prev_button">&nbsp;</div> 
     
    5353 
    5454{minical} 
    55  
    56 <div class='calendar_month_identifier' style='clear:left;margin-left:50px;margin-right:50px;text-align:center'><a href="javascript:void(0)" onclick="javascript:scheduler.toPDF('calendar/js/dhtmlx/server/generate.php')">Printer Friendly</a></div> 
     55<div class='calendar_month_identifier' style='clear:left;margin-left:50px;margin-right:50px;text-align:center'>&nbsp;</div> 
    5756<body onload="resize();loadScheduler();"></body> 
    5857 
  • branches/2.2.0.1/calendar/templates/default/new_week.tpl

    r4049 r4098  
    3232 
    3333 
     34 
     35<div id='conteiner' class="th" style='height:700px;margin-left:50px;margin-right:50px;float:left;'> 
    3436<div class='calendar_month_identifier' style='background-color:white;padding-bottom:2px;text-align:center'>{title}</div> 
    3537<div class='calendar_user_identifier' style='background-color:white;padding-bottom:2px;text-align:center'>:&nbsp;{user}&nbsp;:</div> 
    3638 
    37 <div id='conteiner' class="th" style='height:700px;margin-left:50px;margin-right:50px;float:left;'> 
    38 <div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:100%; border-left: 1px dotted #586A7E;'> 
     39<div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:95%; border-left: 1px dotted #586A7E;'> 
    3940                <div class="dhx_cal_navline" style="display: none;"> 
    4041                        <div class="dhx_cal_prev_button">&nbsp;</div> 
     
    5455{minical} 
    5556 
    56 <div class='calendar_month_identifier' style='clear:left;margin-left:50px;margin-right:50px;text-align:center'><a href="javascript:void(0)" onclick="javascript:scheduler.toPDF('calendar/js/dhtmlx/server/generate.php')">Printer Friendly</a></div> 
     57<div class='calendar_month_identifier' style='clear:left;margin-left:50px;margin-right:50px;text-align:center'>&nbsp;</div> 
    5758<body onload="resize();loadScheduler();"></body> 
    5859 
Note: See TracChangeset for help on using the changeset viewer.