diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index a88a6b7dda2..38f29df1b13 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -656,7 +656,7 @@ foreach ($tabcomplete as $key => $value) {
continue;
}
$tabcomplete[$key]['id'] = $i;
- // TODO Comment the line when data is stored into the tabcomplete array
+ // TODO Comment this lines when data is stored into the tabcomplete array
$tabcomplete[$key]['cond'] = $tabcond[$i];
$tabcomplete[$key]['rowid'] = $tabrowid[$i];
$tabcomplete[$key]['fieldinsert'] = $tabfieldinsert[$i];
@@ -2243,8 +2243,8 @@ if ($id > 0) {
if (!is_null($withentity)) {
print ' ';
}
- print ' ';
- print ' ';
+ print ' ';
+ print ' ';
print '';
} else {
$tmpaction = 'view';
@@ -2297,8 +2297,10 @@ if ($id > 0) {
} elseif ($value == 'price' || preg_match('/^amount/i', $value)) {
$valuetoshow = price($valuetoshow);
}
- if ($value == 'private') {
- $valuetoshow = yn($valuetoshow);
+ if (in_array($value, array('private', 'joinfile', 'use_default'))) {
+ if ($valuetoshow) {
+ $valuetoshow = yn($valuetoshow);
+ }
} elseif ($value == 'libelle_facture') {
$langs->load("bills");
$key = $langs->trans("PaymentCondition".strtoupper($obj->code));
diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php
index 0ad9e90d92d..6ae7405ca87 100644
--- a/htdocs/admin/ticket.php
+++ b/htdocs/admin/ticket.php
@@ -583,6 +583,7 @@ if (isModEnabled('product')) {
$htmlname = "product_category_id";
print '
'.$langs->trans("TicketChooseProductCategory").' ';
print '';
+ print img_picto('', 'category', 'class="pictofixedwidth"');
$formcategory->selectProductCategory(getDolGlobalString('TICKET_PRODUCT_CATEGORY'), $htmlname);
if ($conf->use_javascript_ajax) {
print ajax_combobox('select_'.$htmlname);
@@ -635,9 +636,11 @@ print $formcategory->buttonsSaveCancel("Save", '', array(), 0, 'reposition');
print '';
+
/*
* Notification
*/
+
// Admin var of module
print load_fiche_titre($langs->trans("Notification"), '', '');
diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php
index f63160d787b..65a9326662c 100644
--- a/htdocs/core/class/html.formticket.class.php
+++ b/htdocs/core/class/html.formticket.class.php
@@ -243,8 +243,8 @@ class FormTicket
print '';
+ // Ref
if ($this->withref) {
- // Ref
$defaultref = $ticketstat->getDefaultRef();
if ($mode == 'edit') {
@@ -255,10 +255,10 @@ class FormTicket
print '';
}
- // TITLE
+ // Title
if ($this->withemail) {
print ''.$langs->trans("Email").' ';
- print ' ';
+ print ' '; // Do not use "required", it breaks button cancel
print ' ';
if ($with_contact) {
@@ -382,21 +382,21 @@ class FormTicket
// Type of Ticket
print ''.$langs->trans("TicketTypeRequest").' ';
- $this->selectTypesTickets($type_code, 'type_code', '', 2, 1, 0, 0, 'minwidth200');
+ $this->selectTypesTickets($type_code, 'type_code', '', 2, 1, 0, 0, 'minwidth200 maxwidth500');
print ' ';
// Group => Category
print ''.$langs->trans("TicketCategory").' ';
$filter = '';
if ($public) {
- $filter = 'public=1';
+ $filter = '(public:=:1)';
}
- $this->selectGroupTickets($category_code, 'category_code', $filter, 2, 1, 0, 0, 'minwidth200');
+ $this->selectGroupTickets($category_code, 'category_code', $filter, 2, 1, 0, 0, 'minwidth200 maxwidth500');
print ' ';
// Severity => Priority
print ''.$langs->trans("TicketSeverity").' ';
- $this->selectSeveritiesTickets($severity_code, 'severity_code', '', 2, 1);
+ $this->selectSeveritiesTickets($severity_code, 'severity_code', '', 2, 1, 0, 0, 'minwidth200 maxwidth500');
print ' ';
if (isModEnabled('knowledgemanagement')) {
@@ -476,13 +476,13 @@ class FormTicket
print '';
}
- // MESSAGE
+ // Message
print ''.$langs->trans("Message").' ';
// If public form, display more information
$toolbarname = 'dolibarr_notes';
if ($this->ispublic) {
- $toolbarname = 'dolibarr_details';
+ $toolbarname = 'dolibarr_details'; // TODO Allow image so use can do paste of image into content but disallow file manager
print ''.(getDolGlobalString("TICKET_PUBLIC_TEXT_HELP_MESSAGE", $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'))).'
';
}
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
@@ -505,14 +505,14 @@ class FormTicket
}
// Categories
- if (isModEnabled('category')) {
+ if (isModEnabled('category') && !$public) {
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_TICKET, '', 'parent', 64, 0, 3);
if (count($cate_arbo)) {
// Categories
- print ' '.$langs->trans("Categories").' ';
- print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
+ print ' ';
+ print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0, '', '', $langs->transnoentitiesnoconv("Categories"));
print " ";
}
}
@@ -536,7 +536,7 @@ class FormTicket
}
$out = '';
- $out .= ''.$langs->trans("MailFile").' ';
+ $out .= ' ';
$out .= '';
// TODO Trick to have param removedfile containing nb of image to delete. But this does not works without javascript
$out .= ' '."\n";
@@ -556,8 +556,6 @@ class FormTicket
}
$out .= ' ';
}
- } else {
- $out .= ''.$langs->trans("NoAttachedFiles").' ';
}
if ($this->withfile == 2) { // Can add other files
$maxfilesizearray = getMaxFileSizeArray();
@@ -821,7 +819,7 @@ class FormTicket
print ' selected="selected"';
} elseif (in_array($id, $selected)) {
print ' selected="selected"';
- } elseif ($arraytypes['use_default'] == "1" && !$selected && !$empty) {
+ } elseif ($arraytypes['use_default'] == "1" && empty($selected)) {
print ' selected="selected"';
}
@@ -857,7 +855,7 @@ class FormTicket
* @param string $htmlname Name of select component
* @param string $filtertype To filter on some properties in llx_c_ticket_category ('public = 1'). This parameter must not come from input of users.
* @param int $format 0 = id+label, 1 = code+code, 2 = code+label, 3 = id+code
- * @param int $empty 1 = can be empty, 0 = or not
+ * @param int $empty 1 = can be empty, 0 = or can't be empty
* @param int $noadmininfo 0 = ddd admin info, 1 = disable admin info
* @param int $maxlength Max length of label
* @param string $morecss More CSS
@@ -923,15 +921,15 @@ class FormTicket
if ($format == 3) {
print 'cache_category_tickets) == 1) {
+ } elseif (count($ticketstat->cache_category_tickets) == 1) { // If only 1 choice, we autoselect it
print ' selected="selected"';
}
@@ -1001,7 +999,8 @@ class FormTicket
$sql .= $this->db->ifsql("ctc.rowid NOT IN (SELECT ctcfather.rowid FROM ".MAIN_DB_PREFIX."c_ticket_category as ctcfather JOIN ".MAIN_DB_PREFIX."c_ticket_category as ctcjoin ON ctcfather.rowid = ctcjoin.fk_parent WHERE ctcjoin.active > 0)", "'NOTPARENT'", "'PARENT'")." as isparent";
$sql .= " FROM ".$this->db->prefix()."c_ticket_category as ctc";
$sql .= " WHERE ctc.active > 0 AND ctc.entity = ".((int) $conf->entity);
- if ($filtertype == 'public=1') {
+ $public = ($filtertype == 'public=1' || $filtertype == '(public:=:1)');
+ if ($public) {
$sql .= " AND ctc.public = 1";
}
$sql .= " AND ctc.fk_parent = 0";
@@ -1063,7 +1062,8 @@ class FormTicket
$sql .= " WHERE ctc.active > 0 AND ctc.entity = ".((int) $conf->entity);
$sql .= " AND ctc.rowid NOT IN (".$this->db->sanitize(implode(',', $arrayidusedconcat)).")";
- if ($filtertype == 'public=1') {
+ $public = ($filtertype == 'public=1' || $filtertype == '(public:=:1)');
+ if ($public) {
$sql .= " AND ctc.public = 1";
}
// Add a test to take only record that are direct child
@@ -1271,7 +1271,7 @@ class FormTicket
print ' selected="selected"';
} elseif (isset($selected) && $selected == $id) {
print ' selected="selected"';
- } elseif ($arrayseverities['use_default'] == "1" && !$selected && !$empty) {
+ } elseif ($arrayseverities['use_default'] == "1" && empty($selected)) {
print ' selected="selected"';
}
diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php
index 3e52db42821..705cf304460 100644
--- a/htdocs/core/lib/admin.lib.php
+++ b/htdocs/core/lib/admin.lib.php
@@ -1343,7 +1343,7 @@ function unActivateModule($value, $requiredby = 1)
*/
function complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tabsql, &$tabsqlsort, &$tabfield, &$tabfieldvalue, &$tabfieldinsert, &$tabrowid, &$tabcond, &$tabhelp, &$tabcomplete)
{
- global $db, $modules, $conf, $langs;
+ global $db, $langs;
dol_syslog("complete_dictionary_with_modules Search external modules to complete the list of dictionary tables", LOG_DEBUG, 1);
@@ -1461,7 +1461,7 @@ function complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tab
$tmptablename = preg_replace('/'.MAIN_DB_PREFIX.'/', '', $tabnamerelwithkey[$key]);
$nbtabcond++;
$tabcond[] = $val;
- $tabcomplete[$tmptablename]['rowid'] = $val;
+ $tabcomplete[$tmptablename]['cond'] = $val;
}
if (!empty($objMod->dictionaries['tabhelp'])) {
foreach ($objMod->dictionaries['tabhelp'] as $key => $val) {
diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php
index 7632700bc4a..b0ba5d69290 100644
--- a/htdocs/core/modules/DolibarrModules.class.php
+++ b/htdocs/core/modules/DolibarrModules.class.php
@@ -2657,10 +2657,12 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
$fields = array('name', 'lib', 'sql', 'sqlsort', 'field', 'fieldvalue', 'fieldinsert', 'rowid', 'cond', 'help', 'fieldcheck');
foreach ($fields as $field) {
- if (!empty($dictionaryArray[$field])) {
+ if (isset($dictionaryArray[$field])) {
$this->dictionaries['tab'.$field][] = $dictionaryArray[$field];
}
}
- if ($langs && !in_array($langs, $this->dictionaries[$langs])) $this->dictionaries['langs'][] = $langs;
+ if ($langs && !in_array($langs, $this->dictionaries[$langs])) {
+ $this->dictionaries['langs'][] = $langs;
+ }
}
}
diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php
index 09a606bc7ff..84cfd9f0c83 100644
--- a/htdocs/core/modules/modTicket.class.php
+++ b/htdocs/core/modules/modTicket.class.php
@@ -149,7 +149,7 @@ class modTicket extends DolibarrModules
'fieldinsert' => 'code,label,pos,use_default,entity',
'rowid' => 'rowid',
'cond' => isModEnabled('ticket'),
- 'help' => array('code' => $langs->trans('EnterAnyCode'), 'use_default' => $langs->trans('Enter0or1'))
+ 'help' => array('code' => $langs->trans('EnterAnyCode'), 'use_default' => $langs->trans('EnterYesOrNo'))
)
);
@@ -165,7 +165,7 @@ class modTicket extends DolibarrModules
'fieldinsert' => 'code,label,pos,use_default,entity',
'rowid' => 'rowid',
'cond' => isModEnabled('ticket'),
- 'help' => array('code' => $langs->trans('EnterAnyCode'), 'use_default' => $langs->trans('Enter0or1'))
+ 'help' => array('code' => $langs->trans('EnterAnyCode'), 'use_default' => $langs->trans('EnterYesOrNo'))
)
);
@@ -183,14 +183,14 @@ class modTicket extends DolibarrModules
'cond' => isModEnabled('ticket'),
'help' => array(
'code' => $langs->trans('EnterAnyCode'),
- 'use_default' => $langs->trans('Enter0or1'),
+ 'use_default' => $langs->trans('EnterYesOrNo'),
'public' => $langs->trans('Enter0or1').' '.$langs->trans('TicketGroupIsPublicDesc'),
'fk_parent' => $langs->trans('IfThisCategoryIsChildOfAnother')
)
)
);
- // (apparently unused) Dictionary of ticket resolutions
+ // Dictionary of ticket resolutions (apparently unused except if TICKET_ENABLE_RESOLUTION is on)
$this->declareNewDictionary(
array(
'name' => 'c_ticket_resolution',
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 93c3eceb2c4..c35990420e4 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -2028,6 +2028,7 @@ MinimumNoticePeriod=Minimum notice period (Your leave request must be done befor
NbAddedAutomatically=Number of days added to counters of users (automatically) each month
EnterAnyCode=This field contains a reference to identify the line. Enter any value of your choice, but without special characters.
Enter0or1=Enter 0 or 1
+EnterYesOrNo=Enter Yes or No
UnicodeCurrency=Enter here between braces, list of byte number that represent the currency symbol. For example: for $, enter [36] - for brazil real R$ [82,36] - for €, enter [8364]
ColorFormat=The RGB color is in HEX format, eg: FF0000
PictoHelp=Icon name in format: - image.png for an image file into the current theme directory - image.png@module if file is into the directory /img/ of a module - fa-xxx for a FontAwesome fa-xxx picto - fontawesome_xxx_fa_color_size for a FontAwesome fa-xxx picto (with prefix, color and size set)
diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang
index 33b9b2e7218..a1aa4b035c5 100644
--- a/htdocs/langs/fr_FR/admin.lang
+++ b/htdocs/langs/fr_FR/admin.lang
@@ -2027,7 +2027,7 @@ BackgroundTableLineEvenColor=Couleur de fond pour les lignes paires des tables
MinimumNoticePeriod=Période de préavis minimum (Votre demande de congé doit être faite avant ce délai)
NbAddedAutomatically=Nombre de jours ajoutés aux compteurs des utilisateurs (automatiquement) chaque mois
EnterAnyCode=Ce champ contient une référence pour identifier l'enregistrement. Entrez une valeur de votre choix, mais sans caractères spéciaux.
-Enter0or1=Saisir 0 ou 1
+Enter0or1=Saisir 0 ou 1
UnicodeCurrency=Saisissez ici entre accolades, la liste du numéro des octets qui représentent le symbole de la monnaie. Pour exemple: pour $, entrez [36] - pour le Real Brésilien R$ [82,36] - pour l'euro €, entrez [8364]
ColorFormat=La couleur RVB au format HEX est, par exemple: FF0000
PictoHelp=Nom de l'icône au format : - image.png pour un fichier image dans le répertoire du thème courant - image.png@module si le fichier est dans le répertoire /img/ d'un module - fa-xxx pour un picto FontAwesome fa-xxx - fonwtawesome_xxx_fa_color_size pour un picto FontAwesome fa-xxx (avec préfixe, couleur et taille forcés)
diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php
index 066fe034d21..de8ad9c8751 100644
--- a/htdocs/public/ticket/create_ticket.php
+++ b/htdocs/public/ticket/create_ticket.php
@@ -149,7 +149,7 @@ if (empty($reshook)) {
if ($action == 'create_ticket' && GETPOST('save', 'alpha')) {
$error = 0;
- $origin_email = GETPOST('email', 'alpha');
+ $origin_email = GETPOST('email', 'email');
if (empty($origin_email)) {
$error++;
array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("Email")));
@@ -275,6 +275,7 @@ if (empty($reshook)) {
$object->subject = GETPOST("subject", "alphanohtml");
$object->message = GETPOST("message", "restricthtml");
$object->origin_email = $origin_email;
+ $object->email_from = $origin_email;
$object->type_code = GETPOST("type_code", 'aZ09');
$object->category_code = GETPOST("category_code", 'aZ09');
@@ -541,7 +542,7 @@ if ($action != "infos_success") {
print '';
} else {
//print ''.$langs->trans('TicketPublicInfoCreateTicket').'
';
- $formticket->showForm(0, 'edit', 1, $with_contact, '', $object);
+ $formticket->showForm(0, ($action ? $action : 'create'), 1, $with_contact, '', $object);
}
}
diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php
index db7a20b4f01..0820c33a2f6 100644
--- a/htdocs/public/ticket/list.php
+++ b/htdocs/public/ticket/list.php
@@ -419,7 +419,11 @@ if ($action == "view_ticketlist") {
if ($resql) {
$num = $db->num_rows($resql);
- print_barre_liste($langs->trans('TicketList'), $page, 'list.php', $param, $sortfield, $sortorder, '', $num, $num_total, 'ticket');
+ $baseurl = getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE', DOL_URL_ROOT.'/public/ticket/');
+
+ $newcardbutton = ' ';
+
+ print_barre_liste($langs->trans('TicketList'), $page, 'list.php', $param, $sortfield, $sortorder, '', $num, $num_total, 'ticket', 0, $newcardbutton);
// Search bar
print '