diff --git a/htdocs/public/ticketsup/create_ticket.php b/htdocs/public/ticketsup/create_ticket.php index 867658b48ac..bc5fc584219 100644 --- a/htdocs/public/ticketsup/create_ticket.php +++ b/htdocs/public/ticketsup/create_ticket.php @@ -45,30 +45,12 @@ if (!defined('NOREQUIREHTML')) { define("NOLOGIN", 1); // This means this output page does not require to be logged. define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. -// Change this following line to use the correct relative path (../, ../../, etc) -$res = 0; -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} - -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} - -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} - -if (!$res) { - die("Include of main fails"); -} - -dol_include_once('/ticketsup/class/ticketsup.class.php'); -dol_include_once('/ticketsup/class/html.formticketsup.class.php'); -dol_include_once('/ticketsup/lib/ticketsup.lib.php'); - -require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; -require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/ticketsup/class/actions_ticketsup.class.php'; +require_once DOL_DOCUMENT_ROOT.'/ticketsup/class/html.formticketsup.class.php'; +require_once DOL_DOCUMENT_ROOT.'/ticketsup/lib/ticketsup.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; // Load traductions files requiredby by page $langs->load("companies"); diff --git a/htdocs/public/ticketsup/index.php b/htdocs/public/ticketsup/index.php index ed141b32922..f913ce9c70d 100644 --- a/htdocs/public/ticketsup/index.php +++ b/htdocs/public/ticketsup/index.php @@ -42,30 +42,11 @@ if (!defined("NOLOGIN")) { } // If this page is public (can be called outside logged session) -// Change this following line to use the correct relative path (../, ../../, etc) -$res = 0; -if (!$res && file_exists("../main.inc.php")) { - $res = @include '../main.inc.php'; -} - -if (!$res && file_exists("../../main.inc.php")) { - $res = @include '../../main.inc.php'; -} - -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include '../../../main.inc.php'; -} - -if (!$res) { - die("Include of main fails"); -} - -require_once DOL_DOCUMENT_ROOT . '/core/lib/security.lib.php'; - -// Change this following line to use the correct relative path from htdocs -dol_include_once('/ticketsup/class/ticketsup.class.php'); -dol_include_once('/ticketsup/class/html.formticketsup.class.php'); -dol_include_once('/ticketsup/lib/ticketsup.lib.php'); +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/ticketsup/class/actions_ticketsup.class.php'; +require_once DOL_DOCUMENT_ROOT.'/ticketsup/class/html.formticketsup.class.php'; +require_once DOL_DOCUMENT_ROOT.'/ticketsup/lib/ticketsup.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php'; // Load traductions files requiredby by page $langs->load("companies"); diff --git a/htdocs/public/ticketsup/view.php b/htdocs/public/ticketsup/view.php index 036d1d17b86..68e18e67d14 100644 --- a/htdocs/public/ticketsup/view.php +++ b/htdocs/public/ticketsup/view.php @@ -17,8 +17,8 @@ /** * \file ticketsup/public/index.php - * \ingroup ticketsup - * \brief Public file to add and manage ticket + * \ingroup ticketsup + * \brief Public file to add and manage ticket */ if (!defined('NOCSRFCHECK')) { @@ -34,28 +34,10 @@ if (!defined("NOLOGIN")) { } // If this page is public (can be called outside logged session) -// Change this following line to use the correct relative path (../, ../../, etc) -$res = 0; -if (!$res && file_exists("../main.inc.php")) { - $res = @include '../main.inc.php'; -} - -if (!$res && file_exists("../../main.inc.php")) { - $res = @include '../../main.inc.php'; -} - -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include '../../../main.inc.php'; -} - -if (!$res) { - die("Include of main fails"); -} - -// Change this following line to use the correct relative path from htdocs -dol_include_once('/ticketsup/class/actions_ticketsup.class.php'); -dol_include_once('/ticketsup/class/html.formticketsup.class.php'); -dol_include_once('/ticketsup/lib/ticketsup.lib.php'); +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/ticketsup/class/actions_ticketsup.class.php'; +require_once DOL_DOCUMENT_ROOT.'/ticketsup/class/html.formticketsup.class.php'; +require_once DOL_DOCUMENT_ROOT.'/ticketsup/lib/ticketsup.lib.php'; // Load traductions files requiredby by page $langs->load("companies"); @@ -300,13 +282,13 @@ if ($action == "view_ticket" || $action == "add_message" || $action == "close" | print load_fiche_titre($langs->trans('TicketMessagesList'), '', 'messages@ticketsup'); $object->viewTicketMessages(false); - print '
'; + print '
'; // Logs list print load_fiche_titre($langs->trans('TicketHistory'), '', 'history@ticketsup'); $object->viewTicketLogs(false); } else { - print '
Not Allowed
' . $langs->trans('Back') . '
'; + print '
Not Allowed
' . $langs->trans('Back') . '
'; } } else { print '

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

';