Changeset 4362 for contrib/Resources
- Timestamp:
- 05/12/11 11:52:50 (13 years ago)
- Location:
- contrib/Resources
- Files:
-
- 5 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
contrib/Resources/inc/class.boresources.inc.php
r3524 r4362 267 267 } 268 268 269 /*$this->so = CreateObject('resources.soresources',269 $this->so = CreateObject('calendar.socalendar', 270 270 Array( 271 271 'owner' => $this->owner, … … 274 274 'g_owner' => $this->g_owner 275 275 ) 276 ); */276 ); 277 277 $this->rpt_day = array( // need to be after creation of soresources 278 278 MCAL_M_SUNDAY => 'Sunday', … … 589 589 590 590 $event = $this->so->read_entry($id); 591 echo $event;591 //echo $event; 592 592 593 593 594 594 return False; 595 } 596 597 598 function read_entry2($id,$ignore_acl=False) 599 { 600 601 602 $event = $this->so->read_entry($id); 603 if(!isset($event['participants'][$this->owner]) && $this->user_is_a_member($event,$this->owner)) 604 { 605 $this->so->add_attribute('participants','U',(int)$this->owner); 606 $this->so->add_entry($event); 607 $event = $this->get_cached_event(); 608 } 609 return $this->xmlrpc ? $this->xmlrpc_prepare($event) : $event; 610 595 611 } 596 612 … … 774 790 775 791 792 776 793 $send_to_ui = True; 777 794 //if ((!is_array($l_start) || !is_array($l_end)) && !isset($_GET['readsess'])) // xmlrpc call … … 799 816 foreach($params['participants'] as $user => $data) 800 817 { 818 801 819 $l_participants[] = $user.$data['status']; 802 820 } … … 1204 1222 } 1205 1223 1224 1206 1225 $overlapping_events = $this->overlap( 1207 1226 $this->maketime($event['start']), … … 1471 1490 } 1472 1491 1473 function overlap($starttime,$endtime,$participants,$owner=0,$id=0,$restore_cache=False)1492 function overlap($starttime,$endtime,$participants,$owner=0,$id=0,$restore_cache=False,$location='n/a') 1474 1493 { 1475 1494 // $retval = Array(); … … 1478 1497 /* This needs some attention.. by commenting this chunk of code it will fix bug #444265 */ 1479 1498 1499 // foreach($id as $c=>$v) 1500 // echo "<p>El 565vector con indice $c tiene el valor $v </p>"; 1501 1502 1503 1480 1504 if($restore_cache) 1481 1505 { … … 1488 1512 // $temp_end_time = (int)$GLOBALS['phpgw']->common->show_date($endtime,'Hi'); 1489 1513 $temp_start = (int)(date('Ymd',$starttime)); 1514 1490 1515 $temp_start_time = (int)(date('Hi',$starttime)); 1491 1516 $temp_end = (int)(date('Ymd',$endtime)); 1492 1517 $temp_end_time = (int)(date('Hi',$endtime)); 1518 // echo "<br>inicio".$temp_start_time." <br> fin ".$temp_end_time."<br> ".(int)(date('Hi a',$endtime))."<br>"; 1519 // echo "<br>inicio".$temp_start." <br> fin ".$temp_end."<br> ".(int)(date('Hi a',$endtime))."<br>"; 1520 1493 1521 if($this->debug) 1494 1522 { … … 1509 1537 $users[] = $this->owner; 1510 1538 } 1539 1511 1540 1512 1541 $possible_conflicts = $this->store_to_cache( … … 1518 1547 'eday' => substr(strval($temp_end),6,2), 1519 1548 'eyear' => substr(strval($temp_end),0,4), 1520 'owner' => $users 1549 'owner' => $users, 1550 'location' => $location 1521 1551 ) 1522 1552 ); … … 1527 1557 echo '<!-- Possible Conflicts ('.$temp_start.'): '.count($possible_conflicts[$temp_start]).' '.count($id).' -->'."\n"; 1528 1558 } 1529 1559 //echo "aaa".$possible_conflicts[$temp_start]; 1560 //echo "bbbb".$possible_conflicts[$temp_end]; 1530 1561 if($possible_conflicts[$temp_start] || $possible_conflicts[$temp_end]) 1531 1562 { … … 1569 1600 $temp_event_end = sprintf("%d%02d",$event['end']['hour'],$event['end']['min']); 1570 1601 // if((($temp_start_time <= $temp_event_start) && ($temp_end_time >= $temp_event_start) && ($temp_end_time <= $temp_event_end)) || 1602 1603 1604 /*}*/ 1605 1606 1607 1571 1608 if(($temp_start_time <= $temp_event_start && 1572 $temp_end_time > $temp_event_start && 1573 $temp_end_time <= $temp_event_end || 1574 $temp_start_time >= $temp_event_start && 1575 $temp_start_time < $temp_event_end && 1576 $temp_end_time >= $temp_event_end || 1577 $temp_start_time <= $temp_event_start && 1578 $temp_end_time >= $temp_event_end || 1579 $temp_start_time >= $temp_event_start && 1580 $temp_end_time <= $temp_event_end) && 1581 $this->participants_not_rejected($participants,$event)) 1609 $temp_end_time >= $temp_event_start && 1610 $temp_end_time <= $temp_event_end) || 1611 ($temp_start_time <= $temp_event_start && 1612 $temp_end_time >= $temp_event_start && 1613 $temp_end_time >= $temp_event_end)|| 1614 ($temp_start_time <= $temp_event_start && 1615 $temp_end_time >= $temp_event_end) || 1616 1617 ($temp_start_time >= $temp_event_start && 1618 $temp_start_time <= $temp_event_end && 1619 $temp_end_time >= $temp_event_end) || 1620 1621 ($temp_start_time >= $temp_event_start && 1622 $temp_end_time <= $temp_event_end)) 1582 1623 { 1583 1624 if($this->debug) … … 1585 1626 echo ' Conflicts'; 1586 1627 } 1587 $retval[] = $event ['id'];1628 $retval[] = $event; 1588 1629 } 1589 1630 if($this->debug) … … 1597 1638 else 1598 1639 { 1599 $retval = False; 1640 $retval1 = False; 1641 $retval = Array(); 1600 1642 } 1601 1643 … … 2022 2064 } 2023 2065 $repeated = $this->repeating_events; 2066 2067 //echo $repeated."repeat<br>" ; 2024 2068 $r_events = count($repeated); 2069 //echo $r_events." ".$this->repeating_event[1]. "repeat23<br>" ; 2025 2070 for ($i=0;$i<$r_events;$i++) 2026 2071 { 2027 2072 $rep_events = $this->repeating_events[$i]; 2073 2028 2074 $id = $rep_events['id']; 2075 //echo $id; 2029 2076 $event_beg_day = mktime(0,0,0,$rep_events['start']['month'],$rep_events['start']['mday'],$rep_events['start']['year']); 2030 2077 if($rep_events['recur_enddate']['month'] != 0 && $rep_events['recur_enddate']['mday'] != 0 && $rep_events['recur_enddate']['year'] != 0) … … 2160 2207 return False; 2161 2208 } 2162 if (isset($params['start']) && ($datearr = $GLOBALS['server']->iso86012date($params['start']))) 2209 $location=$params['location']; 2210 2211 //echo "location".$location; 2212 if (isset($params['start']) && ($datearr = $GLOBALS['server']->iso86012date($params['start']))) 2163 2213 { 2164 2214 $syear = $datearr['year']; … … 2219 2269 //Se $emonth nao tem valor, recebe o valor de $smonth (que recebe $params['smonth']) e soma 1. 2220 2270 //O valor $params['emonth'] indica o mes final para a pesquisa de eventos, e passou a ser 2221 //informado na a impressao de eventos mensais. Mudancas feitas em class.ui resources.inc.php,2271 //informado na a impressao de eventos mensais. Mudancas feitas em class.uicalendar.inc.php, 2222 2272 //function display_month_print(); 2223 2273 if(!$emonth) … … 2236 2286 $edate = mktime(23,59,59,$emonth,$eday,$eyear); 2237 2287 } 2238 //echo "<p>bo resources::store_to_cache(".print_r($params,True).") syear=$syear, smonth=$smonth, sday=$sday, eyear=$eyear, emonth=$emonth, eday=$eday, xmlrpc='$param[xmlrpc]'</p>\n";2288 //echo "<p>bocalendar::store_to_cache(".print_r($params,True).") syear=$syear, smonth=$smonth, sday=$sday, eyear=$eyear, emonth=$emonth, eday=$eday, xmlrpc='$param[xmlrpc]'</p>\n"; 2239 2289 if($this->debug) 2240 2290 { … … 2248 2298 if($owner_id) 2249 2299 { 2250 $cached_event_ids = "";//$this->so->list_events($syear,$smonth,$sday,$eyear,$emonth,$eday,$owner_id); 2251 $cached_event_ids_repeating = "";//$this->so->list_repeated_events($syear,$smonth,$sday,$eyear,$emonth,$eday,$owner_id); 2300 2301 $cached_event_ids = $this->so->list_events($syear,$smonth,$sday,$eyear,$emonth,$eday,$owner_id,$location); 2302 $cached_event_ids_repeating = $this->so->list_repeated_events($syear,$smonth,$sday,$eyear,$emonth,$eday,$owner_id,$location); 2252 2303 } 2253 2304 else 2254 2305 { 2255 $cached_event_ids = "";//$this->so->list_events($syear,$smonth,$sday,$eyear,$emonth,$eday); 2256 $cached_event_ids_repeating = "";//$this->so->list_repeated_events($syear,$smonth,$sday,$eyear,$emonth,$eday); 2306 2307 $cached_event_ids = $this->so->list_events($syear,$smonth,$sday,$eyear,$emonth,$eday,0,$location); 2308 $cached_event_ids_repeating = $this->so->list_repeated_events($syear,$smonth,$sday,$eyear,$emonth,$eday,0,$location); 2257 2309 } 2258 2310 2259 2311 $c_cached_ids = count($cached_event_ids); 2260 2312 $c_cached_ids_repeating = count($cached_event_ids_repeating); 2261 2313 //echo "totaless".$c_cached_ids." - ".$c_cached_ids_repeating; 2262 2314 if($this->debug) 2263 2315 { … … 2274 2326 2275 2327 $cache_start = (int)(sprintf("%04d%02d%02d",$syear,$smonth,$sday)); 2328 2276 2329 $cached_event=$this->get_cached_event(); 2330 2277 2331 if($c_cached_ids) 2278 2332 { 2333 2279 2334 for($i=0;$i<$c_cached_ids;$i++) 2280 2335 { 2281 $event = "";//$this->so->read_entry($cached_event_ids[$i]); 2336 $event = $this->so->read_entry($cached_event_ids[$i]); 2337 2338 //echo "<br>antrrrrroooo".$event['start']." a ".$event['end']." b ".$event['id']; 2282 2339 if ($event['recur_type']) 2283 2340 { … … 2287 2344 $enddate = (int)(date('Ymd',$this->maketime($event['end']))); 2288 2345 $this->cached_events[$startdate][] = $event; 2346 //echo "ver".$event['recur_type'].$startdate." ---".$enddate."<br>antrrrrroooo";; 2289 2347 if($startdate != $enddate) 2290 2348 { … … 2294 2352 for($j=$startdate,$k=0;$j<=$enddate;$k++,$j=(int)(date('Ymd',mktime(0,0,0,$start['month'],$start['mday'] + $k,$start['year'])))) 2295 2353 { 2354 2355 2296 2356 $c_evt_day = count($this->cached_events[$j]) - 1; 2357 //echo "<br>aaaa".$c_evt_day."<br>antrrrrroooo"; ; 2297 2358 if($c_evt_day < 0) 2298 2359 { … … 2310 2371 } 2311 2372 $this->cached_events[$j][] = $event; 2373 //echo "<br>llll:".$event."<br>antrrrrroooo";; 2312 2374 } 2313 2375 if ($j >= $cache_start && (@$params['no_doubles'] || @$this->xmlrpc)) … … 2323 2385 if($c_cached_ids_repeating) 2324 2386 { 2387 //echo "repeaiting".$c_cached_ids_repeating; 2388 2325 2389 for($i=0;$i<$c_cached_ids_repeating;$i++) 2326 2390 { 2327 $this->repeating_events[$i] = "";//$this->so->read_entry($cached_event_ids_repeating[$i]); 2391 $this->repeating_events[$i] = $this->so->read_entry($cached_event_ids_repeating[$i]); 2392 //echo "abc".$this->repeating_events[$i]."<br>"; 2328 2393 if($this->debug) 2329 2394 { … … 2339 2404 } 2340 2405 $this->check_repeating_events($date); 2406 2407 2341 2408 if($this->debug) 2342 2409 { … … 2349 2416 } 2350 2417 } 2418 2419 //echo "countt".count($this->cached_events); 2351 2420 $retval = Array(); 2352 2421 for($j=date('Ymd',mktime(0,0,0,$smonth,$sday,$syear)),$k=0;$j<=date('Ymd',mktime(0,0,0,$emonth,$eday,$eyear));$k++,$j=date('Ymd',mktime(0,0,0,$smonth,$sday + $k,$syear))) 2353 2422 { 2423 //echo "vueltaaaa".$j."<br>"; 2354 2424 if(is_array($this->cached_events[$j])) 2355 2425 { … … 2359 2429 { 2360 2430 $retval[] = $this->xmlrpc_prepare($event); 2431 //echo "cachhhhhheeeeeqqq2222".$this->xmlrpc_prepare($event)."<br>"; 2361 2432 } 2362 2433 } … … 2364 2435 { 2365 2436 $retval[$j] = $this->cached_events[$j]; 2366 } 2367 } 2437 //foreach($this->cached_events[$j][0] as $c=>$v) 2438 //echo "<p>El vector con indice $c tiene el valor $v </p>"; 2439 //echo "cachhhhhheeeeeqqq".$this->cached_events[$j][0]['public']."<br>"; 2440 } 2441 } 2442 2443 2368 2444 } 2369 2445 //echo "store_to_cache(".print_r($params,True).")=<pre>".print_r($retval,True)."</pre>\n"; 2370 //$this->so->cal->event = $cached_event;2446 $this->so->cal->event = $cached_event; 2371 2447 return $retval; 2372 2448 } -
contrib/Resources/inc/class.soresources.inc.php
r3524 r4362 49 49 echo '<!-- SO cat_id : '.$this->cat_id.' -->'."\n"; 50 50 } 51 $this->cal = CreateObject('infolog.soinfolog_'); 51 // $this->cal = CreateObject('infolog.soinfolog_'); 52 $this->cal = CreateObject('calendar.socalendar_'); 52 53 //$this->open_box($this->owner); 53 54 } … … 76 77 } 77 78 79 function read_entry2($id) 80 { 81 return $this->cal->fetch_event($id); 82 } 83 78 84 function list_events($startYear,$startMonth,$startDay,$endYear=0,$endMonth=0,$endDay=0,$owner_id=0) 79 85 { … … 427 433 $this->cal->set_recur_yearly($year,$month,$day,$interval); 428 434 } 435 function 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 } 429 464 430 465 /* End mcal equiv functions */ -
contrib/Resources/inc/class.uiresources.inc.php
r3524 r4362 37 37 'footer' => True 38 38 ); 39 40 39 41 40 42 … … 135 137 function uiresources() 136 138 { 137 138 139 $localtime = $GLOBALS['phpgw']->datetime->users_localtime; 140 141 $this->year = date('Y',$localtime); 142 $this->month = date('m',$localtime); 143 $this->day = date('d',$localtime); 144 $this->today = date('Ymd',$GLOBALS['phpgw']->datetime->users_localtime); 139 145 140 146 … … 954 960 'accionmodificar' =>'index.php?menuaction=resources.uiresources.edit&id='. $data['id'], 955 961 'accionlistar' =>'index.php?menuaction=resources.uiresources.search2&id='. $data['name'], 962 956 963 'accionborrar' =>'index.php?menuaction=resources.uiresources.delete&id='. $data['id'], 957 964 'accionreservar' =>'index.php?menuaction=calendar.uicalendar.add&location='. $data['name'] … … 985 992 // } 986 993 987 $sql = 'select t1.*,t2.cat_name from phpgw_resources t1 ,phpgw_categories t2 where t1.cat_id=t2.cat_id '994 $sql = "select t1.*,t2.cat_name from phpgw_resources t1 ,phpgw_categories t2 where t1.cat_id=t2.cat_id and t1.name !='n/a'" 988 995 . $from; 989 996 //.$search; … … 1452 1459 1453 1460 //print_r($_REQUEST); 1461 $this->today = date('Ymd',$GLOBALS['phpgw']->datetime->users_localtime); 1462 1463 1464 1465 $jscal = CreateObject('phpgwapi.jscalendar'); // before phpgw_header() !!! 1466 1467 unset($GLOBALS['phpgw_info']['flags']['noheader']); 1468 unset($GLOBALS['phpgw_info']['flags']['nonavbar']); 1469 $GLOBALS['phpgw_info']['flags']['app_header'] = $GLOBALS['phpgw_info']['apps']['resources']['title'].' - '.lang('Search Results'); 1470 $GLOBALS['phpgw']->common->phpgw_header(); 1471 1472 $error = ''; 1473 1474 1475 1476 $matches = 0; 1477 1478 //echo "aaaaa".$GLOBALS['phpgw']->common->show_date(1288884600); 1479 1480 //echo "aaaaa".$GLOBALS['phpgw']->common->show_date(1288886400); 1481 1482 if (isset($_REQUEST['fecha'])){ 1483 list($dia,$mes,$ano)=split("/",$_REQUEST['fecha']); 1484 if (isset($_REQUEST['fecha2'])){ 1485 list($dia2,$mes2,$ano2)=split("/",$_REQUEST['fecha2']); 1486 }else{ 1487 list($dia2,$mes2,$ano2)=split("/",$_REQUEST['fecha']); 1488 1489 } 1490 if(isset($_REQUEST['hora'])){ 1491 list($horai,$minutoi,$horaf,$minutof)=split(":",$_REQUEST['hora']); 1492 }else{ 1493 $horai=0; 1494 $minutoi=0; 1495 $horaf=23; 1496 $minutof=59; 1497 } 1498 $starttimea = $this->bo->maketime2(0,0,0,$dia,$mes,$ano,'am') - $GLOBALS['phpgw']->datetime->tz_offset; 1499 1500 1501 }else{ 1502 $localtime = $GLOBALS['phpgw']->datetime->users_localtime; 1503 $ano = date('Y',$localtime); 1504 $mes = date('m',$localtime); 1505 $dia = date('d',$localtime); 1506 $ano2 = date('Y',$localtime); 1507 $mes2 = date('m',$localtime); 1508 $dia2 = date('d',$localtime); 1509 $horai=0; 1510 $minutoi=0; 1511 $horaf=23; 1512 $minutof=59; 1513 1514 //$starttime = $this->bo->maketime2(0,0,0,$dia,$mes,$ano,'am') - $GLOBALS['phpgw']->datetime->tz_offset; 1515 ///echo $starttime; 1516 //$starttime2 = $this->bo->maketime2(23,59,59,$dia,$mes,$ano,'pm') - $GLOBALS['phpgw']->datetime->tz_offset; 1517 ///echo $starttime2; 1518 1519 } 1520 1521 1522 1523 $pm='pm'; 1524 if($horaf<12){ 1525 $pm='am'; 1526 }else{ 1527 $horaf=$horaf-12; 1528 } 1529 $am='am'; 1530 if($horai>11){ 1531 $am='pm'; 1532 $horai=$horai-12; 1533 1534 } 1535 1536 1537 //echo $horai." <br> ".$starttimea."<br>".$horaf; 1538 $starttime = $this->bo->maketime2($horai,$minutoi,0,$dia,$mes,$ano,$am) - $GLOBALS['phpgw']->datetime->tz_offset; 1539 //echo "fff".$starttime; 1540 $starttime2 = $this->bo->maketime2($horaf,$minutof,59,$dia2,$mes2,$ano2,$pm) - $GLOBALS['phpgw']->datetime->tz_offset; 1541 ///echo $starttime2; 1542 //$event = $this->bo->read_entry($res_id); 1543 $location=''; 1544 if($_GET['id']!=''){ 1545 $location=$_GET['id'];}else{ 1546 $location='n/a';} 1547 1548 /*$eventtt=$this->bo->store_to_cache( 1549 Array( 1550 'syear' => $ano, 1551 'smonth' => $mes, 1552 'sday' => $dia, 1553 'shour' => $horai, 1554 'smin' => $minutoi, 1555 'eyear' => $ano, 1556 'emonth' => $mes, 1557 'eday' => $dia, 1558 'fhour' => $horaf, 1559 'fmin' => $minutof, 1560 'location' => $location 1561 ) 1562 ); */ 1563 $date_to_eval = sprintf("%04d%02d%02d",$ano,$mes,$dia); 1564 1565 // echo "date _to _eval".$date_to_eval."<br>"; 1566 //$events = $this->bo->cached_events[$date_to_eval];//(5,23,0,22,10,2010) 1567 $events=$this->bo->overlap($starttime,$starttime2,Array(),0,0,'False',$location); 1568 print_debug('Date',$date_to_eval); 1569 print_debug('Count',count($events)); 1570 //echo "llll<br>".'Date'.$date_to_eval; 1571 //echo "llll<br>".'Count'.count($events); 1572 if(count($events)>0){ 1573 foreach($events as $event) 1574 { 1575 if ($this->bo->rejected_no_show($event)) 1576 { 1577 continue; // user does not want to see rejected events 1578 } 1579 if ($event['recur_type']) // calculate start- + end-datetime for recuring events 1580 { 1581 $this->bo->set_recur_date($event,$date_to_eval); 1582 } 1583 //$events_to_show[] = array( 1584 // 'starttime' => $this->bo->maketime($event['start']), 1585 // 'endtime' => $this->bo->maketime($event['end']), 1586 // 'content' => $this->link_to_entry($event,$mes,$dia,$ano) 1587 //); 1588 1589 } 1590 } 1591 //echo "eeeevento".count($event)."<br>"; 1592 $date_to_eval = sprintf("%04d%02d%02d",$ano,$mes,$dia); 1593 1594 //$event = $this->get_event_ids2($_REQUEST['id'],$starttime,$starttime2); 1595 1596 1597 //$event_ids = $this->bo->search_keywords($_POST['keywords']); 1598 1599 1600 $matches = count($event); 1601 1602 //echo "matches" . $matches."<br>"; 1603 1604 if ($matches == 1) 1605 { 1606 $quantity = lang('1 match found').'.'; 1607 } 1608 elseif ($matches > 0) 1609 { 1610 $quantity = lang('%1 matches found',$matches).'.'; 1611 } 1612 else 1613 { 1614 echo lang('no matches found')." para el ".$dia."/".$mes."/".$ano." en la sala:".$location; 1615 1616 //return; 1617 } 1618 1619 if ($matches > 0){ 1620 $p = $GLOBALS['phpgw']->template; 1621 $p->set_file( 1622 Array( 1623 'search_form' => 'search2.tpl' 1624 ) 1625 ); 1626 1627 }else{ 1628 $p = $GLOBALS['phpgw']->template; 1629 $p->set_file( 1630 Array( 1631 'search_form' => 'search3.tpl' 1632 ) 1633 ); 1634 } 1635 $p->set_block('search_form','search','search'); 1636 $p->set_block('search_form','search_list_header','search_list_header'); 1637 $p->set_block('search_form','search_list','search_list'); 1638 $p->set_block('search_form','search_list_footer','search_list_footer'); 1639 1640 $script=''; 1641 1642 1643 1644 if($matches > 0) 1645 { 1646 $p->parse('rows','search_list_header',True); 1647 } 1648 1649 //if($info){ 1650 //echo $matches; 1651 //for($i=0;$i<$matches;$i++) 1652 // { 1653 //echo "i".$i; 1654 if(count($events)>0){ 1655 foreach($events as $id => $data) 1656 { 1657 1658 //echo "<br>dataaaa".$data['title']; 1659 //echo "<br>".$this->get_account_name($data['owner'],'gecos')." ".$data['owner']; 1660 $datetime = $this->bo->maketime($event['start']) - $GLOBALS['phpgw']->datetime->tz_offset; 1661 1662 1663 1664 //echo "ffffffeeecha".$GLOBALS['phpgw']->common->show_date($data[$i]['datetime'])." ".$data[$i]['start']." ".$this->bo->maketime($data[$i]['start']); 1665 //echo $data['location']." .. ".$data['last_status']." .. ".$data['is_public']; 1666 if($data['public']==1){ 1667 $descripcion=$data['description']; 1668 $name=$data['title']; 1669 }else{ 1670 $descripcion='-'; 1671 $name='Privado'; 1672 } 1673 $dueno=$this->get_account_name($data['owner'],'gecos'); 1674 $info = array( 1675 'tr_color' => $GLOBALS['phpgw']->nextmatchs->alternate_row_color(), 1676 'date' => $GLOBALS['phpgw']->common->show_date($datetime), 1677 'id' => $data['id'], 1678 'name' => $name, 1679 'description' => $descripcion, 1680 'location' =>$data['location'], 1681 1682 'owner'=>$this->get_account_name($data['owner'],'gecos'), 1683 'fecha'=> $dia."/".$mes."/".$ano." <br> ".$GLOBALS['phpgw']->common->show_hour($this->bo->maketime($data['start']))."-".$GLOBALS['phpgw']->common->show_hour($this->bo->maketime($data['end'])), 1684 'priority'=>'', 1685 'ispublic'=>$data['is_public'], 1686 1687 'accionmodificar' =>'index.php?menuaction=resources.uiresources.edit&id='. $data['id'], 1688 'accionlistar' =>'index.php?menuaction=resources.uiresources.search2&id='. $data['id'], 1689 'accionborrar' =>$data['id'], 1690 'accionreservar' =>'index.php?menuaction=calendar.uicalendar.add&location='. $data['id'] 1691 ); 1692 1693 1694 1695 //'accionagregar' =>'index.php?menuaction=resources.uiresources.edit&parent='. $data['id'] 1696 $p->set_var($info); 1697 $p->set_var($info); 1698 $p->parse('rows','search_list',True); 1699 } 1700 //} 1701 // } 1702 } 1703 if($matches > 0) 1704 { 1705 $p->parse('rows','search_list_footer',True); 1706 } 1707 1708 $p->pparse('out','search'); 1709 } 1710 1711 1712 1713 1714 1715 1716 function search22() 1717 { 1718 1719 //print_r($_REQUEST); 1454 1720 1455 1721 $jscal = CreateObject('phpgwapi.jscalendar'); // before phpgw_header() !!! … … 1568 1834 } 1569 1835 1570 1571 1572 1836 1573 1837 function get_event_ids2($idd,$starttime,$starttime2) 1574 1838 { 1575 ////echo "tamannn".count($search)." ".$search[0]; 1576 1839 1840 1841 1842 $from =""; 1577 1843 $from =""; 1578 1844 if (isset($idd)){ … … 1582 1848 1583 1849 if (isset($starttime)){ 1850 1851 $from =$from .' and t1.datetime>=\''.$starttime.'\''; 1584 1852 if (isset($starttime2)){ 1585 1853 1586 $from =$from .' and t1.datetime>=\''.$starttime.'\'and t1.datetime<=\''.$starttime2.'\' ';1854 $from =$from .' and t1.datetime<=\''.$starttime2.'\' '; 1587 1855 } 1588 1856 } … … 1601 1869 1602 1870 1871 //echo $sql; 1603 1872 1604 1873 … … 1638 1907 ); 1639 1908 1640 1641 1909 } 1642 1910 … … 1646 1914 return $retval; 1647 1915 } 1916 function link_to_entry($event,$month,$day,$year) 1917 { 1918 $str = ''; 1919 $is_private = !$event['public'] && !$this->bo->check_perms(PHPGW_ACL_READ,$event); 1920 $viewable = !$this->bo->printer_friendly && $this->bo->check_perms(PHPGW_ACL_READ,$event); 1921 1922 $starttime = $this->bo->maketime($event['start']) - $GLOBALS['phpgw']->datetime->tz_offset; 1923 $endtime = $this->bo->maketime($event['end']) - $GLOBALS['phpgw']->datetime->tz_offset; 1924 $rawdate = mktime(0,0,0,$month,$day,$year); 1925 $rawdate_offset = $rawdate - $GLOBALS['phpgw']->datetime->tz_offset; 1926 $nextday = mktime(0,0,0,$month,$day + 1,$year) - $GLOBALS['phpgw']->datetime->tz_offset; 1927 if ((int)$GLOBALS['phpgw']->common->show_date($starttime,'Hi') && $starttime == $endtime) 1928 { 1929 $time = $GLOBALS['phpgw']->common->show_date($starttime,$this->bo->users_timeformat); 1930 } 1931 elseif ($starttime <= $rawdate_offset && $endtime >= $nextday - 60) 1932 { 1933 $time = '[ '.lang('All Day').' ]'; 1934 } 1935 elseif ((int)$GLOBALS['phpgw']->common->show_date($starttime,'Hi') || $starttime != $endtime) 1936 { 1937 if($starttime < $rawdate_offset && $event['recur_type'] == MCAL_RECUR_NONE) 1938 { 1939 $start_time = $GLOBALS['phpgw']->common->show_date($rawdate_offset,$this->bo->users_timeformat); 1940 } 1941 else 1942 { 1943 $start_time = $GLOBALS['phpgw']->common->show_date($starttime,$this->bo->users_timeformat); 1944 } 1945 1946 if($endtime >= ($rawdate_offset + 86400)) 1947 { 1948 $end_time = $GLOBALS['phpgw']->common->show_date(mktime(23,59,59,$month,$day,$year) - $GLOBALS['phpgw']->datetime->tz_offset,$this->bo->users_timeformat); 1949 } 1950 else 1951 { 1952 $end_time = $GLOBALS['phpgw']->common->show_date($endtime,$this->bo->users_timeformat); 1953 } 1954 $time = $start_time.'-'.$end_time; 1955 } 1956 else 1957 { 1958 $time = ''; 1959 } 1960 1961 $texttitle = $texttime = $textdesc = $textlocation = $textstatus = ''; 1962 1963 1964 1965 if(!$is_private) 1966 { 1967 //$text .= $this->bo->display_status($event['users_status']); 1968 1969 // split text for better display by templates, also see $texttime $texttitle $textdesc $textlocation 1970 $textstatus=$this->bo->display_status($event['users_status']); 1971 1972 } 1973 1974 /* 1975 $text = '<nobr> '.$time.' </nobr> '.$this->bo->get_short_field($event,$is_private,'title').$text. 1976 (!$is_private && $event['description'] ? ': <i>'.$this->bo->get_short_field($event,$is_private,'description').'</i>':''). 1977 $GLOBALS['phpgw']->browser->br; 1978 */ 1979 1980 $texttime=$time; 1981 $texttitle=$this->bo->get_short_field($event,$is_private,'title'); 1982 $textdesc=(!$is_private && $event['description'] ? $this->bo->get_short_field($event,$is_private,'description'):''); 1983 // added $textlocation but this must be activated in the actual pict_link.tpl file of the used template set 1984 $textlocation=$this->bo->get_short_field($event,$is_private,'location'); 1985 1986 if ($viewable) 1987 { 1988 $date = sprintf('%04d%02d%02d',$year,$month,$day); 1989 $this->link_tpl->set_var('link_link',$this->page('view','&cal_id='.$event['id'].'&date='.$date)); 1990 $this->link_tpl->set_var('lang_view',lang('View this entry')); 1991 $this->link_tpl->set_var('desc', $textdesc); 1992 $this->link_tpl->set_var('location', $textlocation); 1993 $this->link_tpl->parse('picture','link_open',True); 1994 } 1995 if (!$is_private) 1996 { 1997 if($event['priority'] == 3) 1998 { 1999 $picture[] = Array( 2000 'pict' => $GLOBALS['phpgw']->common->image('calendar','high'), 2001 'width' => 16, 2002 'height'=> 16, 2003 'title' => lang('high priority') 2004 ); 2005 } 2006 if($event['recur_type'] == MCAL_RECUR_NONE) 2007 { 2008 $picture[] = Array( 2009 'pict' => $GLOBALS['phpgw']->common->image('calendar','circle'), 2010 'width' => 9, 2011 'height'=> 9, 2012 'title' => lang('single event') 2013 ); 2014 } 2015 else 2016 { 2017 $picture[] = Array( 2018 'pict' => $GLOBALS['phpgw']->common->image('calendar','recur'), 2019 'width' => 12, 2020 'height'=> 12, 2021 'title' => lang('recurring event') 2022 ); 2023 } 2024 } 2025 2026 if($event['public'] == 0) 2027 { 2028 $picture[] = Array( 2029 'pict' => $GLOBALS['phpgw']->common->image('calendar','private'), 2030 'width' => 13, 2031 'height'=> 13, 2032 'title' => lang('private') 2033 ); 2034 } 2035 /** if(@isset($event['alarm']) && count($event['alarm']) >= 1 && !$is_private) 2036 { 2037 // if the alarm is to go off the day before the event 2038 // the icon does not show up because of 'alarm_today' 2039 // - TOM 2040 if($this->bo->alarm_today($event,$rawdate_offset,$starttime)) 2041 { 2042 $picture[] = Array( 2043 'pict' => $GLOBALS['phpgw']->common->image('calendar','alarm'), 2044 'width' => 13, 2045 'height'=> 13, 2046 'title' => lang('alarm') 2047 ); 2048 } 2049 }*/ 2050 2051 $description = $this->bo->get_short_field($event,$is_private,'description'); 2052 for($i=0;$i<count($picture);$i++) 2053 { 2054 $var = Array( 2055 'pic_image' => $picture[$i]['pict'], 2056 'width' => $picture[$i]['width'], 2057 'height' => $picture[$i]['height'], 2058 'title' => $picture[$i]['title'] 2059 ); 2060 $this->output_template_array($this->link_tpl,'picture','pict',$var); 2061 } 2062 if ($texttitle) 2063 { 2064 $var = Array( 2065 // 'text' => $text, 2066 'time'=> $texttime, 2067 'title'=> $texttitle, 2068 'users_status'=>$textstatus, 2069 'desc'=> $textdesc, 2070 'location'=> "<br><b>Local:</b> ".$textlocation 2071 ); 2072 $this->output_template_array($this->link_tpl,'picture','link_text',$var); 2073 } 2074 2075 if ($viewable) 2076 { 2077 $this->link_tpl->parse('picture','link_close',True); 2078 } 2079 $str = $this->link_tpl->fp('out','link_pict'); 2080 $this->link_tpl->set_var('picture',''); 2081 $this->link_tpl->set_var('out',''); 2082 // unset($p); 2083 return $str; 2084 } 1648 2085 1649 2086 -
contrib/Resources/templates/default/head.tpl
r3524 r4362 17 17 <table id="calendar_head_table" class="calendar_head_table" border="0" width="100%" cols="{cols}" cellpadding="6" cellspacing="0"> 18 18 <tr> 19 <td rowspan=10>19 <td> 20 20 21 <div id="divSubContainer"> 22 <table cellpadding="0" cellspacing="0" width="100%"> 23 <tbody><tr> 24 <!-- Sidebox Column --> 25 <td id="tdSidebox" valign="top"><div id="thesideboxcolumn" style="width: 203px;"><div id="sideresize"></div> 26 <div class="divSidebox"> 27 <div class="divSideboxHeader"><span>Recursos Menú</span></div> 28 29 <div> 30 <table cellpadding="0" cellspacing="0" width="100%"> 31 <tbody><tr class="divSideboxEntry"> 32 <td class="textSidebox" align="center" valign="middle" width="20"><img class="sideboxstar" src="/resources/templates/default/images/orange-ball.png" alt="ball" height="9" width="9"></td><td class="textSidebox"><a class="textSidebox" href="index.php?menuaction=resources.uiresources.search">Lista del registro</a></td> 33 </tr> 34 <tr class="divSideboxEntry"> 35 <td class="textSidebox" align="center" valign="middle" width="20"><img class="sideboxstar" src="/resources/templates/default/images/orange-ball.png" alt="ball" height="9" width="9"></td><td class="textSidebox"><a class="textSidebox" href=""></a><a class="textSidebox" href="index.php?menuaction=resources.uiresources.edit" >Añadir</a></td> 36 </tr> 37 38 </tbody></table> 39 </div> 40 </div> 41 42 <div class="sideboxSpace"></div> 43 44 </td> <td> 21 45 22 46 23 -
contrib/Resources/templates/default/search.tpl
r3524 r4362 56 56 </td> 57 57 58 <td>59 <table>60 58 61 <tr>62 <td class="inactiv_sortcolumn" align="left">Categoría <br>Administrador</td>63 64 </tr>65 66 </table>67 </td>68 59 <td> 69 60 <table> … … 103 94 104 95 105 <td>{category}<br>{administrador}</td> 96 106 97 <td> {location}</td> 107 98 … … 109 100 110 101 111 <td> 112 <a href="{accionmodificar}"><img src=/resources/templates/default/images/edit.png alt="modificar"></a> 113 </td> 102 114 103 <td> 115 104 <a href="{accionlistar}"><img src=/resources/templates/default/images/calendar.png alt="ver recursos asignados"></a> … … 121 110 <a href="{accionreservar}"><img src=/resources/templates/default/images/bookable.png alt="reservar"></a> 122 111 </td> 123 <td>124 112 125 <a href="" onClick="if ( 0 || confirm('eliminar esta entrada?')) return submitit2('{accionborrar}');; "><img src=/infolog/templates/default/images/delete.png alt="borrar"></a><br>126 127 128 <br>129 130 </td>131 113 132 114 -
contrib/Resources/templates/default/search2.tpl
r3524 r4362 31 31 </script> 32 32 <center> 33 34 <table id="calendar_search_table" width="90%"> 33 <table id="calendar_search_table" width="800"> 35 34 36 35 <tr><td align=left> … … 40 39 41 40 <td> 42 <table >41 <table width="150"> 43 42 44 43 <tr> … … 50 49 </td> 51 50 <td> 52 <table >51 <table width="300"> 53 52 54 53 <tr> … … 62 61 63 62 <td> 64 <table >63 <table width="100"> 65 64 66 65 <tr> … … 71 70 </table> 72 71 </td> 72 73 73 <td> 74 <table> 75 76 <tr> 77 <td class="inactiv_sortcolumn" align="left">Grupos</td> 78 79 </tr> 80 81 </table> 82 </td> 83 <td> 84 <table> 85 86 <tr> 87 <td class="inactiv_sortcolumn" align="left">Prioridad</td> 88 89 </tr> 90 91 </table> 92 </td> 93 <td> 94 <table> 95 96 <tr> 97 <td class="inactiv_sortcolumn" align="left">Public</td> 98 99 </tr> 100 101 </table> 102 </td> 103 <td> 104 <table> 74 <table width="150"> 105 75 106 76 <tr> … … 125 95 </td> 126 96 <td> 127 <table >97 <table width="100"> 128 98 129 99 <tr> … … 158 128 <td>{description}</td> 159 129 <td> {location}</td> 160 <td> {groups}</td> 161 <td> {priority}</td> 162 <td> {ispublic}</td> 130 163 131 <td> {fecha}</td> 164 <td>{owner}< /td>132 <td>{owner}<input type=hidden value={id}></td> 165 133 166 134 -
contrib/Resources/todo
r3526 r4362 11 11 add buy and prize functionality 12 12 add location functionality 13 14 15 CREATE TABLE phpgw_resources16 (17 res_id integer NOT NULL DEFAULT nextval('seq_phpgw_resources'::regclass),18 "name" character varying(100),19 short_description character varying(100),20 cat_id integer NOT NULL,21 quantity integer,22 useable integer,23 "location" character varying(100),24 bookable character(1),25 prize character varying(200),26 picture_src character varying(20),27 accessory_of integer,28 storage_info character varying(200),29 inventory_number character varying(20),30 administrador character varying(255),31 email character varying(255),32 "owner" character varying(255),33 CONSTRAINT phpgw_resources_pkey PRIMARY KEY (res_id)34 )35 WITH (OIDS=TRUE);36 ALTER TABLE phpgw_resources OWNER TO postgres;
Note: See TracChangeset
for help on using the changeset viewer.