Beispiel #1
0
/**
 *
 */
function save_ticket()
{
    global $plugin;
    $category_id = $_POST['category_id'];
    $content = $_POST['content'];
    if ($_POST['phone'] != "") {
        $content .= '<p style="color:red">&nbsp;' . get_lang('Phone') . ': ' . Security::remove_XSS($_POST['phone']) . '</p>';
    }
    $course_id = $_POST['course_id'];
    $project_id = $_POST['project_id'];
    $subject = $_POST['subject'];
    $other_area = (int) $_POST['other_area'];
    $email = $_POST['email'];
    $personal_email = $_POST['personal_email'];
    $source = $_POST['source_id'];
    $user_id = $_POST['user_id_request'];
    $priority = $_POST['priority_id'];
    $status = $_POST['status_id'];
    $file_attachments = $_FILES;
    $responsible = api_is_platform_admin() ? api_get_user_id() : 0;
    if (TicketManager::insert_new_ticket($category_id, $course_id, $project_id, $other_area, $email, $subject, $content, $personal_email, $file_attachments, $source, $priority, $status, $user_id, $responsible)) {
        header('location:' . api_get_path(WEB_PLUGIN_PATH) . PLUGIN_NAME . '/src/myticket.php?message=success');
        exit;
    } else {
        Display::display_header(get_lang('ComposeMessage'));
        Display::display_error_message($plugin->get_lang('ErrorRegisterMessage'));
    }
}
Beispiel #2
0
function save_ticket()
{
    $category_id = $_POST['category_id'];
    $content = $_POST['content'];
    if ($_POST['phone'] != "") {
        $content .= '<p style="color:red">&nbsp;' . get_lang('Phone') . ': ' . $_POST['phone'] . '</p>';
    }
    $course_id = $_POST['course_id'];
    $project_id = $_POST['project_id'];
    $subject = $_POST['subject'];
    $other_area = (int) $_POST['other_area'];
    $email = $_POST['email'];
    $personal_email = $_POST['personal_email'];
    $file_attachments = $_FILES;
    if (TicketManager::insert_new_ticket($category_id, $course_id, $project_id, $other_area, $email, $subject, $content, $personal_email, $file_attachments)) {
        header('location:' . api_get_path(WEB_PLUGIN_PATH) . PLUGIN_NAME . '/s/myticket.php?message=success');
    } else {
        Display::display_header(get_lang('ComposeMessage'));
        Display::display_error_message($plugin->get_lang('ErrorRegisterMessage'));
    }
}