FIX Can't submit a ticket from public interface
This commit is contained in:
parent
c3715646e7
commit
e3359c6f0f
@ -419,7 +419,7 @@ class FormTicket
|
|||||||
|
|
||||||
if ($withdolfichehead) dol_fiche_end();
|
if ($withdolfichehead) dol_fiche_end();
|
||||||
|
|
||||||
print '<center>';
|
print '<br><center>';
|
||||||
print '<input class="button" type="submit" name="add" value="' . $langs->trans(($this->withthreadid > 0 ? "SendResponse" : "NewTicket")) . '" />';
|
print '<input class="button" type="submit" name="add" value="' . $langs->trans(($this->withthreadid > 0 ? "SendResponse" : "NewTicket")) . '" />';
|
||||||
|
|
||||||
if ($this->withcancel) {
|
if ($this->withcancel) {
|
||||||
|
|||||||
@ -159,7 +159,7 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $
|
|||||||
|
|
||||||
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
|
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
|
||||||
|
|
||||||
print '<body id="mainbody" class="publicnewticketform" style="margin-top: 10px;">';
|
print '<body id="mainbody" class="publicnewticketform">';
|
||||||
|
|
||||||
if (! empty($conf->global->TICKET_SHOW_COMPANY_LOGO) || ! empty($conf->global->TICKET_PUBLIC_INTERFACE_TOPIC)) {
|
if (! empty($conf->global->TICKET_SHOW_COMPANY_LOGO) || ! empty($conf->global->TICKET_PUBLIC_INTERFACE_TOPIC)) {
|
||||||
print '<center>';
|
print '<center>';
|
||||||
|
|||||||
@ -59,7 +59,7 @@ $extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Add file in email form
|
// Add file in email form
|
||||||
if (GETPOST('addfile') && !GETPOST('add_ticket')) {
|
if (GETPOST('addfile', 'alpha') && ! GETPOST('add', 'alpha')) {
|
||||||
////$res = $object->fetch('','',GETPOST('track_id'));
|
////$res = $object->fetch('','',GETPOST('track_id'));
|
||||||
////if($res > 0)
|
////if($res > 0)
|
||||||
////{
|
////{
|
||||||
@ -77,7 +77,7 @@ if (GETPOST('addfile') && !GETPOST('add_ticket')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove file
|
// Remove file
|
||||||
if (GETPOST('removedfile') && !GETPOST('add_ticket')) {
|
if (GETPOST('removedfile', 'alpha') && !GETPOST('add', 'alpha')) {
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ if (GETPOST('removedfile') && !GETPOST('add_ticket')) {
|
|||||||
dol_remove_file_process($_POST['removedfile'], 0, 0);
|
dol_remove_file_process($_POST['removedfile'], 0, 0);
|
||||||
$action = 'create_ticket';
|
$action = 'create_ticket';
|
||||||
}
|
}
|
||||||
if ($action == 'create_ticket' && GETPOST('add_ticket')) {
|
if ($action == 'create_ticket' && GETPOST('add', 'alpha')) {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
$origin_email = GETPOST('email', 'alpha');
|
$origin_email = GETPOST('email', 'alpha');
|
||||||
if (empty($origin_email)) {
|
if (empty($origin_email)) {
|
||||||
@ -311,7 +311,13 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
|
|||||||
$formmail->remove_attached_files($i);
|
$formmail->remove_attached_files($i);
|
||||||
}
|
}
|
||||||
|
|
||||||
setEventMessages($langs->trans('YourTicketSuccessfullySaved'), null, 'mesgs');
|
//setEventMessages($langs->trans('YourTicketSuccessfullySaved'), null, 'mesgs');
|
||||||
|
|
||||||
|
// Make a redirect to avoid to have ticket submitted twice if we make back
|
||||||
|
setEventMessages($langs->trans('MesgInfosPublicTicketCreatedWithTrackId', '<strong>' . $object->track_id . '</strong>'), null, 'warnings');
|
||||||
|
setEventMessages($langs->trans('PleaseRememberThisId'), null, 'warnings');
|
||||||
|
header("Location: index.php");
|
||||||
|
exit;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
@ -324,21 +330,23 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$arrayofjs = array();
|
|
||||||
$arrayofcss = array('/opensurvey/css/style.css', '/ticket/css/styles.css.php');
|
|
||||||
|
|
||||||
llxHeaderTicket($langs->trans("CreateTicket"), "", 0, 0, $arrayofjs, $arrayofcss);
|
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formticket = new FormTicket($db);
|
$formticket = new FormTicket($db);
|
||||||
|
|
||||||
if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) {
|
if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)
|
||||||
|
{
|
||||||
print '<div class="error">' . $langs->trans('TicketPublicInterfaceForbidden') . '</div>';
|
print '<div class="error">' . $langs->trans('TicketPublicInterfaceForbidden') . '</div>';
|
||||||
$db->close();
|
$db->close();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<div style="width:60%; margin: 0 auto;">';
|
$arrayofjs = array();
|
||||||
|
$arrayofcss = array('/opensurvey/css/style.css', '/ticket/css/styles.css.php');
|
||||||
|
|
||||||
|
llxHeaderTicket($langs->trans("CreateTicket"), "", 0, 0, $arrayofjs, $arrayofcss);
|
||||||
|
|
||||||
|
|
||||||
|
print '<div style="width:60%; margin: 0 auto;" class="ticketpublicarea">';
|
||||||
|
|
||||||
if ($action != "infos_success") {
|
if ($action != "infos_success") {
|
||||||
$formticket->withfromsocid = isset($socid) ? $socid : $user->societe_id;
|
$formticket->withfromsocid = isset($socid) ? $socid : $user->societe_id;
|
||||||
@ -361,11 +369,8 @@ if ($action != "infos_success") {
|
|||||||
|
|
||||||
print '<div class="info marginleftonly marginrightonly">' . $langs->trans('TicketPublicInfoCreateTicket') . '</div>';
|
print '<div class="info marginleftonly marginrightonly">' . $langs->trans('TicketPublicInfoCreateTicket') . '</div>';
|
||||||
$formticket->showForm();
|
$formticket->showForm();
|
||||||
} else {
|
|
||||||
print '<div class="info center">' . $langs->trans('MesgInfosPublicTicketCreatedWithTrackId', '<strong>' . $object->track_id . '</strong>');
|
|
||||||
print '<br>';
|
|
||||||
print $langs->trans('PleaseRememberThisId');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
@ -55,18 +55,18 @@ $action = GETPOST('action', 'alpha');
|
|||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formticket = new FormTicket($db);
|
$formticket = new FormTicket($db);
|
||||||
|
|
||||||
$arrayofjs = array();
|
|
||||||
$arrayofcss = array('/ticket/css/styles.css.php');
|
|
||||||
|
|
||||||
if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
|
if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
|
||||||
{
|
{
|
||||||
print $langs->trans('TicketPublicInterfaceForbidden');
|
print $langs->trans('TicketPublicInterfaceForbidden');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$arrayofjs = array();
|
||||||
|
$arrayofcss = array('/ticket/css/styles.css.php');
|
||||||
|
|
||||||
llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
|
llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
|
||||||
|
|
||||||
print '<div style="margin: 0 auto; width:60%">';
|
print '<div style="margin: 0 auto; width:60%" class="ticketpublicarea">';
|
||||||
print '<p style="text-align: center">' . ($conf->global->TICKET_PUBLIC_TEXT_HOME ? $conf->global->TICKET_PUBLIC_TEXT_HOME : $langs->trans("TicketPublicDesc")) . '</p>';
|
print '<p style="text-align: center">' . ($conf->global->TICKET_PUBLIC_TEXT_HOME ? $conf->global->TICKET_PUBLIC_TEXT_HOME : $langs->trans("TicketPublicDesc")) . '</p>';
|
||||||
print '<div class="ticketform">';
|
print '<div class="ticketform">';
|
||||||
print '<a href="create_ticket.php" class=""><div class="index_create orange bigrounded">' . dol_escape_htmltag($langs->trans("CreateTicket")) . '</div></a>';
|
print '<a href="create_ticket.php" class=""><div class="index_create orange bigrounded">' . dol_escape_htmltag($langs->trans("CreateTicket")) . '</div></a>';
|
||||||
|
|||||||
@ -155,21 +155,23 @@ $user_assign = new User($db);
|
|||||||
$user_create = new User($db);
|
$user_create = new User($db);
|
||||||
$formTicket = new FormTicket($db);
|
$formTicket = new FormTicket($db);
|
||||||
|
|
||||||
|
if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) {
|
||||||
|
print '<div class="error">' . $langs->trans('TicketPublicInterfaceForbidden') . '</div>';
|
||||||
|
$db->close();
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
$arrayofjs = array();
|
$arrayofjs = array();
|
||||||
$arrayofcss = array('/ticket/css/styles.css.php');
|
$arrayofcss = array('/ticket/css/styles.css.php');
|
||||||
|
|
||||||
llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
|
llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
|
||||||
|
|
||||||
if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) {
|
|
||||||
print '<div class="error">' . $langs->trans('TicketPublicInterfaceForbidden') . '</div>';
|
|
||||||
$db->close();
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<div style="margin: 0 auto; width:60%">';
|
print '<div style="margin: 0 auto; width:60%" class="ticketpublicarea">';
|
||||||
|
|
||||||
if ($action == "view_ticketlist")
|
if ($action == "view_ticketlist")
|
||||||
{
|
{
|
||||||
|
print '<br>';
|
||||||
if ($display_ticket_list) {
|
if ($display_ticket_list) {
|
||||||
// Filters
|
// Filters
|
||||||
$search_fk_status = GETPOST("search_fk_status", 'alpha');
|
$search_fk_status = GETPOST("search_fk_status", 'alpha');
|
||||||
@ -676,6 +678,7 @@ if ($action == "view_ticketlist")
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print '<p class="center">' . $langs->trans("TicketPublicMsgViewLogIn") . '</p>';
|
print '<p class="center">' . $langs->trans("TicketPublicMsgViewLogIn") . '</p>';
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
print '<div id="form_view_ticket">';
|
print '<div id="form_view_ticket">';
|
||||||
print '<form method="post" name="form_view_ticketlist" enctype="multipart/form-data" action="' . $_SERVER['PHP_SELF'] . '">';
|
print '<form method="post" name="form_view_ticketlist" enctype="multipart/form-data" action="' . $_SERVER['PHP_SELF'] . '">';
|
||||||
|
|||||||
@ -133,18 +133,18 @@ if ($action == "view_ticket" || $action == "add_message" || $action == "close" |
|
|||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formticket = new FormTicket($db);
|
$formticket = new FormTicket($db);
|
||||||
|
|
||||||
|
if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) {
|
||||||
|
print '<div class="error">' . $langs->trans('TicketPublicInterfaceForbidden') . '</div>';
|
||||||
|
$db->close();
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
$arrayofjs = array();
|
$arrayofjs = array();
|
||||||
$arrayofcss = array('/ticket/css/styles.css.php');
|
$arrayofcss = array('/ticket/css/styles.css.php');
|
||||||
|
|
||||||
llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
|
llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
|
||||||
|
|
||||||
if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) {
|
print '<div style="margin: 0 auto; width:60%" class="ticketpublicarea">';
|
||||||
print '<div class="error">' . $langs->trans('TicketPublicInterfaceForbidden') . '</div>';
|
|
||||||
$db->close();
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<div style="margin: 0 auto; width:60%">';
|
|
||||||
|
|
||||||
if ($action == "view_ticket" || $action == "add_message" || $action == "close" || $action == "confirm_public_close") {
|
if ($action == "view_ticket" || $action == "add_message" || $action == "close" || $action == "confirm_public_close") {
|
||||||
if ($display_ticket) {
|
if ($display_ticket) {
|
||||||
|
|||||||
@ -5248,6 +5248,9 @@ div.tabsElem a.tab {
|
|||||||
/* Ticket module */
|
/* Ticket module */
|
||||||
/* ============================================================================== */
|
/* ============================================================================== */
|
||||||
|
|
||||||
|
.publicnewticketform {
|
||||||
|
margin-top: 25px !important;
|
||||||
|
}
|
||||||
#cd-timeline {
|
#cd-timeline {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 2em 0;
|
padding: 2em 0;
|
||||||
|
|||||||
@ -1936,7 +1936,6 @@ a.tmenuimage:focus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Login */
|
/* Login */
|
||||||
|
|
||||||
.bodylogin
|
.bodylogin
|
||||||
@ -5388,7 +5387,6 @@ border-top-right-radius: 6px;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ============================================================================== */
|
/* ============================================================================== */
|
||||||
/* Public */
|
/* Public */
|
||||||
/* ============================================================================== */
|
/* ============================================================================== */
|
||||||
@ -5402,26 +5400,14 @@ border-top-right-radius: 6px;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
::-webkit-scrollbar {
|
|
||||||
width: 12px;
|
|
||||||
}
|
|
||||||
::-webkit-scrollbar-button {
|
|
||||||
background: #aaa
|
|
||||||
}
|
|
||||||
::-webkit-scrollbar-track-piece {
|
|
||||||
background: #fff
|
|
||||||
}
|
|
||||||
::-webkit-scrollbar-thumb {
|
|
||||||
background: #ddd
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ============================================================================== */
|
/* ============================================================================== */
|
||||||
/* Ticket module */
|
/* Ticket module */
|
||||||
/* ============================================================================== */
|
/* ============================================================================== */
|
||||||
|
|
||||||
|
.publicnewticketform {
|
||||||
|
margin-top: 25px !important;
|
||||||
|
}
|
||||||
|
|
||||||
#cd-timeline {
|
#cd-timeline {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 2em 0;
|
padding: 2em 0;
|
||||||
@ -5833,6 +5819,22 @@ border-top-right-radius: 6px;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* This must be at end */
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
width: 12px;
|
||||||
|
}
|
||||||
|
::-webkit-scrollbar-button {
|
||||||
|
background: #aaa;
|
||||||
|
}
|
||||||
|
::-webkit-scrollbar-track-piece {
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
::-webkit-scrollbar-thumb {
|
||||||
|
background: #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?php if (! defined('DISABLE_FONT_AWSOME') && empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) { ?>
|
<?php if (! defined('DISABLE_FONT_AWSOME') && empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) { ?>
|
||||||
<?php include dol_buildpath($path.'/theme/'.$theme.'/main_menu_fa_icons.inc.php', 0); ?>
|
<?php include dol_buildpath($path.'/theme/'.$theme.'/main_menu_fa_icons.inc.php', 0); ?>
|
||||||
<?php }
|
<?php }
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user