diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php
index 8cb1e85afe4..31e2d8f219a 100644
--- a/htdocs/admin/ticket.php
+++ b/htdocs/admin/ticket.php
@@ -42,6 +42,12 @@ $label = GETPOST('label', 'alpha');
$scandir = GETPOST('scandir', 'alpha');
$type = 'ticket';
+$error = 0;
+
+/*
+ * Actions
+ */
+
if ($action == 'updateMask') {
$maskconstticket = GETPOST('maskconstticket', 'alpha');
$maskticket = GETPOST('maskticket', 'alpha');
@@ -91,7 +97,7 @@ if ($action == 'updateMask') {
$error++;
}
- $mail_intro = GETPOST('TICKET_MESSAGE_MAIL_INTRO', 'alpha');
+ $mail_intro = GETPOST('TICKET_MESSAGE_MAIL_INTRO', 'restricthtml');
if (!empty($mail_intro)) {
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_INTRO', $mail_intro, 'chaine', 0, '', $conf->entity);
} else {
@@ -101,7 +107,7 @@ if ($action == 'updateMask') {
$error++;
}
- $mail_signature = GETPOST('TICKET_MESSAGE_MAIL_SIGNATURE', 'alpha');
+ $mail_signature = GETPOST('TICKET_MESSAGE_MAIL_SIGNATURE', 'restricthtml');
if (!empty($mail_signature)) {
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_SIGNATURE', $mail_signature, 'chaine', 0, '', $conf->entity);
} else {
@@ -110,16 +116,6 @@ if ($action == 'updateMask') {
if (!$res > 0) {
$error++;
}
-
- $text_help = GETPOST('TICKET_PUBLIC_TEXT_HELP_MESSAGE', 'alpha');
- if (!empty($text_help)) {
- $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $text_help, 'chaine', 0, '', $conf->entity);
- } else {
- $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'), 'chaine', 0, '', $conf->entity);
- }
- if (!$res > 0) {
- $error++;
- }
}
if ($action == 'setvarother') {
diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php
index 4e6b6d75e85..ec36d3f873d 100644
--- a/htdocs/admin/ticket_public.php
+++ b/htdocs/admin/ticket_public.php
@@ -42,6 +42,12 @@ $label = GETPOST('label', 'alpha');
$scandir = GETPOST('scandir', 'alpha');
$type = 'ticket';
+$error = 0;
+
+/*
+ * Actions
+ */
+
if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE')
{
if (GETPOST('value')) dolibarr_set_const($db, 'TICKET_ENABLE_PUBLIC_INTERFACE', 1, 'chaine', 0, '', $conf->entity);
@@ -51,95 +57,54 @@ if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE')
if ($action == 'setvar') {
include_once DOL_DOCUMENT_ROOT . "/core/lib/files.lib.php";
- $notification_email = GETPOST('TICKET_NOTIFICATION_EMAIL_FROM', 'alpha');
- if (!empty($notification_email)) {
- $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_FROM', $notification_email, 'chaine', 0, '', $conf->entity);
+ $topic_interface = GETPOST('TICKET_PUBLIC_INTERFACE_TOPIC', 'nohtml');
+ if (!empty($topic_interface)) {
+ $res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', $topic_interface, 'chaine', 0, '', $conf->entity);
} else {
- $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_FROM', '', 'chaine', 0, '', $conf->entity);
+ $res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', '', 'chaine', 0, '', $conf->entity);
}
if (!$res > 0) {
- $error++;
+ $error++;
}
- // altairis : differentiate notification email FROM and TO
- $notification_email_to = GETPOST('TICKET_NOTIFICATION_EMAIL_TO', 'alpha');
- if (!empty($notification_email_to)) {
- $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_TO', $notification_email_to, 'chaine', 0, '', $conf->entity);
+ $text_home = GETPOST('TICKET_PUBLIC_TEXT_HOME', 'restricthtml');
+ if (!empty($text_home)) {
+ $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $text_home, 'chaine', 0, '', $conf->entity);
} else {
- $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_TO', '', 'chaine', 0, '', $conf->entity);
+ $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $langs->trans('TicketPublicInterfaceTextHome'), 'chaine', 0, '', $conf->entity);
}
if (!$res > 0) {
- $error++;
+ $error++;
}
- $mail_new_ticket = GETPOST('TICKET_MESSAGE_MAIL_NEW', 'alpha');
+ $text_help = GETPOST('TICKET_PUBLIC_TEXT_HELP_MESSAGE', 'restricthtml');
+ if (!empty($text_help)) {
+ $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $text_help, 'chaine', 0, '', $conf->entity);
+ } else {
+ $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'), 'chaine', 0, '', $conf->entity);
+ }
+ if (!$res > 0) {
+ $error++;
+ }
+
+ $mail_new_ticket = GETPOST('TICKET_MESSAGE_MAIL_NEW', 'restricthtml');
if (!empty($mail_new_ticket)) {
- $res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_NEW', $mail_new_ticket, 'chaine', 0, '', $conf->entity);
+ $res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_NEW', $mail_new_ticket, 'chaine', 0, '', $conf->entity);
} else {
- $res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_NEW', $langs->trans('TicketMessageMailNewText'), 'chaine', 0, '', $conf->entity);
+ $res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_NEW', $langs->trans('TicketMessageMailNewText'), 'chaine', 0, '', $conf->entity);
}
if (!$res > 0) {
- $error++;
- }
-
- $mail_intro = GETPOST('TICKET_MESSAGE_MAIL_INTRO', 'alpha');
- if (!empty($mail_intro)) {
- $res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_INTRO', $mail_intro, 'chaine', 0, '', $conf->entity);
- } else {
- $res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_INTRO', $langs->trans('TicketMessageMailIntroText'), 'chaine', 0, '', $conf->entity);
- }
- if (!$res > 0) {
- $error++;
- }
-
- $mail_signature = GETPOST('TICKET_MESSAGE_MAIL_SIGNATURE', 'alpha');
- if (!empty($mail_signature)) {
- $res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_SIGNATURE', $mail_signature, 'chaine', 0, '', $conf->entity);
- } else {
- $res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_SIGNATURE', $langs->trans('TicketMessageMailSignatureText'), 'chaine', 0, '', $conf->entity);
- }
- if (!$res > 0) {
- $error++;
+ $error++;
}
$url_interface = GETPOST('TICKET_URL_PUBLIC_INTERFACE', 'alpha');
if (!empty($url_interface)) {
- $res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', $url_interface, 'chaine', 0, '', $conf->entity);
+ $res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', $url_interface, 'chaine', 0, '', $conf->entity);
} else {
- $res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', '', 'chaine', 0, '', $conf->entity);
+ $res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', '', 'chaine', 0, '', $conf->entity);
}
if (!$res > 0) {
- $error++;
- }
-
- $topic_interface = GETPOST('TICKET_PUBLIC_INTERFACE_TOPIC', 'alpha');
- if (!empty($topic_interface)) {
- $res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', $topic_interface, 'chaine', 0, '', $conf->entity);
- } else {
- $res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', '', 'chaine', 0, '', $conf->entity);
- }
- if (!$res > 0) {
- $error++;
- }
-
- $text_home = GETPOST('TICKET_PUBLIC_TEXT_HOME', 'alpha');
- if (!empty($text_home)) {
- $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $text_home, 'chaine', 0, '', $conf->entity);
- } else {
- $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $langs->trans('TicketPublicInterfaceTextHome'), 'chaine', 0, '', $conf->entity);
- }
- if (!$res > 0) {
- $error++;
- }
-
- $text_help = GETPOST('TICKET_PUBLIC_TEXT_HELP_MESSAGE', 'alpha');
- if (!empty($text_help)) {
- $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $text_help, 'chaine', 0, '', $conf->entity);
- } else {
- $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'), 'chaine', 0, '', $conf->entity);
- }
- if (!$res > 0) {
- $error++;
+ $error++;
}
}
@@ -162,14 +127,11 @@ if ($action == 'setvarother') {
$error++;
}
- if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
- {
- $param_show_module_logo = GETPOST('TICKET_SHOW_MODULE_LOGO', 'alpha');
- $res = dolibarr_set_const($db, 'TICKET_SHOW_MODULE_LOGO', $param_show_module_logo, 'chaine', 0, '', $conf->entity);
- if (!$res > 0) {
- $error++;
- }
- }
+ $param_show_module_logo = GETPOST('TICKET_SHOW_COMPANY_LOGO', 'alpha');
+ $res = dolibarr_set_const($db, 'TICKET_SHOW_COMPANY_LOGO', $param_show_module_logo, 'chaine', 0, '', $conf->entity);
+ if (!$res > 0) {
+ $error++;
+ }
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
{
@@ -179,12 +141,6 @@ if ($action == 'setvarother') {
$error++;
}
}
-
- $param_limit_view = GETPOST('TICKET_LIMIT_VIEW_ASSIGNED_ONLY', 'alpha');
- $res = dolibarr_set_const($db, 'TICKET_LIMIT_VIEW_ASSIGNED_ONLY', $param_limit_view, 'chaine', 0, '', $conf->entity);
- if (!$res > 0) {
- $error++;
- }
}
@@ -238,8 +194,7 @@ print '
';
if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
{
-
- if (!$conf->use_javascript_ajax) {
+ if (empty($conf->use_javascript_ajax)) {
print '