From 29853b5fbd4b5b396c3203060de0a68149405ed4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Jan 2020 14:01:35 +0100 Subject: [PATCH] Fix responsive for public interface of tickets --- htdocs/core/lib/ticket.lib.php | 37 ++++++++++++++++++++------ htdocs/public/ticket/create_ticket.php | 2 ++ htdocs/public/ticket/index.php | 1 + htdocs/theme/eldy/global.inc.php | 5 ++-- htdocs/theme/md/style.css.php | 3 ++- htdocs/ticket/css/styles.css.php | 8 ++++-- 6 files changed, 43 insertions(+), 13 deletions(-) diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index fd2d56c946b..b7c741bd839 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -216,8 +216,9 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $ print ''; + // Define urllogo + $width = 0; if (! empty($conf->global->TICKET_SHOW_COMPANY_LOGO) || ! empty($conf->global->TICKET_PUBLIC_INTERFACE_TOPIC)) { - print '
'; // Print logo if (! empty($conf->global->TICKET_SHOW_COMPANY_LOGO)) { @@ -225,21 +226,41 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $ if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output . '/logos/thumbs/' . $mysoc->logo_small)) { $urllogo = DOL_URL_ROOT . '/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file=' . urlencode('logos/thumbs/'.$mysoc->logo_small); + $width = 150; } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output . '/logos/' . $mysoc->logo)) { $urllogo = DOL_URL_ROOT . '/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file=' . urlencode('logos/'.$mysoc->logo); - $width = 128; + $width = 150; } elseif (is_readable(DOL_DOCUMENT_ROOT . '/theme/dolibarr_logo.png')) { $urllogo = DOL_URL_ROOT . '/theme/dolibarr_logo.png'; } - print 'Logo
'; } - if (! empty($conf->global->TICKET_PUBLIC_INTERFACE_TOPIC)) - { - print '' . ($conf->global->TICKET_PUBLIC_INTERFACE_TOPIC ? $conf->global->TICKET_PUBLIC_INTERFACE_TOPIC : $langs->trans("TicketSystem")) . ''; - } - print '

'; } + print '
'; + // Output html code for logo + if ($urllogo || ! empty($conf->global->TICKET_PUBLIC_INTERFACE_TOPIC)) + { + print '
'; + print '
'; + if ($urllogo) { + print ''; + print ''; + print ''; + } + if (! empty($conf->global->TICKET_PUBLIC_INTERFACE_TOPIC)) { + print '
' . ($conf->global->TICKET_PUBLIC_INTERFACE_TOPIC ? $conf->global->TICKET_PUBLIC_INTERFACE_TOPIC : $langs->trans("TicketSystem")) . ''; + } + print '
'; + if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { + print ''; + } + print '
'; + } + + print '
'; + print '
'; } diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index c4a3b71e6ad..b3e94d5ceb2 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -28,6 +28,7 @@ if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); if (!defined('NOLOGIN')) define("NOLOGIN", 1); // This means this output page does not require to be logged. if (!defined('NOCSRFCHECK')) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. +if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/ticket/class/actions_ticket.class.php'; @@ -53,6 +54,7 @@ $extrafields = new ExtraFields($db); $extrafields->fetch_name_optionals_label($object->table_element); + /* * Actions */ diff --git a/htdocs/public/ticket/index.php b/htdocs/public/ticket/index.php index 031ef2793b5..bbe831c1a84 100644 --- a/htdocs/public/ticket/index.php +++ b/htdocs/public/ticket/index.php @@ -25,6 +25,7 @@ if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); if (!defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session) +if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip // For MultiCompany module. // Do not use GETPOST here, function is not defined and define must be done before including main.inc.php diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 0f96bb15d62..fe42bcfc995 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -5501,11 +5501,12 @@ div.tabsElem a.tab { width: 70%; } .publicnewticketform { - margin-top: 25px !important; + /* margin-top: 25px !important; */ } .ticketlargemargin { padding-left: 50px; padding-right: 50px; + padding-top: 10px; } @media only screen and (max-width: 767px) { @@ -5513,7 +5514,7 @@ div.tabsElem a.tab { padding-left: 5px; padding-right: 5px; } .ticketpublicarea { - width: 100%; + width: 100% !important; } } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 0806cb47d1e..fe23020991f 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -5649,11 +5649,12 @@ border-top-right-radius: 6px; width: 70%; } .publicnewticketform { - margin-top: 25px !important; + /* margin-top: 25px !important; */ } .ticketlargemargin { padding-left: 50px; padding-right: 50px; + padding-top: 10px; } @media only screen and (max-width: 767px) { diff --git a/htdocs/ticket/css/styles.css.php b/htdocs/ticket/css/styles.css.php index 15eadf8ffb8..914a3dba119 100644 --- a/htdocs/ticket/css/styles.css.php +++ b/htdocs/ticket/css/styles.css.php @@ -146,5 +146,9 @@ div.ticketform .blue:hover { background-color: #f8f8f8; } -#form_create_ticket input.text, -#form_create_ticket textarea { width:450px;} +#form_create_ticket input.text, #form_create_ticket textarea { width:450px;} + +@media only screen and (max-width: 767px) +{ + #form_create_ticket input.text, #form_create_ticket textarea { width: unset;} +}