diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index 9c33744ceb0..d20a0348d3d 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -681,7 +681,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
// Title of task
if (count($arrayfields) > 0 && !empty($arrayfields['t.label']['checked'])) {
- print "
";
+ print '
';
if ($showlineingray) {
print '';
}
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index 80ea1d5ea7b..90de417c767 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -382,6 +382,31 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
'submenus' => array(),
);
+ // Tickets and knwoledge base
+ $tmpentry = array(
+ 'enabled'=>(!empty($conf->ticket->enabled) || !empty($conf->knwoledgemanagement->enabled)),
+ 'perms'=>(!empty($user->rights->ticket->read) || !empty($user->rights->knwoledgemanagement->read)),
+ 'module'=>'ticket|knwoledgemanagement'
+ );
+ $menu_arr[] = array(
+ 'name' => 'Ticket',
+ 'link' => '/ticket/index.php?mainmenu=ticket&leftmenu=',
+ 'title' => "Tickets",
+ 'level' => 0,
+ 'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
+ 'target' => $atarget,
+ 'mainmenu' => "ticket",
+ 'leftmenu' => '',
+ 'position' => 88,
+ 'id' => $id,
+ 'idsel' => 'ticket',
+ 'classname' => $classname = ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "ticket") ? 'class="tmenusel"' : 'class="tmenu"',
+ 'prefix' => img_picto('', 'ticket', 'class="fa-fw paddingright"'),
+ 'session' => (($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "ticket") ? 0 : 1),
+ 'loadLangs' => array("other"),
+ 'submenus' => array(),
+ );
+
// Tools
$tmpentry = array(
'enabled'=>1,
diff --git a/htdocs/core/modules/modEventOrganization.class.php b/htdocs/core/modules/modEventOrganization.class.php
index 3a81102f4bd..4ba73d4fe2c 100644
--- a/htdocs/core/modules/modEventOrganization.class.php
+++ b/htdocs/core/modules/modEventOrganization.class.php
@@ -268,7 +268,7 @@ class modEventOrganization extends DolibarrModules
'fk_menu'=>'fk_mainmenu=project,fk_leftmenu=eventorganization', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'type'=>'left', // This is a Left menu entry
'titre'=>'List',
- 'url'=>'/projet/list.php?search_usage_event_organization=1&mainmenu=project&contextpage=organizedevents',
+ 'url'=>'/projet/list.php?search_usage_event_organization=1&search_status=99&mainmenu=project&contextpage=organizedevents',
'langs'=>'eventorganization@eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>1000+$r,
'enabled'=>'$conf->eventorganization->enabled', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
diff --git a/htdocs/core/modules/modKnowledgeManagement.class.php b/htdocs/core/modules/modKnowledgeManagement.class.php
index 504c363b648..14e5aabb681 100644
--- a/htdocs/core/modules/modKnowledgeManagement.class.php
+++ b/htdocs/core/modules/modKnowledgeManagement.class.php
@@ -261,17 +261,17 @@ class modKnowledgeManagement extends DolibarrModules
// Add here entries to declare new permissions
/* BEGIN MODULEBUILDER PERMISSIONS */
$this->rights[$r][0] = $this->numero + $r + 1; // Permission id (must not be already used)
- $this->rights[$r][1] = 'Read objects of Knowledge Management'; // Permission label
+ $this->rights[$r][1] = 'Read articles'; // Permission label
$this->rights[$r][4] = 'knowledgerecord'; // In php code, permission will be checked by test if ($user->rights->knowledgemanagement->level1->level2)
$this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->knowledgemanagement->level1->level2)
$r++;
$this->rights[$r][0] = $this->numero + $r + 1; // Permission id (must not be already used)
- $this->rights[$r][1] = 'Create/Update objects of Knowledge Management'; // Permission label
+ $this->rights[$r][1] = 'Create/Update articles'; // Permission label
$this->rights[$r][4] = 'knowledgerecord'; // In php code, permission will be checked by test if ($user->rights->knowledgemanagement->level1->level2)
$this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->knowledgemanagement->level1->level2)
$r++;
$this->rights[$r][0] = $this->numero + $r + 1; // Permission id (must not be already used)
- $this->rights[$r][1] = 'Delete objects of Knowledge Management'; // Permission label
+ $this->rights[$r][1] = 'Delete articles'; // Permission label
$this->rights[$r][4] = 'knowledgerecord'; // In php code, permission will be checked by test if ($user->rights->knowledgemanagement->level1->level2)
$this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->knowledgemanagement->level1->level2)
$r++;
@@ -282,6 +282,7 @@ class modKnowledgeManagement extends DolibarrModules
$r = 0;
// Add here entries to declare new menus
/* BEGIN MODULEBUILDER TOPMENU */
+ /*
$this->menu[$r++] = array(
'fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'type'=>'top', // This is a Top menu entry
@@ -297,60 +298,17 @@ class modKnowledgeManagement extends DolibarrModules
'target'=>'',
'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
);
- /* END MODULEBUILDER TOPMENU */
- /* BEGIN MODULEBUILDER LEFTMENU KNOWLEDGERECORD
- $this->menu[$r++]=array(
- 'fk_menu'=>'fk_mainmenu=knowledgemanagement', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
- 'type'=>'left', // This is a Top menu entry
- 'titre'=>'KnowledgeRecord',
- 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'),
- 'mainmenu'=>'knowledgemanagement',
- 'leftmenu'=>'knowledgerecord',
- 'url'=>'/knowledgemanagement/knowledgemanagementindex.php',
- 'langs'=>'knowledgemanagement@knowledgemanagement', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
- 'position'=>1000+$r,
- 'enabled'=>'$conf->knowledgemanagement->enabled', // Define condition to show or hide menu entry. Use '$conf->knowledgemanagement->enabled' if entry must be visible if module is enabled.
- 'perms'=>'$user->rights->knowledgemanagement->knowledgerecord->read', // Use 'perms'=>'$user->rights->knowledgemanagement->level1->level2' if you want your menu with a permission rules
- 'target'=>'',
- 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
- );
- $this->menu[$r++]=array(
- 'fk_menu'=>'fk_mainmenu=knowledgemanagement,fk_leftmenu=knowledgerecord', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
- 'type'=>'left', // This is a Left menu entry
- 'titre'=>'List_KnowledgeRecord',
- 'mainmenu'=>'knowledgemanagement',
- 'leftmenu'=>'knowledgemanagement_knowledgerecord_list',
- 'url'=>'/knowledgemanagement/knowledgerecord_list.php',
- 'langs'=>'knowledgemanagement@knowledgemanagement', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
- 'position'=>1000+$r,
- 'enabled'=>'$conf->knowledgemanagement->enabled', // Define condition to show or hide menu entry. Use '$conf->knowledgemanagement->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
- 'perms'=>'$user->rights->knowledgemanagement->knowledgerecord->read', // Use 'perms'=>'$user->rights->knowledgemanagement->level1->level2' if you want your menu with a permission rules
- 'target'=>'',
- 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
- );
- $this->menu[$r++]=array(
- 'fk_menu'=>'fk_mainmenu=knowledgemanagement,fk_leftmenu=knowledgerecord', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
- 'type'=>'left', // This is a Left menu entry
- 'titre'=>'New_KnowledgeRecord',
- 'mainmenu'=>'knowledgemanagement',
- 'leftmenu'=>'knowledgemanagement_knowledgerecord_new',
- 'url'=>'/knowledgemanagement/knowledgerecord_card.php?action=create',
- 'langs'=>'knowledgemanagement@knowledgemanagement', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
- 'position'=>1000+$r,
- 'enabled'=>'$conf->knowledgemanagement->enabled', // Define condition to show or hide menu entry. Use '$conf->knowledgemanagement->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
- 'perms'=>'$user->rights->knowledgemanagement->knowledgerecord->write', // Use 'perms'=>'$user->rights->knowledgemanagement->level1->level2' if you want your menu with a permission rules
- 'target'=>'',
- 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
- );
*/
+ /* END MODULEBUILDER TOPMENU */
$this->menu[$r++]=array(
// '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
- 'fk_menu'=>'fk_mainmenu=knowledgemanagement',
+ 'fk_menu'=>'fk_mainmenu=ticket',
// This is a Left menu entry
'type'=>'left',
'titre'=>'MenuKnowledgeRecord',
- 'mainmenu'=>'knowledgemanagement',
+ 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth em092"'),
+ 'mainmenu'=>'ticket',
'leftmenu'=>'knowledgemanagement_knowledgerecord',
'url'=>'/knowledgemanagement/knowledgerecord_list.php',
// Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
@@ -366,11 +324,11 @@ class modKnowledgeManagement extends DolibarrModules
);
$this->menu[$r++]=array(
// '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
- 'fk_menu'=>'fk_mainmenu=knowledgemanagement,fk_leftmenu=knowledgemanagement_knowledgerecord',
+ 'fk_menu'=>'fk_mainmenu=ticket,fk_leftmenu=knowledgemanagement_knowledgerecord',
// This is a Left menu entry
'type'=>'left',
'titre'=>'ListKnowledgeRecord',
- 'mainmenu'=>'knowledgemanagement',
+ 'mainmenu'=>'ticket',
'leftmenu'=>'knowledgemanagement_list',
'url'=>'/knowledgemanagement/knowledgerecord_list.php',
// Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
@@ -386,11 +344,11 @@ class modKnowledgeManagement extends DolibarrModules
);
$this->menu[$r++]=array(
// '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
- 'fk_menu'=>'fk_mainmenu=knowledgemanagement,fk_leftmenu=knowledgemanagement_knowledgerecord',
+ 'fk_menu'=>'fk_mainmenu=ticket,fk_leftmenu=knowledgemanagement_knowledgerecord',
// This is a Left menu entry
'type'=>'left',
'titre'=>'NewKnowledgeRecord',
- 'mainmenu'=>'knowledgemanagement',
+ 'mainmenu'=>'ticket',
'leftmenu'=>'knowledgemanagement_new',
'url'=>'/knowledgemanagement/knowledgerecord_card.php?action=create',
// Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
@@ -406,6 +364,7 @@ class modKnowledgeManagement extends DolibarrModules
);
/* END MODULEBUILDER LEFTMENU KNOWLEDGERECORD */
+
// Exports profiles provided by this module
$r = 1;
/* BEGIN MODULEBUILDER EXPORT KNOWLEDGERECORD */
diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php
index b374000c74c..8b1a1dc8525 100644
--- a/htdocs/core/modules/modTicket.class.php
+++ b/htdocs/core/modules/modTicket.class.php
@@ -200,7 +200,7 @@ class modTicket extends DolibarrModules
$this->menus = array(); // List of menus to add
$r = 0;
- $this->menu[$r] = array('fk_menu' => 0, // Put 0 if this is a top menu
+ /*$this->menu[$r] = array('fk_menu' => 0, // Put 0 if this is a top menu
'type' => 'top', // This is a Top menu entry
'titre' => 'Ticket',
'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth em092"'),
@@ -209,11 +209,11 @@ class modTicket extends DolibarrModules
'url' => '/ticket/index.php',
'langs' => 'ticket', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position' => 88,
- 'enabled' => '$conf->ticket->enabled', // Define condition to show or hide menu entry. Use '$conf->ticket->enabled' if entry must be visible if module is enabled.
+ 'enabled' => '$conf->ticket->enabled',
'perms' => '$user->rights->ticket->read', // Use 'perms'=>'$user->rights->ticket->level1->level2' if you want your menu with a permission rules
'target' => '',
'user' => 2); // 0=Menu for internal users, 1=external users, 2=both
- $r++;
+ $r++;*/
$this->menu[$r] = array('fk_menu' => 'fk_mainmenu=ticket',
'type' => 'left',
diff --git a/htdocs/install/mysql/data/llx_c_ticket_type.sql b/htdocs/install/mysql/data/llx_c_ticket_type.sql
index 660f1444b43..3b6fda322ad 100644
--- a/htdocs/install/mysql/data/llx_c_ticket_type.sql
+++ b/htdocs/install/mysql/data/llx_c_ticket_type.sql
@@ -19,7 +19,8 @@
INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('COM', '10', 'Commercial question', 1, 0, NULL);
INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('HELP', '15', 'Request for functionnal help', 1, 0, NULL);
-INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('ISSUE', '20', 'Issue or problem', 1, 0, NULL);
+INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('ISSUE', '20', 'Issue or bug', 1, 0, NULL);
+INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('PROBLEM', '22', 'Problem', 0, 0, NULL);
INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('REQUEST', '25', 'Change or enhancement request', 1, 0, NULL);
INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('PROJECT', '30', 'Project', 0, 0, NULL);
INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('OTHER', '40', 'Other', 1, 0, NULL);
diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql
index ade8f867160..a01f589aa20 100644
--- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql
+++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql
@@ -86,6 +86,9 @@ DELETE FROM llx_user_param where param = 'MAIN_THEME' and value in ('auguria', '
-- For v14
+UPDATE llx_c_ticket_type set label = 'Issue or bug' WHERE code = 'ISSUE';
+INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('PROBLEM', '22', 'Problem', 0, 0, NULL);
+
ALTER TABLE llx_import_model MODIFY COLUMN type varchar(64);
ALTER TABLE llx_export_model MODIFY COLUMN type varchar(64);
diff --git a/htdocs/knowledgemanagement/README.md b/htdocs/knowledgemanagement/README.md
new file mode 100644
index 00000000000..406e9032154
--- /dev/null
+++ b/htdocs/knowledgemanagement/README.md
@@ -0,0 +1,9 @@
+Knowledge Management base
+=========================
+
+
+A complete knowledge database inside your application.
+Store, search and retreive any article to keep your knowledge into a database. It can be used to manage a list of FAQ, or a database
+of process, or solutions of common problems.
+
+If you are using the Ticket module, you can also link each article of your knowledge management database to the main
diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php
index 872c5289c61..550ef976aba 100644
--- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php
+++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php
@@ -113,7 +113,7 @@ class KnowledgeRecord extends CommonObject
'question' => array('type'=>'text', 'label'=>'Question', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'csslist'=>'tdoverflow300'),
'answer' => array('type'=>'html', 'label'=>'Solution', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>3, 'csslist'=>'tdoverflow300'),
//'url' => array('type'=>'varchar(255)', 'label'=>'URL', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>-1, 'csslist'=>'tdoverflow200', 'help'=>'UrlForInfoPage'),
- 'fk_c_ticket_category' => array('type'=>'integer:CTicketCategory:ticket/class/cticketcategory.class.php', 'label'=>'TicketGroup', 'enabled'=>'$conf->ticket->enabled', 'position'=>512, 'notnull'=>0, 'visible'=>-1, 'help'=>'YouCanLinkArticleToATicketCategory'),
+ 'fk_c_ticket_category' => array('type'=>'integer:CTicketCategory:ticket/class/cticketcategory.class.php', 'label'=>'GroupOfTicket', 'enabled'=>'$conf->ticket->enabled', 'position'=>512, 'notnull'=>0, 'visible'=>-1, 'help'=>'YouCanLinkArticleToATicketCategory'),
'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'visible'=>1, 'default'=>0, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Valid'),),
);
public $rowid;
diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php
index c96319eb022..dbab7ec0528 100644
--- a/htdocs/knowledgemanagement/knowledgerecord_card.php
+++ b/htdocs/knowledgemanagement/knowledgerecord_card.php
@@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/class/knowledgerecord.class
require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php';
// Load translation files required by the page
-$langs->loadLangs(array("knowledgemanagement", "other"));
+$langs->loadLangs(array("knowledgemanagement", "ticket", "other"));
// Get parameters
$id = GETPOST('id', 'int');
diff --git a/htdocs/langs/en_US/knowledgemanagement.lang b/htdocs/langs/en_US/knowledgemanagement.lang
index 68f5cced76c..757ab01fc35 100644
--- a/htdocs/langs/en_US/knowledgemanagement.lang
+++ b/htdocs/langs/en_US/knowledgemanagement.lang
@@ -37,15 +37,7 @@ About = About
KnowledgeManagementAbout = About Knowledge Management
KnowledgeManagementAboutPage = Knowledge Management about page
-#
-# Sample page
-#
KnowledgeManagementArea = Knowledge Management
-
-
-#
-# Menu
-#
MenuKnowledgeRecord = Knowledge base
ListKnowledgeRecord = List of articles
NewKnowledgeRecord = New article
@@ -53,3 +45,5 @@ ValidateReply = Validate solution
KnowledgeRecords = Articles
KnowledgeRecord = Article
KnowledgeRecordExtraFields = Extrafields for Article
+GroupOfTicket=Group of tickets
+YouCanLinkArticleToATicketCategory=You can link an article to a ticket group (so the article will be suggested during qualification of new tickets)
\ No newline at end of file
diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang
index 0f87504a0a5..a039ee1b38b 100644
--- a/htdocs/langs/en_US/ticket.lang
+++ b/htdocs/langs/en_US/ticket.lang
@@ -34,7 +34,8 @@ TicketDictResolution=Ticket - Resolution
TicketTypeShortCOM=Commercial question
TicketTypeShortHELP=Request for functionnal help
-TicketTypeShortISSUE=Issue, bug or problem
+TicketTypeShortISSUE=Issue or bug
+TicketTypeShortPROBLEM=Problem
TicketTypeShortREQUEST=Change or enhancement request
TicketTypeShortPROJET=Project
TicketTypeShortOTHER=Other
@@ -54,14 +55,14 @@ TypeContact_ticket_internal_SUPPORTTEC=Assigned user
TypeContact_ticket_external_SUPPORTCLI=Customer contact / incident tracking
TypeContact_ticket_external_CONTRIBUTOR=External contributor
-OriginEmail=Email source
+OriginEmail=Email reporter
Notify_TICKET_SENTBYMAIL=Send ticket message by email
# Status
Read=Read
Assigned=Assigned
InProgress=In progress
-NeedMoreInformation=Waiting for information
+NeedMoreInformation=Waiting for customer feedback
Answered=Answered
Waiting=Waiting
Closed=Closed
@@ -160,7 +161,7 @@ CreatedBy=Created by
NewTicket=New Ticket
SubjectAnswerToTicket=Ticket answer
TicketTypeRequest=Request type
-TicketCategory=Group
+TicketCategory=Ticket categorization
SeeTicket=See ticket
TicketMarkedAsRead=Ticket has been marked as read
TicketReadOn=Read on
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index cd532ecd048..39a47e969a8 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -174,16 +174,28 @@ foreach ($object->fields as $key => $val) {
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
-// Add none object fields to fields for list
+// Add non object fields to fields for list
$arrayfields['s.nom'] = array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'position'=>21, 'enabled'=>(empty($conf->societe->enabled) ? 0 : 1));
$arrayfields['commercial'] = array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>0, 'position'=>23);
$arrayfields['opp_weighted_amount'] = array('label'=>$langs->trans('OpportunityWeightedAmountShort'), 'checked'=>0, 'position'=> 116, 'enabled'=>(empty($conf->global->PROJECT_USE_OPPORTUNITIES) ? 0 : 1), 'position'=>106);
+// Force some fields according to search_usage filter...
+if (GETPOST('search_usage_opportunity')) {
+ //$arrayfields['p.usage_opportunity']['visible'] = 1; // Not require, filter on search_opp_status is enough
+ //$arrayfields['p.usage_opportunity']['checked'] = 1; // Not require, filter on search_opp_status is enough
+}
+if (GETPOST('search_usage_event_organization')) {
+ $arrayfields['p.fk_opp_status']['enabled'] = 0;
+ $arrayfields['p.opp_amount']['enabled'] = 0;
+ $arrayfields['p.opp_percent']['enabled'] = 0;
+ $arrayfields['opp_weighted_amount']['enabled'] = 0;
+ $arrayfields['p.usage_organize_event']['visible'] = 1;
+ $arrayfields['p.usage_organize_event']['checked'] = 1;
+}
$object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
-
/*
* Actions
*/
@@ -720,6 +732,7 @@ $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
+
print '
';
if (!$i) {
$totalarray['nbfield']++;
diff --git a/htdocs/ticket/README.md b/htdocs/ticket/README.md
index e4c9b49f6b3..ee91036a0be 100644
--- a/htdocs/ticket/README.md
+++ b/htdocs/ticket/README.md
@@ -6,5 +6,5 @@ An issue tracker that provides a delicate balance between simplicity and power a
Offer your customers an easy to use interface to report and follow status of their issue. Manage your issues from
your backoffice.
+By enabling the Email Collector module, you can also having your ticket created automatically from input emails.
-(c) The development of this module has been initiated by the company Libr&thic and is now part of Dolibarr ERP CRM core.
diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php
index 42445ce1701..3cefec17686 100644
--- a/htdocs/ticket/list.php
+++ b/htdocs/ticket/list.php
@@ -45,7 +45,7 @@ $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
-$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'ticketlist'; // To manage different context of search
+$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'tickep#selectedfieldstlist'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
@@ -314,8 +314,7 @@ $formTicket = new FormTicket($db);
$now = dol_now();
-$user_assign = new User($db);
-$user_create = new User($db);
+$user_temp = new User($db);
$socstatic = new Societe($db);
$help_url = '';
@@ -973,8 +972,25 @@ while ($i < min($num, $limit)) {
print dol_print_date($db->jdate($obj->$key), 'dayhour', 'tzuser');
} elseif ($key == 'fk_user_create') {
if ($object->fk_user_create > 0) {
- $user_create->fetch($object->fk_user_create);
- print $user_create->getNomUrl(-1);
+ if (isset($conf->cache['user'][$object->fk_user_create])) {
+ $user_temp = $conf->cache['user'][$object->fk_user_create];
+ } else {
+ $user_temp = new User($db);
+ $user_temp->fetch($object->fk_user_create);
+ $conf->cache['user'][$object->fk_user_create] = $user_temp;
+ }
+ print $user_temp->getNomUrl(-1);
+ }
+ } elseif ($key == 'fk_user_assign') {
+ if ($object->fk_user_assign > 0) {
+ if (isset($conf->cache['user'][$object->fk_user_assign])) {
+ $user_temp = $conf->cache['user'][$object->fk_user_assign];
+ } else {
+ $user_temp = new User($db);
+ $user_temp->fetch($object->fk_user_assign);
+ $conf->cache['user'][$object->fk_user_assign] = $user_temp;
+ }
+ print $user_temp->getNomUrl(-1);
}
} elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
print $object->showOutputField($val, $key, $db->jdate($obj->$key), '');