diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 0a812f5d6e2..224d321a0cf 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1571,7 +1571,6 @@ if ($id > 0) { unset($fieldlist[2]); // Remove field ??? if dictionary Regions } - if (empty($reshook)) { fieldList($fieldlist, $obj, $tabname[$id], 'add'); } @@ -2531,7 +2530,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') $classtd = 'right'; $class = 'maxwidth50 right'; } if (in_array($fieldlist[$field], array('pos', 'position'))) { - $classtd = 'center'; $class = 'maxwidth50 center'; + $classtd = 'right'; $class = 'maxwidth50 right'; } if (in_array($fieldlist[$field], array('dayrule', 'day', 'month', 'year', 'use_default', 'affect', 'delay', 'public', 'sortorder', 'sens', 'category_type', 'fk_parent'))) { $class = 'maxwidth50 center'; diff --git a/htdocs/core/ajax/fetchKnowledgeRecord.php b/htdocs/core/ajax/fetchKnowledgeRecord.php index 1816217cdef..61ed0f6f98e 100644 --- a/htdocs/core/ajax/fetchKnowledgeRecord.php +++ b/htdocs/core/ajax/fetchKnowledgeRecord.php @@ -36,8 +36,10 @@ if (!defined('NOREQUIREMENU')) { define('NOREQUIREMENU', '1'); } // If there is no need to load and show top and left menu -if (!defined("NOLOGIN")) { - define("NOLOGIN", '1'); +if (!empty($_GET['public'])) { + if (!defined("NOLOGIN")) { + define("NOLOGIN", '1'); + } } if (!defined('NOIPCHECK')) { define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip @@ -52,6 +54,7 @@ $idticketgroup = GETPOST('idticketgroup', 'aZ09'); $idticketgroup = GETPOST('idticketgroup', 'aZ09'); $lang = GETPOST('lang', 'aZ09'); + /* * Actions */ @@ -71,8 +74,13 @@ if ($action == "getKnowledgeRecord") { $sql .= " FROM ".MAIN_DB_PREFIX."knowledgemanagement_knowledgerecord as kr "; $sql .= " JOIN ".MAIN_DB_PREFIX."c_ticket_category as ctc ON ctc.rowid = kr.fk_c_ticket_category"; $sql .= " WHERE ctc.code = '".$db->escape($idticketgroup)."'"; - $sql .= " AND ctc.active = 1 AND ctc.public = 1 AND (kr.lang = '".$db->escape($lang)."' OR kr.lang = 0 OR kr.lang IS NULL)"; + $sql .= " AND ctc.active = 1"; + if (defined("NOLOGIN")) { + $sql .= " AND ctc.public = 1"; + } + $sql .= " AND (kr.lang = '".$db->escape($lang)."' OR kr.lang = 0 OR kr.lang IS NULL)"; $sql .= " AND kr.status = 1 AND (kr.answer IS NOT NULL AND kr.answer <> '')"; + $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index fd83d4fbd45..4f3ae4bc5e6 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -340,26 +340,9 @@ class FormTicket $this->selectSeveritiesTickets((GETPOST('severity_code') ? GETPOST('severity_code') : $this->severity_code), 'severity_code', '', 2, 1); print ''; - // Subject - if ($this->withtitletopic) { - print ''; - // Answer to a ticket : display of the thread title in readonly - if ($this->withtopicreadonly) { - print $langs->trans('SubjectAnswerToTicket').' '.$this->topic_title; - } else { - if (isset($this->withreadid) && $this->withreadid > 0) { - $subject = $langs->trans('SubjectAnswerToTicket').' '.$this->withreadid.' : '.$this->topic_title.''; - } else { - $subject = GETPOST('subject', 'alpha'); - } - print ''; - } - print ''; - } - if (!empty($conf->knowledgemanagement->enabled)) { // KM Articles - print ''; + print ''; print ' '."\n"; } + // Subject + if ($this->withtitletopic) { + print ''; + // Answer to a ticket : display of the thread title in readonly + if ($this->withtopicreadonly) { + print $langs->trans('SubjectAnswerToTicket').' '.$this->topic_title; + } else { + if (isset($this->withreadid) && $this->withreadid > 0) { + $subject = $langs->trans('SubjectAnswerToTicket').' '.$this->withreadid.' : '.$this->topic_title.''; + } else { + $subject = GETPOST('subject', 'alpha'); + } + print 'withemail)?' autofocus':'').' />'; + } + print ''; + } + // MESSAGE $msg = GETPOSTISSET('message') ? GETPOST('message', 'restricthtml') : ''; print ''; @@ -846,6 +851,8 @@ class FormTicket print ' selected="selected"'; } elseif ($arraycategories['use_default'] == "1" && !$selected && !$empty) { print ' selected="selected"'; + } elseif (count($ticketstat->cache_category_tickets) == 1) { + print ' selected="selected"'; } print '>'; diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index 089629234d6..99b8210644c 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -274,7 +274,7 @@ class InterfaceTicketEmail extends DolibarrTriggers $message_admin = $langs->transnoentities($body, $object->track_id).'
'; $message_admin .= '