====== How to activate RTE on a textarea field in a module ====== * set the Global Variable **Application_Use_RTE** to 1 for the module, which is it's default value * create an [[en:adminmanual:businessmappings:fieldinfo|Extended Field Information Mapping]] declaring the fields you want to have RTE activated * enjoy! ---- ---- THE PATCH BELOW IS NOT NECESSARY ANYMORE! It has been made obsolete by the [[en:adminmanual:businessmappings:fieldinfo|Extended Field Information Mapping]] where you can establish which textarea fields in which modules you want to edit with RTE. We leave the patch here as a historical reference. ---- ---- ====== How to activate RTE on a module ====== * Activate RTE feature in [[en:adminmanual:configeditor|Config Editor]] * modify template to add support for the module you want. If the module has more than one field with this feature you have to also add a block of code to launch CKEditor on the field * modify the EditView.php script of the module by passing the USE_RTE variable * modify the detail view of the fields to process and show HTML symbols {{:devel:patches:helpdeskrte.diff|This next patch does this for HelpDesk (Trouble Tickets)}} diff --git a/Smarty/templates/salesEditView.tpl b/Smarty/templates/salesEditView.tpl index 96ce7b2..febb003 100755 --- a/Smarty/templates/salesEditView.tpl +++ b/Smarty/templates/salesEditView.tpl @@ -251,7 +251,7 @@ function AddressSync(Addform,id) -{if ($MODULE eq 'Emails' || $MODULE eq 'Documents' || $MODULE eq 'Timecontrol') and ($USE_RTE eq 'true')} +{if ($MODULE eq 'Emails' || $MODULE eq 'Documents' || $MODULE eq 'Timecontrol' || $MODULE eq 'HelpDesk') and ($USE_RTE eq 'true')} {/if} diff --git a/include/utils/DetailViewUtils.php b/include/utils/DetailViewUtils.php index 73c555e..b9f5515 100755 --- a/include/utils/DetailViewUtils.php +++ b/include/utils/DetailViewUtils.php @@ -237,7 +237,7 @@ function getDetailViewOutputHtml($uitype, $fieldname, $fieldlabel, $col_fields, $label_fld[] = ''; } } elseif ($uitype == 19) { - if ($fieldname == 'notecontent' or $module=='Timecontrol') + if ($fieldname == 'notecontent' or $module=='Timecontrol' or $module=='HelpDesk') $col_fields[$fieldname] = decode_html($col_fields[$fieldname]); else $col_fields[$fieldname] = str_replace("<br />", "
", $col_fields[$fieldname]); diff --git a/modules/HelpDesk/EditView.php b/modules/HelpDesk/EditView.php index a042b55..3331f20 100755 --- a/modules/HelpDesk/EditView.php +++ b/modules/HelpDesk/EditView.php @@ -22,7 +22,7 @@ if($_REQUEST['record'] != '') { //Added to display the ticket comments information $smarty->assign("COMMENT_BLOCK",$focus->getCommentInformation($_REQUEST['record'])); } - +$smarty->assign("USE_RTE", vt_hasRTE()); $smarty->display("salesEditView.tpl"); ?> \ No newline at end of file