diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 1d681d2672b..6f712fa6c4d 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -419,7 +419,7 @@ class FormTicket if ($withdolfichehead) dol_fiche_end(); - print '
'; + print '
'; print ''; if ($this->withcancel) { diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index c5791e5c89e..9e0c357be05 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -159,7 +159,7 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $ top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers - print ''; + print ''; if (! empty($conf->global->TICKET_SHOW_COMPANY_LOGO) || ! empty($conf->global->TICKET_PUBLIC_INTERFACE_TOPIC)) { print '
'; diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index 42774772eb5..b663aaa43c3 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -59,7 +59,7 @@ $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); */ // Add file in email form -if (GETPOST('addfile') && !GETPOST('add_ticket')) { +if (GETPOST('addfile', 'alpha') && ! GETPOST('add', 'alpha')) { ////$res = $object->fetch('','',GETPOST('track_id')); ////if($res > 0) ////{ @@ -77,7 +77,7 @@ if (GETPOST('addfile') && !GETPOST('add_ticket')) { } // 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'; @@ -89,7 +89,7 @@ if (GETPOST('removedfile') && !GETPOST('add_ticket')) { dol_remove_file_process($_POST['removedfile'], 0, 0); $action = 'create_ticket'; } -if ($action == 'create_ticket' && GETPOST('add_ticket')) { +if ($action == 'create_ticket' && GETPOST('add', 'alpha')) { $error = 0; $origin_email = GETPOST('email', 'alpha'); if (empty($origin_email)) { @@ -311,7 +311,13 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { $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', '' . $object->track_id . ''), null, 'warnings'); + setEventMessages($langs->trans('PleaseRememberThisId'), null, 'warnings'); + header("Location: index.php"); + exit; } } else { setEventMessages($object->error, $object->errors, 'errors'); @@ -324,21 +330,23 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { * 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); $formticket = new FormTicket($db); -if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) { +if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) +{ print '
' . $langs->trans('TicketPublicInterfaceForbidden') . '
'; $db->close(); exit(); } -print '
'; +$arrayofjs = array(); +$arrayofcss = array('/opensurvey/css/style.css', '/ticket/css/styles.css.php'); + +llxHeaderTicket($langs->trans("CreateTicket"), "", 0, 0, $arrayofjs, $arrayofcss); + + +print '
'; if ($action != "infos_success") { $formticket->withfromsocid = isset($socid) ? $socid : $user->societe_id; @@ -361,11 +369,8 @@ if ($action != "infos_success") { print '
' . $langs->trans('TicketPublicInfoCreateTicket') . '
'; $formticket->showForm(); -} else { - print '
' . $langs->trans('MesgInfosPublicTicketCreatedWithTrackId', '' . $object->track_id . ''); - print '
'; - print $langs->trans('PleaseRememberThisId'); } + print '
'; // End of page diff --git a/htdocs/public/ticket/index.php b/htdocs/public/ticket/index.php index a3e4d63a4bc..2e138312102 100644 --- a/htdocs/public/ticket/index.php +++ b/htdocs/public/ticket/index.php @@ -55,18 +55,18 @@ $action = GETPOST('action', 'alpha'); $form = new Form($db); $formticket = new FormTicket($db); -$arrayofjs = array(); -$arrayofcss = array('/ticket/css/styles.css.php'); - if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { print $langs->trans('TicketPublicInterfaceForbidden'); exit; } +$arrayofjs = array(); +$arrayofcss = array('/ticket/css/styles.css.php'); + llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss); -print '
'; +print '
'; print '

' . ($conf->global->TICKET_PUBLIC_TEXT_HOME ? $conf->global->TICKET_PUBLIC_TEXT_HOME : $langs->trans("TicketPublicDesc")) . '

'; print '
'; print '
' . dol_escape_htmltag($langs->trans("CreateTicket")) . '
'; diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index 443af658cb5..9da0a4272e1 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -155,21 +155,23 @@ $user_assign = new User($db); $user_create = new User($db); $formTicket = new FormTicket($db); +if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) { + print '
' . $langs->trans('TicketPublicInterfaceForbidden') . '
'; + $db->close(); + exit(); +} + $arrayofjs = array(); $arrayofcss = array('/ticket/css/styles.css.php'); llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss); -if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) { - print '
' . $langs->trans('TicketPublicInterfaceForbidden') . '
'; - $db->close(); - exit(); -} -print '
'; +print '
'; if ($action == "view_ticketlist") { + print '
'; if ($display_ticket_list) { // Filters $search_fk_status = GETPOST("search_fk_status", 'alpha'); @@ -676,6 +678,7 @@ if ($action == "view_ticketlist") } } else { print '

' . $langs->trans("TicketPublicMsgViewLogIn") . '

'; + print '
'; print '
'; print '
'; diff --git a/htdocs/public/ticket/view.php b/htdocs/public/ticket/view.php index a0311ce1430..4886a0cc3be 100644 --- a/htdocs/public/ticket/view.php +++ b/htdocs/public/ticket/view.php @@ -133,18 +133,18 @@ if ($action == "view_ticket" || $action == "add_message" || $action == "close" | $form = new Form($db); $formticket = new FormTicket($db); +if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) { + print '
' . $langs->trans('TicketPublicInterfaceForbidden') . '
'; + $db->close(); + exit(); +} + $arrayofjs = array(); $arrayofcss = array('/ticket/css/styles.css.php'); llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss); -if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) { - print '
' . $langs->trans('TicketPublicInterfaceForbidden') . '
'; - $db->close(); - exit(); -} - -print '
'; +print '
'; if ($action == "view_ticket" || $action == "add_message" || $action == "close" || $action == "confirm_public_close") { if ($display_ticket) { diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 6f4fd4fa660..44c66a979d5 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -5248,6 +5248,9 @@ div.tabsElem a.tab { /* Ticket module */ /* ============================================================================== */ +.publicnewticketform { + margin-top: 25px !important; +} #cd-timeline { position: relative; padding: 2em 0; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 332b4964a94..c15bbf26eef 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1936,7 +1936,6 @@ a.tmenuimage:focus { } - /* Login */ .bodylogin @@ -5388,7 +5387,6 @@ border-top-right-radius: 6px; } - /* ============================================================================== */ /* 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 */ /* ============================================================================== */ +.publicnewticketform { + margin-top: 25px !important; +} + #cd-timeline { position: relative; 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; +}​ + + + global->MAIN_DISABLE_FONT_AWESOME_5)) { ?>