class ilEventAppointment More...
Inheritance diagram for ilEventAppointment:
Collaboration diagram for ilEventAppointment:Public Member Functions | |
| ilEventAppointment ($a_appointment_id=null) | |
| setAppointmentId ($a_appointment_id) | |
| getAppointmentId () | |
| setEventId ($a_event_id) | |
| getEventId () | |
| setStartingTime ($a_starting_time) | |
| getStartingTime () | |
| setEndingTime ($a_ending_time) | |
| getEndingTime () | |
| toggleFullTime ($a_status) | |
| enabledFullTime () | |
| formatTime () | |
| _timeToString ($start, $end) | |
| _appointmentToString ($start, $end, $fulltime) | |
| appointmentToString () | |
| create () | |
| update () | |
| delete () | |
| _delete ($a_appointment_id) | |
| _deleteByEvent ($a_event_id) | |
| & | _readAppointmentsByEvent ($a_event_id) |
| validate () | |
| __read () | |
Data Fields | |
| $ilErr | |
| $ilDB | |
| $tree | |
| $lng | |
| $starting_time = null | |
| $ending_time = null | |
class ilEventAppointment
Definition at line 35 of file class.ilEventAppointment.php.
| ilEventAppointment::__read | ( | ) |
Definition at line 253 of file class.ilEventAppointment.php.
References $ilDB, $res, getAppointmentId(), setEndingTime(), setEventId(), setStartingTime(), and toggleFullTime().
Referenced by ilEventAppointment().
{
global $ilDB;
if(!$this->getAppointmentId())
{
return null;
}
$query = "SELECT * FROM event_appointment ".
"WHERE appointment_id = ".$ilDB->quote($this->getAppointmentId())." ";
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->setEventId($row->event_id);
$this->setStartingTime($row->starting_time);
$this->setEndingTime($row->ending_time);
$this->toggleFullTime($row->fulltime);
}
return true;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilEventAppointment::_appointmentToString | ( | $ | start, | |
| $ | end, | |||
| $ | fulltime | |||
| ) |
Definition at line 115 of file class.ilEventAppointment.php.
References $lng, and ilFormat::formatUnixTime().
Referenced by ilCourseContentGUI::__renderEvent(), and appointmentToString().
{
global $lng;
$start_day = date('j',$start);
$start_month = date('n',$start);
$start_year = date('Y',$start);
$end_day = date('j',$end);
$end_month = date('n',$end);
$end_year = date('Y',$end);
if($start_day == $end_day and
$start_month == $end_month and
$start_year == $end_year)
{
$date_time = ilFormat::formatUnixTime($start,false);
if(!$fulltime)
{
$date_time .= (' '.ilEventAppointment::_timeToString($start,$end));
}
else
{
$date_time .= (' ('.$lng->txt('event_full_time_info').')');
}
}
else
{
if(!$fulltime)
{
$date_time = ilFormat::formatUnixTime($start,true) . ' - '.
ilFormat::formatUnixTime($end,true);
}
else
{
$date_time = ilFormat::formatUnixTime($start,false) . ' - '.
ilFormat::formatUnixTime($end,false);
$date_time .= (' ('.$lng->txt('event_full_time_info').')');
}
}
return $date_time;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilEventAppointment::_delete | ( | $ | a_appointment_id | ) |
Definition at line 204 of file class.ilEventAppointment.php.
References $ilDB.
Referenced by delete().
{
global $ilDB;
$query = "DELETE FROM event_appointment ".
"WHERE appointment_id = ".$ilDB->quote($a_appointment_id)." ";
$this->db->query($query);
return true;
}
Here is the caller graph for this function:| ilEventAppointment::_deleteByEvent | ( | $ | a_event_id | ) |
Definition at line 215 of file class.ilEventAppointment.php.
References $ilDB.
Referenced by ilEvent::_delete().
{
global $ilDB;
$query = "DELETE FROM event_appointment ".
"WHERE event_id = ".$ilDB->quote($a_event_id)." ";
$ilDB->query($query);
return true;
}
Here is the caller graph for this function:| & ilEventAppointment::_readAppointmentsByEvent | ( | $ | a_event_id | ) |
Definition at line 226 of file class.ilEventAppointment.php.
References $ilDB, $res, and ilEventAppointment().
Referenced by ilEvent::__read().
{
global $ilDB;
$query = "SELECT * FROM event_appointment ".
"WHERE event_id = ".$ilDB->quote($a_event_id)." ".
"ORDER BY starting_time";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$appointments[] =& new ilEventAppointment($row->appointment_id);
}
return is_array($appointments) ? $appointments : array();
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilEventAppointment::_timeToString | ( | $ | start, | |
| $ | end | |||
| ) |
Definition at line 107 of file class.ilEventAppointment.php.
Referenced by formatTime().
{
$start = date($this->lng->txt('lang_timeformat_no_sec'),$start);
$end = date($this->lng->txt('lang_timeformat_no_sec'),$end);
return $start.' - '. $end;
}
Here is the caller graph for this function:| ilEventAppointment::appointmentToString | ( | ) |
Definition at line 157 of file class.ilEventAppointment.php.
References _appointmentToString(), enabledFullTime(), getEndingTime(), and getStartingTime().
{
return ilEventAppointment::_appointmentToString($this->getStartingTime(),$this->getEndingTime(),$this->enabledFullTime());
}
Here is the call graph for this function:| ilEventAppointment::create | ( | ) |
Definition at line 162 of file class.ilEventAppointment.php.
References $ilDB, enabledFullTime(), getEndingTime(), getEventId(), and getStartingTime().
{
global $ilDB;
if(!$this->getEventId())
{
return false;
}
$query = "INSERT INTO event_appointment ".
"SET event_id = ".$ilDB->quote($this->getEventId()).", ".
"starting_time = ".$ilDB->quote($this->getStartingTime()).", ".
"ending_time = ".$ilDB->quote($this->getEndingTime()).", ".
"fulltime = ".$ilDB->quote($this->enabledFullTime())." ";
$this->db->query($query);
return true;
}
Here is the call graph for this function:| ilEventAppointment::delete | ( | ) |
Definition at line 199 of file class.ilEventAppointment.php.
References _delete(), and getAppointmentId().
{
return ilEventAppointment::_delete($this->getAppointmentId());
}
Here is the call graph for this function:| ilEventAppointment::enabledFullTime | ( | ) |
Definition at line 97 of file class.ilEventAppointment.php.
Referenced by appointmentToString(), create(), and update().
{
return $this->fulltime;
}
Here is the caller graph for this function:| ilEventAppointment::formatTime | ( | ) |
Definition at line 102 of file class.ilEventAppointment.php.
References _timeToString(), getEndingTime(), and getStartingTime().
{
return ilEventAppointment::_timeToString($this->getStartingTime(),$this->getEndingTime());
}
Here is the call graph for this function:| ilEventAppointment::getAppointmentId | ( | ) |
Definition at line 61 of file class.ilEventAppointment.php.
Referenced by __read(), delete(), and update().
{
return $this->appointment_id;
}
Here is the caller graph for this function:| ilEventAppointment::getEndingTime | ( | ) |
Definition at line 88 of file class.ilEventAppointment.php.
Referenced by appointmentToString(), create(), formatTime(), and update().
{
return isset($this->ending_time) ? $this->ending_time : mktime(16,0,0,date('n',time()),date('d',time()),date('Y',time()));
}
Here is the caller graph for this function:| ilEventAppointment::getEventId | ( | ) |
Definition at line 70 of file class.ilEventAppointment.php.
Referenced by create(), and update().
{
return $this->event_id;
}
Here is the caller graph for this function:| ilEventAppointment::getStartingTime | ( | ) |
Definition at line 79 of file class.ilEventAppointment.php.
Referenced by appointmentToString(), create(), formatTime(), and update().
{
return isset($this->starting_time) ? $this->starting_time : mktime(8,0,0,date('n',time()),date('d',time()),date('Y',time()));
}
Here is the caller graph for this function:| ilEventAppointment::ilEventAppointment | ( | $ | a_appointment_id = null |
) |
Definition at line 45 of file class.ilEventAppointment.php.
References $ilDB, $ilErr, $lng, $tree, and __read().
Referenced by _readAppointmentsByEvent().
{
global $ilErr,$ilDB,$lng,$tree;
$this->ilErr =& $ilErr;
$this->db =& $ilDB;
$this->lng =& $lng;
$this->appointment_id = $a_appointment_id;
$this->__read();
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilEventAppointment::setAppointmentId | ( | $ | a_appointment_id | ) |
Definition at line 57 of file class.ilEventAppointment.php.
{
$this->appointment_id = $a_appointment_id;
}
| ilEventAppointment::setEndingTime | ( | $ | a_ending_time | ) |
Definition at line 84 of file class.ilEventAppointment.php.
Referenced by __read().
{
$this->ending_time = $a_ending_time;
}
Here is the caller graph for this function:| ilEventAppointment::setEventId | ( | $ | a_event_id | ) |
Definition at line 66 of file class.ilEventAppointment.php.
Referenced by __read().
{
$this->event_id = $a_event_id;
}
Here is the caller graph for this function:| ilEventAppointment::setStartingTime | ( | $ | a_starting_time | ) |
Definition at line 75 of file class.ilEventAppointment.php.
Referenced by __read().
{
$this->starting_time = $a_starting_time;
}
Here is the caller graph for this function:| ilEventAppointment::toggleFullTime | ( | $ | a_status | ) |
Definition at line 93 of file class.ilEventAppointment.php.
Referenced by __read().
{
$this->fulltime = $a_status;
}
Here is the caller graph for this function:| ilEventAppointment::update | ( | ) |
Definition at line 180 of file class.ilEventAppointment.php.
References $ilDB, enabledFullTime(), getAppointmentId(), getEndingTime(), getEventId(), and getStartingTime().
{
global $ilDB;
if(!$this->getEventId())
{
return false;
}
$query = "UPDATE event_appointment ".
"SET event_id = ".$ilDB->quote($this->getEventId()).", ".
"starting_time = ".$ilDB->quote($this->getStartingTime()).", ".
"ending_time = ".$ilDB->quote($this->getEndingTime()).", ".
"fulltime = ".$ilDB->quote($this->enabledFullTime())." ".
"WHERE appointment_id = ".$ilDB->quote($this->getAppointmentId())." ";
$this->db->query($query);
return true;
}
Here is the call graph for this function:| ilEventAppointment::validate | ( | ) |
Definition at line 242 of file class.ilEventAppointment.php.
{
if($this->starting_time > $this->ending_time)
{
$this->ilErr->appendMessage($this->lng->txt('event_etime_smaller_stime'));
return false;
}
return true;
}
| ilEventAppointment::$ending_time = null |
Definition at line 43 of file class.ilEventAppointment.php.
| ilEventAppointment::$ilDB |
Definition at line 38 of file class.ilEventAppointment.php.
Referenced by __read(), _delete(), _deleteByEvent(), _readAppointmentsByEvent(), create(), ilEventAppointment(), and update().
| ilEventAppointment::$ilErr |
Definition at line 37 of file class.ilEventAppointment.php.
Referenced by ilEventAppointment().
| ilEventAppointment::$lng |
Definition at line 40 of file class.ilEventAppointment.php.
Referenced by _appointmentToString(), and ilEventAppointment().
| ilEventAppointment::$starting_time = null |
Definition at line 42 of file class.ilEventAppointment.php.
| ilEventAppointment::$tree |
Definition at line 39 of file class.ilEventAppointment.php.
Referenced by ilEventAppointment().
1.7.1