diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php index a640370dc7b..35bd0b35f8b 100644 --- a/htdocs/admin/ticket_public.php +++ b/htdocs/admin/ticket_public.php @@ -153,7 +153,7 @@ if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE') { } // For compatibility when javascript is not enabled - if ($conf->global->MAIN_FEATURES_LEVEL >= 2 && empty($conf->use_javascript_ajax)) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2 && empty($conf->use_javascript_ajax)) { $param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha'); $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity); if (!($res > 0)) { @@ -164,7 +164,7 @@ if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE') { } elseif (preg_match('/set_(.*)/', $action, $reg)) { $code = $reg[1]; $value = GETPOSTISSET($code) ? GETPOST($code, 'int') : 1; - if ($code == 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS' && $conf->global->MAIN_FEATURES_LEVEL >= 2) { + if ($code == 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS' && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { $param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha'); $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity); if (!($res > 0)) { @@ -240,7 +240,7 @@ $param = ''; print '
'; $enabledisablehtml = $langs->trans("TicketsActivatePublicInterface").' '; -if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { +if (!getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE')) { // Button off, click to enable $enabledisablehtml .= ''; $enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off'); @@ -252,13 +252,13 @@ if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { $enabledisablehtml .= ''; } print $enabledisablehtml; -print ''; +print ''; print dol_get_fiche_end(); -if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { +if (getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE')) { print '
'; @@ -299,7 +299,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA_TICKET'); } else { - if (empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA_TICKET)) { + if (!getDolGlobalInt('MAIN_SECURITY_ENABLECAPTCHA_TICKET')) { print ''.img_picto($langs->trans("Disabled"), 'off').''; } else { print ''.img_picto($langs->trans("Enabled"), 'on').''; @@ -346,7 +346,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { print ''; */ - /*if ($conf->global->MAIN_FEATURES_LEVEL >= 2) + /*if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { // Show logo for module print '' . $langs->trans("TicketsShowModuleLogo") . ''; @@ -355,7 +355,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { print ajax_constantonoff('TICKET_SHOW_MODULE_LOGO'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("TICKET_SHOW_MODULE_LOGO", $arrval, $conf->global->TICKET_SHOW_MODULE_LOGO); + print $form->selectarray("TICKET_SHOW_MODULE_LOGO", $arrval, getDolGlobalInt('TICKET_SHOW_MODULE_LOGO')); } print ''; print ''; @@ -367,11 +367,11 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { // Show logo for company print ''.$langs->trans("TicketsShowCompanyLogo").''; print ''; - if ($conf->use_javascript_ajax) { + if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('TICKET_SHOW_COMPANY_LOGO'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("TICKET_SHOW_COMPANY_LOGO", $arrval, $conf->global->TICKET_SHOW_COMPANY_LOGO); + print $form->selectarray("TICKET_SHOW_COMPANY_LOGO", $arrval, getDolGlobalInt('TICKET_SHOW_COMPANY_LOGO')); } print ''; print ''; @@ -382,10 +382,14 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { // Show progression print ''.$langs->trans("TicketsShowProgression").''; print ''; - if (!getDolGlobalInt('TICKET_SHOW_PROGRESSION')) { - print '' . img_picto($langs->trans('Disabled'), 'switch_off') . ''; + if (!empty($conf->use_javascript_ajax)) { + print ajax_constantonoff('TICKET_SHOW_PROGRESSION'); } else { - print '' . img_picto($langs->trans('Enabled'), 'switch_on') . ''; + if (!getDolGlobalInt('TICKET_SHOW_PROGRESSION')) { + print '' . img_picto($langs->trans('Disabled'), 'switch_off') . ''; + } else { + print '' . img_picto($langs->trans('Enabled'), 'switch_on') . ''; + } } print ''; print ''; @@ -394,14 +398,14 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { print ''; // Also send to main email address - if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { print ''.$langs->trans("TicketsEmailAlsoSendToMainAddress").''; print ''; - if ($conf->use_javascript_ajax) { + if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS", $arrval, $conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS); + print $form->selectarray("TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS", $arrval, getDolGlobalInt('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS')); } print ''; print ''; @@ -410,12 +414,12 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { print ''; } - if (!$conf->use_javascript_ajax) { + if (empty($conf->use_javascript_ajax)) { print ''; print ''; } - if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) { + if (!getDolGlobalInt('FCKEDITOR_ENABLE_MAIL')) { print ''; print '
'.$langs->trans("TicketCkEditorEmailNotActivated").'
'; print "\n"; @@ -483,7 +487,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { print ajax_constantonoff('TICKET_DISABLE_CUSTOMER_MAILS'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("TICKET_DISABLE_CUSTOMER_MAILS", $arrval, $conf->global->TICKET_DISABLE_CUSTOMER_MAILS); + print $form->selectarray("TICKET_DISABLE_CUSTOMER_MAILS", $arrval, getDolGlobalInt('TICKET_DISABLE_CUSTOMER_MAILS')); } print ''; print ''; diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index fcc7b12b1d2..2e0fb66127e 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -60,7 +60,7 @@ if ($reshook < 0) { //var_dump($extrafields->attributes[$object->table_element]); -if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label'])) { +if (empty($reshook) && !empty($object->table_element) && isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label'])) { $lastseparatorkeyfound = ''; $extrafields_collapse_num = ''; $extrafields_collapse_num_old = ''; diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index e399df59197..cc0a02dd294 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -28,6 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; /**