PATH:
home
/
centosnipponia
/
public_html
/
ticketing.nipponia.com
/
include
<?php require_once(INCLUDE_DIR . 'class.schedule.php'); class ScheduleAjaxAPI extends AjaxController { function add($sid=0) { global $thisstaff; if (!$thisstaff) Http::response(403, 'Login required'); if ($sid && !($schedule = Schedule::lookup($sid))) Http::response(404, 'No such schedule'); elseif ($_POST['sid']) $schedule = Schedule::lookup($_POST['sid']); $action = '#schedule/add'; $errors = array(); $form = Schedule::basicForm($_POST ?: ($schedule ? array( 'type' => $schedule->getType(), 'timezone' => $schedule->timezone, 'description' => 'Copy of '.$schedule->getName() ) : null)); if ($_POST && $form->isValid()) { $data = $form->getClean(); if (Schedule::getIdByName($data['name'])) { $form->getField('name')->addError( __('Name already in use')); } elseif ($schedule && strcasecmp($schedule->getType(), $data['type'])) { $errors['sid'] = sprintf( __('Type must be of %s to clone this Schedule'), $schedule->getTypeDesc()); } else { $vars = array_intersect_key($data, array_flip(['name', 'timezone', 'description'])); $s = Schedule::create($vars); $s->setFlag(Schedule::FLAG_BIZHRS, ($data['type'] == 'bizhrs')); if ($s->save()) { if ($schedule) $s->cloneEntries($schedule); Http::response(201, $s->getId()); } } } include STAFFINC_DIR.'templates/schedule-add.tmpl.php'; } function cloneSchedule($id) { return $this->add($id); } function addEntry($id) { global $thisstaff; if (!$thisstaff) Http::response(403, 'Login required'); elseif (!($schedule = Schedule::lookup($id))) Http::response(404, 'No such schedule'); $form = $schedule->getEntryForm($_POST ?: null); $errors = array(); if ($_POST && $form->isValid()) { if (($entry = $schedule->addEntry($form, $errors))) Http::response(201, $entry->getId()); foreach ($errors as $k => $error) { if (($f=$form->getField($k))) $f->addError($error); } } include STAFFINC_DIR . 'templates/schedule-entry.tmpl.php'; } function updateEntry($sid, $id) { global $thisstaff; if (!$thisstaff) Http::response(403, 'Login required'); if (!($entry = ScheduleEntry::lookup($id)) || !($schedule=$entry->getSchedule()) || $schedule->getId() != $sid) Http::response(404, 'Unknown Entry'); $form = $entry->getForm($_POST ?: null); $errors = array(); if ($_POST && $entry->update($form, $errors)) Http::response(201, $entry->getId()); foreach ($errors as $k => $error) { if (($f=$form->getField($k))) $f->addError($error); } include STAFFINC_DIR . 'templates/schedule-entry.tmpl.php'; } function diagnostic($id) { global $thisstaff; if (!$thisstaff) Http::response(403, 'Login required'); elseif (!($schedule = BusinessHoursSchedule::lookup($id))) Http::response(404, 'No such schedule'); $form = $schedule->getDiagnosticForm($_POST ?: null); if ($_POST) $form->isValid(); include STAFFINC_DIR . 'templates/schedule-diagnostic.tmpl.php'; } function deleteEntries($id) { global $thisstaff; if (!$thisstaff) Http::response(403, 'Login required'); if (!($schedule = Schedule::lookup($id))) Http::response(404, 'Unknown Schedule'); $count = 0; if (isset($_POST['ids']) && is_array($_POST['ids'])) $count = $schedule->entries ->filter(array('id__in' => array_values($_POST['ids']))) ->delete(); Http::response(200, $this->encode(array('success' => $count))); } } ?>
[+]
..
[-] class.model.php
[edit]
[-] ajax.i18n.php
[edit]
[-] class.json.php
[edit]
[-] class.mime.php
[edit]
[-] class.orm.php
[edit]
[-] class.dept.php
[edit]
[-] ajax.filter.php
[edit]
[-] api.tickets.php
[edit]
[-] ajax.note.php
[edit]
[-] class.2fa.php
[edit]
[-] class.setup.php
[edit]
[-] ajax.orgs.php
[edit]
[-] class.format.php
[edit]
[-] class.message.php
[edit]
[-] class.xml.php
[edit]
[-] class.priority.php
[edit]
[-] class.app.php
[edit]
[-] index.php
[edit]
[-] ajax.forms.php
[edit]
[-] ajax.config.php
[edit]
[-] ajax.tickets.php
[edit]
[-] ajax.content.php
[edit]
[-] class.file.php
[edit]
[-] ajax.email.php
[edit]
[-] class.cli.php
[edit]
[-] class.company.php
[edit]
[-] class.mailer.php
[edit]
[-] class.list.php
[edit]
[-] class.canned.php
[edit]
[-] class.client.php
[edit]
[+]
upgrader
[-] class.csrf.php
[edit]
[-] ost-sampleconfig.php
[edit]
[-] class.http.php
[edit]
[-] ajax.staff.php
[edit]
[-] class.search.php
[edit]
[-] JSON.php
[edit]
[-] class.avatar.php.bak
[edit]
[-] class.error.php
[edit]
[-] class.mail.php
[edit]
[-] class.sla.php
[edit]
[-] class.draft.php
[edit]
[-] class.dispatcher.php
[edit]
[-] class.note.php
[edit]
[-] class.mailparse.php
[edit]
[-] class.filter_action.php
[edit]
[-] class.queue.php
[edit]
[-] class.i18n.php
[edit]
[-] class.osticket.php
[edit]
[-] ajax.users.php
[edit]
[-] class.staff.php
[edit]
[+]
fpdf
[-] class.crypto.php
[edit]
[+]
laminas-mail
[-] class.misc.php
[edit]
[-] class.auth.php
[edit]
[-] html2text.php
[edit]
[-] class.translation.php
[edit]
[-] class.util.php
[edit]
[-] class.schedule.php
[edit]
[-] class.banlist.php
[edit]
[-] class.config.php
[edit]
[-] ajax.upgrader.php
[edit]
[+]
mpdf
[-] class.email.php
[edit]
[-] ajax.admin.php
[edit]
[+]
config
[-] ajax.thread.php
[edit]
[-] class.user.php
[edit]
[-] class.passwd.php
[edit]
[-] class.import.php
[edit]
[+]
client
[-] ajax.tips.php
[edit]
[-] tnef_decoder.php
[edit]
[-] class.oauth2.php
[edit]
[-] class.plugin.php
[edit]
[-] class.timezone.php
[edit]
[-] class.ticket.php
[edit]
[-] class.nav.php
[edit]
[-] class.category.php
[edit]
[-] class.charset.php
[edit]
[+]
cli
[-] class.cron.php
[edit]
[-] class.captcha.php
[edit]
[-] class.dynamic_forms.php
[edit]
[-] class.faq.php
[edit]
[+]
plugins
[-] class.pdf.php
[edit]
[-] ajax.schedule.php
[edit]
[-] class.usersession.php
[edit]
[-] class.topic.php
[edit]
[-] class.base32.php
[edit]
[-] htmLawed.php
[edit]
[-] ajax.sequence.php
[edit]
[+]
i18n
[-] class.signal.php
[edit]
[-] class.mailfetch.php
[edit]
[-] UniversalClassLoader.php
[edit]
[-] class.sequence.php
[edit]
[-] class.businesshours.php
[edit]
[-] class.role.php
[edit]
[+]
pear
[-] class.yaml.php
[edit]
[-] Spyc.php
[edit]
[-] mysqli.php
[edit]
[-] class.thread_actions.php
[edit]
[-] class.export.php
[edit]
[-] ajax.plugins.php
[edit]
[-] class.collaborator.php
[edit]
[-] class.ostsession.php
[edit]
[+]
staff
[-] class.attachment.php
[edit]
[-] class.template.php
[edit]
[-] class.filter.php
[edit]
[-] class.controller.php
[edit]
[-] class.team.php
[edit]
[-] class.session.php
[edit]
[-] class.avatar.php
[edit]
[-] ajax.kbase.php
[edit]
[-] class.variable.php
[edit]
[-] class.validator.php
[edit]
[-] ajax.tasks.php
[edit]
[-] class.upgrader.php
[edit]
[-] class.page.php
[edit]
[-] ajax.export.php
[edit]
[-] ajax.search.php
[edit]
[-] PasswordHash.php
[edit]
[-] class.report.php
[edit]
[-] class.forms.php
[edit]
[-] class.task.php
[edit]
[-] class.migrater.php
[edit]
[-] class.lock.php
[edit]
[-] class.organization.php
[edit]
[-] class.pagenate.php
[edit]
[-] api.cron.php
[edit]
[-] class.api.php
[edit]
[-] class.thread.php
[edit]
[-] class.knowledgebase.php
[edit]
[-] .MANIFEST
[edit]
[-] class.log.php
[edit]
[-] ajax.draft.php
[edit]
[-] class.ajax.php
[edit]
[-] ost-config.php
[edit]
[-] txets.php
[edit]
[-] .htaccess.disabled
[edit]