diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php
index 08987b2852d..b6e62973cf7 100644
--- a/htdocs/admin/bom.php
+++ b/htdocs/admin/bom.php
@@ -44,7 +44,6 @@ $type = 'bom';
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
-include DOL_DOCUMENT_ROOT.'/core/actions_setfreetext.inc.php';
if ($action == 'updateMask')
{
@@ -168,7 +167,23 @@ elseif ($action == 'set_BOM_DRAFT_WATERMARK')
}
}
-elseif ($action=="setshippableiconinlist") {
+elseif ($action == 'set_BOM_FREE_TEXT')
+{
+ $freetext = GETPOST("BOM_FREE_TEXT", 'none'); // No alpha here, we want exact string
+
+ $res = dolibarr_set_const($db, "BOM_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
+
+ if (! $res > 0) $error++;
+
+ if (! $error)
+ {
+ setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
+ }
+ else
+ {
+ setEventMessages($langs->trans("Error"), null, 'errors');
+ }
+} elseif ($action=="setshippableiconinlist") {
// Activate Set Shippable Icon In List
$setshippableiconinlist = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "SHIPPABLE_BOM_ICON_IN_LIST", $setshippableiconinlist, 'yesno', 0, '', $conf->entity);
@@ -475,12 +490,35 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
print "
\n";
print "\n";
- // free text
- $freetexttitle = $langs->trans("FreeLegalTextOnBOMs");
- $freetextvar = "BOM_FREE_TEXT";
- require_once(DOL_DOCUMENT_ROOT.'/core/tpl/admin_freetext.tpl.php');
+ $substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2);
+ $substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
+ $htmltext = ''.$langs->trans("AvailableVariables").': ';
+ foreach($substitutionarray as $key => $val) $htmltext.=$key.' ';
+ $htmltext.=' ';
+
+ print '';
//Use draft Watermark
+
print "";
print ' ';
print " ";
diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php
index 59d217adac1..efc192e6de1 100644
--- a/htdocs/admin/chequereceipts.php
+++ b/htdocs/admin/chequereceipts.php
@@ -44,7 +44,6 @@ $value = GETPOST('value', 'alpha');
if (empty($conf->global->CHEQUERECEIPTS_ADDON)) $conf->global->CHEQUERECEIPTS_ADDON = 'mod_chequereceipts_mint.php';
-include DOL_DOCUMENT_ROOT.'/core/actions_setfreetext.inc.php';
/*
* Actions
@@ -73,6 +72,23 @@ if ($action == 'setmod')
dolibarr_set_const($db, "CHEQUERECEIPTS_ADDON", $value, 'chaine', 0, '', $conf->entity);
}
+if ($action == 'set_BANK_CHEQUERECEIPT_FREE_TEXT')
+{
+ $freetext = GETPOST('BANK_CHEQUERECEIPT_FREE_TEXT', 'none'); // No alpha here, we want exact string
+
+ $res = dolibarr_set_const($db, "BANK_CHEQUERECEIPT_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
+
+ if (! $res > 0) $error++;
+
+ if (! $error)
+ {
+ setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
+ }
+ else
+ {
+ setEventMessages($langs->trans("Error"), null, 'errors');
+ }
+}
/*
* view
@@ -221,6 +237,10 @@ print ' ';
*/
print load_fiche_titre($langs->trans("OtherOptions"), '', '');
+print ' ';
+print ' ';
+print ' ';
+
print '';
print '';
print ''.$langs->trans("Parameters").' ';
@@ -228,15 +248,37 @@ print ' ';
print ' ';
print " \n";
-// free text
-$freetexttitle = $langs->trans("FreeLegalTextOnChequeReceipts");
-$freetextvar = "BANK_CHEQUERECEIPT_FREE_TEXT";
-require_once(DOL_DOCUMENT_ROOT.'/core/tpl/admin_freetext.tpl.php');
+$substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2);
+$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
+$htmltext = ''.$langs->trans("AvailableVariables").': ';
+foreach($substitutionarray as $key => $val) $htmltext.=$key.' ';
+$htmltext.=' ';
+
+print '';
+print $form->textwithpicto($langs->trans("FreeLegalTextOnChequeReceipts"), $langs->trans("AddCRIfTooLong").' '.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').' ';
+$variablename='BANK_CHEQUERECEIPT_FREE_TEXT';
+if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
+{
+ print ''.$conf->global->$variablename.' ';
+}
+else
+{
+ include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+ $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
+ print $doleditor->Create();
+}
+print ' ';
+print ' ';
+print " \n";
+print '
';
+print " ";
print ''."\n";
dol_fiche_end();
+print ' ';
+
// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php
index b7e1e3e0f75..455175220a8 100644
--- a/htdocs/admin/commande.php
+++ b/htdocs/admin/commande.php
@@ -47,12 +47,12 @@ $label = GETPOST('label', 'alpha');
$scandir = GETPOST('scan_dir', 'alpha');
$type = 'order';
+
/*
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
-include DOL_DOCUMENT_ROOT.'/core/actions_setfreetext.inc.php';
if ($action == 'updateMask')
{
@@ -176,8 +176,23 @@ elseif ($action == 'set_COMMANDE_DRAFT_WATERMARK')
}
}
-elseif ($action=="setshippableiconinlist")
+elseif ($action == 'set_ORDER_FREE_TEXT')
{
+ $freetext = GETPOST("ORDER_FREE_TEXT", 'none'); // No alpha here, we want exact string
+
+ $res = dolibarr_set_const($db, "ORDER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
+
+ if (! $res > 0) $error++;
+
+ if (! $error)
+ {
+ setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
+ }
+ else
+ {
+ setEventMessages($langs->trans("Error"), null, 'errors');
+ }
+} elseif ($action=="setshippableiconinlist") {
// Activate Set Shippable Icon In List
$setshippableiconinlist = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist, 'yesno', 0, '', $conf->entity);
@@ -517,12 +532,35 @@ print ''.$langs->trans("Value").' ';
print " \n";
print "\n";
-// free text
-$freetexttitle = $langs->trans("FreeLegalTextOnOrders");
-$freetextvar = "ORDER_FREE_TEXT";
-require_once(DOL_DOCUMENT_ROOT.'/core/tpl/admin_freetext.tpl.php');
+$substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2);
+$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
+$htmltext = ''.$langs->trans("AvailableVariables").': ';
+foreach($substitutionarray as $key => $val) $htmltext.=$key.' ';
+$htmltext.=' ';
+
+print '';
+print ' ';
+print ' ';
+print '';
+print $form->textwithpicto($langs->trans("FreeLegalTextOnOrders"), $langs->trans("AddCRIfTooLong").' '.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').' ';
+$variablename='ORDER_FREE_TEXT';
+if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
+{
+ print ''.$conf->global->$variablename.' ';
+}
+else
+{
+ include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+ $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
+ print $doleditor->Create();
+}
+print ' ';
+print ' ';
+print " \n";
+print ' ';
//Use draft Watermark
+
print "";
print ' ';
print " ";
diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php
index e3d67c8aef7..63597eaa22b 100644
--- a/htdocs/admin/contract.php
+++ b/htdocs/admin/contract.php
@@ -50,7 +50,6 @@ if (empty($conf->global->CONTRACT_ADDON))
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
-include DOL_DOCUMENT_ROOT.'/core/actions_setfreetext.inc.php';
if ($action == 'updateMask')
{
@@ -158,10 +157,13 @@ elseif ($action == 'setmod')
elseif ($action == 'set_other')
{
- $draft= GETPOST('CONTRACT_DRAFT_WATERMARK', 'alpha');
- $res = dolibarr_set_const($db, "CONTRACT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
+ $freetext= GETPOST('CONTRACT_FREE_TEXT', 'none'); // No alpha here, we want exact string
+ $res1 = dolibarr_set_const($db, "CONTRACT_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
- if (! $res > 0) $error++;
+ $draft= GETPOST('CONTRACT_DRAFT_WATERMARK', 'alpha');
+ $res2 = dolibarr_set_const($db, "CONTRACT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
+
+ if (! $res1 > 0 || ! $res2 > 0) $error++;
if (! $error)
{
@@ -456,37 +458,55 @@ print " ";
*
*/
+print ' ';
+print ' ';
+print ' ';
+
print load_fiche_titre($langs->trans("OtherOptions"), '', '');
print '';
print '';
print ''.$langs->trans("Parameter").' ';
print ''.$langs->trans("Value").' ';
-print " \n";
print " \n";
-// free text
-$freetexttitle = $langs->trans("FreeLegalTextOnContracts");
-$freetextvar = "CONTRACT_FREE_TEXT";
-$freetextsubstitutionexclude = array('objectamount');
-require_once(DOL_DOCUMENT_ROOT.'/core/tpl/admin_freetext.tpl.php');
+$substitutionarray=pdf_getSubstitutionArray($langs, array('objectamount'), null, 2);
+$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
+$htmltext = ''.$langs->trans("AvailableVariables").': ';
+foreach($substitutionarray as $key => $val) $htmltext.=$key.' ';
+$htmltext.=' ';
-print '';
-print ' ';
-print ' ';
+print '';
+print $form->textwithpicto($langs->trans("FreeLegalTextOnContracts"), $langs->trans("AddCRIfTooLong").' '.$htmltext, 1, 'help', '', 0, 2, 'tooltiphelp');
+print ' ';
+$variablename='CONTRACT_FREE_TEXT';
+if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
+{
+ print ''.$conf->global->$variablename.' ';
+}
+else
+{
+ include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+ $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
+ print $doleditor->Create();
+}
+print ' '."\n";
//Use draft Watermark
+
print '';
print $form->textwithpicto($langs->trans("WatermarkOnDraftContractCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').' ';
print ' ';
print ' ';
-print ' ';
-print ' ';
print ' '."\n";
-print ' ';
-
print '
';
+print '';
+print ' ';
+print '
';
+
+print ' ';
+
dol_fiche_end();
// End of page
diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php
index cf473c53aa7..23a154511c1 100644
--- a/htdocs/admin/expedition.php
+++ b/htdocs/admin/expedition.php
@@ -57,7 +57,6 @@ if (empty($conf->global->EXPEDITION_ADDON_NUMBER))
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
-include DOL_DOCUMENT_ROOT.'/core/actions_setfreetext.inc.php';
if ($action == 'updateMask')
{
@@ -77,6 +76,14 @@ if ($action == 'updateMask')
elseif ($action == 'set_param')
{
+ $freetext=GETPOST('SHIPPING_FREE_TEXT', 'none'); // No alpha here, we want exact string
+ $res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
+ if ($res <= 0)
+ {
+ $error++;
+ setEventMessages($langs->trans("Error"), null, 'errors');
+ }
+
$draft=GETPOST('SHIPPING_DRAFT_WATERMARK', 'alpha');
$res = dolibarr_set_const($db, "SHIPPING_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
if ($res <= 0)
@@ -459,35 +466,47 @@ print ' ';
*/
print load_fiche_titre($langs->trans("OtherOptions"));
-print '';
-print '';
-print ''.$langs->trans("Parameter").' ';
-print ''.$langs->trans("Value").' ';
-print " \n";
-print " \n";
-
-// free text
-$freetexttitle = $langs->trans("FreeLegalTextOnShippings");
-$freetextvar = "SHIPPING_FREE_TEXT";
-require_once(DOL_DOCUMENT_ROOT.'/core/tpl/admin_freetext.tpl.php');
-
-
print '';
print ' ';
print ' ';
+print "";
+print "";
+print "".$langs->trans("Parameter")." \n";
+print " ";
+
+$substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2);
+$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
+$htmltext = ''.$langs->trans("AvailableVariables").': ';
+foreach($substitutionarray as $key => $val) $htmltext.=$key.' ';
+$htmltext.=' ';
+
print '';
-print $form->textwithpicto($langs->trans("WatermarkOnDraftContractCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').' ';
-print ' ';
-print ' ';
-print ' ';
-print ' ';
+print $form->textwithpicto($langs->trans("FreeLegalTextOnShippings"), $langs->trans("AddCRIfTooLong").' '.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').' ';
+$variablename='SHIPPING_FREE_TEXT';
+if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
+{
+ print ''.$conf->global->$variablename.' ';
+}
+else
+{
+ include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+ $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
+ print $doleditor->Create();
+}
print " \n";
-print '';
+print '';
+print $form->textwithpicto($langs->trans("WatermarkOnDraftContractCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').' ';
+print ' ';
+print " \n";
print '
';
+print '
';
+
+print ' ';
+
// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php
index cf65089977c..da77c0e78d3 100644
--- a/htdocs/admin/expensereport.php
+++ b/htdocs/admin/expensereport.php
@@ -51,7 +51,6 @@ $type='expensereport';
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
-include DOL_DOCUMENT_ROOT.'/core/actions_setfreetext.inc.php';
if ($action == 'updateMask')
{
@@ -167,10 +166,13 @@ elseif ($action == 'setoptions')
{
$db->begin();
- $draft= GETPOST('EXPENSEREPORT_DRAFT_WATERMARK', 'alpha');
- $res = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
+ $freetext= GETPOST('EXPENSEREPORT_FREE_TEXT', 'none'); // No alpha here, we want exact string
+ $res1 = dolibarr_set_const($db, "EXPENSEREPORT_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
- if (! $res > 0) $error++;
+ $draft= GETPOST('EXPENSEREPORT_DRAFT_WATERMARK', 'alpha');
+ $res2 = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
+
+ if (! $res1 > 0 || ! $res2 > 0) $error++;
if (! $error)
{
@@ -462,37 +464,53 @@ print ' ';
* Other options
*/
-print load_fiche_titre($langs->trans("OtherOptions"), '', '');
-print '';
-print '';
-print ''.$langs->trans("Parameter").' ';
-print ' ';
-print " \n";
-print " \n";
-
-// free text
-$freetexttitle = $langs->trans("FreeLegalTextOnExpenseReports");
-$freetextvar = "EXPENSEREPORT_FREE_TEXT";
-require_once(DOL_DOCUMENT_ROOT.'/core/tpl/admin_freetext.tpl.php');
-
-
print '';
print ' ';
print ' ';
+print load_fiche_titre($langs->trans("OtherOptions"), '', '');
+print '';
+print '';
+print ''.$langs->trans("Parameter").' ';
+print ' ';
+print " \n";
+
+$substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2);
+$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
+$htmltext = ''.$langs->trans("AvailableVariables").': ';
+foreach($substitutionarray as $key => $val) $htmltext.=$key.' ';
+$htmltext.=' ';
+
+print '';
+print $form->textwithpicto($langs->trans("FreeLegalTextOnExpenseReports"), $langs->trans("AddCRIfTooLong").' '.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').' ';
+$variablename='EXPENSEREPORT_FREE_TEXT';
+if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
+{
+ print ''.$conf->global->$variablename.' ';
+}
+else
+{
+ include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+ $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
+ print $doleditor->Create();
+}
+print ' '."\n";
+
//Use draft Watermark
print '';
print $form->textwithpicto($langs->trans("WatermarkOnDraftExpenseReports"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').' ';
print ' ';
-print ' ';
-print ' ';
print ' '."\n";
-print '';
-
print '
';
+print '';
+print ' ';
+print '
';
+
+print ' ';
+
dol_fiche_end();
// End of page
diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php
index b0991365a6d..765f2e6f995 100644
--- a/htdocs/admin/facture.php
+++ b/htdocs/admin/facture.php
@@ -50,7 +50,6 @@ $type='invoice';
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
-include DOL_DOCUMENT_ROOT.'/core/actions_setfreetext.inc.php';
if ($action == 'updateMask')
{
@@ -196,6 +195,24 @@ elseif ($action == 'set_FACTURE_DRAFT_WATERMARK')
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
+
+elseif ($action == 'set_INVOICE_FREE_TEXT')
+{
+ $freetext = GETPOST('INVOICE_FREE_TEXT', 'none'); // No alpha here, we want exact string
+
+ $res = dolibarr_set_const($db, "INVOICE_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
+
+ if (! $res > 0) $error++;
+
+ if (! $error)
+ {
+ setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
+ }
+ else
+ {
+ setEventMessages($langs->trans("Error"), null, 'errors');
+ }
+}
elseif ($action == 'setforcedate')
{
$forcedate = GETPOST('forcedate', 'alpha');
@@ -742,12 +759,34 @@ print ' \n";
print '';
-// free text
-$freetexttitle = $langs->trans("FreeLegalTextOnInvoices");
-$freetextvar = "INVOICE_FREE_TEXT";
-require_once(DOL_DOCUMENT_ROOT.'/core/tpl/admin_freetext.tpl.php');
+$substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2);
+$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
+$htmltext = ''.$langs->trans("AvailableVariables").': ';
+foreach($substitutionarray as $key => $val) $htmltext.=$key.' ';
+$htmltext.=' ';
+
+print '';
+print ' ';
+print ' ';
+print '';
+print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices"), $langs->trans("AddCRIfTooLong").' '.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').' ';
+$variablename='INVOICE_FREE_TEXT';
+if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
+{
+ print ''.$conf->global->$variablename.' ';
+}
+else
+{
+ include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+ $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
+ print $doleditor->Create();
+}
+print ' ';
+print ' ';
+print " \n";
+print ' ';
+
-//Use draft Watermark
print '';
print ' ';
print ' ';
diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php
index 89f112b023c..27f105435d5 100644
--- a/htdocs/admin/fichinter.php
+++ b/htdocs/admin/fichinter.php
@@ -51,7 +51,6 @@ $type='ficheinter';
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
-include DOL_DOCUMENT_ROOT.'/core/actions_setfreetext.inc.php';
if ($action == 'updateMask')
{
@@ -157,6 +156,23 @@ elseif ($action == 'setmod')
dolibarr_set_const($db, "FICHEINTER_ADDON", $value, 'chaine', 0, '', $conf->entity);
}
+elseif ($action == 'set_FICHINTER_FREE_TEXT')
+{
+ $freetext= GETPOST('FICHINTER_FREE_TEXT', 'none'); // No alpha here, we want exact string
+ $res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
+
+ if (! $res > 0) $error++;
+
+ if (! $error)
+ {
+ setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
+ }
+ else
+ {
+ setEventMessages($langs->trans("Error"), null, 'errors');
+ }
+}
+
elseif ($action == 'set_FICHINTER_DRAFT_WATERMARK')
{
$draft= GETPOST('FICHINTER_DRAFT_WATERMARK', 'alpha');
@@ -516,10 +532,32 @@ print ''.$langs->trans("Value").' ';
print " \n";
print "\n";
-// free text
-$freetexttitle = $langs->trans("FreeLegalTextOnInterventions");
-$freetextvar = "FICHINTER_FREE_TEXT";
-require_once(DOL_DOCUMENT_ROOT.'/core/tpl/admin_freetext.tpl.php');
+$substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2);
+$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
+$htmltext = ''.$langs->trans("AvailableVariables").': ';
+foreach($substitutionarray as $key => $val) $htmltext.=$key.' ';
+$htmltext.=' ';
+
+print ' ';
+print ' ';
+print ' ';
+print '';
+print $form->textwithpicto($langs->trans("FreeLegalTextOnInterventions"), $langs->trans("AddCRIfTooLong").' '.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').' ';
+$variablename='FICHINTER_FREE_TEXT';
+if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
+{
+ print ''.$conf->global->$variablename.' ';
+}
+else
+{
+ include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+ $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
+ print $doleditor->Create();
+}
+print ' ';
+print ' ';
+print " \n";
+print ' ';
//Use draft Watermark
print "";
diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php
index 8f975ef7bf3..e3571fdb253 100644
--- a/htdocs/admin/holiday.php
+++ b/htdocs/admin/holiday.php
@@ -52,7 +52,6 @@ if (empty($conf->global->HOLIDAY_ADDON))
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
-include DOL_DOCUMENT_ROOT.'/core/actions_setfreetext.inc.php';
if ($action == 'updateMask')
{
@@ -160,10 +159,13 @@ elseif ($action == 'setmod')
elseif ($action == 'set_other')
{
- $draft= GETPOST('HOLIDAY_DRAFT_WATERMARK', 'alpha');
- $res = dolibarr_set_const($db, "HOLIDAY_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
+ $freetext= GETPOST('HOLIDAY_FREE_TEXT', 'none'); // No alpha here, we want exact string
+ $res1 = dolibarr_set_const($db, "HOLIDAY_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
- if (! $res > 0) $error++;
+ $draft= GETPOST('HOLIDAY_DRAFT_WATERMARK', 'alpha');
+ $res2 = dolibarr_set_const($db, "HOLIDAY_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
+
+ if (! $res1 > 0 || ! $res2 > 0) $error++;
if (! $error)
{
@@ -462,37 +464,54 @@ print " ";
* Other options
*/
-print load_fiche_titre($langs->trans("OtherOptions"), '', '');
-
-print '';
-print '';
-print ''.$langs->trans("Parameter").' ';
-print ''.$langs->trans("Value").' ';
-print " \n";
-print " \n";
-
-// free text
-$freetexttitle = $langs->trans("FreeLegalTextOnHolidays");
-$freetextvar = "HOLIDAY_FREE_TEXT";
-$freetextsubstitutionexclude = array('objectamount');
-require_once(DOL_DOCUMENT_ROOT.'/core/tpl/admin_freetext.tpl.php');
-
print '';
print ' ';
print ' ';
+print load_fiche_titre($langs->trans("OtherOptions"), '', '');
+print '';
+print '';
+print ''.$langs->trans("Parameter").' ';
+print ''.$langs->trans("Value").' ';
+print " \n";
+
+$substitutionarray=pdf_getSubstitutionArray($langs, array('objectamount'), null, 2);
+$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
+$htmltext = ''.$langs->trans("AvailableVariables").': ';
+foreach($substitutionarray as $key => $val) $htmltext.=$key.' ';
+$htmltext.=' ';
+
+print '';
+print $form->textwithpicto($langs->trans("FreeLegalTextOnHolidays"), $langs->trans("AddCRIfTooLong").' '.$htmltext, 1, 'help', '', 0, 2, 'tooltiphelp');
+print ' ';
+$variablename='HOLIDAY_FREE_TEXT';
+if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
+{
+ print ''.$conf->global->$variablename.' ';
+}
+else
+{
+ include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+ $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
+ print $doleditor->Create();
+}
+print ' '."\n";
+
//Use draft Watermark
+
print '';
print $form->textwithpicto($langs->trans("WatermarkOnDraftHolidayCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').' ';
print ' ';
print ' ';
-print ' ';
-print ' ';
print ' '."\n";
-print '';
-
print '
';
+
+print '';
+print ' ';
+print '
';
+
+print ' ';
}
diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php
index 287f21da022..7635c9a3c19 100644
--- a/htdocs/admin/livraison.php
+++ b/htdocs/admin/livraison.php
@@ -51,7 +51,6 @@ $type='delivery';
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
-include DOL_DOCUMENT_ROOT.'/core/actions_setfreetext.inc.php';
if ($action == 'updateMask')
{
@@ -71,6 +70,23 @@ if ($action == 'updateMask')
}
}
+if ($action == 'set_DELIVERY_FREE_TEXT')
+{
+ $free=GETPOST('DELIVERY_FREE_TEXT', 'none'); // No alpha here, we want exact string
+ $res=dolibarr_set_const($db, "DELIVERY_FREE_TEXT", $free, 'chaine', 0, '', $conf->entity);
+
+ if (! $res > 0) $error++;
+
+ if (! $error)
+ {
+ setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
+ }
+ else
+ {
+ setEventMessages($langs->trans("Error"), null, 'errors');
+ }
+}
+
if ($action == 'specimen')
{
$modele=GETPOST('module', 'alpha');
@@ -433,10 +449,32 @@ print ''.$langs->trans("Value").' ';
print ' ';
print "\n";
-// free text
-$freetexttitle = $langs->trans("FreeLegalTextOnDeliveryReceipts");
-$freetextvar = "DELIVERY_FREE_TEXT";
-require_once(DOL_DOCUMENT_ROOT.'/core/tpl/admin_freetext.tpl.php');
+$substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2);
+$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
+$htmltext = ''.$langs->trans("AvailableVariables").': ';
+foreach($substitutionarray as $key => $val) $htmltext.=$key.' ';
+$htmltext.=' ';
+
+print '';
+print ' ';
+print ' ';
+print '';
+print $form->textwithpicto($langs->trans("FreeLegalTextOnDeliveryReceipts"), $langs->trans("AddCRIfTooLong").' '.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').' ';
+$variablename='DELIVERY_FREE_TEXT';
+if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
+{
+ print ''.$conf->global->$variablename.' ';
+}
+else
+{
+ include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+ $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
+ print $doleditor->Create();
+}
+print ' ';
+print ' ';
+print " \n";
+print ' ';
print '
';
diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php
index f975222cb97..843de325e73 100644
--- a/htdocs/admin/propal.php
+++ b/htdocs/admin/propal.php
@@ -50,7 +50,6 @@ $type='propal';
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
-include DOL_DOCUMENT_ROOT.'/core/actions_setfreetext.inc.php';
$error=0;
if ($action == 'updateMask')
@@ -149,6 +148,23 @@ elseif ($action == 'set_PROPALE_DRAFT_WATERMARK')
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
+elseif ($action == 'set_PROPOSAL_FREE_TEXT')
+{
+ $freetext = GETPOST('PROPOSAL_FREE_TEXT', 'none'); // No alpha here, we want exact string
+
+ $res = dolibarr_set_const($db, "PROPOSAL_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
+
+ if (! $res > 0) $error++;
+
+ if (! $error)
+ {
+ setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
+ }
+ else
+ {
+ setEventMessages($langs->trans("Error"), null, 'errors');
+ }
+}
elseif ($action == 'setdefaultduration')
{
$res = dolibarr_set_const($db, "PROPALE_VALIDITY_DURATION", $value, 'chaine', 0, '', $conf->entity);
@@ -637,12 +653,34 @@ print "\n";
print ' ';
*/
-// free text
-$freetexttitle = $langs->trans("FreeLegalTextOnProposal");
-$freetextvar = "PROPOSAL_FREE_TEXT";
-require_once(DOL_DOCUMENT_ROOT.'/core/tpl/admin_freetext.tpl.php');
+$substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2);
+$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
+$htmltext = ''.$langs->trans("AvailableVariables").': ';
+foreach($substitutionarray as $key => $val) $htmltext.=$key.' ';
+$htmltext.=' ';
+
+print '';
+print ' ';
+print ' ';
+print '';
+print $form->textwithpicto($langs->trans("FreeLegalTextOnProposal"), $langs->trans("AddCRIfTooLong").' '.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').' ';
+$variablename='PROPOSAL_FREE_TEXT';
+if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
+{
+ print ''.$conf->global->$variablename.' ';
+}
+else
+{
+ include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+ $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
+ print $doleditor->Create();
+}
+print ' ';
+print ' ';
+print " \n";
+print ' ';
+
-//Use draft Watermark
print "";
print ' ';
print " ";
diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php
index 74dc50564b9..836afc27a7c 100644
--- a/htdocs/admin/supplier_invoice.php
+++ b/htdocs/admin/supplier_invoice.php
@@ -55,8 +55,6 @@ $specimenthirdparty->initAsSpecimen();
* Actions
*/
-include DOL_DOCUMENT_ROOT.'/core/actions_setfreetext.inc.php';
-
if ($action == 'updateMask')
{
$maskconstinvoice=GETPOST('maskconstinvoice', 'alpha');
@@ -176,6 +174,25 @@ if ($action == 'addcat')
$fourn->CreateCategory($user, $_POST["cat"]);
}
+if ($action == 'set_SUPPLIER_INVOICE_FREE_TEXT')
+{
+ $freetext = GETPOST('SUPPLIER_INVOICE_FREE_TEXT', 'none'); // No alpha here, we want exact string
+
+ $res = dolibarr_set_const($db, "SUPPLIER_INVOICE_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
+
+ if (! $res > 0) $error++;
+
+ if (! $error)
+ {
+ setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
+ }
+ else
+ {
+ setEventMessages($langs->trans("Error"), null, 'errors');
+ }
+}
+
+
/*
* View
*/
@@ -444,6 +461,11 @@ print '
';
/*
* Other options
*/
+
+print '';
+print ' ';
+print ' ';
+
print load_fiche_titre($langs->trans("OtherOptions"), '', '');
print '';
print '';
@@ -452,10 +474,33 @@ print ''.$langs->trans("Value").' ';
print ' ';
print " \n";
-// free text
-$freetexttitle = $langs->trans("FreeLegalTextOnInvoices");
-$freetextvar = "SUPPLIER_INVOICE_FREE_TEXT";
-require_once(DOL_DOCUMENT_ROOT.'/core/tpl/admin_freetext.tpl.php');
+$substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2);
+$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
+$htmltext = ''.$langs->trans("AvailableVariables").': ';
+foreach($substitutionarray as $key => $val) $htmltext.=$key.' ';
+$htmltext.=' ';
+
+print '';
+print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices"), $langs->trans("AddCRIfTooLong").' '.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').' ';
+$variablename='SUPPLIER_INVOICE_FREE_TEXT';
+if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
+{
+ print ''.$conf->global->$variablename.' ';
+}
+else
+{
+ include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+ $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
+ print $doleditor->Create();
+}
+print ' ';
+print ' ';
+print " \n";
+
+print '
';
+
+print ' ';
+
/*
* Notifications
diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php
index eca7fe7b4d7..e895a0b4005 100644
--- a/htdocs/admin/supplier_order.php
+++ b/htdocs/admin/supplier_order.php
@@ -54,8 +54,6 @@ $specimenthirdparty->initAsSpecimen();
* Actions
*/
-include DOL_DOCUMENT_ROOT.'/core/actions_setfreetext.inc.php';
-
if ($action == 'updateMask')
{
$maskconstorder=GETPOST('maskconstorder', 'alpha');
@@ -170,10 +168,12 @@ elseif ($action == 'addcat')
elseif ($action == 'set_SUPPLIER_ORDER_OTHER')
{
+ $freetext = GETPOST('SUPPLIER_ORDER_FREE_TEXT', 'none'); // No alpha here, we want exact string
$doubleapproval = GETPOST('SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED', 'alpha');
$doubleapproval = price2num($doubleapproval);
- $res = dolibarr_set_const($db, "SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED", $doubleapproval, 'chaine', 0, '', $conf->entity);
+ $res1 = dolibarr_set_const($db, "SUPPLIER_ORDER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
+ $res2 = dolibarr_set_const($db, "SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED", $doubleapproval, 'chaine', 0, '', $conf->entity);
// TODO We add/delete permission here until permission can have a condition on a global var
include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php';
@@ -541,12 +541,34 @@ else
}
*/
+$substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2);
+$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
+$htmltext = ''.$langs->trans("AvailableVariables").': ';
+foreach($substitutionarray as $key => $val) $htmltext.=$key.' ';
+$htmltext.=' ';
+
+print '';
+print $form->textwithpicto($langs->trans("FreeLegalTextOnOrders"), $langs->trans("AddCRIfTooLong").' '.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').' ';
+$variablename='SUPPLIER_ORDER_FREE_TEXT';
+if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
+{
+ print ''.$conf->global->$variablename.' ';
+}
+else
+{
+ include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+ $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
+ print $doleditor->Create();
+}
+print ' ';
+print ' ';
+print " \n";
+
+print '
';
+
print '';
-// free text
-$freetexttitle = $langs->trans("FreeLegalTextOnOrders");
-$freetextvar = "SUPPLIER_ORDER_FREE_TEXT";
-require_once(DOL_DOCUMENT_ROOT.'/core/tpl/admin_freetext.tpl.php');
+
/*
* Notifications
diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php
index b3dd25105cc..e627068b692 100644
--- a/htdocs/admin/supplier_proposal.php
+++ b/htdocs/admin/supplier_proposal.php
@@ -48,7 +48,6 @@ $error=0;
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
-include DOL_DOCUMENT_ROOT.'/core/actions_setfreetext.inc.php';
if ($action == 'updateMask')
{
@@ -130,6 +129,24 @@ if ($action == 'set_SUPPLIER_PROPOSAL_DRAFT_WATERMARK')
}
}
+if ($action == 'set_SUPPLIER_PROPOSAL_FREE_TEXT')
+{
+ $freetext = GETPOST('SUPPLIER_PROPOSAL_FREE_TEXT', 'none'); // No alpha here, we want exact string
+
+ $res = dolibarr_set_const($db, "SUPPLIER_PROPOSAL_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
+
+ if (! $res > 0) $error++;
+
+ if (! $error)
+ {
+ setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
+ }
+ else
+ {
+ setEventMessages($langs->trans("Error"), null, 'errors');
+ }
+}
+
if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL')
{
$res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL", $value, 'chaine', 0, '', $conf->entity);
@@ -478,12 +495,34 @@ print ''.$langs->trans("Value")." \n";
print " \n";
print "";
-// free text
-$freetexttitle = $langs->trans("FreeLegalTextOnSupplierProposal");
-$freetextvar = "SUPPLIER_PROPOSAL_FREE_TEXT";
-require_once(DOL_DOCUMENT_ROOT.'/core/tpl/admin_freetext.tpl.php');
+$substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2);
+$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
+$htmltext = ''.$langs->trans("AvailableVariables").': ';
+foreach($substitutionarray as $key => $val) $htmltext.=$key.' ';
+$htmltext.=' ';
+
+print '';
+print ' ';
+print ' ';
+print '';
+print $form->textwithpicto($langs->trans("FreeLegalTextOnSupplierProposal"), $langs->trans("AddCRIfTooLong").' '.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').' ';
+$variablename='SUPPLIER_PROPOSAL_FREE_TEXT';
+if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
+{
+ print ''.$conf->global->$variablename.' ';
+}
+else
+{
+ include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+ $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
+ print $doleditor->Create();
+}
+print ' ';
+print ' ';
+print " \n";
+print ' ';
+
-//Use draft Watermark
print "";
print ' ';
print " ";
diff --git a/htdocs/core/actions_setfreetext.inc.php b/htdocs/core/actions_setfreetext.inc.php
deleted file mode 100644
index deb6efd9f86..00000000000
--- a/htdocs/core/actions_setfreetext.inc.php
+++ /dev/null
@@ -1,52 +0,0 @@
-
- *
- * 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
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- * or see http://www.gnu.org/
- */
-
-/**
- * \file htdocs/core/actions_setmoduleoptions.inc.php
- * \brief Code for actions on setting notes of object page
- */
-
-
-// $action must be defined
-
-if ($action == 'set_freetext')
-{
- $freetextvar = GETPOST("freetextvar", 'alpha');
- $freetext = GETPOST("freetext", 'none'); // No alpha here, we want exact string
- $freetextlang = GETPOST('freetextlang', 'alpha');
-
- if ( ! empty($conf->global->MAIN_MULTILANGS) && !empty($freetextlang) )
- {
- $res = dolibarr_set_const($db, $freetextvar."_".$freetextlang, $freetext, 'chaine', 0, '', $conf->entity);
- }
- else
- {
- $res = dolibarr_set_const($db, $freetextvar, $freetext, 'chaine', 0, '', $conf->entity);
- }
-
- if (! $res > 0) $error++;
-
- if (! $error)
- {
- setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
- }
- else
- {
- setEventMessages($langs->trans("Error"), null, 'errors');
- }
-}
\ No newline at end of file
diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php
index 3b51a5c9cdc..c1b5f4c489d 100644
--- a/htdocs/core/lib/pdf.lib.php
+++ b/htdocs/core/lib/pdf.lib.php
@@ -891,12 +891,6 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
$dims=$pdf->getPageDimensions();
- $paramfreetextlang = $paramfreetext."_".$outputlangs->defaultlang;
- if ( ! empty($conf->global->$paramfreetextlang) )
- {
- $paramfreetext = $paramfreetextlang;
- }
-
// Line of free text
if (empty($hidefreetext) && ! empty($conf->global->$paramfreetext))
{
diff --git a/htdocs/core/tpl/admin_freetext.tpl.php b/htdocs/core/tpl/admin_freetext.tpl.php
deleted file mode 100644
index 99c4f62a209..00000000000
--- a/htdocs/core/tpl/admin_freetext.tpl.php
+++ /dev/null
@@ -1,120 +0,0 @@
-
- *
- * 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
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-
-/**
- * The following vars must be defined:
- * $freetexttitle
- * $freetextvar
- * $conf, $langs, $db
- * The following vars may also be defined:
- * $freetextlang
- * $freetextsubstitutionexclude
- */
-
-// Protection to avoid direct call of template
-if (empty($conf) || ! is_object($conf))
-{
- print "Error, template page can't be called as URL";
- exit;
-}
-
-$substitutionarray=pdf_getSubstitutionArray($langs, $freetextsubstitutionexclude, null, 2);
-$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
-$htmltext = ''.$langs->trans("AvailableVariables").': ';
-foreach($substitutionarray as $key => $val) $htmltext.=$key.' ';
-$htmltext.=' ';
-
-print ' ';
-print ' ';
-print ' ';
-print ' ';
-print '';
-
-$form=new Form($db);
-print $form->textwithpicto($freetexttitle, $langs->trans("AddCRIfTooLong").' '.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').' ';
-
-$freetextconfvar = $freetextvar;
-if (! empty($conf->global->MAIN_MULTILANGS) )
-{
- $freetextlang = GETPOST('freetextlang', 'alpha');
- require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
- $formadmin=new FormAdmin($db);
- print ' '.$langs->trans('Language').' ';
- print $formadmin->select_language($freetextlang, 'freetextlang', 0, $freetextlang, 1);
- print '';
-
- if (! empty($freetextlang))
- {
- $freetextconfvar .= '_'.$freetextlang;
- }
-}
-
-if (empty($conf->fckeditor->enabled) || empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
-{
- print ''.$conf->global->$freetextconfvar.' ';
-}
-else
-{
- include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
- $doleditor=new DolEditor("freetext", $conf->global->$freetextconfvar, '', 80, 'dolibarr_notes');
- print $doleditor->Create();
-}
-print ' ';
-print ' ';
-print " \n";
-print ' ';
-
-if (! empty($conf->global->MAIN_MULTILANGS) )
-{
-?>
-
-