diff --git a/htdocs/admin/ticketsup.php b/htdocs/admin/ticketsup.php index 4f6839d1e59..7a3ddf7826b 100644 --- a/htdocs/admin/ticketsup.php +++ b/htdocs/admin/ticketsup.php @@ -23,7 +23,7 @@ */ require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; require_once DOL_DOCUMENT_ROOT."/ticketsup/class/ticketsup.class.php"; require_once DOL_DOCUMENT_ROOT."/core/lib/ticketsup.lib.php"; @@ -172,12 +172,6 @@ if ($action == 'setvarother') { $error++; } - $param_extrafields_public = GETPOST('TICKETS_EXTRAFIELDS_PUBLIC', 'alpha'); - $res = dolibarr_set_const($db, 'TICKETS_EXTRAFIELDS_PUBLIC', $param_extrafields_public, 'chaine', 0, '', $conf->entity); - if (!$res > 0) { - $error++; - } - $param_disable_email = GETPOST('TICKETS_DISABLE_ALL_MAILS', 'alpha'); $res = dolibarr_set_const($db, 'TICKETS_DISABLE_ALL_MAILS', $param_disable_email, 'chaine', 0, '', $conf->entity); if (!$res > 0) { @@ -241,7 +235,7 @@ dol_fiche_head($head, 'settings', $langs->trans("Module56000Name"), -1, "tickets print $langs->trans("TicketsupSetupDictionaries") . ' : ' . dol_buildpath('/admin/dict.php', 2) . '
'; -print $langs->trans("TicketsupPublicAccess") . ' : ' . dol_buildpath('/ticketsup/public/index.php', 2) . ''; +print $langs->trans("TicketsupPublicAccess") . ' : ' . dol_buildpath('/public/ticketsup/index.php', 2) . ''; dol_fiche_end(); @@ -416,21 +410,6 @@ print $form->textwithpicto('', $langs->trans("TicketsShowCompanyLogoHelp"), 1, ' print ''; print ''; -// Display extrafields into public interface -print '' . $langs->trans("TicketsShowExtrafieldsIntoPublicArea") . ''; -print ''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('TICKETS_EXTRAFIELDS_PUBLIC'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("TICKETS_EXTRAFIELDS_PUBLIC", $arrval, $conf->global->TICKETS_EXTRAFIELDS_PUBLIC); -} -print ''; -print ''; -print $form->textwithpicto('', $langs->trans("TicketsShowExtrafieldsIntoPublicAreaHelp"), 1, 'help'); -print ''; -print ''; - print '
'; print_titre($langs->trans("TicketParams")); diff --git a/htdocs/core/class/html.formticketsup.class.php b/htdocs/core/class/html.formticketsup.class.php index b86ebc95442..545a6e210b4 100644 --- a/htdocs/core/class/html.formticketsup.class.php +++ b/htdocs/core/class/html.formticketsup.class.php @@ -140,7 +140,7 @@ class FormTicketsup print "\n\n"; - print '
'; + print ''; print ''; print ''; foreach ($this->param as $key => $value) { @@ -148,8 +148,8 @@ class FormTicketsup } print ''; - print '
'; - print ''; + print '
'; + print '
'; if ($this->withref) { @@ -385,11 +385,10 @@ class FormTicketsup } // Other attributes - if ($this->withextrafields == 1) { - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $ticketstat, $action); // Note that $action and $object may have been modified by hook - if (empty($reshook) && !empty($extrafields->attribute_label)) { - print $ticketstat->showOptionals($extrafields, 'edit'); - } + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $ticketstat, $action); // Note that $action and $object may have been modified by hook + if (empty($reshook) && is_array($extrafields->attributes[$ticketstat->table_element]['label'])) + { + print $ticketstat->showOptionals($extrafields, 'edit'); } print '
'; diff --git a/htdocs/core/triggers/interface_50_modTicketsup_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicketsup_TicketEmail.class.php index b1dd9fb282a..96be9ba9c74 100644 --- a/htdocs/core/triggers/interface_50_modTicketsup_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicketsup_TicketEmail.class.php @@ -236,14 +236,29 @@ class InterfaceTicketEmail extends DolibarrTriggers $message_customer.='
  • '.$langs->trans('Type').' : '.$object->type_label.'
  • '; $message_customer.='
  • '.$langs->trans('Category').' : '.$object->category_label.'
  • '; $message_customer.='
  • '.$langs->trans('Severity').' : '.$object->severity_label.'
  • '; + // Extrafields - if ($conf->global->TICKETS_EXTRAFIELDS_PUBLIC) { - if (is_array($object->array_options) && count($object->array_options) > 0) { - foreach ($object->array_options as $key => $value) { - $message_customer.='
  • '.$langs->trans($key).' : '.$value.'
  • '; - } - } + foreach ($this->attributes[$object->table_element]['label'] as $key => $value) + { + $enabled = 1; + if ($enabled && isset($this->attributes[$object->table_element]['list'][$key])) + { + $enabled = dol_eval($this->attributes[$object->table_element]['list'][$key], 1); + } + $perms = 1; + if ($perms && isset($this->attributes[$object->table_element]['perms'][$key])) + { + $perms = dol_eval($this->attributes[$object->table_element]['perms'][$key], 1); + } + + $qualified = true; + if (empty($enabled)) $qualified = false; + if (empty($perms)) $qualified = false; + + if ($qualified) $message_customer.='
  • '.$langs->trans($key).' : '.$value.'
  • '; } + + $message_customer.=''; $message_customer.='

    '.$langs->trans('Message').' :
    '.$object->message.'

    '; $url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE?$conf->global->TICKETS_URL_PUBLIC_INTERFACE.'/':dol_buildpath('/ticketsup/public/view.php', 2)).'?track_id='.$object->track_id; diff --git a/htdocs/langs/en_US/ticketsup.lang b/htdocs/langs/en_US/ticketsup.lang index d46a6be5dbd..3ce1b9c44ce 100644 --- a/htdocs/langs/en_US/ticketsup.lang +++ b/htdocs/langs/en_US/ticketsup.lang @@ -115,8 +115,6 @@ TicketsShowCompanyLogo=Display the logo of the company in the public interface TicketsShowCompanyLogoHelp=Enable this option to hide the logo of the main company in the pages of the public interface TicketsEmailAlsoSendToMainAddress=Also send notification to main email address TicketsEmailAlsoSendToMainAddressHelp=Enable this option to send an email to "Notification email from" address (see setup below) -TicketsShowExtrafieldsIntoPublicArea=Show Extras fields in the public interface -TicketsShowExtrafieldsIntoPublicAreaHelp=When this option is enabled, additional attributes defined on the tickets will be shown in the public interface of ticket creation. TicketsLimitViewAssignedOnly=Restrict the display to tickets assigned to the current user (not effective for external users, always be limited to the thirdparty they depend on) TicketsLimitViewAssignedOnlyHelp=Only tickets assigned to the current user will be visible. Does not apply to a user with tickets management rights. TicketsActivatePublicInterface=Activate public interface @@ -264,7 +262,7 @@ TicketNewEmailBodyInfosTrackId=Ticket tracking number : %s TicketNewEmailBodyInfosTrackUrl=You can view the progress of the ticket by clicking the link above. TicketNewEmailBodyInfosTrackUrlCustomer=You can view the progress of the ticket in the specific interface by clicking the following link TicketEmailPleaseDoNotReplyToThisEmail=Please do not reply directly to this email! Use the link to reply into the interface. -TicketPublicInfoCreateTicket=This form allows you to record a trouble ticket in our management system. +TicketPublicInfoCreateTicket=This form allows you to record a support ticket in our management system. TicketPublicPleaseBeAccuratelyDescribe=Please accurately describe the problem. Provide the most information possible to allow us to correctly identify your request. TicketPublicMsgViewLogIn=Please enter ticket tracking ID TicketTrackId=Tracking ID diff --git a/htdocs/public/ticketsup/create_ticket.php b/htdocs/public/ticketsup/create_ticket.php index a0cb6f787ac..d7b3cf1d833 100644 --- a/htdocs/public/ticketsup/create_ticket.php +++ b/htdocs/public/ticketsup/create_ticket.php @@ -1,7 +1,6 @@ - * 2016 Christophe Battarel +/* Copyright (C) 2013-2016 Jean-François FERRY + * Copyright (C) 2016 Christophe Battarel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,9 +17,9 @@ */ /** - * Display public form to add new ticket + * Display public form to add new ticket * - * @package ticketsup + * \ingroup ticketsup */ if (!defined('NOREQUIREUSER')) { define('NOREQUIREUSER', '1'); @@ -47,8 +46,8 @@ define("NOCSRFCHECK", 1); // We accept to go on this page from external web site 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/html.formticketsup.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/ticketsup.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; @@ -66,6 +65,10 @@ $action = GETPOST('action', 'alpha'); $object = new Ticketsup($db); +$extrafields = new ExtraFields($db); +$extralabels = $extrafields->fetch_name_optionals_label($object->table_element); + + /* * Add file in email form */ @@ -165,11 +168,7 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { $usertoassign = $contacts[0]->id; } - if (!empty($conf->global->TICKETS_EXTRAFIELDS_PUBLIC) && $conf->global->TICKETS_EXTRAFIELDS_PUBLIC == "1") { - $extrafields = new ExtraFields($db); - $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); - $ret = $extrafields->setOptionalsFromPost($extralabels, $object); - } + $ret = $extrafields->setOptionalsFromPost($extralabels, $object); // Generate new ref $object->ref = $object->getDefaultRef(); @@ -251,11 +250,26 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { $message_admin .= '
  • ' . $langs->trans('Category') . ' : ' . $object->category_label . '
  • '; $message_admin .= '
  • ' . $langs->trans('Severity') . ' : ' . $object->severity_label . '
  • '; $message_admin .= '
  • ' . $langs->trans('From') . ' : ' . $object->origin_email . '
  • '; - if (is_array($object->array_options) && count($object->array_options) > 0) { - foreach ($object->array_options as $key => $value) { - $message_admin .= '
  • ' . $langs->trans($key) . ' : ' . $value . '
  • '; - } + + if (is_array($extrafields->attributes[$object->table_element]['label'])) + { + foreach($extrafields->attributes[$object->table_element]['label'] as $key => $val) + { + $qualified = true; + if ($qualified && isset($this->attributes[$object->table_element]['list'][$key])) + { + $qualified = dol_eval($this->attributes[$object->table_element]['list'][$key], 1); + if (empty($result) || $result == 2) $qualified = false; + } + if ($qualified && isset($this->attributes[$object->table_element]['perms'][$key])) + { + $qualified = dol_eval($this->attributes[$object->table_element]['perms'][$key], 1); + } + + if ($qualified) $message_admin .= '
  • ' . $langs->trans($key) . ' : ' . $value . '
  • '; + } } + $message_admin .= ''; $message_admin .= '

    ' . $langs->trans('Message') . ' :
    ' . $object->message . '

    '; $message_admin .= '

    ' . $langs->trans('SeeThisTicketIntomanagementInterface') . '

    '; @@ -303,13 +317,15 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { } } -/*************************************************** - * PAGE - * - ****************************************************/ + + +/* + * View + */ $arrayofjs = array(); $arrayofcss = array('/opensurvey/css/style.css', '/ticketsup/css/styles.css', '/ticketsup/css/bg.css.php'); + llxHeaderTicket($langs->trans("CreateTicket"), "", 0, 0, $arrayofjs, $arrayofcss); $form = new Form($db); @@ -332,9 +348,6 @@ if ($action != "infos_success") { $formticket->withemail = 1; $formticket->ispublic = 1; $formticket->withfile = 2; - if (!empty($conf->global->TICKETS_EXTRAFIELDS_PUBLIC)) { - $formticket->withextrafields = $conf->global->TICKETS_EXTRAFIELDS_PUBLIC; - } $formticket->action = 'create_ticket'; $formticket->param = array('returnurl' => $_SERVER['PHP_SELF']); @@ -343,9 +356,9 @@ if ($action != "infos_success") { $defaultref = ''; } - print load_fiche_titre($langs->trans('NewTicket'), '', 'ticketsup-32@ticketsup', 0); + print load_fiche_titre($langs->trans('NewTicket'), '', '', 0, 0, 'marginleftonly'); - print '
    ' . $langs->trans('TicketPublicInfoCreateTicket') . '
    '; + print '
    ' . $langs->trans('TicketPublicInfoCreateTicket') . '
    '; $formticket->showForm(); } else { print '
    ' . $langs->trans('MesgInfosPublicTicketCreatedWithTrackId', '' . $object->track_id . ''); @@ -354,13 +367,8 @@ if ($action != "infos_success") { } print '
    '; -/*************************************************** - * LINKED OBJECT BLOCK - * - * Put here code to view linked object - ****************************************************/ -//$somethingshown=$object->showLinkedObjectBlock(); - // End of page -$db->close(); + llxFooter(''); + +$db->close(); diff --git a/htdocs/public/ticketsup/index.php b/htdocs/public/ticketsup/index.php index 8352282c4af..66c916f2708 100644 --- a/htdocs/public/ticketsup/index.php +++ b/htdocs/public/ticketsup/index.php @@ -44,8 +44,8 @@ if (!defined("NOLOGIN")) { 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/html.formticketsup.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/ticketsup.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php'; // Load traductions files requiredby by page diff --git a/htdocs/public/ticketsup/list.php b/htdocs/public/ticketsup/list.php index 34413168bc0..4a8462f31e2 100644 --- a/htdocs/public/ticketsup/list.php +++ b/htdocs/public/ticketsup/list.php @@ -36,8 +36,8 @@ if (!defined("NOLOGIN")) { 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/html.formticketsup.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/ticketsup.lib.php'; // Load traductions files requiredby by page $langs->load("companies"); @@ -122,10 +122,11 @@ if ($action == "view_ticketlist") { } $object->doActions($action); -/*************************************************** - * VIEW - * - ****************************************************/ + + +/* + * View + */ $form = new Form($db); $user_assign = new User($db); @@ -293,8 +294,8 @@ if ($action == "view_ticketlist") { $sql .= " t.datec,"; $sql .= " t.date_read,"; $sql .= " t.date_close,"; - $sql .= " t.tms"; - $sql .= ", type.label as type_label, category.label as category_label, severity.label as severity_label"; + $sql .= " t.tms,"; + $sql .= " type.label as type_label, category.label as category_label, severity.label as severity_label"; // Add fields for extrafields foreach ($extrafields->attribute_list as $key => $val) { $sql .= ($extrafields->attribute_type[$key] != 'separate' ? ",ef." . $key . ' as options_' . $key : ''); diff --git a/htdocs/public/ticketsup/view.php b/htdocs/public/ticketsup/view.php index c0069d9f6ee..eef7a8c65be 100644 --- a/htdocs/public/ticketsup/view.php +++ b/htdocs/public/ticketsup/view.php @@ -36,8 +36,8 @@ if (!defined("NOLOGIN")) { 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/html.formticketsup.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/ticketsup.lib.php'; // Load traductions files requiredby by page $langs->load("companies"); diff --git a/htdocs/ticketsup/card.php b/htdocs/ticketsup/card.php index bb6b5804578..ddfa6d183c6 100644 --- a/htdocs/ticketsup/card.php +++ b/htdocs/ticketsup/card.php @@ -53,11 +53,11 @@ $action = GETPOST('action', 'alpha', 3); // Initialize technical object to manage hooks of ticketsup. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('ticketsupcard','globalcard')); +$object = new Ticketsup($db); + $extrafields = new ExtraFields($db); $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); -$object = new Ticketsup($db); - if (!$action) { $action = 'view'; } @@ -85,6 +85,28 @@ $result = restrictedArea($user, 'ticketsup', $object->id); $actionobject = new ActionsTicketsup($db); $actionobject->doActions($action, $object); +if ($action == "update_extras" && $user->rights->ticketsup->write && !GETPOST('cancel','alpha')) +{ + $triggermodname = 'TICKETSUP_MODIFY'; + + $res = $object->fetch(GETPOST('id','int'), '', GETPOST('track_id','alpha')); + $attributekey = GETPOST('attribute','alpha'); + $attributekeylong = 'options_'.$attributekey; + $object->array_options['options_'.$attributekey] = GETPOST($attributekeylong,' alpha'); + + $result = $object->updateExtraField($attributekey, $triggermodname, $user); + if ($result > 0) + { + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); + $action = 'view'; + } + else + { + setEventMessages($object->error, $object->errors, 'errors'); + $action = 'edit_extras'; + } +} + $permissiondellink = $user->rights->ticketsup->write; include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once @@ -100,7 +122,9 @@ $form = new Form($db); $formticket = new FormTicketsup($db); $formproject = new FormProjets($db); -if ($action == 'view' || $action == 'add_message' || $action == 'close' || $action == 'delete' || $action == 'editcustomer' || $action == 'progression' || $action == 'reopen' || $action == 'editsubject' || $action == 'edit_extrafields' || $action == 'set_extrafields' || $action == 'classify' || $action == 'sel_contract' || $action == 'edit_message_init' || $action == 'set_status' || $action == 'dellink') { +if ($action == 'view' || $action == 'add_message' || $action == 'close' || $action == 'delete' || $action == 'editcustomer' || $action == 'progression' || $action == 'reopen' + || $action == 'editsubject' || $action == 'edit_extras' || $action == 'update_extras' || $action == 'edit_extrafields' || $action == 'set_extrafields' || $action == 'classify' || $action == 'sel_contract' || $action == 'edit_message_init' || $action == 'set_status' || $action == 'dellink') +{ if ($res > 0) { // or for unauthorized internals users @@ -412,29 +436,8 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti print ''; // Other attributes - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - if (empty($reshook) && !empty($extrafields->attribute_label)) { - if ($action == "edit_extrafields") { - print ''; - print ''; - print ''; - print ''; + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; - print $object->showOptionals($extrafields, 'edit'); - print ''; - print ' '; - print ' '; - print ''; - print ''; - } else { - print $object->showOptionals($extrafields); - if ($user->rights->ticketsup->write) { - print ''; - print '' . img_picto('', 'edit') . ' ' . $langs->trans('Edit') . ''; - print ''; - } - } - } print ''; diff --git a/htdocs/ticketsup/class/actions_ticketsup.class.php b/htdocs/ticketsup/class/actions_ticketsup.class.php index 9f5e37bbd8a..b5a93b50256 100644 --- a/htdocs/ticketsup/class/actions_ticketsup.class.php +++ b/htdocs/ticketsup/class/actions_ticketsup.class.php @@ -292,7 +292,7 @@ class ActionsTicketsup $object->description = GETPOST("description"); //... - $ret = $object->update(GETPOST('id'), $user); + $ret = $object->update($user); if ($ret <= 0) { $error++; $this->errors = $object->error; @@ -523,24 +523,8 @@ class ActionsTicketsup } } - if ($action == "set_extrafields" && GETPOST('btn_edit_extrafields') && $user->rights->ticketsup->write && !GETPOST('cancel')) { - $res = $this->fetch('', '', GETPOST('track_id','alpha')); - $extrafields = new ExtraFields($this->db); - $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); - $ret = $extrafields->setOptionalsFromPost($extralabels, $object); - - $ret = $object->update($user); - if ($ret > 0) { - setEventMessages($langs->trans('TicketUpdated'), null, 'mesgs'); - $url = 'card.php?action=view&track_id=' . $object->track_id; - header("Location: " . $url); - exit(); - } - - $action = 'view'; - } // Reopen ticket - elseif ($action == 'confirm_reopen' && $user->rights->ticketsup->manage && !GETPOST('cancel')) { + if ($action == 'confirm_reopen' && $user->rights->ticketsup->manage && !GETPOST('cancel')) { if ($this->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { // prevent browser refresh from reopening ticket several times if ($object->fk_statut == 8) { diff --git a/htdocs/ticketsup/css/styles.css b/htdocs/ticketsup/css/styles.css index 694e1c27816..44ce0e7e6ac 100644 --- a/htdocs/ticketsup/css/styles.css +++ b/htdocs/ticketsup/css/styles.css @@ -103,13 +103,3 @@ div.corps { } #form_create_ticket input.text, #form_create_ticket textarea { width:450px;} - div.info { - background: none repeat scroll 0% 0% rgb(252, 245, 184); - padding: 2px 4px 2px 6px; - margin: 1.5em 1em; - border: 1px solid rgb(188, 169, 54); - font-weight: normal; - -} - -div.warning { color: #333333;} diff --git a/htdocs/ticketsup/list.php b/htdocs/ticketsup/list.php index 657f299db6d..9a2ef7c31e1 100644 --- a/htdocs/ticketsup/list.php +++ b/htdocs/ticketsup/list.php @@ -194,7 +194,8 @@ foreach($object->fields as $key => $val) $sql.='t.'.$key.', '; } // Add fields from extrafields -foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ", ef.".$key.' as options_'.$key : ''); +if (! empty($extrafields->attributes[$object->table_element]['label'])) + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.' as options_'.$key.', ' : ''); // Add fields from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook