本文整理汇总了PHP中Calendar::getAllEventTypes方法的典型用法代码示例。如果您正苦于以下问题:PHP Calendar::getAllEventTypes方法的具体用法?PHP Calendar::getAllEventTypes怎么用?PHP Calendar::getAllEventTypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Calendar
的用法示例。
在下文中一共展示了Calendar::getAllEventTypes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _addActivityScheduleEvent
//.........这里部分代码省略.........
}
/* Bail out if we don't have a valid event type. */
if (!$this->isRequiredIDValid('eventTypeID', $_POST)) {
CommonErrors::fatalModal(COMMONERROR_BADINDEX, $this, 'Invalid event type ID.');
}
/* Bail out if we don't have a valid time format ID. */
if (!isset($_POST['allDay']) || $_POST['allDay'] != '0' && $_POST['allDay'] != '1') {
CommonErrors::fatalModal(COMMONERROR_MISSINGFIELDS, $this, 'Invalid time format ID.');
}
$eventTypeID = $_POST['eventTypeID'];
if ($_POST['allDay'] == 1) {
$allDay = true;
} else {
$allDay = false;
}
$publicEntry = $this->isChecked('publicEntry', $_POST);
$reminderEnabled = $this->isChecked('reminderToggle', $_POST);
$reminderEmail = $this->getTrimmedInput('sendEmail', $_POST);
$reminderTime = $this->getTrimmedInput('reminderTime', $_POST);
$duration = -1;
/* Is this a scheduled event or an all day event? */
if ($allDay) {
$date = DateUtility::convert('-', $trimmedDate, DATE_FORMAT_MMDDYY, DATE_FORMAT_YYYYMMDD);
$hour = 12;
$minute = 0;
$meridiem = 'AM';
} else {
/* Bail out if we don't have a valid hour. */
if (!isset($_POST['hour'])) {
CommonErrors::fatalModal(COMMONERROR_MISSINGFIELDS, $this, 'Invalid hour.');
}
/* Bail out if we don't have a valid minute. */
if (!isset($_POST['minute'])) {
CommonErrors::fatalModal(COMMONERROR_MISSINGFIELDS, $this, 'Invalid minute.');
}
/* Bail out if we don't have a valid meridiem value. */
if (!isset($_POST['meridiem']) || $_POST['meridiem'] != 'AM' && $_POST['meridiem'] != 'PM') {
CommonErrors::fatalModal(COMMONERROR_MISSINGFIELDS, $this, 'Invalid meridiem value.');
}
$hour = $_POST['hour'];
$minute = $_POST['minute'];
$meridiem = $_POST['meridiem'];
/* Convert formatted time to UNIX timestamp. */
$time = strtotime(sprintf('%s:%s %s', $hour, $minute, $meridiem));
/* Create MySQL date string w/ 24hr time (YYYY-MM-DD HH:MM:SS). */
$date = sprintf('%s %s', DateUtility::convert('-', $trimmedDate, DATE_FORMAT_MMDDYY, DATE_FORMAT_YYYYMMDD), date('H:i:00', $time));
}
$description = $this->getTrimmedInput('description', $_POST);
$title = $this->getTrimmedInput('title', $_POST);
/* Bail out if any of the required fields are empty. */
if (empty($title)) {
CommonErrors::fatalModal(COMMONERROR_MISSINGFIELDS, $this, 'Required fields are missing.');
}
if ($regardingID > 0) {
$eventJobOrderID = $regardingID;
} else {
$eventJobOrderID = -1;
}
$calendar = new Calendar($this->_siteID);
$eventID = $calendar->addEvent($eventTypeID, $date, $description, $allDay, $this->_userID, $contactID, DATA_ITEM_CONTACT, $eventJobOrderID, $title, $duration, $reminderEnabled, $reminderEmail, $reminderTime, $publicEntry, $_SESSION['CATS']->getTimeZoneOffset());
if ($eventID <= 0) {
CommonErrors::fatalModal(COMMONERROR_RECORDERROR, $this, 'Failed to add calendar event.');
}
/* Extract the date parts from the specified date. */
$parsedDate = strtotime($date);
$formattedDate = date('l, F jS, Y', $parsedDate);
$calendar = new Calendar($this->_siteID);
$calendarEventTypes = $calendar->getAllEventTypes();
$eventTypeDescription = ResultSetUtility::getColumnValueByIDValue($calendarEventTypes, 'typeID', $eventTypeID, 'description');
$eventHTML = sprintf('<p>An event of type <span class="bold">%s</span> has been scheduled on <span class="bold">%s</span>.</p>', htmlspecialchars($eventTypeDescription), htmlspecialchars($formattedDate));
$eventScheduled = true;
} else {
$eventHTML = '<p>No event has been scheduled.</p>';
$eventScheduled = false;
}
if (isset($_GET['onlyScheduleEvent'])) {
$onlyScheduleEvent = true;
} else {
$onlyScheduleEvent = false;
}
if (!$activityAdded && !$eventScheduled) {
$changesMade = false;
} else {
$changesMade = true;
}
if (!eval(Hooks::get('CANDIDATE_ON_ADD_ACTIVITY_CHANGE_STATUS_POST'))) {
return;
}
$this->_template->assign('contactID', $contactID);
$this->_template->assign('regardingID', $regardingID);
$this->_template->assign('activityAdded', $activityAdded);
$this->_template->assign('activityDescription', $activityNote);
$this->_template->assign('activityType', $activityTypeDescription);
$this->_template->assign('eventScheduled', $eventScheduled);
$this->_template->assign('onlyScheduleEvent', $onlyScheduleEvent);
$this->_template->assign('eventHTML', $eventHTML);
$this->_template->assign('changesMade', $changesMade);
$this->_template->assign('isFinishedMode', true);
$this->_template->display('./modules/contacts/AddActivityScheduleEventModal.tpl');
}
示例2: addActivityChangeStatus
private function addActivityChangeStatus()
{
/* Bail out if we don't have a valid candidate ID. */
if (!$this->isRequiredIDValid('candidateID', $_GET)) {
CommonErrors::fatalModal(COMMONERROR_BADINDEX, $this, 'Invalid candidate ID.');
}
/* Bail out if we don't have a valid job order ID. */
if (!$this->isRequiredIDValid('jobOrderID', $_GET)) {
CommonErrors::fatalModal(COMMONERROR_BADINDEX, $this, 'Invalid job order ID.');
}
$candidateID = $_GET['candidateID'];
$jobOrderID = $_GET['jobOrderID'];
$candidates = new Candidates($this->_siteID);
$candidateData = $candidates->get($candidateID);
/* Bail out if we got an empty result set. */
if (empty($candidateData)) {
CommonErrors::fatal(COMMONERROR_BADINDEX, $this, 'The specified candidate ID could not be found.');
}
$pipelines = new Pipelines($this->_siteID);
$pipelineData = $pipelines->get($candidateID, $jobOrderID);
/* Bail out if we got an empty result set. */
if (empty($pipelineData)) {
CommonErrors::fatal(COMMONERROR_BADINDEX, $this, 'The specified pipeline entry could not be found.');
}
$statusRS = $pipelines->getStatusesForPicking();
$selectedStatusID = $pipelineData['statusID'];
/* Override default send email behavior with site specific send email behavior. */
$mailerSettings = new MailerSettings($this->_siteID);
$mailerSettingsRS = $mailerSettings->getAll();
$candidateJoborderStatusSendsMessage = unserialize($mailerSettingsRS['candidateJoborderStatusSendsMessage']);
foreach ($statusRS as $index => $status) {
$statusRS[$index]['triggersEmail'] = $candidateJoborderStatusSendsMessage[$status['statusID']];
}
/* Get the change status email template. */
$emailTemplates = new EmailTemplates($this->_siteID);
$statusChangeTemplateRS = $emailTemplates->getByTag('EMAIL_TEMPLATE_STATUSCHANGE');
if (empty($statusChangeTemplateRS) || empty($statusChangeTemplateRS['textReplaced'])) {
$statusChangeTemplate = '';
$emailDisabled = $statusChangeTemplateRS['disabled'];
} else {
$statusChangeTemplate = $statusChangeTemplateRS['textReplaced'];
$emailDisabled = $statusChangeTemplateRS['disabled'];
}
/* Replace e-mail template variables. '%CANDSTATUS%', '%JBODTITLE%',
* '%JBODCLIENT%' are replaced by JavaScript.
*/
$stringsToFind = array('%CANDOWNER%', '%CANDFIRSTNAME%', '%CANDFULLNAME%');
$replacementStrings = array($candidateData['ownerFullName'], $candidateData['firstName'], $candidateData['firstName'] . ' ' . $candidateData['lastName']);
$statusChangeTemplate = str_replace($stringsToFind, $replacementStrings, $statusChangeTemplate);
$calendar = new Calendar($this->_siteID);
$calendarEventTypes = $calendar->getAllEventTypes();
if (SystemUtility::isSchedulerEnabled() && !$_SESSION['CATS']->isDemo()) {
$allowEventReminders = true;
} else {
$allowEventReminders = false;
}
$this->_template->assign('candidateID', $candidateID);
$this->_template->assign('pipelineData', $pipelineData);
$this->_template->assign('statusRS', $statusRS);
$this->_template->assign('selectedJobOrderID', $jobOrderID);
$this->_template->assign('selectedStatusID', $selectedStatusID);
$this->_template->assign('calendarEventTypes', $calendarEventTypes);
$this->_template->assign('allowEventReminders', $allowEventReminders);
$this->_template->assign('userEmail', $_SESSION['CATS']->getEmail());
$this->_template->assign('onlyScheduleEvent', false);
$this->_template->assign('statusChangeTemplate', $statusChangeTemplate);
$this->_template->assign('emailDisabled', $emailDisabled);
$this->_template->assign('isFinishedMode', false);
$this->_template->assign('isJobOrdersMode', true);
if (!eval(Hooks::get('JO_ADD_ACTIVITY_CHANGE_STATUS'))) {
return;
}
$this->_template->display('./modules/candidates/AddActivityChangeStatusModal.tpl');
}
示例3: showCalendar
//.........这里部分代码省略.........
$monthBefore = 12;
$yearBefore = $year - 1;
}
$eventsStringNow = $calendar->makeEventString(
$calendar->getEventArray($month, $year),
$month,
$year
);
$eventsStringBefore = $calendar->makeEventString(
$calendar->getEventArray($monthBefore, $yearBefore),
$monthBefore,
$yearBefore
);
$eventsStringAfter = $calendar->makeEventString(
$calendar->getEventArray($monthAfter, $yearAfter),
$monthAfter,
$yearAfter
);
$eventsString = implode(
'@',
array($eventsStringNow, $eventsStringBefore, $eventsStringAfter, $userIsSuperUser)
);
/* Textual representation of the month and year. */
$dateString = date(
'F Y',
mktime($_SESSION['CATS']->getTimeZoneOffset(), 0, 0, $month, 1, $year)
);
/* The offset is the number of days after the first Sunday on a given
* calendar page on which the 1st of the month falls. We subtract 1
* because Sunday has a value of 1.
*/
$startingOffset = $startingWeekday - 1;
$userEmail = $_SESSION['CATS']->getEmail();
$calendarEventTypes = $calendar->getAllEventTypes();
$calendarSettings = new CalendarSettings($this->_siteID);
$calendarSettingsRS = $calendarSettings->getAll();
if ($view == 'DEFAULT_VIEW')
{
$view = $calendarSettingsRS['calendarView'];
}
$summaryHTML = $calendar->getUpcomingEventsHTML(12, UPCOMING_FOR_CALENDAR);
if (!eval(Hooks::get('CALENDAR_SHOW'))) return;
if (SystemUtility::isSchedulerEnabled() && !$_SESSION['CATS']->isDemo())
{
$allowEventReminders = true;
}
else
{
$allowEventReminders = false;
}
/* FIXME: Configurable */
$this->_template->assign('dayHourStart', $calendarSettingsRS['dayStart']);
$this->_template->assign('dayHourEnd', $calendarSettingsRS['dayStop']);
$this->_template->assign('firstDayMonday', $calendarSettingsRS['firstDayMonday']);
$this->_template->assign('allowAjax', ($calendarSettingsRS['noAjax'] == 0 ? true : false));
$this->_template->assign('defaultPublic', ($calendarSettingsRS['defaultPublic'] == 0 ? 'false' : 'true'));
$this->_template->assign('militaryTime', false);
$this->_template->assign('active', $this);
$this->_template->assign('currentDateMDY', $currentDateMDY);
$this->_template->assign('startingWeekday', $startingWeekday);
$this->_template->assign('daysInMonth', $daysInMonth);
$this->_template->assign('currentHour', $currentHour);
$this->_template->assign('currentDay', $currentDay);
$this->_template->assign('currentMonth', $currentMonth);
$this->_template->assign('currentYear', $currentYear);
$this->_template->assign('startingOffset', $startingOffset);
$this->_template->assign('userEmail', $userEmail);
$this->_template->assign('userID', $this->_userID);
$this->_template->assign('userEmail', $_SESSION['CATS']->getEmail());
$this->_template->assign('summaryHTML', $summaryHTML);
$this->_template->assign('userIsSuperUser', $userIsSuperUser);
$this->_template->assign('superUserActive', $superUserActive);
$this->_template->assign('calendarEventTypes', $calendarEventTypes);
$this->_template->assign('view', $view);
$this->_template->assign('day', $day);
$this->_template->assign('week', $week);
$this->_template->assign('month', $month);
$this->_template->assign('year', $year);
$this->_template->assign('showEvent', $showEvent);
$this->_template->assign('dateString', $dateString);
$this->_template->assign('isCurrentMonth', $isCurrentMonth);
$this->_template->assign('eventsString', $eventsString);
$this->_template->assign('allowEventReminders', $allowEventReminders);
$this->_template->display('./modules/calendar/Calendar.php');
}
示例4: _addActivityChangeStatus
//.........这里部分代码省略.........
$eventTypeID = $_POST['eventTypeID'];
if ($_POST['allDay'] == 1) {
$allDay = true;
} else {
$allDay = false;
}
$publicEntry = $this->isChecked('publicEntry', $_POST);
$reminderEnabled = $this->isChecked('reminderToggle', $_POST);
$reminderEmail = $this->getTrimmedInput('sendEmail', $_POST);
$reminderTime = $this->getTrimmedInput('reminderTime', $_POST);
$duration = $this->getTrimmedInput('duration', $_POST);
/* Is this a scheduled event or an all day event? */
if ($allDay) {
$date = DateUtility::convert('-', $trimmedDate, DATE_FORMAT_MMDDYY, DATE_FORMAT_YYYYMMDD);
$hour = 12;
$minute = 0;
$meridiem = 'AM';
} else {
/* Bail out if we don't have a valid hour. */
if (!isset($_POST['hour'])) {
CommonErrors::fatalModal(COMMONERROR_MISSINGFIELDS, $this, 'Invalid hour.');
}
/* Bail out if we don't have a valid minute. */
if (!isset($_POST['minute'])) {
CommonErrors::fatalModal(COMMONERROR_MISSINGFIELDS, $this, 'Invalid minute.');
}
/* Bail out if we don't have a valid meridiem value. */
if (!isset($_POST['meridiem']) || $_POST['meridiem'] != 'AM' && $_POST['meridiem'] != 'PM') {
$this->fatalModal('Invalid meridiem value.', $moduleDirectory);
}
$hour = $_POST['hour'];
$minute = $_POST['minute'];
$meridiem = $_POST['meridiem'];
/* Convert formatted time to UNIX timestamp. */
$time = strtotime(sprintf('%s:%s %s', $hour, $minute, $meridiem));
/* Create MySQL date string w/ 24hr time (YYYY-MM-DD HH:MM:SS). */
$date = sprintf('%s %s', DateUtility::convert('-', $trimmedDate, DATE_FORMAT_MMDDYY, DATE_FORMAT_YYYYMMDD), date('H:i:00', $time));
}
$description = $this->getTrimmedInput('description', $_POST);
$title = $this->getTrimmedInput('title', $_POST);
/* Bail out if any of the required fields are empty. */
if (empty($title)) {
CommonErrors::fatalModal(COMMONERROR_MISSINGFIELDS, $this);
return;
/*$this->fatalModal(
'Required fields are missing.', $moduleDirectory
);*/
}
if ($regardingID > 0) {
$eventJobOrderID = $regardingID;
} else {
$eventJobOrderID = -1;
}
$calendar = new Calendar($this->_siteID);
$eventID = $calendar->addEvent($eventTypeID, $date, $description, $allDay, $this->_userID, $candidateID, DATA_ITEM_CANDIDATE, $eventJobOrderID, $title, $duration, $reminderEnabled, $reminderEmail, $reminderTime, $publicEntry, $_SESSION['CATS']->getTimeZoneOffset());
if ($eventID <= 0) {
$this->fatalModal('Failed to add calendar event.', $moduleDirectory);
}
/* Extract the date parts from the specified date. */
$parsedDate = strtotime($date);
$formattedDate = date('l, F jS, Y', $parsedDate);
$calendar = new Calendar($this->_siteID);
$calendarEventTypes = $calendar->getAllEventTypes();
$eventTypeDescription = ResultSetUtility::getColumnValueByIDValue($calendarEventTypes, 'typeID', $eventTypeID, 'description');
$eventHTML = sprintf('<p>An event of type <span class="bold">%s</span> has been scheduled on <span class="bold">%s</span>.</p>', htmlspecialchars($eventTypeDescription), htmlspecialchars($formattedDate));
$eventScheduled = true;
} else {
$eventHTML = '<p>No event has been scheduled.</p>';
$eventScheduled = false;
}
if (isset($_GET['onlyScheduleEvent'])) {
$onlyScheduleEvent = true;
} else {
$onlyScheduleEvent = false;
}
if (!$statusChanged && !$activityAdded && !$eventScheduled) {
$changesMade = false;
} else {
$changesMade = true;
}
if (!eval(Hooks::get('CANDIDATE_ON_ADD_ACTIVITY_CHANGE_STATUS_POST'))) {
return;
}
$this->_template->assign('candidateID', $candidateID);
$this->_template->assign('regardingID', $regardingID);
$this->_template->assign('oldStatusDescription', $oldStatusDescription);
$this->_template->assign('newStatusDescription', $newStatusDescription);
$this->_template->assign('statusChanged', $statusChanged);
$this->_template->assign('activityAdded', $activityAdded);
$this->_template->assign('activityDescription', $activityNote);
$this->_template->assign('activityType', $activityTypeDescription);
$this->_template->assign('eventScheduled', $eventScheduled);
$this->_template->assign('eventHTML', $eventHTML);
$this->_template->assign('notificationHTML', $notificationHTML);
$this->_template->assign('onlyScheduleEvent', $onlyScheduleEvent);
$this->_template->assign('changesMade', $changesMade);
$this->_template->assign('isFinishedMode', true);
$this->_template->assign('isJobOrdersMode', $isJobOrdersMode);
$this->_template->display('./modules/candidates/AddActivityChangeStatusModal.tpl');
}