Ignore:
Timestamp:
05/12/11 11:52:50 (13 years ago)
Author:
afernandes
Message:

Ticket #1416 - Disponibilizado módulo de recursos para a comunidade

File:
1 edited

Legend:

Unmodified
Added
Removed
  • contrib/Resources/inc/class.soresources.inc.php

    r3524 r4362  
    4949                                echo '<!-- SO cat_id : '.$this->cat_id.' -->'."\n"; 
    5050                        } 
    51                         $this->cal = CreateObject('infolog.soinfolog_'); 
     51                //      $this->cal = CreateObject('infolog.soinfolog_'); 
     52                        $this->cal = CreateObject('calendar.socalendar_'); 
    5253                        //$this->open_box($this->owner); 
    5354                } 
     
    7677                } 
    7778 
     79        function read_entry2($id) 
     80                { 
     81                        return $this->cal->fetch_event($id); 
     82                } 
     83                 
    7884                function list_events($startYear,$startMonth,$startDay,$endYear=0,$endMonth=0,$endDay=0,$owner_id=0) 
    7985                { 
     
    427433                        $this->cal->set_recur_yearly($year,$month,$day,$interval); 
    428434                } 
     435function list_eventsa($startYear,$startMonth,$startDay,$endYear=0,$endMonth=0,$endDay=0,$owner_id=0,$location='n/a') 
     436                { 
     437 
     438                        $extra = ''; 
     439                        $extra .= (strpos($this->filter,'private')?'AND phpgw_cal.is_public=0 ':''); 
     440                        //$extra .= ($this->cat_id?"AND phpgw_cal.category like '%".$this->cat_id."%' ":''); 
     441                        if ($this->cat_id) 
     442                        { 
     443                                if (!is_object($GLOBALS['phpgw']->categories)) 
     444                                { 
     445                                        $GLOBALS['phpgw']->categories = CreateObject('phpgwapi.categories'); 
     446                                } 
     447                                $cats = $GLOBALS['phpgw']->categories->return_all_children($this->cat_id); 
     448                                $extra .= "AND (phpgw_cal.category".(count($cats) > 1 ? " IN ('".implode("','",$cats)."')" : '=\''.(int)$this->cat_id."'"); 
     449                                foreach($cats as $cat) 
     450                                { 
     451                                        $extra .= " OR phpgw_cal.category LIKE '$cat,%' OR phpgw_cal.category LIKE '%,$cat,%' OR phpgw_cal.category LIKE '%,$cat'"; 
     452                                } 
     453                                $extra .= ') '; 
     454                        } 
     455                        if($owner_id) 
     456                        { 
     457                                return $this->cal->list_events($startYear,$startMonth,$startDay,$endYear,$endMonth,$endDay,$extra,$GLOBALS['phpgw']->datetime->tz_offset,$owner_id,$location); 
     458                        } 
     459                        else 
     460                        { 
     461                                return $this->cal->list_events($startYear,$startMonth,$startDay,$endYear,$endMonth,$endDay,$extra,$GLOBALS['phpgw']->datetime->tz_offset); 
     462                        } 
     463                } 
    429464                 
    430465                /* End mcal equiv functions */ 
Note: See TracChangeset for help on using the changeset viewer.