Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezgroupevent.php
Go to the documentation of this file.
1 <?
3 //
4 // Definition of eZEvent class
5 //
6 // Adam Fallert <FallertA@umsystem.edu>
7 // Created on: <3-Oct-2001 14:36:00>
8 //
9 // This program is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU General Public License
11 // as published by the Free Software Foundation; either version 2
12 // of the License, or (at your option) any later version.
13 //
14 // This program is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
22 //
23
26
33 /*
34 include_once( "classes/ezdb.php" );
35 include_once( "classes/ezdatetime.php" );
36 include_once( "classes/eztime.php" );
37
38 include_once( "ezgroupeventcalendar/classes/ezgroupnoshow.php" );
39 include_once( "ezgroupeventcalendar/classes/ezgroupeventtype.php" );
40
41 include_once( "ezmail/classes/ezmail.php" );
42 */
43
44 // take two date objects and return an array holding
45 // the difference in years, months, weeks, and days
46 // we should probably integrate this in a class later on...
47 function _date_diff($date1, $date2)
48 {
49 if (is_object($date1)) {
50 $y1 = $date1->year();
51 $m1 = $date1->month();
52 $d1 = $date1->day();
53 } else {
54 $d1 = explode("-", $date1);
55 $y1 = $d1[0];
56 $m1 = $d1[1];
57 $d1 = $d1[2];
58 }
59 if (is_object($date2)) {
60 $y2 = $date2->year();
61 $m2 = $date2->month();
62 $d2 = $date2->day();
63 } else {
64 $d2 = explode("-", $date2);
65 $y2 = $d2[0];
66 $m2 = $d2[1];
67 $d2 = $d2[2];
68 }
69 $years = $y2 - $y1;
70
71 if (($m2-$m1) && (!$years))
72 $months = ($m2 - $m1);
73 else
74 $months = ($m2 -$m1)+(12*$years);
75
76 $date1_set = mktime(0,0,0, $m1, $d1, $y1);
77 $date2_set = mktime(0,0,0, $m2, $d2, $y2);
78 $days = round(($date2_set-$date1_set)/(60*60*24));
79 $weeks = round($days / 7);
80 $retArr = array('years'=>$years, 'months'=>$months, 'weeks'=>$weeks, 'days'=>$days);
81 return $retArr;
82 }
83
84 class eZGroupEvent
85 {
92 function __construct( $id=-1, $fetch=true )
93 {
94 $this->IsConnected = false;
95 $this->EventCategoryID = 0;
96 $this->IsRecurring = 0;
97 $this->RepeatTimes = 0;
98 $this->EMailNotice = 0;
99 $this->EventTypeID = 0;
100 $this->GroupID = 0;
101 $this->Date = "";
102 $this->RepeatUntilDate = "";
103
104 if ( $id != -1 )
105 {
106 $this->ID = $id;
107 if ( $fetch == true )
108 {
109 $this->get( $this->ID );
110 }
111 else
112 {
113 $this->State_ = "Dirty";
114 }
115 }
116 else
117 {
118 $this->State_ = "New";
119 }
120 }
121
125 function store()
126 {
127 // commenting out all the recurring stuff until the UI is implemented
128 $this->dbInit();
129
130 $Name = addslashes( $this->Name );
131 $Description = addslashes( $this->Description );
132
133 if ( !isset( $this->ID ) )
134 {
135 $query = "INSERT INTO eZGroupEventCalendar_Event SET
136 Name='$Name',
137 Description='$Description',
138 Date='$this->Date',
139 Duration='$this->Duration',
140 Url='$this->Url',
141 Status='$this->Status',
142 Location='$this->Location',
143 EventAlarmNotice='$this->EventAlarmNotice',
144 EventCategoryID='$this->EventCategoryID',
145 IsRecurring='$this->IsRecurring',
146 RecurExceptions='$this->RecurExceptions',
147 RecurDay='$this->RecurDay',
148 RecurMonthlyType='$this->RecurMonthlyType',
149 RecurMonthlyTypeInfo='$this->RecurMonthlyTypeInfo',
150 RecurType='$this->RecurType',
151 RecurFreq='$this->RecurFreq',
152 RepeatForever='$this->RepeatForever',
153 RepeatTimes='$this->RepeatTimes',
154 RepeatUntilDate='$this->RepeatUntilDate',
155 RecurFinishDate='$this->RecurFinishDate',
156 EMailNotice='$this->EMailNotice',
157 IsPrivate='$this->IsPrivate',
158 Priority='$this->Priority',
159 EventTypeID='$this->EventTypeID',
160 GroupID='$this->GroupID'";
161
162 $this->Database->query( $query );
163 $this->ID = $this->Database->insertID();
164 }
165 else
166 {
167 $query = "UPDATE eZGroupEventCalendar_Event SET
168 Name='$Name',
169 Description='$Description',
170 Date='$this->Date',
171 Duration='$this->Duration',
172 Url='$this->Url',
173 Status='$this->Status',
174 Location='$this->Location',
175 EventAlarmNotice='$this->EventAlarmNotice',
176 EventCategoryID='$this->EventCategoryID',
177 IsRecurring='$this->IsRecurring',
178 RecurExceptions='$this->RecurExceptions',
179 RecurDay='$this->RecurDay',
180 RecurMonthlyType='$this->RecurMonthlyType',
181 RecurMonthlyTypeInfo='$this->RecurMonthlyTypeInfo',
182 RecurType='$this->RecurType',
183 RecurFreq='$this->RecurFreq',
184 RepeatForever='$this->RepeatForever',
185 RepeatTimes='$this->RepeatTimes',
186 RepeatUntilDate='$this->RepeatUntilDate',
187 RecurFinishDate='$this->RecurFinishDate',
188 EMailNotice='$this->EMailNotice',
189 IsPrivate='$this->IsPrivate',
190 Priority='$this->Priority',
191 EventTypeID='$this->EventTypeID',
192 GroupID='$this->GroupID'
193 WHERE ID='$this->ID'";
194
195 $this->Database->query( $query );
196 }
197 return true;
198 }
199
204 function delete()
205 {
206 $this->dbInit();
207
208 if ( isset( $this->ID ) )
209 {
210 $this->Database->query( "DELETE FROM eZGroupEventCalendar_Event WHERE ID='$this->ID'" );
211 }
212
213 return true;
214 }
215
219 function get( $id=-1 )
220 {
221 $this->dbInit();
222
223 if ( $id != "" )
224 {
225 $this->Database->array_query( $event_array, "SELECT * FROM eZGroupEventCalendar_Event WHERE ID='$id'" );
226
227 if ( count( $event_array ) > 1 )
228 {
229 die( "Error: Event's with the same ID was found in the database. This shouldent happen." );
230 }
231 else if( count( $event_array ) == 1 )
232 {
233
234 $this->ID =& $event_array[0][ "ID" ];
235 $this->Name =& $event_array[0][ "Name" ];
236 $this->Description =& $event_array[0][ "Description" ];
237 $this->EventTypeID =& $event_array[0][ "EventTypeID" ];
238 $this->GroupID =& $event_array[0][ "GroupID" ];
239 $this->Date =& $event_array[0][ "Date" ];
240 $this->Duration =& $event_array[0][ "Duration" ];
241 $this->IsPrivate =& $event_array[0][ "IsPrivate" ];
242 $this->Priority =& $event_array[0][ "Priority" ];
243
244 $this->Url =& $event_array[0][ "Url" ];
245 $this->Location =& $event_array[0][ "Location" ];
246
247 $this->Status =& $event_array[0][ "Status" ];
248 $this->EventCategoryID =& $event_array[0][ "EventCategoryID" ];
249
250 $this->EMailNotice =& $event_array[0][ "EventAlarmNotice" ];
251 $this->EventAlarmNotice =& $event_array[0][ "EventAlarmNotice" ];
252
253 $this->EventCategoryID =& $event_array[0][ "EventCategoryID" ];
254 $this->IsRecurring =& $event_array[0][ "IsRecurring" ];
255 $this->RecurDay =& $event_array[0][ "RecurDay" ];
256 $this->RecurFreq =& $event_array[0][ "RecurFreq" ];
257 $this->RecurForever =& $event_array[0][ "RecurForever" ];
258 $this->RecurMonthlyType =& $event_array[0][ "RecurMonthlyType" ];
259 $this->RecurMonthlyTypeInfo =& $event_array[0][ "RecurMonthlyTypeInfo" ];
260 $this->RecurType =& $event_array[0] [ "RecurType" ];
261 $this->RecurExceptions =& $event_array[0][ "RecurExceptions" ];
262 $this->RepeatForever =& $event_array[0][ "RepeatForever" ];
263 $this->RepeatTimes =& $event_array[0][ "RepeatTimes" ];
264 $this->RepeatUntilDate =& $event_array[0][ "RepeatUntilDate" ];
265 $this->RecurFinishDate =& $event_array[0][ "RecurFinishDate" ];
266 $this->State_ = "Coherent";
267 }
268 }
269 else
270 {
271 $this->State_ = "Dirty";
272 }
273 }
274
280 function &getAll()
281 {
282 $this->dbInit();
283
284 $return_array = array();
285 $event_array = array();
286
287 $this->Database->array_query( $event_array,
288 "SELECT ID FROM eZGroupEventCalendar_Event" );
289
290 for ( $i=0; $i<count($event_array); $i++ )
291 {
292 $return_array[$i] = new eZGroupEvent( $event_array[$i]["ID"], 0 );
293 }
294
295 return $return_array;
296 }
297
303 function &getAllByOthers()
304 {
305 $this->dbInit();
306
307 $return_array = array();
308 $event_array = array();
309
310 $this->Database->array_query( $event_array,
311 "SELECT ID FROM eZGroupEventCalendar_Event WHERE ID='$id' AND IsPrivate='0'" );
312
313 for ( $i=0; $i<count($event_array); $i++ )
314 {
315 $return_array[$i] = new eZGroupEvent( $event_array[$i]["ID"], 0 );
316 }
317
318 return $return_array;
319 }
320
321
327 function &getByDate( $date, $group, $showPrivate=false )
328 {
329 $ret = array();
330
331 if ( ( get_class( $date ) == "eZDate" ) && ( get_class( $group ) == "eZUserGroup" ) )
332 {
333 $this->dbInit();
334
335 $return_array = array();
336 $event_array = array();
337
338 $month = $date->month();
339 $month = eZDateTime::addZero( $month );
340
341 $day = $date->day();
342 $day = eZDateTime::addZero( $day );
343
344 $groupID = $group->id();
345 $stamp = $date->year() . $month . $day;
346 $longstamp = $stamp . '235959';
347 //include_once( "classes/INIFile.php" );
348 $ini =& eZINI::instance( 'site.ini' );
349
350 if( $ini->variable( "eZGroupEventCalendarMain", "SubGroupSelect" ) == "enabled" )
351 {
352 $i = 0;
353 $groupTree = $group->getTree( $groupID );
354
355 $selectGroups = "GroupId='$groupID'";
356
357 foreach( $groupTree as $tree )
358 {
359 $i++;
360 $groupID = $tree[0]->id();
361 $selectGroups .= " OR GroupID='$groupID'";
362 }
363
364 $selectGroups = "( $selectGroups )";
365 }
366 else
367 {
368 // Add Support for Events in All Groups
369 $selectGroups = "GroupID='$groupID'";
370 // $selectGroups = "GroupID='$groupID' OR GroupID=0";
371 }
372
373 if ( $showPrivate == false )
374 {
375 $this->Database->array_query( $event_array,
376 "SELECT ID, GroupID, IsRecurring, RecurType, RecurFreq, RepeatTimes, RecurDay, RecurFinishDate, RecurMonthlyType, RecurMonthlyTypeInfo, RecurExceptions, Date FROM eZGroupEventCalendar_Event
377 WHERE ( Date LIKE '$stamp%' AND IsPrivate='0' AND $selectGroups )
378 OR ( IsRecurring='1' AND RecurFinishDate>='$longstamp' AND Date<='$longstamp' AND IsPrivate='0' AND $selectGroups )
379 ORDER BY Date ASC", true );
380 }
381 else
382 {
383 $query = "SELECT ID, GroupID, IsRecurring, RecurType, RecurFreq, RepeatTimes, RecurDay, RecurFinishDate, RecurMonthlyType, RecurMonthlyTypeInfo, RecurExceptions, Date FROM eZGroupEventCalendar_Event
384 WHERE ( Date LIKE '$stamp%' AND $selectGroups )
385 OR ( IsRecurring='1' AND RecurFinishDate>='$longstamp' AND Date<='$longstamp' AND $selectGroups)
386 ORDER BY Date ASC";
387 echo $query;
388 $this->Database->array_query( $event_array,
389 $query );
390 }
391 // print(" SELECT ID FROM eZGroupEventCalendar_Event WHERE ( Date LIKE '$stamp%' AND GroupID='$groupID' ) ORDER BY Date ASC <br />");
392 for ( $i=0; $i<count($event_array); $i++ )
393 {
394 $recurCheck = filterRecurring($event_array[$i], $date);
395 if ($recurCheck)
396 $return_array[] = new eZGroupEvent( $event_array[$i]["ID"], 0 );
397 }
398
399 $ret =& $return_array;
400 }
401 return $ret;
402 }
403
409 function &getByGroupType( $date, $group, $type, $showPrivate=false )
410 {
411 $ret = array();
412
413 if ( ( get_class( $date ) == "eZDate" ) && ( get_class( $group ) == "eZUserGroup" ) && ( get_class( $type ) == "eZGroupEventType" ) )
414 {
415 $this->dbInit();
416
417 $return_array = array();
418 $event_array = array();
419
420 $month = $date->month();
421 $month = eZDateTime::addZero( $month );
422
423 $day = $date->day();
424 $day = eZDateTime::addZero( $day );
425
426 $groupID = $group->id();
427
428 //include_once( "classes/INIFile.php" );
429 $ini =& eZINI::instance( 'site.ini' );
430
431 if( $ini->variable( "eZGroupEventCalendarMain", "SubGroupSelect" ) == "enabled" )
432 {
433 $i = 0;
434 $groupTree = $group->getTree( $groupID );
435
436 $selectGroups = "GroupId='$groupID'";
437
438 foreach( $groupTree as $tree )
439 {
440 $i++;
441 $groupID = $tree[0]->id();
442 $selectGroups .= " OR GroupID='$groupID'";
443 }
444
445 $selectGroups = "( $selectGroups )";
446 }
447 else
448 {
449 // Add Support for Events in All Groups
450 $selectGroups = "GroupID='$groupID'";
451 // $selectGroups = "GroupID='$groupID' OR GroupID=0";
452 }
453
454 $typeID = $type->id();
455
456 $stamp = $date->year() . $month . $day;
457 $longstamp = $stamp . '235959';
458 if ( $showPrivate == false )
459 {
460 $this->Database->array_query( $event_array,
461 "SELECT ID, GroupID, IsRecurring, RecurType, RecurFreq, RepeatTimes, RecurDay, RecurFinishDate, RecurMonthlyType, RecurMonthlyTypeInfo, RecurExceptions, Date FROM eZGroupEventCalendar_Event
462 WHERE Date LIKE '$stamp%' AND IsPrivate='0' AND $selectGroups AND EventTypeID='$typeID'
463 OR ( IsRecurring='1' AND $selectGroups AND EventTypeID='$typeID' AND RecurFinishDate>='$longstamp' AND Date<='$longstamp' AND IsPrivate='0' )
464 ORDER BY Date ASC", true );
465 }
466 else
467 {
468 $query = "SELECT ID, GroupID, IsRecurring, RecurType, RecurFreq, RepeatTimes, RecurDay, RecurFinishDate, RecurMonthlyType, RecurMonthlyTypeInfo, RecurExceptions, Date FROM eZGroupEventCalendar_Event
469 WHERE Date LIKE '$stamp%' AND $selectGroups AND EventTypeID='$typeID'
470 OR ( IsRecurring='1' AND $selectGroups AND EventTypeID='$typeID' AND RecurFinishDate>='$longstamp' AND Date<='$longstamp')
471 ORDER BY Date ASC";
472 echo $query;
473 $this->Database->array_query( $event_array,
474 $query );
475 }
476
477 for ( $i=0; $i<count($event_array); $i++ )
478 {
479 $recurCheck = filterRecurring($event_array[$i], $date);
480 if (!$recurCheck) echo 'filtering out ' . $event->name() . ': '. $event->GroupID() . '<br>';
481 if ($recurCheck) {
482 $return_array[] = new eZGroupEvent( $event_array[$i]["ID"], 0 ); }
483 }
484
485 $ret =& $return_array;
486 }
487 return $ret;
488 }
489
490
496 function &getAllByDate( $date, $showPrivate=false, $groupNoShow=true )
497 {
498 $ret = array();
499
500 if ( ( is_a( $date, "eZDate" ) ) )
501 {
502 $this->dbInit();
503
504 $return_array = array();
505 $event_array = array();
506
507 $month = $date->month();
508 $month = eZDateTime::addZero( $month );
509
510 $day = $date->day();
511 $day = eZDateTime::addZero( $day );
512
513 $stamp = $date->year() . $month . $day;
514 $longstamp = $stamp . '235959';
515 if ( $showPrivate == false )
516 {
517 $this->Database->array_query( $event_array,
518 "SELECT ID, GroupID, IsRecurring, RecurType, RecurFreq, RepeatTimes, RecurDay, RecurFinishDate, RecurMonthlyType, RecurMonthlyTypeInfo, RecurExceptions, Date
519 FROM eZGroupEventCalendar_Event
520 WHERE ( Date LIKE '$stamp%' AND IsPrivate='0' )
521 OR ( IsRecurring='1' AND RecurFinishDate>='$longstamp' AND Date<='$longstamp' AND IsPrivate='0' )
522 ORDER BY Date ASC", true );
523
524 }
525 else
526 {
527 $this->Database->array_query( $event_array,
528 "SELECT ID, GroupID, IsRecurring, RecurType, RecurFreq, RepeatTimes, RecurDay, RecurFinishDate, RecurMonthlyType, RecurMonthlyTypeInfo, RecurExceptions, Date
529 FROM eZGroupEventCalendar_Event
530 WHERE ( Date LIKE '$stamp%')
531 OR ( IsRecurring='1' AND RecurFinishDate>='$longstamp' AND Date<='$longstamp')
532 ORDER BY Date ASC" );
533 }
534
535 // groups not to include
536 if( $groupNoShow == true )
537 {
538 $noShowGroup = new eZGroupNoShow();
539 $noshow_array = $noShowGroup->getAll();
540 }
541 for ( $i=0; $i<=count($event_array); $i++ )
542 {
543 if( !isset($event_array[$i]) )
544 continue;
545
546 // : implementing recurring event sorting
547 $recurCheck = filterRecurring($event_array[$i], $date);
548 if( $groupNoShow == true )
549 {
550 $displayGroup = true;
551
552 foreach( $noshow_array as $noshow )
553 {
554 if( $noshow->GroupID == $event_array[$i]["GroupID"] )
555 $displayGroup = false;
556 }
557 }
558 else
559 {
560 $displayGroup = true;
561 }
562 if( $displayGroup == true && isset($event_array[$i]["ID"]) && $recurCheck)
563 $return_array[] = new eZGroupEvent( $event_array[$i]["ID"], 0 );
564 }
565
566 $ret =& $return_array;
567 }
568 return $ret;
569 }
570
576 function &getAllByType( $date, $type, $showPrivate=false, $groupNoShow=true )
577 {
578 $ret = array();
579 // Advanced debuging
580 // var_dump($date, $type, $showPrivate, $groupNoShow);
581
582 if ( ( is_a( $date, "eZDate" ) ) && ( is_a( $type, "eZGroupEventType" ) ) )
583 {
584 $this->dbInit();
585
586 $return_array = array();
587 $event_array = array();
588
589 $month = $date->month();
590 $month = eZDateTime::addZero( $month );
591
592 $day = $date->day();
593 $day = eZDateTime::addZero( $day );
594
595 $typeID = $type->id();
596
597 $stamp = $date->year() . $month . $day;
598 $longstamp = $stamp . '235959';
599 if ( $showPrivate == false )
600 {
601 $this->Database->array_query( $event_array,
602 "SELECT ID, GroupID, IsRecurring, RecurType, RecurFreq, RepeatTimes, RecurDay, RecurFinishDate, RecurMonthlyType, RecurMonthlyTypeInfo, RecurExceptions, Date FROM eZGroupEventCalendar_Event
603 WHERE Date LIKE '$stamp%' AND IsPrivate='0' AND EventTypeID='$typeID'
604 OR ( IsRecurring='1' AND IsPrivate='0' AND EventTypeID='$typeID' AND RecurFinishDate>='$longstamp' AND Date<='$longstamp' )
605 ORDER BY Date ASC", true );
606 }
607 else
608 {
609 $query = "SELECT ID, GroupID, IsRecurring, RecurType, RecurFreq, RepeatTimes, RecurDay, RecurFinishDate, RecurMonthlyType, RecurMonthlyTypeInfo, RecurExceptions, Date FROM eZGroupEventCalendar_Event
610 WHERE Date LIKE '$stamp%' AND EventTypeID='$typeID'
611 OR ( IsRecurring='1' AND EventTypeID='$typeID' AND RecurFinishDate>='$longstamp' AND Date<='$longstamp')
612 ORDER BY Date ASC";
613 // echo $query; die();
614 $this->Database->array_query( $event_array, $query );
615 }
616
617 // groups not to include
618 if( $groupNoShow == true )
619 {
620 $noShowGroup = new eZGroupNoShow();
621 $noshow_array = $noShowGroup->getAll();
622 }
623
624 for ( $i=0; $i<count($event_array); $i++ )
625 {
626 if( $groupNoShow == true )
627 {
628 $displayGroup = true;
629
630 foreach( $noshow_array as $noshow )
631 {
632 if( $noshow->GroupID == $event_array[$i]["GroupID"] )
633 $displayGroup = false;
634 }
635 }
636 else
637 {
638 $displayGroup = true;
639 }
640 $recurCheck = filterRecurring($event_array[$i], $date);
641 if( $displayGroup == true && $recurCheck)
642 $return_array[] = new eZGroupEvent( $event_array[$i]["ID"], 0 );
643 }
644
645 $ret =& $return_array;
646 }
647 return $ret;
648 }
649
650
656 function &getByType( $type, $showPrivate=false )
657 {
658 $ret = array();
659 if ( ( is_a( $type, "eZGroupEventType" ) ) )
660 {
661 $this->dbInit();
662
663 $return_array = array();
664 $event_array = array();
665
666 $typeID = $type->id();
667
668 if ( $showPrivate == false )
669 {
670 $this->Database->array_query( $event_array,
671 "SELECT ID FROM eZGroupEventCalendar_Event
672 WHERE IsPrivate='0' AND EventTypeID='$typeID'
673 ORDER BY Date ASC", true );
674 }
675 else
676 {
677 $this->Database->array_query( $event_array,
678 "SELECT ID FROM eZGroupEventCalendar_Event
679 WHERE EventTypeID='$typeID' ORDER BY Date ASC" );
680 }
681
682 for ( $i=0; $i<count($event_array); $i++ )
683 {
684 $return_array[] = new eZGroupEvent( $event_array[$i]["ID"], 0 );
685 }
686
687 $ret =& $return_array;
688 }
689 return $ret;
690 }
691
692
698 function &getByGroup( $group, $showPrivate=false )
699 {
700 $ret = array();
701
702 if ( ( is_a( $group, "eZUserGroup" ) ) )
703 {
704 $this->dbInit();
705
706 $return_array = array();
707 $event_array = array();
708
709 $groupID = $group->id();
710
711 if ( $showPrivate == false )
712 {
713 $this->Database->array_query( $event_array,
714 "SELECT ID FROM eZGroupEventCalendar_Event
715 WHERE IsPrivate='0' AND GroupID='$groupID' ORDER BY Date ASC", true );
716 }
717 else
718 {
719 $this->Database->array_query( $event_array,
720 "SELECT ID FROM eZGroupEventCalendar_Event
721 WHERE GroupID='$groupID' ORDER BY Date ASC" );
722 }
723
724 for ( $i=0; $i<count($event_array); $i++ )
725 {
726 $return_array[] = new eZGroupEvent( $event_array[$i]["ID"], 0 );
727 }
728
729 $ret =& $return_array;
730 }
731 return $ret;
732 }
733
734
738 function id()
739 {
740 return $this->ID;
741 }
742
743
747 function name( $htmlchars=true )
748 {
749 if ( $this->State_ == "Dirty" )
750 $this->get( $this->ID );
751
752 if ( $htmlchars == true )
753 {
754 return htmlspecialchars( $this->Name );
755 }
756 else
757 {
758 return $this->Name;
759 }
760 }
761
765 function description( $htmlchars=true )
766 {
767 if ( $this->State_ == "Dirty" )
768 $this->get( $this->ID );
769
770 if ( $htmlchars == true )
771 {
772 return htmlspecialchars( $this->Description );
773 }
774 else
775 {
776 return $this->Description;
777 }
778 }
779
780
784 function location( $htmlchars=true )
785 {
786 if ( $this->State_ == "Dirty" )
787 $this->get( $this->ID );
788
789 if ( $htmlchars == true )
790 {
791 return htmlspecialchars( $this->Location );
792 }
793 else
794 {
795 return $this->Location;
796 }
797 }
798
802 function url( $htmlchars=true )
803 {
804 if ( $this->State_ == "Dirty" )
805 $this->get( $this->ID );
806
807 if ( $htmlchars == true )
808 {
809 return htmlspecialchars( $this->Url );
810 }
811 else
812 {
813 return $this->Url;
814 }
815 }
816
817
821 function dateTime()
822 {
823 if ( $this->State_ == "Dirty" )
824 $this->get( $this->ID );
825
826 $date = new eZDateTime();
827 $date->setMySQLTimeStamp( $this->Date );
828
829 return $date;
830 }
831
835 function &getDate()
836 {
837 if ( $this->State_ == "Dirty" )
838 $this->get( $this->ID );
839
840 $date = $this->Date;
841
842 return $date;
843 }
844
848 function duration()
849 {
850 if ( $this->State_ == "Dirty" )
851 $this->get( $this->ID );
852
853 $time = new eZTime();
854 $time->setMySQLTime( $this->Duration );
855
856 return $time;
857 }
858
862 function &startTime()
863 {
864 if ( $this->State_ == "Dirty" )
865 $this->get( $this->ID );
866
867 $date = new eZDateTime();
868 $date->setMySQLDateTime( date("Y-m-d H:i:s", $this->Date ) );
869
870 $time = new eZTime();
871 $time->setHour( $date->hour() );
872 $time->setMinute( $date->minute() );
873 $time->setSecond( $date->second() );
874
875 return $time;
876 }
877
881 function &stopTime()
882 {
883 if ( $this->State_ == "Dirty" )
884 $this->get( $this->ID );
885
886 $date = new eZDateTime();
887 $time = new eZTime();
888
889 $date->setMySQLDateTime( date("Y-m-d H:i:s", $this->Date ) );
890
891 $time->setHour( $this->duration()->secondsElapsed() / 3600 );
892 $time->setMinute( $date->minute() );
893 $time->setSecond( $this->duration()->secondsElapsed() );
894
895 return $time;
896 }
897
901 function priority()
902 {
903 if ( $this->State_ == "Dirty" )
904 $this->get( $this->ID );
905
906 return $this->Priority;
907 }
908
912 function status()
913 {
914 if ( $this->State_ == "Dirty" )
915 $this->get( $this->ID );
916
917 return $this->Status;
918 }
919
923 function type( )
924 {
925 if ( $this->State_ == "Dirty" )
926 $this->get( $this->ID );
927
928 $type = new eZGroupEventType( $this->EventTypeID );
929 return $type;
930 }
931
935 function category( )
936 {
937 if ( $this->State_ == "Dirty" )
938 $this->get( $this->ID );
939
940 $category = new eZGroupEventCategory( $this->EventCategoryID );
941 return $category;
942 }
943
947 function &isPrivate()
948 {
949 if ( $this->State_ == "Dirty" )
950 $this->get( $this->ID );
951
952 if ( $this->IsPrivate == 0 )
953 $ret = false;
954 else
955 $ret = true;
956
957 return $ret;
958 }
959
963 function &isEventAlarmNotice()
964 {
965 if ( $this->State_ == "Dirty" )
966 $this->get( $this->ID );
967
968 if ( $this->EventAlarmNotice == 0 )
969 $ret = false;
970 else
971 $ret = true;
972
973 return $ret;
974 }
975
979 function setName( $value )
980 {
981 if ( $this->State_ == "Dirty" )
982 $this->get( $this->ID );
983
984 $this->Name = $value;
985 }
986
990 function setDescription( $value )
991 {
992 if ( $this->State_ == "Dirty" )
993 $this->get( $this->ID );
994
995 $this->Description = $value;
996 }
997
1001 function setLocation( $value )
1002 {
1003 if ( $this->State_ == "Dirty" )
1004 $this->get( $this->ID );
1005
1006 $this->Location = $value;
1007 }
1008
1012 function setUrl( $value )
1013 {
1014 if ( $this->State_ == "Dirty" )
1015 $this->get( $this->ID );
1016
1017 $this->Url = $value;
1018 }
1019
1020
1024 function setPriority( $value )
1025 {
1026 if ( $this->State_ == "Dirty" )
1027 $this->get( $this->ID );
1028
1029 $this->Priority = $value;
1030 }
1031
1035 function setStatus( $value )
1036 {
1037 if ( $this->State_ == "Dirty" )
1038 $this->get( $this->ID );
1039
1040 $this->Status = $value;
1041 }
1042
1047 function setDateTime( $dateTime )
1048 {
1049 if ( $this->State_ == "Dirty" )
1050 $this->get( $this->ID );
1051
1052 if ( is_a( $dateTime, "eZDateTime" ) )
1053 {
1054 $this->Date = $dateTime->mysqlTimeStamp();
1055 }
1056 }
1057
1061 function setType( $type )
1062 {
1063 if ( $this->State_ == "Dirty" )
1064 $this->get( $this->ID );
1065
1066 if ( get_class( $type ) == "eZGroupEventType" )
1067 {
1068 $this->EventTypeID = $type->id();
1069 }
1070 }
1071
1075 function setCategory( $category )
1076 {
1077 if ( $this->State_ == "Dirty" )
1078 $this->get( $this->ID );
1079
1080 if ( get_class( $category ) == "eZGroupEventCategory" )
1081 {
1082 $this->EventCategoryID = $category->id();
1083 }
1084 }
1085
1089 function setGroup( $group )
1090 {
1091 if ( $this->State_ == "Dirty" )
1092 $this->get( $this->ID );
1093
1094 if ( get_class( $group ) == "eZUserGroup" )
1095 {
1096 $this->GroupID = $group->id();
1097 }
1098 }
1099
1103 function groupID()
1104 {
1105 return $this->GroupID;
1106 }
1107
1111 function setIsPrivate( $value )
1112 {
1113 if ( $this->State_ == "Dirty" )
1114 $this->get( $this->ID );
1115
1116 if ( $value == true )
1117 {
1118 $this->IsPrivate = 1;
1119 }
1120 else
1121 {
1122 $this->IsPrivate = 0;
1123 }
1124 }
1125
1126
1127
1131 function setEventAlarmNotice( $value )
1132 {
1133 if ( $this->State_ == "Dirty" )
1134 $this->get( $this->ID );
1135
1136 if ( $value == true )
1137 {
1138 $this->EventAlarmNotice = 1;
1139 }
1140 else
1141 {
1142 $this->EventAlarmNotice = 0;
1143 }
1144 }
1145
1149 function setDuration( $time )
1150 {
1151 if ( $this->State_ == "Dirty" )
1152 $this->get( $this->ID );
1153
1154 if ( is_a( $time, "eZTime" ) )
1155 {
1156 $this->Duration = $time->mysqlTime();
1157 }
1158 }
1159
1164 function dbInit()
1165 {
1166 if ( $this->IsConnected == false )
1167 {
1168 $this->Database = eZDB::globalDatabase();
1169 $this->IsConnected = true;
1170 }
1171 }
1172
1177 function notification( $debug = false )
1178 {
1179
1180 /*
1181 if ( $this->IsConnected == false )
1182 {
1183 $this->Database = eZDB::globalDatabase();
1184 $this->IsConnected = true;
1185 }
1186 */
1187
1188 $ret = false;
1189 // include_once( "classes/INIFile.php" );
1190 $ini =& eZINI::instance( 'site.ini' );
1191 // site variables
1192 $siteName = $ini->variable( "site", "SiteURL" );
1193 $siteAdministrator = $ini->variable( "eZUserMain", "ReminderMailFromAddress" );
1194
1195 $db =& eZDB::globalDatabase();
1196 $event_array = new eZGroupEvent();
1197
1198 $eventIteration = 0;
1199 $eventName = $this->name();
1200
1201 if ( $debug )
1202 print("\n## Begin Event: $eventName ##############################\n\n");
1203
1204
1205 $current_date = new eZDate();
1206 $current_date_stamp = $current_date->timeStamp();
1207 $current_date_human = laddZero($current_date->month()) ." / ". laddZero($current_date->day()) ." / ". laddZero($current_date->year());
1208
1209 if ( $debug )
1210 print( "current date: ". $current_date_human ."\n" );
1211
1212
1213 $future_date = new eZDate();
1214 $future_date->move(0,0,-7);
1215 $future_date_stamp = $future_date->timeStamp();
1216 $future_date_human = laddZero($future_date->month()) ." / ". laddZero($future_date->day()) ." / ". laddZero($future_date->year());
1217 // print( "future date: ". $future_date_human ."\n");
1218
1219 /*
1220 $event_date = new eZDateTime();
1221 $event_date->setMySQLTimeStamp( $this->Date ); echo("\n\n");
1222 $event_date_human = $event_date->month() ." / ". $event_date->day() ." / ". $event_date->year();
1223 */
1224
1225 /*
1226 $zDate = new eZDateTime();
1227 $zDate->setMySQLTimeStamp( $this->Date );
1228 */
1229
1230 $zDate = $this->dateTime();
1231 $event_date = $zDate;
1232 $event_date_human = laddZero($zDate->month()) ." / ". laddZero($zDate->day()) ." / ". laddZero($zDate->year());
1233
1234 if ( $debug )
1235 print( "event date: ". $event_date_human ."\n");
1236
1237 /*
1238 $event_date = new eZDate();
1239 $event_date_time = $event_date->setMySQLDate($event_date_time);
1240
1241 $zDate = new eZDateTime();
1242 $zDate->setMySQLTimeStamp( $this->Date );
1243 $event_date_human = $zDate->month() ." / ". $zDate->day() ." / ". $zDate->year();
1244
1245 */
1246
1247
1248 $event_date_time = $this->startTime();
1249 $event_date_time_human = laddZero($event_date_time->hour()) .":". laddZero($event_date_time->minute()) .":". laddZero($event_date_time->second());
1250
1251 if ( $debug )
1252 print("event Date: $event_date_human\nevent Time: $event_date_time_human \n\n");
1253
1254 if ( $debug )
1255 print("Iteration: ". $eventIteration ."\n\n");
1256
1257 // $date_gt = $current_date->isGreater($future_date);
1258 // $date_gt = $event_date_time->isGreater($current_date);
1259 // $date_gt = $current_date->isGreater($event_date_time);
1260 $date_gt = $current_date->equals($event_date);
1261
1262 /*
1263 $date_gt = count(event_array);
1264 print($date_gt."\n");
1265 */
1266 // if ($future_date_stamp < $current_date_stamp ) {
1267 // if ( $current_date->isGreater($event_date_time) ) {
1268
1269 //equals
1270 // if ( $date_gt ) {
1271 // print("Current Date Matches Event Date \n\n");
1272
1273 // if the event date is greater than current date
1274 // if it is greater (meaning active event), match event_date with current date,
1275 // if they match then the message should be sent.
1276
1277 $eventGroupID = $this->GroupID;
1278
1279 // get users by group
1280 if ( $eventGroupID != 0 ) {
1281 $eventGroup = new eZUserGroup($eventGroupID);
1282 $eventGroupID = $eventGroup->id();
1283
1284 // get all users per group
1285 $eventGroupUserList = $eventGroup->users($eventGroupID);
1286
1287 if ( $debug )
1288 print("group (static) : $this->GroupID --> $eventGroupID\n");
1289
1290
1291 foreach( $eventGroupUserList as $user ) {
1292 $userNotificationPreference = $user->infoSubscription();
1293 if ($userNotificationPreference){
1294 $userEmail = $user->email();
1295 $userName = $user->name();
1296 // build email
1297 $mailBody = "Greetings $userName,\n\nThe $siteName Calendar event $eventName is occuring today at: ". $event_date_human ." ". $event_date_time_human ."\n\n". "You have opted to recive this email notification via your user account settings. This email notication is provided by the $siteName's Calendar System and is not spam.";
1298 $mailSubject = $siteName ." : Calendar : Event Notification ";
1299
1300 $mail = new eZMail();
1301 $mail->to($userEmail);
1302 $mail->from($siteAdministrator);
1303 $mail->subject($mailSubject3);
1304 $mail->body($mailBody);
1305
1306 // send mail
1307 if (!$debug )
1308 $mail->send();
1309
1310 if ( $debug )
1311 print("$userEmail\n$mailSubject\n\n$mailBody");
1312 //print("Virtual Email: Sent To: $userEmail \n\n####################################### \n");
1313 }
1314 }
1315 }else {
1316 $eventGroup = new eZUserGroup();
1317 $eventGroupList = $eventGroup->getAll();
1318
1319
1320 foreach ($eventGroupList as $group) {
1321 $cGroupID = $group->id();
1322 $eventGroupUserList = $group->users($cGroupID);
1323
1324 if ( $debug )
1325 print("group (all): $cGroupID --> $eventGroupID \n");
1326
1327 // foreach user print notice
1328 foreach( $eventGroupUserList as $user ) {
1329 $userID = $user->ID();
1330 $userList[] = $userID;
1331 }
1332
1333 }
1334
1335
1336 // ensure that per group loop we only mail to
1337 $uniqueUserList = array_unique( $userList );
1338
1339 foreach( $uniqueUserList as $user_id ) {
1340 $userObj = new eZUser($user_id);
1341 $userObjectList[] = $userObj;
1342 }
1343
1344
1345
1346 // foreach user print notice
1347 // foreach( $eventGroupUserList as $user ) {
1348 foreach( $userObjectList as $user ) {
1349 $userNotificationPreference = $user->infoSubscription();
1350 if ($userNotificationPreference){
1351 $userEmail = $user->email();
1352 $userName = $user->name();
1353
1354 // build mail
1355 $mailBody = "Greetings $userName,\n\nThe $siteName Calendar event \"$eventName\" is occuring today at ". $event_date_human ." ". $event_date_time_human ."\n\n". "You have opted to recive this email notification via your user account settings.\nThis email notication is provided by the $siteName's Calendar System and is not spam.";
1356 $mailSubject = $siteName ." : Calendar : Event Notification : $eventName";
1357
1358 $mail = new eZMail();
1359 $mail->to($userEmail);
1360 $mail->from($siteAdministrator);
1361 $mail->subject($mailSubject3);
1362 $mail->body($mailBody);
1363
1364 // send mail
1365 if (!$debug )
1366 $mail->send();
1367
1368 if ( $debug )
1369 print("$siteAdministrator\n\n$userEmail\n$mailSubject\n\n$mailBody");
1370 //print("\nVirtual Email: Sent To: $userEmail \n############################## \n");
1371 }
1372 }
1373 }
1374
1375
1376 if ( $debug )
1377 print("\n## End $eventName ############################################ \n");
1378 $eventIteration++;
1379
1380 /*
1381 } else {
1382 print("Current Date Does Not Match Event Date \n\n");
1383 }
1384 */
1385
1386 $eventResponceDateMysql = $future_date_stamp;
1387
1388
1389 // if (x )
1390 // consider: $ret = true;
1391
1392
1393 // $eventResponceDateMysql = "bob";
1394
1395 // $date = new eZDate( 2000, 9, 2 );
1396 // $eventResponceDeadline = $event->responceDueDate(true);
1397
1398 // responce due date & printable
1399 // $eventResponceDeadline = $event->responceDueDate();
1400 //
1401
1402 // $eventResponceDeadlineStamp = $eventResponceDeadline->timeStamp();
1403
1404 // $eventResponceDateMysql = $db->escapeString( $current_date_stamp );
1405 // $eventResponceDateCheck = $db->escapeString( $eventResponseDueDate );
1406
1407 // the rest of the script is bogus!
1408
1409 return $ret;
1410 }
1411
1415 function files( $as_object = true )
1416 {
1417 $db =& eZDB::globalDatabase();
1418
1419 $return_array = array();
1420 $file_array = array();
1421
1422 $db->array_query( $file_array, "SELECT FileID, Created FROM eZGroupEventCalendar_EventFileLink WHERE EventID='$this->ID' ORDER BY Created" );
1423
1424 for ( $i=0; $i < count($file_array); $i++ )
1425 {
1426 $id = $file_array[$i][$db->fieldName("FileID")];
1427 $return_array[$i] = $as_object ? new eZVirtualFile( $id, false ) : $id;
1428 }
1429
1430 return $return_array;
1431 }
1432
1439 function deleteFile( $value )
1440 {
1441 if ( get_class( $value ) == "eZVirtualFile" )
1442 {
1443 $fileID = $value->id();
1444
1445 }
1446 else
1447 $fileID = $value;
1448
1449 $db =& eZDB::globalDatabase();
1450 $db->query( "DELETE FROM eZGroupEventCalendar_EventFileLink WHERE EventID='$this->ID' AND FileID='$fileID'" );
1451 }
1452
1453
1454
1459 function addFile( $value )
1460 {
1461 if ( get_class( $value ) == "eZVirtualFile" )
1462 {
1463 $fileID = $value->id();
1464 }
1465 else
1466 $fileID = $value;
1467
1468 $db =& eZDB::globalDatabase();
1469
1470 $db->begin( );
1471
1472 $db->lock( "eZGroupEventCalendar_EventFileLink" );
1473
1474 $nextID = $db->nextID( "eZGroupEventCalendar_EventFileLink", "ID" );
1475
1476 $timeStamp = ( (new eZDateTime)->timestamp( true ) );
1477
1478 //print("INSERT INTO eZGroupEventCalendar_EventFileLink
1479
1480 $res = $db->query( "INSERT INTO eZGroupEventCalendar_EventFileLink
1481 ( ID, EventID, FileID, Created ) VALUES ( '$nextID', '$this->ID', '$fileID', '$timeStamp' )" );
1482
1483 $db->unlock();
1484
1485 if ( $res == false )
1486 $db->rollback( );
1487 else
1488 $db->commit();
1489 }
1490
1491
1495 function forum( $as_object = true )
1496 {
1497 $db =& eZDB::globalDatabase();
1498 $db->array_query( $res, "SELECT ForumID FROM
1499 eZGroupEventCalendar_EventForumLink
1500 WHERE EventID='$this->ID'" );
1501 $forum = false;
1502 if ( count( $res ) == 1 )
1503 {
1504 if ( $as_object )
1505 $forum = new eZForum( $res[0][$db->fieldName( "ForumID" )] );
1506 else
1507 $forum = $res[0][$db->fieldName( "ForumID" )];
1508 }
1509 else
1510 {
1511 $forum = new eZForum();
1512 $forum->setName( $db->escapeString( $this->Name ) );
1513
1514 // NOTE: Comment out the below line if you want to disable anonymous (not logged in) comments!!!
1515 $forum->setIsAnonymous(true);
1516
1517 // NOTE: Comment out the below line if you want moderated comments!!!
1518 $forum->setIsModerated(false);
1519
1520 // NOTE: Uncomment the below lines if you want moderated comments!!!
1521 //$forum->setIsModerated(true);
1522 // $moderatorgroup = new eZUserGroup( 1 ); //should be a variable - administrator groupid
1523 // $forum->setModerator( $moderatorgroup );
1524
1525 $forum->store();
1526 $ini =& eZINI::instance( 'site.ini' );
1527 $linkModules = $ini->variable( "eZGroupEventCalendarMain", "LinkModules" );
1528 $module_array = explode(',', $linkModules );
1529 unset ($linkModules);
1530 foreach ( $module_array as $module)
1531 {
1532 $moduleSubArray = explode( ':', $module );
1533 list($module_name, $forum_id) = $moduleSubArray;
1534 $linkModules[$module_name] = $forum_id;
1535 }
1536 $category = new eZForumCategory( $linkModules['eZGroupEventCalendar'] );
1537 $category->addForum( $forum );
1538 $forumID = $forum->id();
1539 $db->begin( );
1540 $db->lock( "eZGroupEventCalendar_EventForumLink" );
1541 $nextID = $db->nextID( "eZGroupEventCalendar_EventForumLink", "ID" );
1542 $res = $db->query( "INSERT INTO eZGroupEventCalendar_EventForumLink
1543 ( ID, EventID, ForumID )
1544 VALUES
1545 ( '$nextID', '$this->ID', '$forumID' )" );
1546 $db->unlock();
1547 if ( $res == false )
1548 $db->rollback( );
1549 else
1550 $db->commit();
1551 if ( $as_object )
1552 $forum = new eZForum( $forumID );
1553 else
1554 $forum = $forumID;
1555 }
1556 return $forum;
1557 }
1558
1562 function eventIDFromForum( $ForumID )
1563 {
1564 $db =& eZDB::globalDatabase();
1565 $EventID = 0;
1566 $db->array_query( $result, "SELECT EventID FROM
1567 eZGroupEventCalendar_EventForumLink
1568 WHERE ForumID='$ForumID' GROUP BY EventID" );
1569 if( count( $result ) > 0 )
1570 {
1571 $EventID = $result[0][$db->fieldName("EventID")];
1572 }
1573 return $EventID;
1574 }
1575 // methods for processing recurring information
1579 function &isRecurring()
1580 {
1581 if ( $this->State_ == "Dirty" )
1582 $this->get( $this->ID );
1583
1584 if ( $this->IsRecurring == 0 )
1585 $ret = false;
1586 else
1587 $ret = true;
1588
1589 return $ret;
1590 }
1594 function &recurType()
1595 {
1596 if ( $this->State_ == "Dirty" )
1597 $this->get( $this->ID );
1598 $ret = $this->RecurType;
1599
1600 return $ret;
1601 }
1605 function &recurFreq()
1606 {
1607 if ( $this->State_ == "Dirty" )
1608 $this->get( $this->ID );
1609 $ret = $this->RecurFreq;
1610
1611 return $ret;
1612 }
1616 function &recurDay()
1617 {
1618 if ( $this->State_ == "Dirty" )
1619 $this->get( $this->ID );
1620 $ret = explode (":", $this->RecurDay);
1621
1622 return $ret;
1623 }
1627 function &recurMonthlyType()
1628 {
1629 if ( $this->State_ == "Dirty" )
1630 $this->get( $this->ID );
1631 $ret = $this->RecurMonthlyType;
1632
1633 return $ret;
1634 }
1638 function RecurMonthlyTypeInfo()
1639 {
1640 if ( $this->State_ == "Dirty" )
1641 $this->get( $this->ID );
1642 $ret = $this->RecurMonthlyTypeInfo;
1643
1644 return $ret;
1645 }
1649 function &repeatUntilDate()
1650 {
1651 if ( $this->State_ == "Dirty" )
1652 $this->get( $this->ID );
1653
1654 if ($this->RepeatUntilDate != '00000000000000')
1655 {
1656 $year = substr($this->RepeatUntilDate, 0, 4);
1657 $month = substr($this->RepeatUntilDate, 4, 2);
1658 $day = substr($this->RepeatUntilDate, 6, 2);
1659
1660 $ret = "$year-$month-$day";
1661 }
1662 else
1663 $ret = false;
1664
1665 return $ret;
1666 }
1667
1671 function &repeatTimes()
1672 {
1673 if ( $this->State_ == "Dirty" )
1674 $this->get( $this->ID );
1675
1676 if ($this->RepeatTimes)
1677 $ret = $this->RepeatTimes;
1678 else
1679 $ret = 0;
1680
1681 return $ret;
1682 }
1686 function &recurExceptions()
1687 {
1688 if ( $this->State_ == "Dirty" )
1689 $this->get( $this->ID );
1690
1691 $ret = explode(":", $this->RecurExceptions);
1692
1693 return $ret;
1694 }
1695
1699 function &repeatForever()
1700 {
1701 if ( $this->State_ == "Dirty" )
1702 $this->get( $this->ID );
1703
1704 $ret = $this->RepeatForever;
1705
1706 return $ret;
1707 }
1708
1712 function setIsRecurring( $IsRecurring )
1713 {
1714 if ( $this->State_ == "Dirty" )
1715 $this->get( $this->ID );
1716 // check if the checkbox was turned "on"
1717 if ($IsRecurring == 'on')
1718 $this->IsRecurring = 1;
1719 else
1720 $this->IsRecurring = 0;
1721 }
1722
1726 function setRecurFreq( $RecurFreq )
1727 {
1728 if ( $this->State_ == "Dirty" )
1729 $this->get( $this->ID );
1730 // straight property set
1731 $this->RecurFreq = $RecurFreq;
1732 }
1733
1737 function setRecurType( $RecurType )
1738 {
1739 if ( $this->State_ == "Dirty" )
1740 $this->get( $this->ID );
1741 // straight property set
1742 $this->RecurType = $RecurType;
1743 }
1747 function setRecurMonthlyType( $RecurMonthlyType = '', $date = false )
1748 {
1749 if ( $this->State_ == "Dirty" )
1750 $this->get( $this->ID );
1751 // strdaynum will currently always be the last of the month, because there is no other option.
1752 if ($RecurMonthlyType == 'strdayname') {
1753 // this should always be taken care of by
1754 $this->RecurMonthlyTypeInfo = 'last';
1755 }
1756 elseif ($RecurMonthlyType == 'numdayname') {
1757 // figure out what week we're in (this should be made a function of eZDate)
1758 if ($date->day() < 8) $week = 'first';
1759 elseif ($date->day() < 15) $week = 'second';
1760 elseif ($date->day() < 22) $week = 'third';
1761 elseif ($date->day() < 29) $week = 'fourth';
1762 // we should never get to this point because of the javascript validation
1763 // but if we do, we are going to turn it into 'last' rather than break stuff or throw errors.
1764 else
1765 $week = 'last';
1766
1767 $this->RecurMonthlyTypeInfo = $week;
1768 }
1769
1770 $this->RecurMonthlyType = $RecurMonthlyType;
1771 }
1772
1773
1777 function setRecurDay( $RecurDay = false )
1778 {
1779 if ( $this->State_ == "Dirty" )
1780 $this->get( $this->ID );
1781 // check to see if we aren't using a recur day
1782 if (!$RecurDay) {
1783 // if it isn't, set $RecurString to blank
1784 $RecurString = '';
1785 } else {
1786 foreach ($RecurDay as $day) {
1787 // build the RecurDay string (will look something like mon:thu:fri:sun)
1788 // if we haven't started building it yet, don't prefix it with a colon
1789 if (!isset($RecurString))
1790 $RecurString = $day;
1791 else
1792 // if we have started building it, do prefix it with a colon
1793 $RecurString .= ":$day";
1794 }
1795 }
1796 $this->RecurDay = $RecurString;
1797 }
1801 function setFinishDateForever( $stamp = '20371230235959' )
1802 {
1803 if ( $this->State_ == "Dirty" )
1804 $this->get( $this->ID );
1805 // straight property set
1806 $this->RepeatForever = true;
1807 $this->RecurFinishDate = $stamp;
1808 }
1813 function setFinishDateNot( $not, $freq, $type, $datetime )
1814 {
1815 if ( $this->State_ == "Dirty" )
1816 $this->get( $this->ID );
1817 // this is a somewhat complex calc (for those of us
1818 // who didn't graduate algebra or prefer the mayan calendar).
1819 // first we must turn the ezdatetime object into a ezdate object
1820 // because we need the move method
1821
1822 if ( is_a( $datetime, "eZDateTime" )) {
1823 // BUG in eZDate2.2 -> For some reason the day is not preserved when calling &date.
1824 // we have to set it manually
1825 // the below line should be the corrent one.
1826 // $date =& $date->date();
1827 // instead we do this stuff
1828 $hackYear =& $datetime->year();
1829 $hackMonth =& $datetime->month();
1830 $hackDay =& $datetime->day();
1831 $date = new eZDate($hackYear, $hackMonth, $hackDay);
1832 } //end hack
1833 // second we switch out the type and do 4 different calculations
1834 switch($type) {
1835 case 'day': // the easy one #uno
1836 // this moves the date 0 years, 0 months, and the correct amount of days
1837 // (recurrance frequency * the number of times to repeat) forward
1838 if ($freq == 1)
1839 $date->move(0,0, $not);
1840 else
1841 $date->move(0, 0, (($freq * $not)-1));
1842 // format this for mysql
1843 $datet = new eZDateTime($date->year(), $date->month(), $date->day(), $datetime->hour(), $datetime->minute(), $datetime->second());
1844 $stamp = $datet->mysqlTimeStamp();
1845 break;
1846 case 'week': // the hard one #uno
1847 /* I better note the functionality of this.
1848 this will find the proper week, then
1849 find the last day in that week
1850 that the user has selected for the recurring
1851 event. So if the user selected monday,
1852 tuesday, and friday the block will end on friday.
1853 */
1854 $date->move( 0, 0, ( $freq * 7 * $not ) );
1855 $lastDay = substr($this->RecurDay, -3);
1856 // now we use the similar logic to the month code
1857 if (strtolower($date->dayName(true)) != $lastDay)
1858 {
1859 // this loop will move ahead a max 6 days to find the last day
1860 for ($i=1; $i<7; $i++)
1861 {
1862 if (strtolower($date->dayName(true)) == $lastDay)
1863 {
1864 $i=7; //break outta the loop
1865 } // end second last day check
1866 } //end for loop
1867 } // end first last day check
1868 $datet = new eZDateTime($date->year(), $date->month(), $date->day(), $datetime->hour(), $datetime->minute(), $datetime->second());
1869 $stamp = $datet->mysqlTimeStamp();
1870 break;
1871 case 'month': // the hard one #dos
1872 // if the type is daily it's easy
1873 if ('daily' == $this->RecurMonthlyType)
1874 {
1875 $date->move( 0, ($freq * $not), 0 );
1876 $datet = new eZDateTime($date->year(), $date->month(), $date->day(), $datetime->hour(), $datetime->minute(), $datetime->second());
1877 $stamp = $datet->mysqlTimeStamp();
1878 } else {
1879 /*
1880 now, this is a weird calc because eZDate just isn't built to handle
1881 stuff like this. So it seems to me the easiest way to do it is to
1882 kick the month forward until we are at the last month, and then
1883 move the day to the correct dayName in the week. But eZDate can
1884 only do the first part. Shucks.
1885 */
1886 // record the date name for later use...
1887 $oldDayName = $date->dayName(true);
1888 $date->move( 0, ($freq * $not) ,0 );
1889 // now we are in the last month
1890 // we check to see if the dayName is already the same...
1891 if ( $date->dayName(true) != $oldDayName )
1892 {
1893 // it's not the same so we are going to build an associative
1894 // array that we will use to build a loop based
1895 // on the week we are in. Then while in that loop
1896 // we will find the day that matches.
1897 $dateNums = array('firsts'=>1,
1898 'firste'=>7,
1899 'seconds'=>8,
1900 'seconde'=>14,
1901 'thirds'=>15,
1902 'thirde'=>21,
1903 'fourths'=>22,
1904 'fourthe'=>28,
1905 'lasts'=>($date->daysInMonth() - 6), // this is the start of the last week in the month
1906 'laste'=>$date->daysInMonth());
1907 // this looks pretty funky, but it should be faster and cleaner than looping through each type
1908 $startDay = $this->RecurMonthlyTypeInfo.'s';
1909 $endDay = $this->RecurMonthlyTypeInfo.'e';
1910 // die ($i=$dateNums[$startDay] .' and ' . $dateNums[$endDay] . ' and oldDayName is ' . $oldDayName);
1911 for ($i=$dateNums[$startDay]; $i<$dateNums[$endDay];$i++) {
1912 $date->setDay($i);
1913 if ($date->dayName(true) == $oldDayName) {
1914 $i = 32; // this will finish the loop, cuz we are on the day we want.
1915 }
1916 }
1917 }
1918 $datet = new eZDateTime($date->year(), $date->month(), $date->day(), $datetime->hour(), $datetime->minute(), $datetime->second());
1919 $stamp = $datet->mysqlTimeStamp();
1920 } //this ends the switch($type)
1921 break;
1922 case 'year': // the easy one #dos
1923 $date->move(($freq * $not), 0, 0);
1924 // format this for mysql
1925 $datet = new eZDateTime($date->year(), $date->month(), $date->day(), $datetime->hour(), $datetime->minute(), $datetime->second());
1926 $stamp = $datet->mysqlTimeStamp();
1927 break;
1928 }
1929 $this->RepeatTimes = $not;
1930 $this->RecurFinishDate = $stamp;
1931 }
1935 function noDisplay()
1936 {
1937 if (!isset($this->noDisplay)) return false;
1938 else return $this->noDisplay;
1939 }
1943 function setNoDisplay($bool)
1944 {
1945 if ( $this->State_ == "Dirty" )
1946 $this->get( $this->ID );
1947 $this->noDisplay = $bool;
1948 }
1952 function setFinishDateUntil( $UntilDate )
1953 {
1954 if ( $this->State_ == "Dirty" )
1955 $this->get( $this->ID );
1956 // prepare the until date to be turned into
1957 // a timestamp
1958 $stamp = str_replace('-', '', $UntilDate);
1959 $stamp .= '235959';
1960 $this->RepeatUntilDate = $stamp; //not necessary?
1961 $this->RecurFinishDate = $stamp;
1962 }
1963
1967 function setRecurExceptions( $ex )
1968 {
1969 if ( $this->State_ == "Dirty" )
1970 $this->get( $this->ID );
1971 // check to see if there are any exceptions
1972 if (is_array($ex)) {
1973 // loop through the exceptions and turn them into a string
1974 foreach ($ex as $x) {
1975 if ($x != '')
1976 if (!isset($exStr)) // if the string hasn't been started, don't include a colon
1977 $exStr = $x;
1978 else // if it has then do
1979 $exStr .= ":$x";
1980 }
1981 } else { $exStr = ''; }
1982 $this->RecurExceptions = $exStr;
1983 }
1984
1985 var $ID;
1986 var $Name;
1987 var $Description;
1988
1989 var $URL;
1990 var $Location;
1991 var $EventCategoryID;
1992
1993 var $GroupID;
1994 var $Date;
1995 var $Duration;
1996 var $EventTypeID;
1997 var $EMailNotice;
1998
1999 var $EventAlarmNotice;
2000
2002 var $IsPrivate;
2003
2005 var $IsRecurring;
2006 var $RecurExceptions;
2007 var $RecurDay;
2008 var $RecurMonthlyType;
2009 var $RecurMonthlyTypeInfo;
2010 var $RecurType;
2011 var $RecurFreq;
2012 var $RepeatForever;
2013 var $RepeatTimes;
2014 var $RepeatUntilDate;
2015 var $RecurFinishDate;
2016
2017 var $noDisplay;
2019 var $Priority;
2020
2022 var $Status;
2023
2025 var $Database;
2026
2028 var $State_;
2030 var $IsConnected;
2031 var $Url;
2032 var $Time;
2033 var $RecurForever;
2034 }
2035 function filterRecurring($event_array, &$date)
2036 {
2037 if ($event_array["IsRecurring"])
2038 {
2039 /*
2040 there are four things we must check to
2041 decide if a recurring event should be included
2042 the bool value IsRecurring (above)
2043 With any recurring events using RepeatUntilDate or RepeatTimes,
2044 we store the last date this event can occur in the column RecurFinishDate.
2045 The sql statement checks to see if the current date object is past RecurFinishDate,
2046 and also if the current date is in the Exceptions table for each recurring event.
2047 Then finally after we have filtered these, we check the RecurType.
2048 If the RecurType is day, we check to see if the day matches,
2049 then we check the RecurFreq and calculate from the day started.
2050 If the RecurType is week, we check RecurFreq to see if it will be this week,
2051 then we check which days have been selected, and if that day is today, include it.
2052 If the RecurType is month, we check RecurFreq to see if this month is
2053 skipped, then we check RecurMonthType
2054 If RecurMonthType is daily(26th of the month), we simply check to see
2055 if this day matches RecurMonthTypeInfo
2056 If RecurMonthType is weekdaynum( Last Tuesday of the month), we first check
2057 to see if it is the day in question in RecurMonthTypeInfo,
2058 then if it is, we check to see if the week matches.
2059 If RecurMonthType numdayname(Second Friday of the month), we check to see if
2060 the day matches, then check to see if what number day it is and see if they match.
2061 Finally, if RecurType is yearly, check RecurFreq first of course, and then
2062 find out if the month matches, then move to day.
2063 */
2064 // filter out recur exceptions if todays date matches
2065 if ($event_array['RecurExceptions']) {
2066 $recurExArr = explode(':', $event_array['RecurExceptions']);
2067 $strMonth = eZDateTime::addZero( $date->month() );
2068 $strDay = eZDateTime::addZero( $date->day());
2069 $fullDateStr = $date->year().'-'.$strMonth.'-'.$strDay;
2070 foreach ($recurExArr as $exKey)
2071 {
2072 if ($exKey == $fullDateStr)
2073 return false;
2074 }
2075 }
2076 // for each of these cases we will be needing dates to compare.
2077 // The first has already been created at the beginning of this method
2078 // as an object, $date. The second is a set of strings made from the
2079 // timestamp $event_array['Date'];
2080 // we will get the year, month, and day substr function
2081 $rYear = substr($event_array['Date'], 0, 4);
2082 $rMonth = substr($event_array['Date'], 4, 2);
2083 $rDay = substr($event_array['Date'], 6, 2);
2084 // now lets make the eZDate object
2085 $rDate = new eZDate( $rYear, $rMonth, $rDay );
2086 $rType = $event_array['RecurType'];
2087 // for readability and ease of use, define extra variables
2088 $rFreq = $event_array['RecurFreq'];
2089 // This switch statement switches out the recurType, because
2090 // we need to know what type of recurring event it is to
2091 // do proper
2092 // first we do a check to see if recurFreq is more than one, because if
2093 // it is, we will need to run the dateDiff function which will help decide
2094 // if we need to do further checks or just remove the key from the array
2095 if ($rFreq > 1) {
2096 // so let's create a couple arrays that the dateDiff function can read
2097 $firstDate = array('year' => $rDate->year(), 'month' => $rDate->month(), 'day' => $rDate->day());
2098 $secondDate = array('year' => $date->year(), 'month' => $date->month(), 'day' => $date->day());
2099 // This dateDiff function returns an array that holds
2100 // the date differences in year, month, and day
2101 $arrDiff = _date_diff($rDate, $date);
2102 }
2103 switch($rType) {
2104 // if the type is day...
2105 case 'day':
2106 // echo($event_array['ID'].' has a datediff of '.$arrDiff["days"].'<br>');
2107 // if $arrDiff['days'] is true, we know that $rFreq is more than 1
2108 // and therefore should check to see if $rFreq renders this date
2109 // invalid.
2110 if ($arrDiff['days']) {
2111 // set $diffDiv var as the difference of days divided by the
2112 // recurrance frequency
2113 $diffDiv = ($arrDiff['days']) / $rFreq;
2114 // this checks to see if the number has a decimal in it
2115 // (ie check to see if it is a whole number)
2116 // if this does NOT return false, it is NOT a whole number
2117 if ( strstr( $diffDiv, '.' ) || (!$diffDiv) ) {
2118 // it's not a whole number or it's 0, so this date shouldn't be considered
2119 // let's remove it from the array
2120 return false;
2121 }
2122 }
2123 // if the recur freq is 1, then we will be repeating every day
2124 // so we leave this event in the array
2125 break;
2126 case 'week':
2127 // to understand most of this section, see the day section calculations
2128 if ($arrDiff['weeks']) {
2129 $diffDiv = $arrDiff['weeks'] / $rFreq;
2130 if ( strstr( $diffDiv, '.' ) ) return false;
2131 } else {
2132 }
2133 if (isset($event_array)) { //if it's still there, we do the next set of checks
2134 // this next section we will be doing week specific checks
2135 // involving the RecurDay string.
2136 // this line is fairly simple, it does a case insentive check
2137 // to see if the name of the current day is in the RecurDay string
2138 $RecurDay = $event_array['RecurDay'];
2139 if ( !stristr( $RecurDay, $date->dayName(true) ) ) {
2140 // if it's not, unset the array
2141 return false;
2142 }
2143 }
2144 break;
2145 case 'month':
2146 // to understand most of this section, see the day section calculations
2147 if ( $arrDiff['months'] ) {
2148 $diffDiv = $arrDiff['months'] / $rFreq;
2149 if ( strstr( $diffDiv, '.' ) ) return false;
2150 }
2151 // this next section isn't pretty, and it's rather complex
2152 // and was generally just a pain in the neck
2153 $RecurMonthlyType = $event_array['RecurMonthlyType'];
2154 if ( $RecurMonthlyType == 'daily') {
2155 // daily is the easy part. if it is not the same day, unset the array
2156 if ( $date->day() != $rDate->day() ) return false;
2157 // we may want to add some extra logic to get the amount
2158 // of days in the month and if a day is over the 28th check
2159 // and see if we need to put the event on the closest
2160 // day to the end of the month
2161 }
2162 if ( $RecurMonthlyType == 'numdayname' ) {
2163 // in this section we assign the $weekNum var
2164 // with first, second, third, fourth, or last
2165 if ( $date->day() < 8) { $weekNum = 'first'; }
2166 elseif ( $date->day() < 15) { $weekNum = 'second'; }
2167 elseif ( $date->day() < 22) { $weekNum = 'third'; }
2168 elseif ( $date->day() < 29) { $weekNum = 'fourth'; }
2169 // we only offer options up to the fourth week, otherwise they
2170 // must check last, so that's why we don't need to worry
2171 // about anything over the 28th in this section
2172 else { return false; }
2173 // we see if these match. If they don't, unset array
2174 if ($event_array['RecurMonthlyTypeInfo'] != $weekNum) return false;
2175 // finally we have to check
2176 if ( $date->dayName(true) != $rDate->dayName(true) ) return false;
2177 }
2178 if ( $RecurMonthlyType == 'strdayname' ) {
2179 // the only value this will ever be is 'last'
2180 // we have to find the amount of days in this month
2181 // then calculate when the last one will happen
2182 // the first thing to do is check if the day is before the 22nd
2183 // because if it is, it's not going to be in the last week
2184 // next if the day plus seven is less than or equal to
2185 // the number of days in the month, it is not the last day.
2186 if ( $date->day() < 22 || ( $date->day() + 7 ) <= $date->daysInMonth() || $date->dayName(true) != $rDate->dayName(true) )
2187 return false;
2188
2189
2190 }
2191 break;
2192 case 'year':
2193 if ($arrDiff['years']) {
2194 $diffDiv = $arrDiff['years'] / $rFreq;
2195 if ( strstr( $diffDiv, '.' ) ) return false;
2196 }
2197 // if at this point the month and day match, we are golden
2198 // note the dash inbetween, its needed to seperate the two otherwise 11-5 and 1-15 are the same :)
2199 if ( ( $date->month() . '-' . $date->day() ) != ( $rDate->month() . '-' . $rDate->day() ) )
2200 return false;
2201 break;
2202 }
2203 }
2204 return true;
2205 }
2206 ?>
2207
$category
if( $Action=="Edit") $category
Definition: adedit.php:378
$i
$i
Definition: admin/adlist.php:91
$group
$group
Definition: admin/articleedit.php:799
$forum
$forum
Definition: admin/forumlist.php:50
$day
else $day
Definition: appointmentedit.php:665
$year
else $year
Definition: appointmentedit.php:655
$userID
else $userID
Definition: appointmentedit.php:121
$month
else $month
Definition: appointmentedit.php:660
$datetime
$datetime
Definition: appointmentview.php:108
$dateTime
$dateTime
Definition: authorview.php:77
$date
$date
Definition: bugpreview.php:66
eZDB\globalDatabase
static & globalDatabase()
Definition: ezdb.php:134
eZDateTime
Definition: ezdatetime.php:55
eZDateTime\addZero
static addZero( $value)
Definition: ezdatetime.php:363
eZDate
Definition: ezdate.php:46
eZForumCategory
Definition: ezforumcategory.php:44
eZForum
Definition: ezforum.php:44
eZGroupEventCategory
Definition: ezgroupeventcategory.php:39
eZGroupEventType
Definition: ezgroupeventtype.php:37
eZGroupEvent
Definition: ezgroupevent.php:85
eZGroupEvent\setDuration
setDuration( $time)
Definition: ezgroupevent.php:1149
eZGroupEvent\location
location( $htmlchars=true)
Definition: ezgroupevent.php:784
eZGroupEvent\$Description
$Description
Definition: ezgroupevent.php:1987
eZGroupEvent\getDate
& getDate()
Definition: ezgroupevent.php:835
eZGroupEvent\$RecurFreq
$RecurFreq
Definition: ezgroupevent.php:2011
eZGroupEvent\$RecurExceptions
$RecurExceptions
Definition: ezgroupevent.php:2006
eZGroupEvent\$EventCategoryID
$EventCategoryID
Definition: ezgroupevent.php:1991
eZGroupEvent\notification
notification( $debug=false)
Definition: ezgroupevent.php:1177
eZGroupEvent\getByGroupType
& getByGroupType( $date, $group, $type, $showPrivate=false)
Definition: ezgroupevent.php:409
eZGroupEvent\$Name
$Name
Definition: ezgroupevent.php:1986
eZGroupEvent\$RepeatUntilDate
$RepeatUntilDate
Definition: ezgroupevent.php:2014
eZGroupEvent\repeatForever
& repeatForever()
Definition: ezgroupevent.php:1699
eZGroupEvent\getByDate
& getByDate( $date, $group, $showPrivate=false)
Definition: ezgroupevent.php:327
eZGroupEvent\$Database
$Database
Variable for keeping the database connection.
Definition: ezgroupevent.php:2025
eZGroupEvent\isEventAlarmNotice
& isEventAlarmNotice()
Definition: ezgroupevent.php:963
eZGroupEvent\getAllByDate
& getAllByDate( $date, $showPrivate=false, $groupNoShow=true)
Definition: ezgroupevent.php:496
eZGroupEvent\stopTime
& stopTime()
Definition: ezgroupevent.php:881
eZGroupEvent\forum
forum( $as_object=true)
Definition: ezgroupevent.php:1495
eZGroupEvent\$Date
$Date
Definition: ezgroupevent.php:1994
eZGroupEvent\setCategory
setCategory( $category)
Definition: ezgroupevent.php:1075
eZGroupEvent\setEventAlarmNotice
setEventAlarmNotice( $value)
Definition: ezgroupevent.php:1131
eZGroupEvent\setRecurExceptions
setRecurExceptions( $ex)
Definition: ezgroupevent.php:1967
eZGroupEvent\$Url
$Url
Definition: ezgroupevent.php:2031
eZGroupEvent\$Priority
$Priority
The priority of the event, values can be 0, 1, 2 where 1 is normal.
Definition: ezgroupevent.php:2019
eZGroupEvent\$EventAlarmNotice
$EventAlarmNotice
Definition: ezgroupevent.php:1999
eZGroupEvent\$noDisplay
$noDisplay
Definition: ezgroupevent.php:2017
eZGroupEvent\setRecurDay
setRecurDay( $RecurDay=false)
Definition: ezgroupevent.php:1777
eZGroupEvent\setStatus
setStatus( $value)
Definition: ezgroupevent.php:1035
eZGroupEvent\setDateTime
setDateTime( $dateTime)
Definition: ezgroupevent.php:1047
eZGroupEvent\$IsPrivate
$IsPrivate
boolean stored as an int
Definition: ezgroupevent.php:2002
eZGroupEvent\setIsRecurring
setIsRecurring( $IsRecurring)
Definition: ezgroupevent.php:1712
eZGroupEvent\recurType
& recurType()
Definition: ezgroupevent.php:1594
eZGroupEvent\getAll
& getAll()
Definition: ezgroupevent.php:280
eZGroupEvent\$EventTypeID
$EventTypeID
Definition: ezgroupevent.php:1996
eZGroupEvent\addFile
addFile( $value)
Definition: ezgroupevent.php:1459
eZGroupEvent\priority
priority()
Definition: ezgroupevent.php:901
eZGroupEvent\recurDay
& recurDay()
Definition: ezgroupevent.php:1616
eZGroupEvent\eventIDFromForum
eventIDFromForum( $ForumID)
Definition: ezgroupevent.php:1562
eZGroupEvent\$Time
$Time
Definition: ezgroupevent.php:2032
eZGroupEvent\$IsRecurring
$IsRecurring
boolean stored as an int
Definition: ezgroupevent.php:2005
eZGroupEvent\$IsConnected
$IsConnected
Is true if the object has database connection, false if not.
Definition: ezgroupevent.php:2030
eZGroupEvent\duration
duration()
Definition: ezgroupevent.php:848
eZGroupEvent\groupID
groupID()
Definition: ezgroupevent.php:1103
eZGroupEvent\id
id()
Definition: ezgroupevent.php:738
eZGroupEvent\repeatTimes
& repeatTimes()
Definition: ezgroupevent.php:1671
eZGroupEvent\repeatUntilDate
& repeatUntilDate()
Definition: ezgroupevent.php:1649
eZGroupEvent\isPrivate
& isPrivate()
Definition: ezgroupevent.php:947
eZGroupEvent\setDescription
setDescription( $value)
Definition: ezgroupevent.php:990
eZGroupEvent\$EMailNotice
$EMailNotice
Definition: ezgroupevent.php:1997
eZGroupEvent\setPriority
setPriority( $value)
Definition: ezgroupevent.php:1024
eZGroupEvent\setRecurType
setRecurType( $RecurType)
Definition: ezgroupevent.php:1737
eZGroupEvent\startTime
& startTime()
Definition: ezgroupevent.php:862
eZGroupEvent\getByType
& getByType( $type, $showPrivate=false)
Definition: ezgroupevent.php:656
eZGroupEvent\url
url( $htmlchars=true)
Definition: ezgroupevent.php:802
eZGroupEvent\type
type()
Definition: ezgroupevent.php:923
eZGroupEvent\recurExceptions
& recurExceptions()
Definition: ezgroupevent.php:1686
eZGroupEvent\recurMonthlyType
& recurMonthlyType()
Definition: ezgroupevent.php:1627
eZGroupEvent\$Location
$Location
Definition: ezgroupevent.php:1990
eZGroupEvent\name
name( $htmlchars=true)
Definition: ezgroupevent.php:747
eZGroupEvent\setFinishDateForever
setFinishDateForever( $stamp='20371230235959')
Definition: ezgroupevent.php:1801
eZGroupEvent\$Duration
$Duration
Definition: ezgroupevent.php:1995
eZGroupEvent\getByGroup
& getByGroup( $group, $showPrivate=false)
Definition: ezgroupevent.php:698
eZGroupEvent\$RepeatTimes
$RepeatTimes
Definition: ezgroupevent.php:2013
eZGroupEvent\$URL
$URL
Definition: ezgroupevent.php:1989
eZGroupEvent\$RecurForever
$RecurForever
Definition: ezgroupevent.php:2033
eZGroupEvent\setRecurMonthlyType
setRecurMonthlyType( $RecurMonthlyType='', $date=false)
Definition: ezgroupevent.php:1747
eZGroupEvent\__construct
__construct( $id=-1, $fetch=true)
Definition: ezgroupevent.php:92
eZGroupEvent\$RecurFinishDate
$RecurFinishDate
Definition: ezgroupevent.php:2015
eZGroupEvent\$RecurType
$RecurType
Definition: ezgroupevent.php:2010
eZGroupEvent\setUrl
setUrl( $value)
Definition: ezgroupevent.php:1012
eZGroupEvent\setIsPrivate
setIsPrivate( $value)
Definition: ezgroupevent.php:1111
eZGroupEvent\setGroup
setGroup( $group)
Definition: ezgroupevent.php:1089
eZGroupEvent\$RecurMonthlyType
$RecurMonthlyType
Definition: ezgroupevent.php:2008
eZGroupEvent\isRecurring
& isRecurring()
Definition: ezgroupevent.php:1579
eZGroupEvent\setLocation
setLocation( $value)
Definition: ezgroupevent.php:1001
eZGroupEvent\$RecurDay
$RecurDay
Definition: ezgroupevent.php:2007
eZGroupEvent\category
category()
Definition: ezgroupevent.php:935
eZGroupEvent\$RepeatForever
$RepeatForever
Definition: ezgroupevent.php:2012
eZGroupEvent\deleteFile
deleteFile( $value)
Definition: ezgroupevent.php:1439
eZGroupEvent\$Status
$Status
The status of the event, values can be 0, 1, 2 where 1 is normal.
Definition: ezgroupevent.php:2022
eZGroupEvent\files
files( $as_object=true)
Definition: ezgroupevent.php:1415
eZGroupEvent\setType
setType( $type)
Definition: ezgroupevent.php:1061
eZGroupEvent\noDisplay
noDisplay()
Definition: ezgroupevent.php:1935
eZGroupEvent\$State_
$State_
Indicates the state of the object. In regard to database information.
Definition: ezgroupevent.php:2028
eZGroupEvent\status
status()
Definition: ezgroupevent.php:912
eZGroupEvent\dbInit
dbInit()
Definition: ezgroupevent.php:1164
eZGroupEvent\recurFreq
& recurFreq()
Definition: ezgroupevent.php:1605
eZGroupEvent\setNoDisplay
setNoDisplay($bool)
Definition: ezgroupevent.php:1943
eZGroupEvent\getAllByOthers
& getAllByOthers()
Definition: ezgroupevent.php:303
eZGroupEvent\setName
setName( $value)
Definition: ezgroupevent.php:979
eZGroupEvent\$GroupID
$GroupID
Definition: ezgroupevent.php:1993
eZGroupEvent\$ID
$ID
Definition: ezgroupevent.php:1985
eZGroupEvent\setRecurFreq
setRecurFreq( $RecurFreq)
Definition: ezgroupevent.php:1726
eZGroupEvent\$RecurMonthlyTypeInfo
$RecurMonthlyTypeInfo
Definition: ezgroupevent.php:2009
eZGroupEvent\setFinishDateNot
setFinishDateNot( $not, $freq, $type, $datetime)
Definition: ezgroupevent.php:1813
eZGroupEvent\store
store()
Definition: ezgroupevent.php:125
eZGroupEvent\getAllByType
& getAllByType( $date, $type, $showPrivate=false, $groupNoShow=true)
Definition: ezgroupevent.php:576
eZGroupEvent\setFinishDateUntil
setFinishDateUntil( $UntilDate)
Definition: ezgroupevent.php:1952
eZGroupEvent\dateTime
dateTime()
Definition: ezgroupevent.php:821
eZGroupEvent\RecurMonthlyTypeInfo
RecurMonthlyTypeInfo()
Definition: ezgroupevent.php:1638
eZGroupEvent\description
description( $htmlchars=true)
Definition: ezgroupevent.php:765
eZGroupNoShow
Definition: ezgroupnoshow.php:34
eZMail
Definition: ezmail.php:57
eZTime
Definition: eztime.php:38
eZUserGroup
Definition: ezusergroup.php:66
eZUser
Definition: ezuser.php:76
eZVirtualFile
Definition: ezvirtualfile.php:42
$ini
$ini
Definition: classes/admin/linklist.php:64
$type
$type
Definition: classes/admin/linkselect.php:220
$module
$module
Definition: classes/admin/linkselect.php:219
$result
$result
Definition: companysearch.php:94
$id
$id
Definition: companytypelist.php:193
$current_date
$current_date
Definition: cron_alerts.php:92
laddZero
laddZero( $value)
Definition: cron_alerts.php:78
$months
$months
Definition: dayreport.php:148
$query
if(isset( $Year) &&!is_numeric( $Year)||isset( $Month) &&!is_numeric( $Month)) $query
Definition: entryexitpages.php:65
$event
if(isset( $Action) && $Action=="New") else $event
Definition: eventedit.php:189
$showPrivate
$showPrivate
Definition: eventview.php:106
$tree
$tree
Definition: ezad/admin/categoryedit.php:172
$db
$db
Definition: ezarticle/user/authorlist.php:53
$mail
$mail
Definition: ezbulkmail/admin/maillist.php:61
filterRecurring
filterRecurring($event_array, &$date)
Definition: ezgroupevent.php:2035
_date_diff
_date_diff($date1, $date2)
Definition: ezgroupevent.php:47
$groupID
$groupID
Definition: ezgroupeventcalendar/user/dayview.php:90
$noShowGroup
$noShowGroup
Definition: ezgroupeventcalendar/user/dayview.php:188
$eventGroup
if(( $session->variable("ShowOtherCalendarGroups")==false)||(isSet( $GetByGroup))) $eventGroup
Definition: ezgroupeventcalendar/user/monthview.php:103
$ret
$ret
Definition: ezsitemanager/admin/filelist.php:88
$res
$res
Definition: ezstats/admin/cron.php:45
$debug
$debug
Definition: ezstats/admin/cron.php:36
$time
$time
Definition: homepage.php:327
Name
if($user) if(isset( $next) && $next)<?=isset($all_fields_error) &&$all_fields_error ?><?=isset($password_error) &&$password_error ?></p ><? endif;?>< form method="post">< table border="0" cellspacing="2" cellpadding="2" class="boxtext" style="font-size=13;">< tr >< td style="color:<?= isset( $error['first_name'] ) ?> First Name
Definition: step1.php:127
$userList
$userList
Definition: trustees.php:80
$user
$user
Definition: user/adlist.php:39
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.