PATH:
home
/
centosnipponia
/
public_html
/
ticketing.nipponia.com
/
ticketing-old
/
include
<?php require_once(INCLUDE_DIR . 'class.dept.php'); require_once(INCLUDE_DIR . 'class.role.php'); require_once(INCLUDE_DIR . 'class.team.php'); class AdminAjaxAPI extends AjaxController { /** * Ajax: GET /admin/add/department * * Uses a dialog to add a new department * * Returns: * 200 - HTML form for addition * 201 - {id: <id>, name: <name>} * * Throws: * 403 - Not logged in * 403 - Not an administrator */ function addDepartment() { global $ost, $thisstaff; if (!$thisstaff) Http::response(403, 'Agent login required'); if (!$thisstaff->isAdmin()) Http::response(403, 'Access denied'); $form = new DepartmentQuickAddForm($_POST); if ($_POST && $form->isValid()) { $dept = Dept::create(); $errors = array(); $vars = $form->getClean(); $vars += array( 'group_membership' => Dept::ALERTS_DEPT_AND_EXTENDED, ); if ($dept->update($vars, $errors)) { Http::response(201, $this->encode(array( 'id' => $dept->id, 'name' => $dept->name, ), 'application/json')); } foreach ($errors as $name=>$desc) if ($F = $form->getField($name)) $F->addError($desc); } $title = __("Add New Department"); $path = ltrim(Osticket::get_path_info(), '/'); include STAFFINC_DIR . 'templates/quick-add.tmpl.php'; } /** * Ajax: GET /admin/add/team * * Uses a dialog to add a new team * * Returns: * 200 - HTML form for addition * 201 - {id: <id>, name: <name>} * * Throws: * 403 - Not logged in * 403 - Not an adminitrator */ function addTeam() { global $ost, $thisstaff; if (!$thisstaff) Http::response(403, 'Agent login required'); if (!$thisstaff->isAdmin()) Http::response(403, 'Access denied'); $form = new TeamQuickAddForm($_POST); if ($_POST && $form->isValid()) { $team = Team::create(); $errors = array(); $vars = $form->getClean(); $vars += array( 'isenabled' => true, ); if ($team->update($vars, $errors)) { Http::response(201, $this->encode(array( 'id' => $team->getId(), 'name' => $team->name, ), 'application/json')); } foreach ($errors as $name=>$desc) if ($F = $form->getField($name)) $F->addError($desc); } $title = __("Add New Team"); $path = ltrim(Osticket::get_path_info(), '/'); include STAFFINC_DIR . 'templates/quick-add.tmpl.php'; } /** * Ajax: GET /admin/add/role * * Uses a dialog to add a new role * * Returns: * 200 - HTML form for addition * 201 - {id: <id>, name: <name>} * * Throws: * 403 - Not logged in * 403 - Not an adminitrator */ function addRole() { global $ost, $thisstaff; if (!$thisstaff) Http::response(403, 'Agent login required'); if (!$thisstaff->isAdmin()) Http::response(403, 'Access denied'); $form = new RoleQuickAddForm($_POST); if ($_POST && $form->isValid()) { $role = Role::create(); $errors = array(); $vars = $form->getClean(); if ($role->update($vars, $errors)) { Http::response(201, $this->encode(array( 'id' => $role->getId(), 'name' => $role->name, ), 'application/json')); } foreach ($errors as $name=>$desc) if ($F = $form->getField($name)) $F->addError($desc); } $title = __("Add New Role"); $path = ltrim(Osticket::get_path_info(), '/'); include STAFFINC_DIR . 'templates/quick-add-role.tmpl.php'; } function getRolePerms($id) { global $ost, $thisstaff; if (!$thisstaff) Http::response(403, 'Agent login required'); if (!$thisstaff->isAdmin()) Http::response(403, 'Access denied'); if (!($role = Role::lookup($id))) Http::response(404, 'No such role'); return $this->encode($role->getPermissionInfo()); } function addStaff() { global $ost, $thisstaff; if (!$thisstaff) Http::response(403, 'Agent login required'); if (!$thisstaff->isAdmin()) Http::response(403, 'Access denied'); $form = new StaffQuickAddForm($_POST); if ($_POST && $form->isValid()) { $staff = Staff::create(); $errors = array(); if ($staff->update($form->getClean(), $errors)) { Http::response(201, $this->encode(array( 'id' => $staff->getId(), 'name' => (string) $staff->getName(), ), 'application/json')); } foreach ($errors as $name=>$desc) { if ($F = $form->getField($name)) { $F->addError($desc); unset($errors[$name]); } } $errors['err'] = implode(", ", $errors); } $title = __("Add New Agent"); $path = ltrim(Osticket::get_path_info(), '/'); include STAFFINC_DIR . 'templates/quick-add.tmpl.php'; } function addQueueColumn($root='Ticket') { global $ost, $thisstaff; if (!$thisstaff) Http::response(403, 'Agent login required'); if (!$thisstaff->isAdmin()) Http::response(403, 'Access denied'); $column = new QueueColumn(); if ($_POST) { $data_form = $column->getDataConfigForm($_POST); if ($data_form->isValid()) { $column->update($_POST, $root); if ($column->save()) Http::response(201, $this->encode(array( 'id' => $column->getId(), 'name' => (string) $column->getName(), ), 'application/json')); } } include STAFFINC_DIR . 'templates/queue-column-add.tmpl.php'; } function addQueueSort($root='Ticket') { global $ost, $thisstaff; if (!$thisstaff) Http::response(403, 'Agent login required'); if (!$thisstaff->isAdmin()) Http::response(403, 'Access denied'); $sort = new QueueSort(); $errors = array(); if ($_POST) { $_POST['root'] = $root; $data_form = $sort->getDataConfigForm($_POST); if ($data_form->isValid()) { $sort->update($data_form->getClean() + $_POST, $errors); if ($sort->save()) Http::response(201, $this->encode(array( 'id' => $sort->getId(), 'name' => (string) $sort->getName(), ), 'application/json')); } } if (!$data_form) $data_form = $sort->getDataConfigForm(); include STAFFINC_DIR . 'templates/queue-sorting-add.tmpl.php'; } }
[+]
..
[-] .MANIFEST
[edit]
[-] ajax.admin.php
[edit]
[-] ajax.config.php
[edit]
[-] ajax.content.php
[edit]
[-] ajax.draft.php
[edit]
[-] ajax.email.php
[edit]
[-] ajax.export.php
[edit]
[-] ajax.filter.php
[edit]
[-] ajax.forms.php
[edit]
[-] ajax.i18n.php
[edit]
[-] ajax.kbase.php
[edit]
[-] ajax.note.php
[edit]
[-] ajax.orgs.php
[edit]
[-] ajax.plugins.php
[edit]
[-] ajax.schedule.php
[edit]
[-] ajax.search.php
[edit]
[-] ajax.sequence.php
[edit]
[-] ajax.staff.php
[edit]
[-] ajax.tasks.php
[edit]
[-] ajax.thread.php
[edit]
[-] ajax.tickets.php
[edit]
[-] ajax.tips.php
[edit]
[-] ajax.upgrader.php
[edit]
[-] ajax.users.php
[edit]
[-] api.cron.php
[edit]
[-] api.tickets.php
[edit]
[-] class.2fa.php
[edit]
[-] class.ajax.php
[edit]
[-] class.api.php
[edit]
[-] class.app.php
[edit]
[-] class.attachment.php
[edit]
[-] class.auth.php
[edit]
[-] class.avatar.php
[edit]
[-] class.banlist.php
[edit]
[-] class.base32.php
[edit]
[-] class.businesshours.php
[edit]
[-] class.canned.php
[edit]
[-] class.captcha.php
[edit]
[-] class.category.php
[edit]
[-] class.charset.php
[edit]
[-] class.cli.php
[edit]
[-] class.client.php
[edit]
[-] class.collaborator.php
[edit]
[-] class.company.php
[edit]
[-] class.config.php
[edit]
[-] class.controller.php
[edit]
[-] class.cron.php
[edit]
[-] class.crypto.php
[edit]
[-] class.csrf.php
[edit]
[-] class.dept.php
[edit]
[-] class.dispatcher.php
[edit]
[-] class.draft.php
[edit]
[-] class.dynamic_forms.php
[edit]
[-] class.email.php
[edit]
[-] class.error.php
[edit]
[-] class.export.php
[edit]
[-] class.faq.php
[edit]
[-] class.file.php
[edit]
[-] class.filter.php
[edit]
[-] class.filter_action.php
[edit]
[-] class.format.php
[edit]
[-] class.forms.php
[edit]
[-] class.http.php
[edit]
[-] class.i18n.php
[edit]
[-] class.import.php
[edit]
[-] class.json.php
[edit]
[-] class.knowledgebase.php
[edit]
[-] class.list.php
[edit]
[-] class.lock.php
[edit]
[-] class.log.php
[edit]
[-] class.mail.php
[edit]
[-] class.mailer.php
[edit]
[-] class.mailfetch.php
[edit]
[-] class.mailparse.php
[edit]
[-] class.message.php
[edit]
[-] class.migrater.php
[edit]
[-] class.mime.php
[edit]
[-] class.misc.php
[edit]
[-] class.model.php
[edit]
[-] class.nav.php
[edit]
[-] class.note.php
[edit]
[-] class.oauth2.php
[edit]
[-] class.organization.php
[edit]
[-] class.orm.php
[edit]
[-] class.osticket.php
[edit]
[-] class.ostsession.php
[edit]
[-] class.page.php
[edit]
[-] class.pagenate.php
[edit]
[-] class.passwd.php
[edit]
[-] class.pdf.php
[edit]
[-] class.plugin.php
[edit]
[-] class.priority.php
[edit]
[-] class.queue.php
[edit]
[-] class.report.php
[edit]
[-] class.role.php
[edit]
[-] class.schedule.php
[edit]
[-] class.search.php
[edit]
[-] class.sequence.php
[edit]
[-] class.session.php
[edit]
[-] class.setup.php
[edit]
[-] class.signal.php
[edit]
[-] class.sla.php
[edit]
[-] class.staff.php
[edit]
[-] class.task.php
[edit]
[-] class.team.php
[edit]
[-] class.template.php
[edit]
[-] class.thread.php
[edit]
[-] class.thread_actions.php
[edit]
[-] class.ticket.php
[edit]
[-] class.timezone.php
[edit]
[-] class.topic.php
[edit]
[-] class.translation.php
[edit]
[-] class.upgrader.php
[edit]
[-] class.user.php
[edit]
[-] class.usersession.php
[edit]
[-] class.util.php
[edit]
[-] class.validator.php
[edit]
[-] class.variable.php
[edit]
[-] class.xml.php
[edit]
[-] class.yaml.php
[edit]
[+]
cli
[+]
client
[+]
config
[+]
fpdf
[-] html2text.php
[edit]
[-] htmLawed.php
[edit]
[+]
i18n
[-] index.php
[edit]
[-] JSON.php
[edit]
[+]
laminas-mail
[+]
mpdf
[-] mysqli.php
[edit]
[-] ost-sampleconfig.php
[edit]
[-] PasswordHash.php
[edit]
[+]
pear
[+]
plugins
[-] Spyc.php
[edit]
[+]
staff
[-] tnef_decoder.php
[edit]
[-] UniversalClassLoader.php
[edit]
[+]
upgrader
[-] ost-config.php
[edit]
[-] .htaccess.disabled
[edit]