Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezcalendar/user/dayview.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: dayview.php 7697 2001-10-08 14:39:10Z jhe $
5 //
6 // Created on: <08-Jan-2001 12:48:35 bf>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 //
10 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
11 //
12 // This program is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
25 //
26
27 // include_once( "classes/INIFile.php" );
28 // include_once( "classes/eztemplate.php" );
29 // include_once( "classes/ezlog.php" );
30 // include_once( "classes/ezlocale.php" );
31 // include_once( "classes/ezdate.php" );
32 // include_once( "classes/eztime.php" );
33
34 // include_once( "ezcalendar/classes/ezappointment.php" );
35
36 $ini =& eZINI::instance( 'site.ini' );
37
38 $Language = $ini->variable( "eZCalendarMain", "Language" );
39 $StartTimeStr = $ini->variable( "eZCalendarMain", "DayStartTime" );
40 $StopTimeStr = $ini->variable( "eZCalendarMain", "DayStopTime" );
41 $IntervalStr = $ini->variable( "eZCalendarMain", "DayInterval" );
42
43 $Locale = new eZLocale( $Language );
44
45 $user =& eZUser::currentUser();
46 $session =& eZSession::globalSession();
47 $session->fetch();
48
49 if ( $user == false )
50 $userID = false;
51 else
52 $userID = $user->id();
53
54 if ( isset( $GetByUser ) )
55 $userID = $GetByUserID;
56
57 if ( ( $session->variable( "ShowOtherCalendarUsers" ) == false ) || ( isset( $GetByUser ) ) )
58 {
59 $session->setVariable( "ShowOtherCalendarUsers", $userID );
60 }
61 else
62 {
63 $userID = $session->variable( "ShowOtherCalendarUsers" );
64 }
65
66 $tmpUser = new eZUser( $userID );
67 $date = new eZDate();
68
69 if ( isset( $Year ) && $Year != "" && isset( $Month ) && $Month != "" && isset( $Day ) && $Day != "" )
70 {
71 $date->setYear( $Year );
72 $date->setMonth( $Month );
73 $date->setDay( $Day );
74 }
75 else
76 {
77 $Year = $session->variable( "Year" );
78 $Month = $session->variable( "Month" );
79 $Day = $session->variable( "Day" );
80 if ( !$Year && !$Month && !$Day )
81 {
82 $Year = $date->year();
83 $Month = $date->month();
84 $Day = $date->day();
85 }
86 else
87 {
88 $date->setYear( $Year );
89 $date->setMonth( $Month );
90 $date->setDay( $Day );
91 }
92 }
93
94 $session->setVariable( "Year", $Year );
95 $session->setVariable( "Month", $Month );
96 $session->setVariable( "Day", $Day );
97
98 $zMonth = addZero( $Month );
99 $zDay = addZero( $Day );
100 $isMyCalendar = ( $user && $user->id() == $userID ) ? "-private" : "";
101 $t = new eZTemplate( "kernel/ezcalendar/user/" . $ini->variable( "eZCalendarMain", "TemplateDir" ),
102 "kernel/ezcalendar/user/intl", $Language, "dayview.php",
103 "default", "ezcalendar" . "/user", "$Year-$zMonth-$zDay-$userID" . $isMyCalendar );
104
105 $t->set_file( "day_view_page_tpl", "dayview.tpl" );
106
107 if ( $StoreSiteCache && $t->hasCache() )
108 {
109 print( $t->cache() );
110 }
111 else
112 {
113 $t->setAllStrings();
114
115 $t->set_block( "day_view_page_tpl", "user_item_tpl", "user_item" );
116 $t->set_block( "day_view_page_tpl", "time_table_tpl", "time_table" );
117 $t->set_block( "time_table_tpl", "no_appointment_tpl", "no_appointment" );
118 $t->set_block( "time_table_tpl", "private_appointment_tpl", "private_appointment" );
119 $t->set_block( "time_table_tpl", "public_appointment_tpl", "public_appointment" );
120 $t->set_block( "public_appointment_tpl", "delete_check_tpl", "delete_check" );
121 $t->set_block( "day_view_page_tpl", "week_tpl", "week" );
122 $t->set_block( "week_tpl", "day_tpl", "day" );
123 $t->set_block( "week_tpl", "empty_day_tpl", "empty_day" );
124
125 $t->set_var( "month_number", $Month );
126 $t->set_var( "year_number", $Year );
127 $t->set_var( "day_number", $Day );
128 $t->set_var( "long_date", $Locale->format( $date, false ) );
129
130
131 $today = new eZDate();
132 $tmpDate = new eZDate( $date->year(), $date->month(), $date->day() );
133 $tmpAppointment = new eZAppointment();
134
135 // fetch the appointments for the selected day
136 $appointments =& $tmpAppointment->getByDate( $tmpDate, $tmpUser, false );
137
138 // set start/stop and interval times
139 $startTime = new eZTime();
140 $stopTime = new eZTime();
141 $interval = new eZTime();
142
143 if ( preg_match( "#(^([0-9]{1,2})[^0-9]{0,1}([0-9]{0,2})$)#", $StartTimeStr, $startArray ) )
144 {
145 $hour = $startArray[2];
146 $startTime->setHour( $hour );
147
148 $min = $startArray[3];
149 $startTime->setMinute( $min );
150
151 $startTime->setSecond( 0 );
152 }
153
154 if ( preg_match( "#(^([0-9]{1,2})[^0-9]{0,1}([0-9]{0,2})$)#", $StopTimeStr, $stopArray ) )
155 {
156 $hour = $stopArray[2];
157 $stopTime->setHour( $hour );
158
159 $min = $stopArray[3];
160 $stopTime->setMinute( $min );
161
162 $stopTime->setSecond( 0 );
163 }
164
165 if ( preg_match( "#(^([0-9]{1,2})[^0-9]{0,1}([0-9]{0,2})$)#", $IntervalStr, $intervalArray ) )
166 {
167 $hour = $intervalArray[2];
168 $interval->setHour( $hour );
169
170 $min = $intervalArray[3];
171 $interval->setMinute( $min );
172
173 $interval->setSecond( 0 );
174 }
175
176 // increase schedule span to fit early/late appointments
177 $midNight = new eZTime();
178 $midNight->setSecondsElapsed( 0 );
179 $lastInterval = $midNight->subtract( $interval );
180 $firstInterval = $midNight->add( $interval );
181
182 foreach ( $appointments as $appointment )
183 {
184 if ( !$appointment->allDay() )
185 {
186 $appStartTime =& $appointment->startTime();
187 $appStopTime =& $appointment->stopTime();
188
189 if ( $appStartTime->isGreater( $firstInterval ) )
190 $startTime = $midNight;
191
192 while ( $appStartTime->isGreater( $startTime ) )
193 {
194 $startTime = $startTime->subtract( $interval );
195 }
196
197 if ( $lastInterval->isGreater( $appStopTime ) )
198 {
199 $stopTime = new eZDateTime( $date->year(), $date->month(), $date->day(), 23, 59 );
200 $stopTime->setTimeStamp( $stopTime->timestamp() );
201 }
202
203 while ( $stopTime->isGreater( $appStopTime ) )
204 {
205 $stopTime = $stopTime->add( $interval );
206 }
207 }
208 else
209 {
210 $appStartTime =& $appointment->startTime();
211 $appStopTime =& $appointment->stopTime();
212
213 if ( $appStartTime->isGreater( $firstInterval ) )
214 $startTime = $midNight;
215
216 while ( $appStartTime->isGreater( $startTime ) )
217 {
218 $startTime = $startTime->subtract( $interval );
219 }
220
221 if ( $lastInterval->isGreater( $appStopTime ) )
222 {
223 $stopTime = new eZDateTime( $date->year(), $date->month(), $date->day(), 23, 59 );
224 $stopTime->setTimeStamp( $stopTime->timestamp() );
225 }
226
227 while ( $stopTime->isGreater( $appStopTime ) )
228 {
229 $stopTime = $stopTime->add( $interval );
230 }
231 }
232 }
233
234 for ( $i = 0; $i < count( $appointments ); $i++ )
235 {
236 $eZDateTimeObject = new eZDateTime();
237 $eZDateTimeObject->setTimeStamp( $appointments[$i]->Date );
238
239 if ( $appointments[$i]->allDay() )
240 {
241 $dateTime = new eZDateTime( $date->year(), $date->month(), $date->day() );
242 $dateTime->setSecondsElapsed( $startTime->secondsElapsed() );
243 // $appointments[$i]->setDateTime( $dateTime );
244
245 // $appointments[$i]->setDuration( $stopTime->Time->timestamp() - $startTime->secondsElapsed() );
246 // $appointments[$i]->store();
247 }
248 }
249
250 // places appointments into columns, creates extra columns as necessary
251 $numRows = 0;
252 $numCols = 1;
253 $tableCellsId = array(); // appointmend id for a cell
254 $tableCellsRowSpan = array(); // rowspan for a cell
255 $colTaken = array(); // number of non free rows in the current column, after the last appointment. 0 means col free.
256 $emptyRows = array(); // number of empty rows in the current column, after the last appointment
257 $appointmentDone = array(); // true when the appointment has been inserted into the table
258 $tmpTime = new eZTime();
259 $tmpTime->setSecondsElapsed( $startTime->secondsElapsed() );
260
261 while ( $tmpTime->isGreater( $stopTime ) )
262 {
263 $numRows++;
264 //$tableCellsId[$numRows - 1] = array();
265 //$tableCellsRowSpan[$numRows - 1] = array();
266 //$colTaken[$numCols] = 0;
267 // marks cells as taken, -1
268 for ( $col = 0; $col < $numCols; $col++ )
269 {
270 if ( isset( $colTaken[$col] ) && $colTaken[$col] > 0 )
271 {
272 $tableCellsId[$numRows - 1][$col] = -1;
273 }
274 }
275
276 foreach ( $appointments as $appointment )
277 {
278 $appointmentDone[ $appointment->id() ] = false;
279 // avoid wrapping around midnight
280 $nextInterval = $tmpTime->add( $interval );
281 if ( $nextInterval->isGreater( $tmpTime ) )
282 $nextInterval = new eZTime( 23, 59 );
283
284 // if this appointment should be inserted into the table now
285 if ( isset( $appointmentDone[$appointment->id()] ) && $appointmentDone[$appointment->id()] == false &&
286 intersects( $appointment, $tmpTime, $nextInterval ) == true )
287 {
288 $foundFreeColumn = false;
289 $col = 0;
290 while ( $foundFreeColumn == false )
291 {
292 //$tableCellsId[$numRows-1][$col] = 0;
293
294 // the column is free, insert appointment here
295 if ( $foundFreeColumn == false && !isset( $tableCellsId[$numRows-1][$col] ) ) //&& $tableCellsId[$numRows-1][$col] == 0 )
296 {
297 $tableCellsId[$numRows-1][$col] = $appointment->id();
298 $tableCellsRowSpan[$numRows-1][$col] = appointmentRowSpan( $appointment, $tmpTime, $interval );
299 $colTaken[$col] = $tableCellsRowSpan[$numRows-1][$col];
300 $appointmentDone[$appointment->id()] = true;
301 $foundFreeColumn = true;
302
303 // if we created a new column, mark leading empty spaces
304 // this was determined not to be needed at this point, so it's left here in case we messed up.
305
306 /* if ( $col >= $numCols )
307 $emptyRows[$col] = $numRows - 1;
308
309 if ( isset( $emptyRows[ $col ] ) && $emptyRows[ $col ] > 0 )
310 {
311 $tableCellsId[$numRows - 1 - $emptyRows[$col]][$col] = -2;
312 $tableCellsRowSpan[$numRows - 1 - $emptyRows[$col]][$col] = $emptyRows[$col];
313 $emptyRows[$col] = 0;
314 } */
315
316 }
317 elseif( $appointment->AllDay() && isset( $appointmentDone[$appointment->id() ] )
318 && $appointmentDone[ $appointment->id() ] == false
319 )
320 {
321 if ( !isset( $tableCellsId[$numRows-1][$col] ) ) //&& $tableCellsId[$numRows-1][$col] == 0 )
322 {
323 $tableCellsId[$numRows - 1][$col] = $appointment->id();
324 $tableCellsRowSpan[$numRows - 1][$col] = appointmentRowSpan($appointment, $tmpTime, $interval);
325 $colTaken[$col] = $tableCellsRowSpan[$numRows - 1][$col];
326 $appointmentDone[$appointment->id()] = true;
327 $foundFreeColumn = true;
328
329 // if we created a new column, mark leading empty spaces
330 if ($col >= $numCols)
331 $emptyRows[$col] = $numRows - 1;
332
333 if (isset($emptyRows[$col]) && $emptyRows[$col] > 0) {
334 $tableCellsId[$numRows - 1 - $emptyRows[$col]][$col] = -2;
335 $tableCellsRowSpan[$numRows - 1 - $emptyRows[$col]][$col] = $emptyRows[$col];
336 $emptyRows[$col] = 0;
337 }
338 }
339 }
340 else
341 {
342 $foundFreeColumn = true;
343 }
344
345 // the column was not free, try the next one
346 $col++;
347 if ( $col > $numCols )
348 $numCols++;
349 }
350 }
351 }
352
353 // decrease/increase counts as we move down
354 for ( $col = 0; $col < $numCols; $col++ )
355 {
356 if ( isset( $colTaken[$col] ) && $colTaken[$col] > 0 )
357 {
358 $colTaken[$col]--;
359 }
360
361 if ( isset( $tableCellsId[ $numRows - 1 ][$col] ) && $tableCellsId[$numRows - 1][$col] == 0 )
362 {
363 $emptyRows[$col]++;
364 }
365 }
366
367 if ( $tmpTime > $tmpTime->add( $interval ) )
368 $tmpTime = new eZTime( 23, 59 );
369 else
370 $tmpTime = $tmpTime->add( $interval );
371 }
372
373 // mark remaining empty spaces as empty, -2
374 for ( $col = 0; $col < $numCols; $col++ )
375 {
376 if ( isset( $emptyRows[$col] ) && $emptyRows[$col] > 0 )
377 {
378 $tableCellsId[$numRows - $emptyRows[$col]][$col] = -2;
379 $tableCellsRowSpan[$numRows - $emptyRows[$col]][$col] = $emptyRows[$col];
380 }
381 }
382
383
384 //debug contents table
385 // print( "Rows: " . $numRows . " Cols: " . $numCols . "<br />" );
386 // print( "<table border=\"1\">" );
387 // for ( $row=0; $row<$numRows; $row++ )
388 // {
389 // print( "<tr>" );
390 // for ( $col=0; $col<$numCols; $col++ )
391 // {
392 // if( isset( $tableCellsId[$row][$col] ) && isset( $tableCellsRowSpan[$row][$col] ) )
393 // print( "<td>" . $tableCellsId[$row][$col] . " / " . $tableCellsRowSpan[$row][$col] . "</td>" );
394 // }
395 // print( "</tr>" );
396 // }
397 // print( "</table>" );
398
399 // prints out the time table
400 $emptyDone = false;
401 $now = new eZTime();
402 $nowSet = false;
403 $row = 0;
404 $tmpTime = new eZTime();
405 $tmpTime->setSecondsElapsed( $startTime->secondsElapsed() );
406
407 while ( $tmpTime->isGreater( $stopTime ) )
408 {
409 $t->set_var( "short_time", $Locale->format( $tmpTime, true ) );
410 $t->set_var( "start_time", addZero( $tmpTime->hour() ) . addZero( $tmpTime->minute() ) );
411
412 $drawnColumn = array();
413
414 $t->set_var( "public_appointment", "" );
415 $t->set_var( "private_appointment", "" );
416 $t->set_var( "no_appointment", "" );
417 $t->set_var( "delete_check", "" );
418
419 // rarely needed now but helpful in data processing review
420 // print_r( $tableCellsId );
421
422 for ( $col = 0; $col < $numCols; $col++ )
423 {
424 if( isset( $tableCellsId[$row][$col] ) )
425 $appointmentId = $tableCellsId[$row][$col];
426 else
427 $appointmentId = -2;
428
429 // an appointment
430 if ( $appointmentId > 0 )
431 {
432 $appointment = new eZAppointment( $appointmentId );
433
434 // a private appointment
435 if ( $appointment->isPrivate() && $appointment->userID() != $userID )
436 {
437 $t->set_var( "td_class", "bglight" );
438 $t->set_var( "rowspan_value", $tableCellsRowSpan[$row][$col] );
439
440 $t->parse( "private_appointment", "private_appointment_tpl", true );
441 }
442 else // a public appointment
443 {
444
445 $t->set_var( "td_class", "bglight" );
446 $t->set_var( "rowspan_value", $tableCellsRowSpan[$row][$col] );
447 $t->set_var( "rowspan_markup_value", 'rowspan="'. $tableCellsRowSpan[$row][$col] . '"' );
448 // $t->set_var( "rowspan_markup_value", '' );
449
450 $t->set_var( "appointment_id", $appointment->id() );
451 $t->set_var( "appointment_name", $appointment->name() );
452 $t->set_var( "appointment_description", $appointment->description() );
453 $t->set_var( "edit_button", "Edit" );
454
455 $t->parse( "delete_check", "delete_check_tpl" );
456 $t->parse( "public_appointment", "public_appointment_tpl", true );
457 }
458 }
459 else if ( $appointmentId == -2 ) // an empty space
460 {
461 $t->set_var("td_class", "bgdark");
462 if ( isset( $tableCellsRowSpan[$row][$col] ) )
463 {
464 $t->set_var("rowspan_value", $tableCellsRowSpan[$row][$col]);
465 $t->set_var("rowspan_markup_value", '');
466 } else {
467 $t->set_var("rowspan_value", '');
468 $t->set_var("rowspan_markup_value", '');
469 }
470 $t->parse( "no_appointment", "no_appointment_tpl", true );
471 }
472 }
473
474 $t->set_var( "td_class", "" );
475
476 // Mark current time with bgcurrent. Does not currently go well together with caching.
477 // if ( $date->equals( $today ) && $nowSet == false &&
478 // $tmpTime->isGreater( $now, true ) && $now->isGreater( $tmpTime->add( $interval ) ) )
479 // {
480 // $t->set_var( "td_class", "bgcurrent" );
481 // $nowSet = true;
482 // }
483
484 if ( $tmpTime > $tmpTime->add( $interval ) )
485 $tmpTime = new eZTime( 23, 59 );
486 else
487 $tmpTime = $tmpTime->add( $interval );
488 $row++;
489
490 $t->parse( "time_table", "time_table_tpl", true );
491 }
492
493
494 // User list
495 $user_array =& eZUser::getAll();
496
497 foreach ( $user_array as $userItem )
498 {
499 $t->set_var( "user_id", $userItem->id() );
500 $t->set_var( "user_firstname", $userItem->firstName() );
501 $t->set_var( "user_lastname", $userItem->lastName() );
502
503 if ( $tmpUser->id() == $userItem->id() )
504 {
505 $t->set_var( "user_is_selected", "selected" );
506 }
507 else
508 {
509 $t->set_var( "user_is_selected", "" );
510 }
511
512 $t->parse( "user_item", "user_item_tpl", true );
513 }
514
515
516 // previous day link
517 $date->setYear( $Year );
518 $date->setMonth( $Month );
519
520 $date->setDay( $Day - 1 );
521 if ( $date->day() < 1 )
522 {
523 $date->setMonth( $Month - 1 );
524 if ( $date->month() < 1 )
525 {
526 $date->setMonth( 12 );
527 $date->setYear( $Year - 1 );
528 }
529 $date->setDay( $date->daysInMonth() );
530 }
531 $t->set_var( "pd_year_number", $date->year() );
532 $t->set_var( "pd_month_number", $date->month() );
533 $t->set_var( "pd_day_number", $date->day() );
534
535 // next day link
536 $date->setYear( $Year );
537 $date->setMonth( $Month );
538
539 $date->setDay( $Day + 1 );
540 if ( $date->day() > $date->daysInMonth() )
541 {
542 $date->setDay( 1 );
543 $date->setMonth( $Month + 1 );
544 if ( $date->month() > 12 )
545 {
546 $date->setMonth( 1 );
547 $date->setYear( $Year + 1 );
548 }
549 }
550 $t->set_var( "nd_year_number", $date->year() );
551 $t->set_var( "nd_month_number", $date->month() );
552 $t->set_var( "nd_day_number", $date->day() );
553
554 // previous month link
555 $date->setYear( $Year );
556 $date->setDay( $Day );
557
558 $date->setMonth( $Month - 1 );
559 if ( $date->month() < 1 )
560 {
561 $date->setMonth( 12 );
562 $date->setYear( $Year - 1 );
563 }
564 if ( $date->day() > $date->daysInMonth() )
565 $date->setDay( $date->daysInMonth() );
566 $t->set_var( "pm_year_number", $date->year() );
567 $t->set_var( "pm_month_number", $date->month() );
568 $t->set_var( "pm_day_number", $date->day() );
569
570 // next month link
571 $date->setYear( $Year );
572 $date->setDay( $Day );
573
574 $date->setMonth( $Month + 1 );
575 if ( $date->month() > 12 )
576 {
577 $date->setMonth( 1 );
578 $date->setYear( $Year + 1 );
579 }
580 if ( $date->day() > $date->daysInMonth() )
581 $date->setDay( $date->daysInMonth() );
582 $t->set_var( "nm_year_number", $date->year() );
583 $t->set_var( "nm_month_number", $date->month() );
584 $t->set_var( "nm_day_number", $date->day() );
585
586
587 // parse month table
588 $date->setYear( $Year );
589 $date->setMonth( $Month );
590 $date->setDay( $Day );
591
592 $t->set_var( "month_number", $date->month() );
593 $t->set_var( "month_name", $Locale->monthName( $date->monthName(), false ) );
594
595 $t->set_var( "week", "" );
596 for ( $week = 0; $week < 6; $week++ )
597 {
598 $t->set_var( "day", "" );
599 $t->set_var( "empty_day", "" );
600
601 for ( $day = 1; $day <= 7; $day++ )
602 {
603 $date->setDay( 1 );
604 $firstDay = $date->dayOfWeek( $Locale->mondayFirst() );
605
606 $currentDay = $day + ( $week * 7 ) - $firstDay + 1;
607
608 if ( ( ( $day + ( $week * 7 ) ) >= $firstDay ) &&
609 ( $currentDay <= $date->daysInMonth() ) )
610 {
611 $date->setDay( $currentDay );
612
613 $t->set_var( "td_class", "bglight" );
614 // if ( $date->equals( $today ) )
615 // $t->set_var( "td_class", "bgcurrent" );
616
617 $t->set_var( "day_number", $currentDay );
618 $t->parse( "day", "day_tpl", true );
619 }
620 else
621 {
622 $t->set_var( "td_class", "bglight" );
623 $t->parse( "day", "empty_day_tpl", true );
624 }
625 }
626 $t->parse( "week", "week_tpl", true );
627
628 if ( $currentDay >= $date->daysInMonth() )
629 {
630 $week = 6;
631 }
632 }
633
634 $t->storeCache( "output", "day_view_page_tpl", true );
635 }
636
637
638 // returns the number of rows an appointment covers.
639 function appointmentRowSpan( &$appointment, &$startTime, &$interval )
640 {
641 $ret = 1;
642 $tmpTime = new eZTime();
643 $tmpTime->setSecondsElapsed( $startTime->secondsElapsed() );
644 $aStop =& $appointment->stopTime();
645
646
647 while ( $tmpTime->isGreater( $aStop ) )
648 {
649 if ( $tmpTime > $tmpTime->add( $interval ) )
650 {
651 $tmpTime = new eZTime( 23, 59 );
652 }
653 else
654 {
655 $tmpTime = $tmpTime->add( $interval->timestamp() );
656 }
657 $ret++;
658 }
659
660 return $ret;
661 }
662
663
664 // checks if an appointment intersects with a given time interval
665 function intersects( &$app, &$startTime, &$stopTime )
666 {
667 $ret = false;
668 $appStartTime =& $app->startTime();
669 $appStopTime =& $app->stopTime();
670
671 // appstart is between start and stop
672 if ( $startTime->isGreater( $appStartTime, true ) == true &&
673 $appStartTime->isGreater( $stopTime ) == true )
674 {
675 $ret = true;
676 }
677 // appstop is between start and stop
678 else if ( $startTime->isGreater( $appStopTime ) == true &&
679 $appStopTime->isGreater( $stopTime, true ) == true )
680 {
681 $ret = true;
682 }
683 // appstart is before start, and appstop is after stop
684 else if ( $appStartTime->isGreater( $startTime ) == true &&
685 $stopTime->isGreater( $appStopTime ) == true )
686 {
687 $ret = true;
688 }
689
690 return $ret;
691 }
692
693
694 //Adds a "0" in front of the value if it's below 10.
695 function addZero( $value )
696 {
697 settype( $value, "integer" );
698 $ret = $value;
699 if ( $ret < 10 )
700 {
701 $ret = "0". $ret;
702 }
703 return $ret;
704 }
705
706 ?>
$i
$i
Definition: admin/adlist.php:91
$day
else $day
Definition: appointmentedit.php:665
$app
else $app
Definition: appointmentedit.php:128
$appointment
$appointment
Definition: appointmentview.php:89
$dateTime
$dateTime
Definition: authorview.php:77
eZAppointment
Definition: ezappointment.php:43
eZDateTime
Definition: ezdatetime.php:55
eZDate
Definition: ezdate.php:46
eZLocale
Definition: ezlocale.php:119
eZSession\globalSession
static & globalSession( $id="", $fetch=true)
Definition: kernel/ezsession/classes/ezsession.php:614
eZTemplate
Definition: eztemplate.php:107
eZTime
Definition: eztime.php:38
eZUser
Definition: ezuser.php:76
eZUser\getAll
static & getAll( $order="Login", $as_object=true, $search=false, $max=-1, $index=0)
Definition: ezuser.php:330
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$hour
$hour
Definition: export_froogle.php:310
$isMyCalendar
$isMyCalendar
Definition: ezcalendar/user/dayview.php:100
$interval
$interval
Definition: ezcalendar/user/dayview.php:141
$tmpDate
$tmpDate
Definition: ezcalendar/user/dayview.php:132
$tmpAppointment
$tmpAppointment
Definition: ezcalendar/user/dayview.php:133
$lastInterval
$lastInterval
Definition: ezcalendar/user/dayview.php:179
$tmpTime
$tmpTime
Definition: ezcalendar/user/dayview.php:258
$user_array
while( $tmpTime->isGreater( $stopTime)) $user_array
Definition: ezcalendar/user/dayview.php:495
appointmentRowSpan
appointmentRowSpan(&$appointment, &$startTime, &$interval)
Definition: ezcalendar/user/dayview.php:639
$t
$t
Definition: ezcalendar/user/dayview.php:101
$startTime
$startTime
Definition: ezcalendar/user/dayview.php:139
$date
$date
Definition: ezcalendar/user/dayview.php:67
$zDay
$zDay
Definition: ezcalendar/user/dayview.php:99
$zMonth
$zMonth
Definition: ezcalendar/user/dayview.php:98
$user
$user
Definition: ezcalendar/user/dayview.php:45
$Month
$Month
Definition: ezcalendar/user/dayview.php:78
$midNight
if(preg_match("#(^( $midNight[0-9]{1, 2})[^0-9]{0, 1}([0-9]{0, 2})$)#", $StartTimeStr, $startArray)) if (preg_match("#(^([0-9]{1, 2})[^0-9]{0, 1}([0-9]{0, 2})$)#", $StopTimeStr, $stopArray)) if (preg_match("#(^([0-9]{1, 2})[^0-9]{0, 1}([0-9]{0, 2})$)#", $IntervalStr, $intervalArray))
Definition: ezcalendar/user/dayview.php:177
$stopTime
$stopTime
Definition: ezcalendar/user/dayview.php:140
$emptyRows
$emptyRows
Definition: ezcalendar/user/dayview.php:256
$IntervalStr
$IntervalStr
Definition: ezcalendar/user/dayview.php:41
$numRows
foreach( $appointments as $appointment) for( $i=0; $i< count( $appointments); $i++) $numRows
Definition: ezcalendar/user/dayview.php:251
$Locale
$Locale
Definition: ezcalendar/user/dayview.php:43
$StopTimeStr
$StopTimeStr
Definition: ezcalendar/user/dayview.php:40
$nowSet
$nowSet
Definition: ezcalendar/user/dayview.php:402
$numCols
$numCols
Definition: ezcalendar/user/dayview.php:252
$Language
$Language
Definition: ezcalendar/user/dayview.php:38
$ini
$ini
Definition: ezcalendar/user/dayview.php:36
addZero
addZero( $value)
Definition: ezcalendar/user/dayview.php:695
$userID
else $userID
Definition: ezcalendar/user/dayview.php:52
$colTaken
$colTaken
Definition: ezcalendar/user/dayview.php:255
$firstInterval
$firstInterval
Definition: ezcalendar/user/dayview.php:180
$row
$row
Definition: ezcalendar/user/dayview.php:403
$tableCellsRowSpan
$tableCellsRowSpan
Definition: ezcalendar/user/dayview.php:254
$appointments
$appointments
Definition: ezcalendar/user/dayview.php:136
$Day
$Day
Definition: ezcalendar/user/dayview.php:79
$session
$session
Definition: ezcalendar/user/dayview.php:46
$tmpUser
$tmpUser
Definition: ezcalendar/user/dayview.php:66
$tableCellsId
$tableCellsId
Definition: ezcalendar/user/dayview.php:253
$emptyDone
while( $tmpTime->isGreater( $stopTime)) for( $col=0; $col< $numCols; $col++) $emptyDone
Definition: ezcalendar/user/dayview.php:400
$appointmentDone
$appointmentDone
Definition: ezcalendar/user/dayview.php:257
$StartTimeStr
$StartTimeStr
Definition: ezcalendar/user/dayview.php:39
$today
$today
Definition: ezcalendar/user/dayview.php:131
$now
$now
Definition: ezcalendar/user/dayview.php:401
intersects
intersects(&$app, &$startTime, &$stopTime)
Definition: ezcalendar/user/dayview.php:665
$firstDay
$firstDay
Definition: ezcalendar/user/monthview.php:134
$ret
$ret
Definition: ezsitemanager/admin/filelist.php:88
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.