'."\n";
+ if (!$notab || $notab == -1 || $notab == -2 || $notab == -3) {
+ $out .= "\n".'
'."\n";
}
$parameters = array('tabname' => $active, 'out' => $out);
diff --git a/htdocs/core/tpl/commonfields_add.tpl.php b/htdocs/core/tpl/commonfields_add.tpl.php
index be91d7b28a5..24fddc2fda4 100644
--- a/htdocs/core/tpl/commonfields_add.tpl.php
+++ b/htdocs/core/tpl/commonfields_add.tpl.php
@@ -35,7 +35,7 @@ if (empty($conf) || !is_object($conf)) {
$object->fields = dol_sort_array($object->fields, 'position');
foreach ($object->fields as $key => $val) {
- // Discard if extrafield is a hidden field on form
+ // Discard if field is a hidden field on form
if (abs($val['visible']) != 1 && abs($val['visible']) != 3) {
continue;
}
diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php
index c20fa91c621..3e78b5b557c 100644
--- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php
+++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php
@@ -105,7 +105,6 @@ class KnowledgeRecord extends CommonObject
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>20, 'index'=>1),
'question' => array('type'=>'text', 'label'=>'Question', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'csslist'=>'tdoverflowmax300', 'copytoclipboard'=>1, 'tdcss'=>'titlefieldcreate nowraponall'),
'lang' => array('type'=>'varchar(6)', 'label'=>'Language', 'enabled'=>'1', 'position'=>40, 'notnull'=>0, 'visible'=>1, 'tdcss'=>'titlefieldcreate nowraponall', "csslist"=>"tdoverflowmax100"),
- 'answer' => array('type'=>'html', 'label'=>'Solution', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>3, 'csslist'=>'tdoverflowmax300', 'copytoclipboard'=>1, 'tdcss'=>'titlefieldcreate nowraponall'),
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,),
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>2,),
'last_main_doc' => array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>'1', 'position'=>600, 'notnull'=>0, 'visible'=>0,),
@@ -115,7 +114,8 @@ class KnowledgeRecord extends CommonObject
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,),
'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,),
//'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:0:(t.active:=:1):pos', 'label'=>'SuggestedForTicketsInGroup', 'enabled'=>'$conf->ticket->enabled', 'position'=>512, 'notnull'=>0, 'visible'=>-1, 'help'=>'YouCanLinkArticleToATicketCategory', 'csslist'=>'minwidth200 tdoverflowmax250'),
+ 'fk_c_ticket_category' => array('type'=>'integer:CTicketCategory:ticket/class/cticketcategory.class.php:0:(t.active:=:1):pos', 'label'=>'SuggestedForTicketsInGroup', 'enabled'=>'$conf->ticket->enabled', 'position'=>520, 'notnull'=>0, 'visible'=>-1, 'help'=>'YouCanLinkArticleToATicketCategory', 'csslist'=>'minwidth200 tdoverflowmax250'),
+ 'answer' => array('type'=>'html', 'label'=>'Solution', 'enabled'=>'1', 'position'=>600, 'notnull'=>0, 'visible'=>3, 'csslist'=>'tdoverflowmax300', 'copytoclipboard'=>1, 'tdcss'=>'titlefieldcreate nowraponall'),
'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'visible'=>5, 'default'=>0, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '9'=>'Obsolete'),),
);
public $rowid;
diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php
index ce3fceeff1c..c28bc9e1c9c 100644
--- a/htdocs/knowledgemanagement/knowledgerecord_card.php
+++ b/htdocs/knowledgemanagement/knowledgerecord_card.php
@@ -182,12 +182,14 @@ if ($action == 'create') {
print '
';
}
- print dol_get_fiche_head(array(), '');
+ print dol_get_fiche_head(array(), '', '', -3);
print '
'."\n";
// Common attributes
+ $object->fields['answer']['enabled'] = 0;
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
+ $object->fields['answer']['enabled'] = 1;
if (isModEnabled('categorie')) {
$cate_arbo = $form->select_all_categories(Categorie::TYPE_KNOWLEDGEMANAGEMENT, '', 'parent', 64, 0, 1);
@@ -205,6 +207,14 @@ if ($action == 'create') {
print '
'."\n";
+ // Add field answer
+ print '
';
+ print $langs->trans($object->fields['answer']['label']).'
';
+ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+ $doleditor = new DolEditor('answer', $object->answer, '', 200, 'dolibarr_notes', 'In', true, 0, true, ROWS_9, '100%');
+ $out = $doleditor->Create(1);
+ print $out;
+
print dol_get_fiche_end();
print $form->buttonsSaveCancel('Create');
@@ -229,12 +239,14 @@ if (($id || $ref) && $action == 'edit') {
print '
';
}
- print dol_get_fiche_head();
+ print dol_get_fiche_head(array(), '', '', -3);
print '
'."\n";
// Common attributes
+ $object->fields['answer']['enabled'] = 0;
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
+ $object->fields['answer']['enabled'] = 1;
if (isModEnabled('categorie')) {
$cate_arbo = $form->select_all_categories(Categorie::TYPE_KNOWLEDGEMANAGEMENT, '', 'parent', 64, 0, 1);
@@ -260,6 +272,14 @@ if (($id || $ref) && $action == 'edit') {
print '
';
+ // Add field answer
+ print '
';
+ print $langs->trans($object->fields['answer']['label']).'
';
+ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+ $doleditor = new DolEditor('answer', $object->answer, '', 200, 'dolibarr_notes', 'In', true, 0, true, ROWS_9, '100%');
+ $out = $doleditor->Create(1);
+ print $out;
+
print dol_get_fiche_end();
print $form->buttonsSaveCancel();
@@ -408,11 +428,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$keyforbreak='fk_c_ticket_category'; // We change column just before this field
//unset($object->fields['fk_project']); // Hide field already shown in banner
//unset($object->fields['fk_soc']); // Hide field already shown in banner
+ $object->fields['answer']['enabled'] = 0;
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
+ $object->fields['answer']['enabled'] = 1;
// Categories
if (isModEnabled('categorie')) {
- print '
'.$langs->trans("Categories").' ';
+ print ' '.$langs->trans("Categories").' ';
print $form->showCategories($object->id, Categorie::TYPE_KNOWLEDGEMANAGEMENT, 1);
print " ";
}
@@ -421,11 +443,20 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
print '';
+
print '