diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 9f64797c646..a91c28789aa 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -200,17 +200,17 @@ class FormTicket // Type print ''; - $this->selectTypesTickets((GETPOST('type_code', 'alpha') ? GETPOST('type_code', 'alpha') : $this->type_code), 'type_code', '', '2', 0, 0, 0, 'minwidth150'); - print ''; - - // Severity - print ''; - $this->selectSeveritiesTickets((GETPOST('severity_code') ? GETPOST('severity_code') : $this->severity_code), 'severity_code', '', '2'); + $this->selectTypesTickets((GETPOST('type_code', 'alpha') ? GETPOST('type_code', 'alpha') : $this->type_code), 'type_code', '', 2, 0, 0, 0, 'minwidth200'); print ''; // Group print ''; - $this->selectGroupTickets((GETPOST('category_code') ? GETPOST('category_code') : $this->category_code), 'category_code', '', '2'); + $this->selectGroupTickets((GETPOST('category_code') ? GETPOST('category_code') : $this->category_code), 'category_code', '', 2, 0, 0, 0, 'minwidth200'); + print ''; + + // Severity + print ''; + $this->selectSeveritiesTickets((GETPOST('severity_code') ? GETPOST('severity_code') : $this->severity_code), 'severity_code', '', 2, 0); print ''; // Subject @@ -247,6 +247,59 @@ class FormTicket $doleditor->Create(); print ''; + + // Attached files + if (!empty($this->withfile)) { + // Define list of attached files + $listofpaths = array(); + $listofnames = array(); + $listofmimes = array(); + if (!empty($_SESSION["listofpaths"])) { + $listofpaths = explode(';', $_SESSION["listofpaths"]); + } + + if (!empty($_SESSION["listofnames"])) { + $listofnames = explode(';', $_SESSION["listofnames"]); + } + + if (!empty($_SESSION["listofmimes"])) { + $listofmimes = explode(';', $_SESSION["listofmimes"]); + } + + $out = ''; + $out .= ''.$langs->trans("MailFile").''; + $out .= ''; + // TODO Trick to have param removedfile containing nb of image to delete. But this does not works without javascript + $out .= ''."\n"; + $out .= ''."\n"; + if (count($listofpaths)) { + foreach ($listofpaths as $key => $val) { + $out .= '
'; + $out .= img_mime($listofnames[$key]).' '.$listofnames[$key]; + if (!$this->withfilereadonly) { + $out .= ' '; + } + $out .= '
'; + } + } else { + $out .= $langs->trans("NoAttachedFiles").'
'; + } + if ($this->withfile == 2) { // Can add other files + $out .= ''; + $out .= ' '; + $out .= ''; + } + $out .= "\n"; + + print $out; + } + // User of creation if ($this->withusercreate > 0 && $this->fk_user_create) { print ''.$langs->trans("CreatedBy").''; @@ -359,58 +412,6 @@ class FormTicket print ''; } - // Attached files - if (!empty($this->withfile)) { - // Define list of attached files - $listofpaths = array(); - $listofnames = array(); - $listofmimes = array(); - if (!empty($_SESSION["listofpaths"])) { - $listofpaths = explode(';', $_SESSION["listofpaths"]); - } - - if (!empty($_SESSION["listofnames"])) { - $listofnames = explode(';', $_SESSION["listofnames"]); - } - - if (!empty($_SESSION["listofmimes"])) { - $listofmimes = explode(';', $_SESSION["listofmimes"]); - } - - $out = ''; - $out .= ''.$langs->trans("MailFile").''; - $out .= ''; - // TODO Trick to have param removedfile containing nb of image to delete. But this does not works without javascript - $out .= ''."\n"; - $out .= ''."\n"; - if (count($listofpaths)) { - foreach ($listofpaths as $key => $val) { - $out .= '
'; - $out .= img_mime($listofnames[$key]).' '.$listofnames[$key]; - if (!$this->withfilereadonly) { - $out .= ' '; - } - $out .= '
'; - } - } else { - $out .= $langs->trans("NoAttachedFiles").'
'; - } - if ($this->withfile == 2) { // Can add other files - $out .= ''; - $out .= ' '; - $out .= ''; - } - $out .= "\n"; - - print $out; - } - // Other attributes $parameters = array(); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $ticketstat, $this->action); // Note that $action and $object may have been modified by hook diff --git a/htdocs/core/tpl/commonfields_view.tpl.php b/htdocs/core/tpl/commonfields_view.tpl.php index a521876a2e7..24019c59c75 100644 --- a/htdocs/core/tpl/commonfields_view.tpl.php +++ b/htdocs/core/tpl/commonfields_view.tpl.php @@ -60,9 +60,10 @@ foreach ($object->fields as $key => $val) print ''; - + if (in_array($val['type'], array('text', 'html'))) print '
'; print $object->showOutputField($val, $key, $value, '', '', '', 0); //print dol_escape_htmltag($object->$key, 1, 1); + if (in_array($val['type'], array('text', 'html'))) print '
'; print ''; print ''; } @@ -105,8 +106,10 @@ foreach ($object->fields as $key => $val) else print $langs->trans($val['label']); print ''; print ''; + if (in_array($val['type'], array('text', 'html'))) print '
'; print $object->showOutputField($val, $key, $value, '', '', '', 0); //print dol_escape_htmltag($object->$key, 1, 1); + if (in_array($val['type'], array('text', 'html'))) print '
'; print ''; print ''; } diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index a41b6825fa3..a3c0b78510c 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -314,3 +314,7 @@ ALTER TABLE llx_inventorydet ADD UNIQUE uk_inventorydet(fk_inventory, fk_warehou ALTER TABLE llx_commandedet ADD COLUMN ref_ext varchar(255) AFTER label; ALTER TABLE llx_facturedet ADD COLUMN ref_ext varchar(255) AFTER multicurrency_total_ttc; + +ALTER TABLE llx_c_ticket_category ADD COLUMN fk_parent integer DEFAULT 0 NOT NULL; +ALTER TABLE llx_c_ticket_category ADD COLUMN force_severity varchar(32) NULL; + diff --git a/htdocs/install/mysql/tables/llx_c_ticket_category.sql b/htdocs/install/mysql/tables/llx_c_ticket_category.sql index 2ccfe4d0758..1e98de92d3b 100644 --- a/htdocs/install/mysql/tables/llx_c_ticket_category.sql +++ b/htdocs/install/mysql/tables/llx_c_ticket_category.sql @@ -17,12 +17,14 @@ create table llx_c_ticket_category ( - rowid integer AUTO_INCREMENT PRIMARY KEY, - entity integer DEFAULT 1, - code varchar(32) NOT NULL, - pos varchar(32) NOT NULL, - label varchar(128) NOT NULL, - active integer DEFAULT 1, - use_default integer DEFAULT 1, - description varchar(255) + rowid integer AUTO_INCREMENT PRIMARY KEY, + entity integer DEFAULT 1, + code varchar(32) NOT NULL, + pos varchar(32) NOT NULL, + label varchar(128) NOT NULL, + active integer DEFAULT 1, + use_default integer DEFAULT 1, + fk_parent integer DEFAULT 0 NOT NULL; -- Parent group + force_severity varchar(32) NULL, -- To force the severity if we choosed this category + description varchar(255) )ENGINE=innodb; diff --git a/htdocs/recruitment/lib/recruitment_recruitmentcandidature.lib.php b/htdocs/recruitment/lib/recruitment_recruitmentcandidature.lib.php index 63cd5ce0d7b..661f5ccc984 100644 --- a/htdocs/recruitment/lib/recruitment_recruitmentcandidature.lib.php +++ b/htdocs/recruitment/lib/recruitment_recruitmentcandidature.lib.php @@ -41,10 +41,12 @@ function recruitmentCandidaturePrepareHead($object) $head[$h][2] = 'card'; $h++; - $head[$h][0] = dol_buildpath("/recruitment/recruitmentrating_card.php", 1).'?id='.$object->id; - $head[$h][1] = $langs->trans("Rating"); - $head[$h][2] = 'rating'; - $h++; + if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { + $head[$h][0] = dol_buildpath("/recruitment/recruitmentrating_card.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans("Rating"); + $head[$h][2] = 'rating'; + $h++; + } if (isset($object->fields['note_public']) || isset($object->fields['note_private'])) { diff --git a/htdocs/takepos/freezone.php b/htdocs/takepos/freezone.php index 5193e95c7c5..c6dc094ca28 100644 --- a/htdocs/takepos/freezone.php +++ b/htdocs/takepos/freezone.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2018 Andreu Bisquerra + * Copyright (C) 2020 Laurent Destailleur * * 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 diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 46a759f7170..ce6e52cc256 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -701,6 +701,12 @@ textarea.centpercent { .text-warning{ color : } +.longmessagecut { + max-height: 250px; + max-width: 100%; + overflow-y: scroll; +} + body[class*="colorblind-"] .text-warning{ color : } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 11eeb5a19d6..970c81e9139 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -788,6 +788,11 @@ textarea.centpercent { font-size: 0.85em; opacity: 0.7; } +.longmessagecut { + max-height: 250px; + max-width: 100%; + overflow-y: scroll; +} .text-warning{ color : diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index a078fe78fc4..f521076e640 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -639,7 +639,7 @@ if ($action == 'create' || $action == 'presend') $formticket->withfromcontactid = $contactid ? $contactid : ''; $formticket->withtitletopic = 1; $formticket->withnotifytiersatcreate = ($notifyTiers ? 1 : 0); - $formticket->withusercreate = 1; + $formticket->withusercreate = 0; $formticket->withref = 1; $formticket->fk_user_create = $user->id; $formticket->withfile = 2; diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index 043eed1d142..f5cff7dcb33 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -208,14 +208,24 @@ class ActionsTicket $msg = GETPOST('message_initial', 'alpha') ? GETPOST('message_initial', 'alpha') : $object->message; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $uselocalbrowser = true; - $doleditor = new DolEditor('message_initial', $msg, '100%', 250, 'dolibarr_details', 'In', true, $uselocalbrowser, $conf->global->FCKEDITOR_ENABLE_TICKET, ROWS_4, '95%'); + $doleditor = new DolEditor('message_initial', $msg, '100%', 250, 'dolibarr_details', 'In', true, $uselocalbrowser, $conf->global->FCKEDITOR_ENABLE_TICKET, ROWS_9, '95%'); $doleditor->Create(); } else { // Deal with format differences (text / HTML) if (dol_textishtml($object->message)) { + print '
'; print $object->message; + print '
'; + /*print '
'; + print $langs->trans("More").'...'; + print '
';*/ } else { + print '
'; print dol_nl2br($object->message); + print '
'; + /*print '
'; + print $langs->trans("More").'...'; + print '
';*/ } //print '
' . $object->message . '
'; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index ce2d986c3ae..56b882b2fb3 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1,7 +1,8 @@ * Copyright (C) 2016 Christophe Battarel - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019 Frédéric France + * Copyright (C) 2020 Laurent Destailleur * * 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 @@ -229,7 +230,7 @@ class Ticket extends CommonObject 'subject' => array('type'=>'varchar(255)', 'label'=>'Subject', 'visible'=>1, 'enabled'=>1, 'position'=>18, 'notnull'=>-1, 'searchall'=>1, 'help'=>"", 'css'=>'maxwidth200', 'autofocusoncreate'=>1), 'type_code' => array('type'=>'varchar(32)', 'label'=>'Type', 'visible'=>1, 'enabled'=>1, 'position'=>20, 'notnull'=>-1, 'searchall'=>1, 'help'=>"", 'css'=>'maxwidth150'), 'category_code' => array('type'=>'varchar(32)', 'label'=>'TicketCategory', 'visible'=>-1, 'enabled'=>1, 'position'=>21, 'notnull'=>-1, 'help'=>"", 'css'=>'maxwidth100'), - 'severity_code' => array('type'=>'varchar(32)', 'label'=>'Severity', 'visible'=>1, 'enabled'=>1, 'position'=>22, 'notnull'=>-1, 'help'=>"", 'css'=>'maxwidth100'), + 'severity_code' => array('type'=>'varchar(32)', 'label'=>'Severity', 'visible'=>1, 'enabled'=>1, 'position'=>20, 'notnull'=>-1, 'help'=>"", 'css'=>'maxwidth100'), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>"LinkToThirparty", 'css'=>'tdoverflowmax150 maxwidth150onsmartphone'), 'notify_tiers_at_create' => array('type'=>'integer', 'label'=>'NotifyThirdparty', 'visible'=>-1, 'enabled'=>0, 'position'=>51, 'notnull'=>1, 'index'=>1), 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php', 'label'=>'Project', 'visible'=>-1, 'enabled'=>1, 'position'=>52, 'notnull'=>-1, 'index'=>1, 'help'=>"LinkToProject"),