From 502b1e4d31bcffb9e1542bdbd4b8b2096b1f7de3 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Tue, 16 Apr 2019 16:16:37 +0200 Subject: [PATCH 01/62] add lang management to freetext --- htdocs/admin/bom.php | 50 ++-------- htdocs/admin/chequereceipts.php | 52 +---------- htdocs/admin/commande.php | 50 ++-------- htdocs/admin/contract.php | 51 +++-------- htdocs/admin/expedition.php | 57 ++++-------- htdocs/admin/expensereport.php | 52 ++++------- htdocs/admin/facture.php | 51 ++--------- htdocs/admin/fichinter.php | 48 +--------- htdocs/admin/holiday.php | 52 ++++------- htdocs/admin/livraison.php | 48 +--------- htdocs/admin/propal.php | 50 ++-------- htdocs/admin/supplier_invoice.php | 57 ++---------- htdocs/admin/supplier_order.php | 42 ++------- htdocs/admin/supplier_proposal.php | 51 ++--------- htdocs/core/actions_setfreetext.inc.php | 54 +++++++++++ htdocs/core/lib/pdf.lib.php | 5 + htdocs/core/tpl/admin_freetext.tpl.php | 116 ++++++++++++++++++++++++ 17 files changed, 303 insertions(+), 583 deletions(-) create mode 100644 htdocs/core/actions_setfreetext.inc.php create mode 100644 htdocs/core/tpl/admin_freetext.tpl.php diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php index b7f1f0e6db9..f862f7e69e5 100644 --- a/htdocs/admin/bom.php +++ b/htdocs/admin/bom.php @@ -44,6 +44,7 @@ $type = 'bom'; */ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; +include DOL_DOCUMENT_ROOT.'/core/actions_setfreetext.inc.php'; if ($action == 'updateMask') { @@ -167,23 +168,7 @@ elseif ($action == 'set_BOM_DRAFT_WATERMARK') } } -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") { +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); @@ -490,35 +475,12 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) print " \n"; 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 ''; - print ''; - print ''; - print $form->textwithpicto($langs->trans("FreeLegalTextOnBOMs"), $langs->trans("AddCRIfTooLong").'

'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'
'; - $variablename='BOM_FREE_TEXT'; - if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) - { - print ''; - } - 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 '
'; + // free text + $freetexttitle = $langs->trans("FreeLegalTextOnBOMs"); + $freetextvar = "BOM_FREE_TEXT"; + require_once(DOL_DOCUMENT_ROOT.'/core/tpl/admin_freetext.tpl.php'); //Use draft Watermark - print "
"; print ''; print ""; diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php index e8e035f8b49..05c2d023364 100644 --- a/htdocs/admin/chequereceipts.php +++ b/htdocs/admin/chequereceipts.php @@ -44,6 +44,7 @@ $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 @@ -72,23 +73,6 @@ 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 @@ -237,10 +221,6 @@ print '
'; */ print load_fiche_titre($langs->trans("OtherOptions"), '', ''); -print ''; -print ''; -print ''; - print ''; print ''; print ''; @@ -248,37 +228,15 @@ print ''; 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 '\n"; -print '
'.$langs->trans("Parameters").'  
'; -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 ''; -} -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 "
'; -print "
"; +// free text +$freetexttitle = $langs->trans("FreeLegalTextOnChequeReceipts"); +$freetextvar = "BANK_CHEQUERECEIPT_FREE_TEXT"; +require_once(DOL_DOCUMENT_ROOT.'/core/tpl/admin_freetext.tpl.php'); 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 455175220a8..b7e1e3e0f75 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,23 +176,8 @@ elseif ($action == 'set_COMMANDE_DRAFT_WATERMARK') } } -elseif ($action == 'set_ORDER_FREE_TEXT') +elseif ($action=="setshippableiconinlist") { - $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); @@ -532,35 +517,12 @@ print ''.$langs->trans("Value").''; print " \n"; 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 ''; -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 ''; -} -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 '
'; +// free text +$freetexttitle = $langs->trans("FreeLegalTextOnOrders"); +$freetextvar = "ORDER_FREE_TEXT"; +require_once(DOL_DOCUMENT_ROOT.'/core/tpl/admin_freetext.tpl.php'); //Use draft Watermark - print "
"; print ''; print ""; diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index bf02df80b5b..36236fc1b30 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -50,6 +50,7 @@ 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') { @@ -157,13 +158,10 @@ elseif ($action == 'setmod') elseif ($action == 'set_other') { - $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); - $draft= GETPOST('CONTRACT_DRAFT_WATERMARK', 'alpha'); - $res2 = dolibarr_set_const($db, "CONTRACT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "CONTRACT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); - if (! $res1 > 0 || ! $res2 > 0) $error++; + if (! $res > 0) $error++; if (! $error) { @@ -458,55 +456,36 @@ print "
"; * */ -print ''; -print ''; -print ''; - print load_fiche_titre($langs->trans("OtherOptions"), '', ''); print ''; print ''; print ''; print ''; +print "\n"; 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.='
'; +// free text +$freetexttitle = $langs->trans("FreeLegalTextOnContracts"); +$freetextvar = "CONTRACT_FREE_TEXT"; +require_once(DOL_DOCUMENT_ROOT.'/core/tpl/admin_freetext.tpl.php'); -print ''."\n"; +print ''; +print ''; +print ''; //Use draft Watermark - print ''."\n"; -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; -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 ''; -} -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 $form->textwithpicto($langs->trans("WatermarkOnDraftContractCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'
'; print '
'; print ''; +print ''; +print ''; 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 04dcf3ddc36..9ac7b2aa61a 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -57,6 +57,7 @@ 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') { @@ -76,14 +77,6 @@ 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) @@ -466,47 +459,35 @@ print '
'; */ print load_fiche_titre($langs->trans("OtherOptions")); +print ''; +print ''; +print ''; +print ''; +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 "
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
"; -print ""; -print "\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 '\n"; - print '\n"; -print '
".$langs->trans("Parameter")."
'; -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 ''; -} -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 $form->textwithpicto($langs->trans("WatermarkOnDraftContractCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'
'; +print '
'; print ''; +print ''; +print ''; print "
'; - -print '
'; - print ''; +print ''; + // End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index cac83ef8d8b..dfe35ee7b56 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -51,6 +51,7 @@ $type='expensereport'; */ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; +include DOL_DOCUMENT_ROOT.'/core/actions_setfreetext.inc.php'; if ($action == 'updateMask') { @@ -166,13 +167,10 @@ elseif ($action == 'setoptions') { $db->begin(); - $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); - $draft= GETPOST('EXPENSEREPORT_DRAFT_WATERMARK', 'alpha'); - $res2 = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); - if (! $res1 > 0 || ! $res2 > 0) $error++; + if (! $res > 0) $error++; if (! $error) { @@ -464,53 +462,37 @@ print '
'; * Other options */ -print '
'; -print ''; -print ''; - print load_fiche_titre($langs->trans("OtherOptions"), '', ''); print ''; print ''; -print ''; +print ''; print ''; +print "\n"; 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.='
'; +// free text +$freetexttitle = $langs->trans("FreeLegalTextOnExpenseReports"); +$freetextvar = "EXPENSEREPORT_FREE_TEXT"; +require_once(DOL_DOCUMENT_ROOT.'/core/tpl/admin_freetext.tpl.php'); -print ''."\n"; + +print ''; +print ''; +print ''; //Use draft Watermark print ''."\n"; -print '
'.$langs->trans("Parameter").''.$langs->trans("Parameter").' 
'; -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 ''; -} -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 $form->textwithpicto($langs->trans("WatermarkOnDraftExpenseReports"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'
'; print ''; +print '
'; +print ''; 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 57a18afcbd3..c25d26f3e0b 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -50,6 +50,7 @@ $type='invoice'; */ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; +include DOL_DOCUMENT_ROOT.'/core/actions_setfreetext.inc.php'; if ($action == 'updateMask') { @@ -195,24 +196,6 @@ 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'); @@ -759,34 +742,12 @@ print '\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 ''; -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 ''; -} -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 '
'; - +// free text +$freetexttitle = $langs->trans("FreeLegalTextOnInvoices"); +$freetextvar = "INVOICE_FREE_TEXT"; +require_once(DOL_DOCUMENT_ROOT.'/core/tpl/admin_freetext.tpl.php'); +//Use draft Watermark print '
'; print ''; print ''; diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index a407edd3864..8dcfadf9a6c 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -51,6 +51,7 @@ $type='ficheinter'; */ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; +include DOL_DOCUMENT_ROOT.'/core/actions_setfreetext.inc.php'; if ($action == 'updateMask') { @@ -156,23 +157,6 @@ 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'); @@ -532,32 +516,10 @@ print ''.$langs->trans("Value").''; print " \n"; 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 ''; -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 ''; -} -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 '
'; +// free text +$freetexttitle = $langs->trans("FreeLegalTextOnInterventions"); +$freetextvar = "FICHINTER_FREE_TEXT"; +require_once(DOL_DOCUMENT_ROOT.'/core/tpl/admin_freetext.tpl.php'); //Use draft Watermark print "
"; diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index d67451812c6..ce6d390aa69 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -52,6 +52,7 @@ 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') { @@ -159,13 +160,10 @@ elseif ($action == 'setmod') elseif ($action == 'set_other') { - $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); - $draft= GETPOST('HOLIDAY_DRAFT_WATERMARK', 'alpha'); - $res2 = dolibarr_set_const($db, "HOLIDAY_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "HOLIDAY_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); - if (! $res1 > 0 || ! $res2 > 0) $error++; + if (! $res > 0) $error++; if (! $error) { @@ -464,54 +462,36 @@ print "
"; * Other options */ -print ''; -print ''; -print ''; - print load_fiche_titre($langs->trans("OtherOptions"), '', ''); + print ''; print ''; print ''; print ''; +print "\n"; 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.='
'; +// free text +$freetexttitle = $langs->trans("FreeLegalTextOnHolidays"); +$freetextvar = "HOLIDAY_FREE_TEXT"; +require_once(DOL_DOCUMENT_ROOT.'/core/tpl/admin_freetext.tpl.php'); -print ''."\n"; +print ''; +print ''; +print ''; //Use draft Watermark - print ''."\n"; -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; -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 ''; -} -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 $form->textwithpicto($langs->trans("WatermarkOnDraftHolidayCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'
'; print '
'; print ''; +print ''; +print ''; print '
'; - -print '
'; -print ''; -print '
'; - print '
'; + +print ''; } diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index d11d07c5f38..dde70bc5314 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -51,6 +51,7 @@ $type='delivery'; */ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; +include DOL_DOCUMENT_ROOT.'/core/actions_setfreetext.inc.php'; if ($action == 'updateMask') { @@ -70,23 +71,6 @@ 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'); @@ -449,32 +433,10 @@ print ''.$langs->trans("Value").''; 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 ''; -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 ''; -} -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 '
'; +// free text +$freetexttitle = $langs->trans("FreeLegalTextOnDeliveryReceipts"); +$freetextvar = "DELIVERY_FREE_TEXT"; +require_once(DOL_DOCUMENT_ROOT.'/core/tpl/admin_freetext.tpl.php'); print ''; diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index db41876b02c..50faa61d87a 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -50,6 +50,7 @@ $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') @@ -148,23 +149,6 @@ 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); @@ -653,34 +637,12 @@ print "\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 ''; -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 ''; -} -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 '
'; - +// free text +$freetexttitle = $langs->trans("FreeLegalTextOnProposal"); +$freetextvar = "PROPOSAL_FREE_TEXT"; +require_once(DOL_DOCUMENT_ROOT.'/core/tpl/admin_freetext.tpl.php'); +//Use draft Watermark print "
"; print ''; print ""; diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index 6d8936fbe71..fcc3906150f 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -55,6 +55,8 @@ $specimenthirdparty->initAsSpecimen(); * Actions */ +include DOL_DOCUMENT_ROOT.'/core/actions_setfreetext.inc.php'; + if ($action == 'updateMask') { $maskconstinvoice=GETPOST('maskconstinvoice', 'alpha'); @@ -174,25 +176,6 @@ 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 */ @@ -461,11 +444,6 @@ print '
'; /* * Other options */ - -print ''; -print ''; -print ''; - print load_fiche_titre($langs->trans("OtherOptions"), '', ''); print ''; print ''; @@ -474,33 +452,10 @@ print ''; 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 '\n"; - -print '
'.$langs->trans("Value").' 
'; -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 ''; -} -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 "

'; - -print '
'; - +// free text +$freetexttitle = $langs->trans("FreeLegalTextOnInvoices"); +$freetextvar = "SUPPLIER_INVOICE_FREE_TEXT"; +require_once(DOL_DOCUMENT_ROOT.'/core/tpl/admin_freetext.tpl.php'); /* * Notifications diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index c414eca8158..95eca54074a 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -54,6 +54,8 @@ $specimenthirdparty->initAsSpecimen(); * Actions */ +include DOL_DOCUMENT_ROOT.'/core/actions_setfreetext.inc.php'; + if ($action == 'updateMask') { $maskconstorder=GETPOST('maskconstorder', 'alpha'); @@ -168,17 +170,15 @@ 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); - $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); + $res = 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'; $newmodule=new modFournisseur($db); - + if ($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) { // clear default rights array @@ -191,7 +191,7 @@ elseif ($action == 'set_SUPPLIER_ORDER_OTHER') $newmodule->rights[$r][3] = 0; $newmodule->rights[$r][4] = 'commande'; $newmodule->rights[$r][5] = 'approve2'; - + // Insert $newmodule->insert_permissions(1); } @@ -199,7 +199,7 @@ elseif ($action == 'set_SUPPLIER_ORDER_OTHER') { // Remove all rights with Permission1190 $newmodule->delete_permissions(); - + // Add all right without Permission1190 $newmodule->insert_permissions(1); } @@ -541,34 +541,12 @@ 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 ''; -} -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 b757fb66673..551572891ba 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -48,6 +48,7 @@ $error=0; */ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; +include DOL_DOCUMENT_ROOT.'/core/actions_setfreetext.inc.php'; if ($action == 'updateMask') { @@ -129,24 +130,6 @@ 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); @@ -495,34 +478,12 @@ print ''.$langs->trans("Value")."\n"; print " \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 ''; -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 ''; -} -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 '
'; - +// free text +$freetexttitle = $langs->trans("FreeLegalTextOnSupplierProposal"); +$freetextvar = "SUPPLIER_PROPOSAL_FREE_TEXT"; +require_once(DOL_DOCUMENT_ROOT.'/core/tpl/admin_freetext.tpl.php'); +//Use draft Watermark print "
"; print ''; print ""; diff --git a/htdocs/core/actions_setfreetext.inc.php b/htdocs/core/actions_setfreetext.inc.php new file mode 100644 index 00000000000..7e76a3d5a6d --- /dev/null +++ b/htdocs/core/actions_setfreetext.inc.php @@ -0,0 +1,54 @@ + + * + * 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 +// $arrayofparameters must be set for action 'update' +// $nomessageinupdate can be set to 1 +// $nomessageinsetmoduleoptions can be set to 1 +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 2d6e41abe59..2e8d286fc26 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -874,6 +874,11 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ $dims=$pdf->getPageDimensions(); + if ( ! empty($conf->global->$paramfreetext."_".$outputlangs->defaultlang) ) + { + $paramfreetext .= "_".$outputlangs->defaultlang; + } + // 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 new file mode 100644 index 00000000000..f80ce8b224e --- /dev/null +++ b/htdocs/core/tpl/admin_freetext.tpl.php @@ -0,0 +1,116 @@ + + * + * 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 + */ + +// 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, 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=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->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) +{ + print ''; +} +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) ) +{ +?> + + Date: Tue, 16 Apr 2019 16:21:32 +0200 Subject: [PATCH 02/62] add freetextsubstitutionexclude parameter --- htdocs/admin/contract.php | 1 + htdocs/admin/holiday.php | 1 + htdocs/core/tpl/admin_freetext.tpl.php | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index 36236fc1b30..74df1b6af31 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -467,6 +467,7 @@ 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'); print '
'; diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index ce6d390aa69..f81bf8fa4a4 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -474,6 +474,7 @@ 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 ''; diff --git a/htdocs/core/tpl/admin_freetext.tpl.php b/htdocs/core/tpl/admin_freetext.tpl.php index f80ce8b224e..98b83215e86 100644 --- a/htdocs/core/tpl/admin_freetext.tpl.php +++ b/htdocs/core/tpl/admin_freetext.tpl.php @@ -23,6 +23,7 @@ * $conf, $langs, $db * The following vars may also be defined: * $freetextlang + * $freetextsubstitutionexclude */ // Protection to avoid direct call of template @@ -32,7 +33,7 @@ if (empty($conf) || ! is_object($conf)) exit; } -$substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2); +$substitutionarray=pdf_getSubstitutionArray($langs, $freetextsubstitutionexclude, null, 2); $substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation"); $htmltext = ''.$langs->trans("AvailableVariables").':
'; foreach($substitutionarray as $key => $val) $htmltext.=$key.'
'; From ce4b67ecaa2ecd15fdf33240867ada0f978cdf90 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Tue, 16 Apr 2019 16:45:43 +0200 Subject: [PATCH 03/62] fix pagefoot --- htdocs/core/lib/pdf.lib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 2e8d286fc26..d38d6d3f3ca 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -874,9 +874,10 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ $dims=$pdf->getPageDimensions(); - if ( ! empty($conf->global->$paramfreetext."_".$outputlangs->defaultlang) ) + $paramfreetextlang = $paramfreetext."_".$outputlangs->defaultlang; + if ( ! empty($conf->global->$paramfreetextlang) ) { - $paramfreetext .= "_".$outputlangs->defaultlang; + $paramfreetext = $paramfreetextlang; } // Line of free text From f4cc1695f46ee3d8677c600c42ebf4e3e7d36faf Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Tue, 16 Apr 2019 17:22:33 +0200 Subject: [PATCH 04/62] fix when ckeditor is not enabled --- htdocs/core/tpl/admin_freetext.tpl.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/tpl/admin_freetext.tpl.php b/htdocs/core/tpl/admin_freetext.tpl.php index 98b83215e86..55269b0d6fc 100644 --- a/htdocs/core/tpl/admin_freetext.tpl.php +++ b/htdocs/core/tpl/admin_freetext.tpl.php @@ -64,7 +64,7 @@ if (! empty($conf->global->MAIN_MULTILANGS) ) } } -if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) +if (empty($conf->modFckeditor->enabled) || empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } @@ -97,10 +97,10 @@ if (! empty($conf->global->MAIN_MULTILANGS) ) $('#freetextlang').change(function() { global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) + if (empty($conf->modFckeditor->enabled) || empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { ?> - $('#freetext').html(freetext[$(this).val()]); + $('textarea[name=freetext]').val(freetext[$(this).val()]); Date: Tue, 16 Apr 2019 17:30:57 +0200 Subject: [PATCH 05/62] fix javascript --- htdocs/core/tpl/admin_freetext.tpl.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/admin_freetext.tpl.php b/htdocs/core/tpl/admin_freetext.tpl.php index 55269b0d6fc..d3b61ebf776 100644 --- a/htdocs/core/tpl/admin_freetext.tpl.php +++ b/htdocs/core/tpl/admin_freetext.tpl.php @@ -64,7 +64,7 @@ if (! empty($conf->global->MAIN_MULTILANGS) ) } } -if (empty($conf->modFckeditor->enabled) || empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) +if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } @@ -83,6 +83,8 @@ if (! empty($conf->global->MAIN_MULTILANGS) ) { ?> Date: Tue, 16 Apr 2019 17:36:42 +0200 Subject: [PATCH 06/62] fix javascript --- htdocs/core/tpl/admin_freetext.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/admin_freetext.tpl.php b/htdocs/core/tpl/admin_freetext.tpl.php index d3b61ebf776..37d014be7d9 100644 --- a/htdocs/core/tpl/admin_freetext.tpl.php +++ b/htdocs/core/tpl/admin_freetext.tpl.php @@ -64,7 +64,7 @@ if (! empty($conf->global->MAIN_MULTILANGS) ) } } -if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) +if (empty($conf->fckeditor->enabled) || empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } @@ -99,7 +99,7 @@ if (! empty($conf->global->MAIN_MULTILANGS) ) $('#freetextlang').change(function() { global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) + if (empty($conf->fckeditor->enabled) || empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { ?> $('textarea[name=freetext]').val(freetext[$(this).val()]); From 79fc351cbdf204807c01e065cf5fe4e064f1a107 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Wed, 17 Apr 2019 09:26:45 +0200 Subject: [PATCH 07/62] credentials --- htdocs/core/actions_setfreetext.inc.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/htdocs/core/actions_setfreetext.inc.php b/htdocs/core/actions_setfreetext.inc.php index 7e76a3d5a6d..deb6efd9f86 100644 --- a/htdocs/core/actions_setfreetext.inc.php +++ b/htdocs/core/actions_setfreetext.inc.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2019 Christophe Battarel * * 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 @@ -23,9 +23,7 @@ // $action must be defined -// $arrayofparameters must be set for action 'update' -// $nomessageinupdate can be set to 1 -// $nomessageinsetmoduleoptions can be set to 1 + if ($action == 'set_freetext') { $freetextvar = GETPOST("freetextvar", 'alpha'); From 0b5cb9770f68081abad703961db11f903c6ce58a Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Thu, 18 Apr 2019 09:59:39 +0200 Subject: [PATCH 08/62] use dol_escapa_js --- htdocs/core/tpl/admin_freetext.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/admin_freetext.tpl.php b/htdocs/core/tpl/admin_freetext.tpl.php index 37d014be7d9..99c4f62a209 100644 --- a/htdocs/core/tpl/admin_freetext.tpl.php +++ b/htdocs/core/tpl/admin_freetext.tpl.php @@ -93,7 +93,7 @@ if (! empty($conf->global->MAIN_MULTILANGS) ) foreach ($langs_available as $key => $value) { $freetextlangvar = $freetextvar."_".$key; - print 'freetext["'.$key.'"] = "'.$conf->global->$freetextlangvar.'";'; + print 'freetext["'.$key.'"] = "'.dol_escape_js($conf->global->$freetextlangvar,2).'";'; } ?> $('#freetextlang').change(function() From c45b191330951781f18b5fcee91fae7b5a0755f9 Mon Sep 17 00:00:00 2001 From: "atm-florian.m" Date: Mon, 1 Jul 2019 10:18:04 +0200 Subject: [PATCH 09/62] FIX: when STOCK_CALCULATE_ON_SHIPMENT_CLOSE is set, deleting a "closed" shipment now increases stock as expected --- htdocs/expedition/class/expedition.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 3ab96fed1fa..dd0d4842276 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1111,7 +1111,9 @@ class Expedition extends CommonObject } // Stock control - if (! $error && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SHIPMENT && $this->statut > self::STATUS_DRAFT) + if (! $error && $conf->stock->enabled && + (($conf->global->STOCK_CALCULATE_ON_SHIPMENT && $this->statut > self::STATUS_DRAFT) || + ($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE && $this->statut == 2))) { require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php"); From 64d1ebf59cd6ee27117cca10fc552257d0e17ea4 Mon Sep 17 00:00:00 2001 From: "atm-florian.m" Date: Thu, 4 Jul 2019 15:06:39 +0200 Subject: [PATCH 10/62] FIX: on shipment delete confirm dialog, a new checkbox allows the user to choose if they want their stock re-incremented after the deletion. --- htdocs/expedition/card.php | 24 ++++++++++++++++++-- htdocs/expedition/class/expedition.class.php | 4 ++-- htdocs/langs/fr_FR/sendings.lang | 2 ++ 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index aa85132b243..ed6b0227f91 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -468,7 +468,8 @@ if (empty($reshook)) else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expedition->supprimer) { - $result = $object->delete(); + $also_update_stock = GETPOST('alsoUpdateStock', 'alpha') ?: 0; + $result = $object->delete($also_update_stock); if ($result > 0) { header("Location: ".DOL_URL_ROOT.'/expedition/index.php'); @@ -1648,7 +1649,26 @@ else if ($id || $ref) // Confirm deleteion if ($action == 'delete') { - $formconfirm=$form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('DeleteSending'),$langs->trans("ConfirmDeleteSending",$object->ref),'confirm_delete','',0,1); + $formquestion = array(); + if ($object->statut == Expedition::STATUS_CLOSED && !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) { + $formquestion = array( + array( + 'label' => $langs->trans('ShipmentIncrementStockOnDelete'), + 'name' => 'alsoUpdateStock', + 'type' => 'checkbox', + 'value' => 0 + ), + ); + } + $formconfirm=$form->formconfirm( + $_SERVER['PHP_SELF'].'?id='.$object->id, + $langs->trans('DeleteSending'), + $langs->trans("ConfirmDeleteSending",$object->ref), + 'confirm_delete', + $formquestion, + 0, + 1 + ); } // Confirmation validation diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 3ab96fed1fa..814d8ccc5a1 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1079,7 +1079,7 @@ class Expedition extends CommonObject * * @return int >0 if OK, 0 if deletion done but failed to delete files, <0 if KO */ - function delete() + function delete($also_update_stock = false) { global $conf, $langs, $user; @@ -1111,7 +1111,7 @@ class Expedition extends CommonObject } // Stock control - if (! $error && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SHIPMENT && $this->statut > self::STATUS_DRAFT) + if (! $error && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SHIPMENT && $this->statut > self::STATUS_DRAFT && $also_update_stock) { require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php"); diff --git a/htdocs/langs/fr_FR/sendings.lang b/htdocs/langs/fr_FR/sendings.lang index 1071d5f23f9..4f4bfc514e2 100644 --- a/htdocs/langs/fr_FR/sendings.lang +++ b/htdocs/langs/fr_FR/sendings.lang @@ -60,6 +60,8 @@ NoProductToShipFoundIntoStock=Aucun produit à expédier n'a été trouver dans WeightVolShort=Poids/vol. ValidateOrderFirstBeforeShipment=Vous devez d'abord valider la commande pour pouvoir créer une expédition. +ShipmentIncrementStockOnDelete=Remettre en stock les éléments de cette expédition + # Sending methods # ModelDocument DocumentModelTyphon=Modèle de bon de réception/livraison complet (logo…) From 4f0316580672122e1154c148935d5e17264ad433 Mon Sep 17 00:00:00 2001 From: "atm-florian.m" Date: Thu, 11 Jul 2019 12:28:24 +0200 Subject: [PATCH 11/62] FIX: outdated phpdoc --- htdocs/expedition/class/expedition.class.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index a8d9acc7b48..ea6e003d326 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1073,12 +1073,14 @@ class Expedition extends CommonObject } } - /** - * Delete shipment. - * Warning, do not delete a shipment if a delivery is linked to (with table llx_element_element) - * - * @return int >0 if OK, 0 if deletion done but failed to delete files, <0 if KO - */ + /** + * Delete shipment. + * Warning, do not delete a shipment if a delivery is linked to (with table llx_element_element) + * + * @param bool $also_update_stock true if the stock should be increased back (false by default) + * @return int >0 if OK, 0 if deletion done but failed to delete files, <0 if KO + * @throws Exception + */ function delete($also_update_stock = false) { global $conf, $langs, $user; From 294bc5dcb5e0fedca685b6976e4d7e042fa03067 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 15 Jul 2019 10:19:06 +0200 Subject: [PATCH 12/62] FIX avoid conflict with "$classname" in card.php --- htdocs/commande/card.php | 4 ++-- htdocs/core/tpl/object_discounts.tpl.php | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 10629ec3452..96ea54c5c84 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1436,11 +1436,11 @@ if ($action == 'create' && $user->rights->commande->creer) if ($element == 'order' || $element == 'commande') { $element = $subelement = 'commande'; } - if ($element == 'propal') { + elseif ($element == 'propal') { $element = 'comm/propal'; $subelement = 'propal'; } - if ($element == 'contract') { + elseif ($element == 'contract') { $element = $subelement = 'contrat'; } diff --git a/htdocs/core/tpl/object_discounts.tpl.php b/htdocs/core/tpl/object_discounts.tpl.php index 70698bfa7eb..3d02d3c5a73 100644 --- a/htdocs/core/tpl/object_discounts.tpl.php +++ b/htdocs/core/tpl/object_discounts.tpl.php @@ -24,7 +24,7 @@ * $backtopage URL to come back to from discount modification pages */ -$classname = get_class($object); +$objclassname = get_class($object); $isInvoice = in_array($object->element, array('facture', 'invoice', 'facture_fourn', 'invoice_supplier')); $isNewObject = empty($object->id) && empty($object->rowid); @@ -53,11 +53,11 @@ if($isNewObject) print ' ('.$addrelativediscount.')'; // Is there is commercial discount or down payment available ? if ($absolute_discount > 0) { - if ($cannotApplyDiscount || ! $isInvoice || $isNewObject || $object->statut > $classname::STATUS_DRAFT || $object->type == $classname::TYPE_CREDIT_NOTE || $object->type == $classname::TYPE_DEPOSIT) { + if ($cannotApplyDiscount || ! $isInvoice || $isNewObject || $object->statut > $objclassname::STATUS_DRAFT || $object->type == $objclassname::TYPE_CREDIT_NOTE || $object->type == $objclassname::TYPE_DEPOSIT) { $translationKey = ! empty($discount_type) ? 'HasAbsoluteDiscountFromSupplier' : 'CompanyHasAbsoluteDiscount'; $text = $langs->trans($translationKey, price($absolute_discount), $langs->transnoentities("Currency" . $conf->currency)).'.'; - if ($isInvoice && ! $isNewObject && $object->statut > $classname::STATUS_DRAFT && $object->type != $classname::TYPE_CREDIT_NOTE && $object->type != $classname::TYPE_DEPOSIT) { + if ($isInvoice && ! $isNewObject && $object->statut > $objclassname::STATUS_DRAFT && $object->type != $objclassname::TYPE_CREDIT_NOTE && $object->type != $objclassname::TYPE_DEPOSIT) { $text = $form->textwithpicto($text, $langs->trans('AbsoluteDiscountUse')); } @@ -77,11 +77,11 @@ if ($absolute_discount > 0) { if ($absolute_creditnote > 0) { // If validated, we show link "add credit note to payment" - if ($cannotApplyDiscount || ! $isInvoice || $isNewObject || $object->statut != $classname::STATUS_VALIDATED || $object->type == $classname::TYPE_CREDIT_NOTE) { + if ($cannotApplyDiscount || ! $isInvoice || $isNewObject || $object->statut != $objclassname::STATUS_VALIDATED || $object->type == $objclassname::TYPE_CREDIT_NOTE) { $translationKey = ! empty($discount_type) ? 'HasCreditNoteFromSupplier' : 'CompanyHasCreditNote'; $text = $langs->trans($translationKey, price($absolute_creditnote), $langs->transnoentities("Currency" . $conf->currency)) . '.'; - if ($isInvoice && ! $isNewObject && $object->statut == $classname::STATUS_DRAFT && $object->type != $classname::TYPE_DEPOSIT) { + if ($isInvoice && ! $isNewObject && $object->statut == $objclassname::STATUS_DRAFT && $object->type != $objclassname::TYPE_DEPOSIT) { $text = $form->textwithpicto($text, $langs->trans('CreditNoteDepositUse')); } @@ -101,7 +101,7 @@ if($absolute_discount <= 0 && $absolute_creditnote <= 0) { $translationKey = ! empty($discount_type) ? 'HasNoAbsoluteDiscountFromSupplier' : 'CompanyHasNoAbsoluteDiscount'; print '
'.$langs->trans($translationKey).'.'; - if ($isInvoice && $object->statut == $classname::STATUS_DRAFT && $object->type != $classname::TYPE_CREDIT_NOTE && $object->type != $classname::TYPE_DEPOSIT) { + if ($isInvoice && $object->statut == $objclassname::STATUS_DRAFT && $object->type != $objclassname::TYPE_CREDIT_NOTE && $object->type != $objclassname::TYPE_DEPOSIT) { print ' (' . $addabsolutediscount . ')'; } } From ae540cb25e5b6b671258f2c4ae71b2c5bca5d4ee Mon Sep 17 00:00:00 2001 From: "atm-florian.m" Date: Tue, 9 Jul 2019 18:00:54 +0200 Subject: [PATCH 13/62] FIX: add missing hook calls --- htdocs/fourn/product/list.php | 57 ++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php index 16ed559814d..90ff76231d1 100644 --- a/htdocs/fourn/product/list.php +++ b/htdocs/fourn/product/list.php @@ -75,7 +75,12 @@ if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } $parameters=array(); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks( + 'doActions', + $parameters, + $object, + $action +); if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) @@ -128,6 +133,17 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions); $sql = "SELECT p.rowid, p.label, p.ref, p.fk_product_type, p.entity,"; $sql.= " ppf.fk_soc, ppf.ref_fourn, ppf.price as price, ppf.quantity as qty, ppf.unitprice,"; $sql.= " s.rowid as socid, s.nom as name"; + +// Add fields to SELECT from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks( + 'printFieldListSelect', + $parameters, + $object, + $action +); +$sql .= $hookmanager->resPrint; + $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; if ($catid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_product = p.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as ppf ON p.rowid = ppf.fk_product"; @@ -158,6 +174,14 @@ if ($fourn_id > 0) $sql .= " AND ppf.fk_soc = ".$fourn_id; } +// Add WHERE filters from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks( + 'printFieldListWhere', + $parameters +); +$sql .= $hookmanager->resPrint; + $sql .= $db->order($sortfield,$sortorder); // Count total nb of records without orderby and limit @@ -242,6 +266,17 @@ if ($resql) print ''; print ''; print ''; + + // add filters from hooks + $parameters = array(); + $reshook = $hookmanager->executeHooks( + 'printFieldPreListTitle', + $parameters, + $object, + $action + ); + if (!empty($reshook)) print $hookmanager->resPrint; + print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; @@ -257,6 +292,16 @@ if ($resql) print_liste_field_titre("BuyingPrice",$_SERVER["PHP_SELF"], "ppf.price",$param,"",'align="right"',$sortfield,$sortorder); print_liste_field_titre("QtyMin",$_SERVER["PHP_SELF"], "ppf.quantity",$param,"",'align="right"',$sortfield,$sortorder); print_liste_field_titre("UnitPrice",$_SERVER["PHP_SELF"], "ppf.unitprice",$param,"",'align="right"',$sortfield,$sortorder); + + // add header cells from hooks + $parameters = array(); + $reshook = $hookmanager->executeHooks( + 'printFieldListTitle', + $parameters, + $object, + $action + ); + if (!empty($reshook)) print $hookmanager->resPrint; print_liste_field_titre('',$_SERVER["PHP_SELF"]); print "\n"; @@ -292,6 +337,16 @@ if ($resql) print ''.(isset($objp->unitprice) ? price($objp->unitprice) : '').''; + // add additional columns from hooks + $parameters = array(); + $reshook = $hookmanager->executeHooks( + 'printFieldListValue', + $parameters, + $objp, + $action + ); + if (!empty($reshook)) print $hookmanager->resPrint; + print ''; print "\n"; From 8aa147a4e518f7b1a4ba203c7825bcc8e82b2d79 Mon Sep 17 00:00:00 2001 From: "atm-florian.m" Date: Wed, 10 Jul 2019 19:00:20 +0200 Subject: [PATCH 14/62] # missing hooks from dispatch.php and list.php --- htdocs/fourn/commande/dispatch.php | 83 ++++++++++++++++++++++++++++++ htdocs/fourn/product/list.php | 11 ++-- 2 files changed, 91 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 4b15f04faa0..af2a2218410 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -491,11 +491,35 @@ if ($id > 0 || ! empty($ref)) { $sql = "SELECT l.rowid, l.fk_product, l.subprice, l.remise_percent, l.ref AS sref, SUM(l.qty) as qty,"; $sql .= " p.ref, p.label, p.tobatch, p.fk_default_warehouse"; + + // Enable hooks to alter the SQL query (SELECT) + $parameters = array(); + $reshook = $hookmanager->executeHooks( + 'printFieldListSelect', + $parameters, + $object, + $action + ); + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + $sql .= $hookmanager->resPrint; + $sql .= " FROM " . MAIN_DB_PREFIX . "commande_fournisseurdet as l"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON l.fk_product=p.rowid"; $sql .= " WHERE l.fk_commande = " . $object->id; if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) $sql .= " AND l.product_type = 0"; + + // Enable hooks to alter the SQL query (WHERE) + $parameters = array(); + $reshook = $hookmanager->executeHooks( + 'printFieldListWhere', + $parameters, + $object, + $action + ); + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + $sql .= $hookmanager->resPrint; + $sql .= " GROUP BY p.ref, p.label, p.tobatch, l.rowid, l.fk_product, l.subprice, l.remise_percent, p.fk_default_warehouse"; // Calculation of amount dispatched is done per fk_product so we must group by fk_product $sql .= " ORDER BY p.ref, p.label"; @@ -526,6 +550,18 @@ if ($id > 0 || ! empty($ref)) { print '' . $langs->trans("QtyToDispatchShort") . ''; print ''; print '' . $langs->trans("Warehouse") . ''; + + // Enable hooks to append additional columns + $parameters = array(); + $reshook = $hookmanager->executeHooks( + 'printFieldListTitle', + $parameters, + $object, + $action + ); + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + print $hookmanager->resPrint; + print "\n"; } @@ -608,6 +644,23 @@ if ($id > 0 || ! empty($ref)) { //print img_picto($langs->trans('AddDispatchBatchLine'), 'split.png', 'onClick="addDispatchLine(' . $i . ',\'' . $type . '\')"'); print ''; // Dispatch column print ''; // Warehouse column + + // Enable hooks to append additional columns + $parameters = array( + 'is_information_row' => true, // allows hook to distinguish between the + // rows with information and the rows with + // dispatch form input + 'objp' => $objp + ); + $reshook = $hookmanager->executeHooks( + 'printFieldListValue', + $parameters, + $object, + $action + ); + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + print $hookmanager->resPrint; + print ''; print ''; @@ -648,6 +701,23 @@ if ($id > 0 || ! empty($ref)) { //print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'onClick="addDispatchLine(' . $i . ',\'' . $type . '\')"'); print ''; // Dispatch column print ''; // Warehouse column + + // Enable hooks to append additional columns + $parameters = array( + 'is_information_row' => true, // allows hook to distinguish between the + // rows with information and the rows with + // dispatch form input + 'objp' => $objp + ); + $reshook = $hookmanager->executeHooks( + 'printFieldListValue', + $parameters, + $object, + $action + ); + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + print $hookmanager->resPrint; + print ''; print ''; @@ -699,6 +769,19 @@ if ($id > 0 || ! empty($ref)) { } print "\n"; + // Enable hooks to append additional columns + $parameters = array( + 'is_information_row' => false // this is a dispatch form row + ); + $reshook = $hookmanager->executeHooks( + 'printFieldListValue', + $parameters, + $object, + $action + ); + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + print $hookmanager->resPrint; + print "\n"; } } diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php index 90ff76231d1..acfeb87fca9 100644 --- a/htdocs/fourn/product/list.php +++ b/htdocs/fourn/product/list.php @@ -142,6 +142,7 @@ $reshook = $hookmanager->executeHooks( $object, $action ); +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); $sql .= $hookmanager->resPrint; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; @@ -180,6 +181,7 @@ $reshook = $hookmanager->executeHooks( 'printFieldListWhere', $parameters ); +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); $sql .= $hookmanager->resPrint; $sql .= $db->order($sortfield,$sortorder); @@ -275,7 +277,8 @@ if ($resql) $object, $action ); - if (!empty($reshook)) print $hookmanager->resPrint; + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + print $hookmanager->resPrint; print ''; $searchpicto=$form->showFilterButtons(); @@ -301,7 +304,8 @@ if ($resql) $object, $action ); - if (!empty($reshook)) print $hookmanager->resPrint; + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + print $hookmanager->resPrint; print_liste_field_titre('',$_SERVER["PHP_SELF"]); print "\n"; @@ -345,7 +349,8 @@ if ($resql) $objp, $action ); - if (!empty($reshook)) print $hookmanager->resPrint; + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + print $hookmanager->resPrint; print ''; From 6c23154a91f683f300bac2b114acce2aa4c2d201 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Jul 2019 22:59:18 +0200 Subject: [PATCH 15/62] FIX #11506 --- htdocs/accountancy/admin/journals_list.php | 20 +++++++++----------- htdocs/langs/en_US/accountancy.lang | 2 +- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index cac81bfbcae..78cd92f90e0 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -162,7 +162,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) { if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) $fieldnamekey='Label'; if ($fieldnamekey == 'code') $fieldnamekey = 'Code'; - if ($fieldnamekey == 'nature') $fieldnamekey = 'Nature'; + if ($fieldnamekey == 'nature') $fieldnamekey = 'NatureOfJournal'; } // Other checks if (isset($_POST["code"])) @@ -437,7 +437,7 @@ if ($id) $valuetoshow=$langs->trans("Label"); } if ($fieldlist[$field]=='nature') { - $valuetoshow=$langs->trans("Nature"); + $valuetoshow=$langs->trans("NatureOfJournal"); } if ($valuetoshow != '') { @@ -516,7 +516,7 @@ if ($id) } // Title line with search boxes - print ''; + /*print ''; print ''; print ''; print ''; @@ -524,16 +524,14 @@ if ($id) print ''; print ''; print ''; - if ($filterfound) - { - $searchpicto=$form->showFilterAndCheckAddButtons(0); - print $searchpicto; - } + $searchpicto=$form->showFilterButtons(); + print $searchpicto; print ''; print ''; - + */ + // Title of lines - print ''; + print ''; foreach ($fieldlist as $field => $value) { // Determine le nom du champ par rapport aux noms possibles @@ -558,7 +556,7 @@ if ($id) $valuetoshow=$langs->trans("Label"); } if ($fieldlist[$field]=='nature') { - $valuetoshow=$langs->trans("Nature"); + $valuetoshow=$langs->trans("NatureOfJournal"); } // Affiche nom du champ diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 6dfe4fc8c4f..4b22f512826 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -265,7 +265,7 @@ AccountingJournals=Accounting journals AccountingJournal=Accounting journal NewAccountingJournal=New accounting journal ShowAccoutingJournal=Show accounting journal -Nature=Nature +NatureOfJournal=Nature of Journal AccountingJournalType1=Miscellaneous operations AccountingJournalType2=Sales AccountingJournalType3=Purchases From ea349de0818dddff6859aaca349d0878d9a57cf3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Jul 2019 23:25:42 +0200 Subject: [PATCH 16/62] FIX #11498 --- dev/dolibarr_changes.txt | 9 +++++++++ htdocs/includes/mike42/escpos-php/Escpos.php | 6 ++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index 5bad55fd4d2..e87b082dd06 100644 --- a/dev/dolibarr_changes.txt +++ b/dev/dolibarr_changes.txt @@ -27,6 +27,15 @@ With +ESCPOS: +------- +Replace + private $connector; +With + protected $connector; + + + NUSOAP: ------- * In file nusoap.php, to avoid a warning, diff --git a/htdocs/includes/mike42/escpos-php/Escpos.php b/htdocs/includes/mike42/escpos-php/Escpos.php index 57e7eb2c8ac..b8568260738 100644 --- a/htdocs/includes/mike42/escpos-php/Escpos.php +++ b/htdocs/includes/mike42/escpos-php/Escpos.php @@ -144,9 +144,11 @@ class Escpos { /** * @var PrintConnector + * @CHANGE */ - private $connector; - + protected $connector; + // private $connector; + /** * @var AbstractCapabilityProfile */ From d694360c66bea525997c471f535948864574ece4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Jul 2019 23:46:54 +0200 Subject: [PATCH 17/62] Fix warning --- htdocs/core/modules/modAgenda.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 3b7c05c5ad1..f84ad6cbcfa 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -418,6 +418,6 @@ class modAgenda extends DolibarrModules $this->export_sql_end[$r] .=' WHERE ac.entity IN ('.getEntity('agenda').')'; if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND (sc.fk_user = '.(empty($user)?0:$user->id).' OR ac.fk_soc IS NULL)'; if (empty($user->rights->agenda->allactions->read)) $this->export_sql_end[$r] .=' AND acr.fk_element = '.(empty($user)?0:$user->id); - $this->export_sql_order[$r] .=' ORDER BY ac.datep'; + $this->export_sql_order[$r] =' ORDER BY ac.datep'; } } From fb5af65f4d1bdb6925e95bca0f1ddb02f01355a7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Jul 2019 23:56:05 +0200 Subject: [PATCH 18/62] FIX #11466 --- htdocs/product/price.php | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 26970f1dd13..6bc7033ec23 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1711,20 +1711,18 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) } print ''; - // Update all child soc - print ''; - print $langs->trans('ForceUpdateChildPriceSoc'); - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; dol_fiche_end(); print '
'; + + // Update all child soc + print '
'; + print ' '; + print $langs->trans('ForceUpdateChildPriceSoc'); + print '
'; + print ''; print '     '; print ''; @@ -1804,10 +1802,8 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) // Update all child soc print ''; - print $langs->trans('ForceUpdateChildPriceSoc'); print ''; print ''; - print ''; print ''; print ''; @@ -1816,6 +1812,11 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) dol_fiche_end(); print '
'; + print '
'; + print ' '; + print $langs->trans('ForceUpdateChildPriceSoc'); + print "
"; + print ''; print '     '; print ''; @@ -2162,7 +2163,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) // Action if ($user->rights->produit->supprimer || $user->rights->service->supprimer) { - print ''; + print ''; print 'id . '&socid=' . $line->fk_soc . '">'; print img_info($langs->trans('PriceByCustomerLog')); print ''; From f826e9631cafe5e54cc6918714b81445713d4ea0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 16 Jul 2019 00:12:22 +0200 Subject: [PATCH 19/62] FIX #11463 --- htdocs/societe/agenda.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index 13838812d9d..53a1ee5d7ed 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -$langs->load(array("companies", "bills", "propal", "orders")); +$langs->loadLangs(array("companies", "bills", "propal", "orders")); if (GETPOST('actioncode', 'array')) { From 70ff806fdffdd50435afb1e043ea59f5011bbe90 Mon Sep 17 00:00:00 2001 From: John Botella Date: Tue, 16 Jul 2019 10:41:01 +0200 Subject: [PATCH 20/62] fix fourn code preload --- htdocs/societe/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index a8991614301..2a86465d4f2 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -949,12 +949,13 @@ else if(empty($duplicate_code_error)) { $object->code_client = GETPOST('customer_code', 'alpha'); $object->fournisseur = GETPOST('fournisseur')?GETPOST('fournisseur'):$object->fournisseur; + $object->code_fournisseur = GETPOST('supplier_code', 'alpha'); } else { setEventMessages($langs->trans('NewCustomerSupplierCodeProposed'),'', 'warnings'); } - $object->code_fournisseur = GETPOST('supplier_code', 'alpha'); + $object->address = GETPOST('address', 'alpha'); $object->zip = GETPOST('zipcode', 'alpha'); $object->town = GETPOST('town', 'alpha'); From c9fe91138d42963e6343923b0b812bfcb893051b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 16 Jul 2019 12:39:43 +0200 Subject: [PATCH 21/62] FIX better compatibility with Multicompany --- htdocs/opensurvey/index.php | 16 +++------------- htdocs/ticket/index.php | 4 ++-- htdocs/ticket/list.php | 3 +-- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/htdocs/opensurvey/index.php b/htdocs/opensurvey/index.php index 4c60a807445..1ddfc47d99a 100644 --- a/htdocs/opensurvey/index.php +++ b/htdocs/opensurvey/index.php @@ -37,18 +37,6 @@ $langs->load("opensurvey"); llxHeader(); -$nbsondages=0; -$sql='SELECT COUNT(*) as nb FROM '.MAIN_DB_PREFIX.'opensurvey_sondage'; -$resql=$db->query($sql); -if ($resql) -{ - $obj=$db->fetch_object($resql); - $nbsondages=$obj->nb; -} -else dol_print_error($db,''); - - - print load_fiche_titre($langs->trans("OpenSurveyArea")); @@ -56,7 +44,9 @@ print '
'; $nbsondages=0; -$sql='SELECT COUNT(*) as nb FROM '.MAIN_DB_PREFIX.'opensurvey_sondage'; +$sql = 'SELECT COUNT(*) as nb'; +$sql.= ' FROM '.MAIN_DB_PREFIX.'opensurvey_sondage'; +$sql.= ' WHERE entity IN ('.getEntity('survey').')'; $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/ticket/index.php b/htdocs/ticket/index.php index 086ea63bc0e..59a2bae5f46 100644 --- a/htdocs/ticket/index.php +++ b/htdocs/ticket/index.php @@ -127,7 +127,7 @@ if (!$user->rights->societe->client->voir && !$socid) { $sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc"; } -$sql .= ' WHERE t.entity IN (' . getEntity('ticket', 1) . ')'; +$sql .= ' WHERE t.entity IN (' . getEntity('ticket') . ')'; $sql .= " AND t.fk_statut IS NOT NULL"; $sql .= " AND date_format(datec,'%Y') = '" . $endyear . "'"; if (!$user->rights->societe->client->voir && !$socid) { @@ -271,7 +271,7 @@ if (!$user->rights->societe->client->voir && !$socid) { $sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc"; } -$sql .= ' WHERE t.entity IN (' . getEntity('ticket', 1) . ')'; +$sql .= ' WHERE t.entity IN (' . getEntity('ticket') . ')'; $sql .= " AND t.fk_statut=0"; if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND t.fk_soc = sc.fk_soc AND sc.fk_user = " . $user->id; diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 64ec859cc0c..965677ded0e 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -209,8 +209,7 @@ $sql.=$hookmanager->resPrint; $sql=preg_replace('/, $/','', $sql); $sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; -if ($object->ismultientitymanaged == 1) $sql.= " WHERE t.entity IN (".getEntity($object->element).")"; -else $sql.=" WHERE 1 = 1"; +$sql.= " WHERE t.entity IN (".getEntity($object->element).")"; foreach($search as $key => $val) { if ($key == 'fk_statut' && $search[$key] == -1) continue; From 464bda996c5a846e3fea7d0df8d729285c6e2630 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Tue, 16 Jul 2019 13:59:00 +0200 Subject: [PATCH 22/62] FIX: propal createFrom hook: undefined parameter attached --- htdocs/comm/propal/class/propal.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 647be1d0233..082281af1da 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1316,9 +1316,9 @@ class Propal extends CommonObject // Hook of thirdparty module if (is_object($hookmanager)) { - $parameters=array('objFrom'=>$this,'clonedObj'=>$clonedObj); + $parameters=array('objFrom'=>$this,'clonedObj'=>$object); $action=''; - $reshook=$hookmanager->executeHooks('createFrom',$parameters,$clonedObj,$action); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('createFrom',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) $error++; } } From c72a59ad36641ab13dbe382c8d52fb36d68b0461 Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 16 Jul 2019 14:55:19 +0200 Subject: [PATCH 23/62] FIX : we need to be able to add freeline with qty between 0 & 1 in supplierorder line --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 9198cf3ac22..f32d9d24c01 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1485,7 +1485,7 @@ class CommandeFournisseur extends CommonOrder $desc=trim($desc); // Check parameters - if ($qty < 1 && ! $fk_product) + if ($qty < 0 && ! $fk_product) { $this->error=$langs->trans("ErrorFieldRequired",$langs->trans("Product")); return -1; From aab23a15317a62e44f551eb71d43058e8f96b24e Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Tue, 16 Jul 2019 17:50:43 +0200 Subject: [PATCH 24/62] FIX : do not return formatted prices in json string --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a68f09e5ee1..64c5063e8a2 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2594,7 +2594,7 @@ class Form } $opt.= "\n"; - $optJson = array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'label2'=>$outlabel, 'desc'=>$outdesc, 'type'=>$outtype, 'price_ht'=>$outprice_ht, 'price_ttc'=>$outprice_ttc, 'pricebasetype'=>$outpricebasetype, 'tva_tx'=>$outtva_tx, 'qty'=>$outqty, 'discount'=>$outdiscount, 'duration_value'=>$outdurationvalue, 'duration_unit'=>$outdurationunit); + $optJson = array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'label2'=>$outlabel, 'desc'=>$outdesc, 'type'=>$outtype, 'price_ht'=>price2num($outprice_ht), 'price_ttc'=>price2num($outprice_ttc), 'pricebasetype'=>$outpricebasetype, 'tva_tx'=>$outtva_tx, 'qty'=>$outqty, 'discount'=>$outdiscount, 'duration_value'=>$outdurationvalue, 'duration_unit'=>$outdurationunit); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps From b5d348356dbc590b50ec97b25fceae111e7ac91a Mon Sep 17 00:00:00 2001 From: John Botella Date: Wed, 17 Jul 2019 16:49:41 +0200 Subject: [PATCH 25/62] Fix socpeople assigned list in action com list --- htdocs/comm/action/list.php | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 2d8be09ee7a..aae2d48e9cf 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -524,6 +524,7 @@ if ($resql) require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php'; $caction=new CActionComm($db); $arraylist=$caction->liste_array(1, 'code', '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0), '', 1); + $contactListCache = array(); while ($i < min($num,$limit)) { @@ -634,7 +635,34 @@ if ($resql) // Contact if (! empty($arrayfields['a.fk_contact']['checked'])) { print ''; - if ($obj->fk_contact > 0) + + + $actionstatic->fetchResources(); + if(!empty($actionstatic->socpeopleassigned)) + { + $contactList = array(); + foreach ($actionstatic->socpeopleassigned as $socpeopleId => $socpeopleassigned) + { + if(!isset($contactListCache[$socpeopleassigned['id']])) + { + // if no cache found we fetch it + $contact = new Contact($db); + if($contact->fetch($socpeopleassigned['id'])>0) + { + $contactListCache[$socpeopleassigned['id']] = $contact->getNomUrl(1,'',28); + $contactList[] = $contact->getNomUrl(1,'',28); + } + } + else{ + // use cache + $contactList[] = $contactListCache[$socpeopleassigned['id']]; + } + } + if(!empty($contactList)){ + print implode(', ', $contactList); + } + } + elseif ($obj->fk_contact > 0) //keep for retrocompatibility with faraway event { $contactstatic->id=$obj->fk_contact; $contactstatic->email=$obj->email; From 27a0c046dfc2e69ff700468e685f0f99ff55a52c Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 18 Jul 2019 09:58:26 +0200 Subject: [PATCH 26/62] Update stripe.class.php --- htdocs/stripe/class/stripe.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 6b910236e96..b5db41a424e 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -392,14 +392,14 @@ class Stripe extends CommonObject "payment_method_types" => array("card"), "description" => $description, "statement_descriptor" => dol_trunc($tag, 10, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt (company + description) - //"save_payment_method" => true, + "setup_future_usage" => "off_session", "metadata" => $metadata ); if (! is_null($customer)) $dataforintent["customer"]=$customer; // payment_method = // payment_method_types = array('card') //var_dump($dataforintent); - + if ($conf->entity!=$conf->global->STRIPECONNECT_PRINCIPAL && $stripefee > 0) { $dataforintent["application_fee"] = $stripefee; From 8a5aad34337723af0fa479c0f67487efbe0f97e3 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 18 Jul 2019 10:00:57 +0200 Subject: [PATCH 27/62] Update stripe.class.php --- htdocs/stripe/class/stripe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index b5db41a424e..e4b021167e0 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -399,7 +399,7 @@ class Stripe extends CommonObject // payment_method = // payment_method_types = array('card') //var_dump($dataforintent); - + if ($conf->entity!=$conf->global->STRIPECONNECT_PRINCIPAL && $stripefee > 0) { $dataforintent["application_fee"] = $stripefee; From 4235f0b3523694c1ef7d3587e3539dae3dd75fd1 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 18 Jul 2019 10:05:54 +0200 Subject: [PATCH 28/62] Update stripe.class.php --- htdocs/stripe/class/stripe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index e4b021167e0..993fe6a07dd 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -392,7 +392,7 @@ class Stripe extends CommonObject "payment_method_types" => array("card"), "description" => $description, "statement_descriptor" => dol_trunc($tag, 10, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt (company + description) - "setup_future_usage" => "off_session", + "setup_future_usage" => "on_session", "metadata" => $metadata ); if (! is_null($customer)) $dataforintent["customer"]=$customer; From 32bc8a5fafb51d4070014f29f84456b4690b1762 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Thu, 18 Jul 2019 11:05:51 +0200 Subject: [PATCH 29/62] FIX fournrprice log for insert --- htdocs/fourn/class/fournisseur.product.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index fc74890f150..49a7b1935cb 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -439,7 +439,7 @@ class ProductFournisseur extends Product $resql = $this->db->query($sql); if ($resql) { - $idinserted = $this->db->last_insert_id(MAIN_DB_PREFIX . "product_fournisseur_price"); + $this->product_fourn_price_id = $this->db->last_insert_id(MAIN_DB_PREFIX . "product_fournisseur_price"); } else { $error++; @@ -462,7 +462,7 @@ class ProductFournisseur extends Product if (empty($error)) { $this->db->commit(); - return $idinserted; + return $this->product_fourn_price_id; } else { $this->db->rollback(); return -1; From a23bae6c9664fdd845b9594f57504cb011c9a387 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 18 Jul 2019 11:10:09 +0200 Subject: [PATCH 30/62] Work to mke the page perf.php public by default. --- htdocs/admin/system/perf.php | 51 ++++++++++++++++++++++++++++++++--- htdocs/langs/en_US/admin.lang | 5 ++-- 2 files changed, 51 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php index 67f75c911aa..66148fb01ab 100644 --- a/htdocs/admin/system/perf.php +++ b/htdocs/admin/system/perf.php @@ -144,6 +144,21 @@ if (! $foundcache && $test) if (! $foundcache) print $langs->trans("NoOPCodeCacheFound"); print '
'; +// Use of preload bootstrap +if (ini_get('opcache.preload')) +{ + print '
'; + print ''.$langs->trans("PreloadOPCode").': '; + print ini_get('opcache.preload'); +} +else +{ + print '
'; + print ''.$langs->trans("PreloadOPCode").': '; + print $langs->trans("No"); +} +print '
'; + // HTTPCacheStaticResources print ' - Date: Thu, 18 Jul 2019 18:53:51 +0200 Subject: [PATCH 49/62] Fix phpcs --- htdocs/comm/action/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 6e46aee2435..1fbae964dff 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -660,8 +660,8 @@ if ($resql) $contact = new Contact($db); if($contact->fetch($socpeopleassigned['id'])>0) { - $contactListCache[$socpeopleassigned['id']] = $contact->getNomUrl(1,'',28); - $contactList[] = $contact->getNomUrl(1,'',28); + $contactListCache[$socpeopleassigned['id']] = $contact->getNomUrl(1, '', 28); + $contactList[] = $contact->getNomUrl(1, '', 28); } } else{ From 6c3a30e872501863d63936d194f48045c24d10eb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Jul 2019 03:05:55 +0200 Subject: [PATCH 50/62] Fix log --- htdocs/core/lib/website.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 198f91a4446..29a2ab27d8f 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -185,7 +185,7 @@ function dolWebsiteOutput($content) global $db, $langs, $conf, $user; global $dolibarr_main_url_root, $dolibarr_main_data_root; - dol_syslog("dolWebsiteOutput start (USEDOLIBARRSERVER=".(defined('USEDOLIBARRSERVER')?'1':'')." (USEDOLIBARREDITOR=".(defined('USEDOLIBARREDITOR')?'1':'').')'); + dol_syslog("dolWebsiteOutput start (USEDOLIBARRSERVER=".(defined('USEDOLIBARRSERVER')?'1':'')." USEDOLIBARREDITOR=".(defined('USEDOLIBARREDITOR')?'1':'').')'); // Define $urlwithroot $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); From 8857d0acf5404dfc5f966cbd771386ba2d07bc36 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Jul 2019 03:18:53 +0200 Subject: [PATCH 51/62] Keep save_payment_method to true. Keep it to true because i see no reason to not save the credit card on Stripe side. --- htdocs/stripe/class/stripe.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 993fe6a07dd..319ff08d2cd 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -392,7 +392,8 @@ class Stripe extends CommonObject "payment_method_types" => array("card"), "description" => $description, "statement_descriptor" => dol_trunc($tag, 10, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt (company + description) - "setup_future_usage" => "on_session", + "save_payment_method" => true, + "setup_future_usage" => "on_session", "metadata" => $metadata ); if (! is_null($customer)) $dataforintent["customer"]=$customer; From 03aa8c4b83baa9361c8e0cee89c693787cc15055 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Jul 2019 03:22:52 +0200 Subject: [PATCH 52/62] Better log --- htdocs/public/payment/newpayment.php | 7 ++++++- htdocs/stripe/class/stripe.class.php | 8 +++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index b36e115deea..deda54bf996 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -21,6 +21,11 @@ * For Paypal test: https://developer.paypal.com/ * For Paybox test: ??? * For Stripe test: Use credit card 4242424242424242 .More example on https://stripe.com/docs/testing + * + * Variants: + * - When option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION is on, we use the new checkout API + * - When option STRIPE_USE_NEW_CHECKOUT is on, we use the new checkout API + * - If no option set, we use old APIS (charge) */ /** @@ -2099,7 +2104,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment else { ?> - // Code for payment with option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION off and STRIPE_USE_NEW_CHECKOUT off + // Old code for payment with option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION off and STRIPE_USE_NEW_CHECKOUT off // Create a Stripe client. var stripe = Stripe(''); diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 6b910236e96..d9e6a077b96 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -286,9 +286,11 @@ class Stripe extends CommonObject /** * Get the Stripe payment intent. Create it with confirm=false * Warning. If a payment was tried and failed, a payment intent was created. - * But if we change someting on object to pay (amount or other), reusing same payment intent is not allowed. + * But if we change something on object to pay (amount or other), reusing same payment intent is not allowed. * Recommanded solution is to recreate a new payment intent each time we need one (old one will be automatically closed after a delay), * that's why i comment the part of code to retreive a payment intent with object id (never mind if we cumulate payment intent with old ones that will not be used) + * Note: This is used when option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION is on when making a payment from the public/payment/newpayment.php page + * but not when using the STRIPE_USE_NEW_CHECKOUT. * * @param double $amount Amount * @param string $currency_code Currency code @@ -307,7 +309,7 @@ class Stripe extends CommonObject { global $conf; - dol_syslog("getPaymentIntent"); + dol_syslog("getPaymentIntent", LOG_INFO, 1); $error = 0; @@ -479,7 +481,7 @@ class Stripe extends CommonObject } } - dol_syslog("getPaymentIntent return error=".$error); + dol_syslog("getPaymentIntent return error=".$error, LOG_INFO, -1); if (! $error) { From efe27d335b31b8a3241448ffb8bf6f55171cc168 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Jul 2019 03:53:34 +0200 Subject: [PATCH 53/62] Fix param --- htdocs/stripe/class/stripe.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index cb71c686ebf..92c6335cd29 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -394,7 +394,6 @@ class Stripe extends CommonObject "payment_method_types" => array("card"), "description" => $description, "statement_descriptor" => dol_trunc($tag, 10, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt (company + description) - "save_payment_method" => true, "setup_future_usage" => "on_session", "metadata" => $metadata ); From 2afefada40ca52d431792429cdbb6d983c6644b5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Jul 2019 04:02:42 +0200 Subject: [PATCH 54/62] Fix: Avoid deletion of system entries in dictionary --- htdocs/admin/dict.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 11cd105137c..87e072b8d7e 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1622,7 +1622,11 @@ if ($id) elseif ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; } elseif ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; } } - + if ($id == 25 && in_array($obj->code, array('banner', 'blogpost', 'other', 'page'))) + { + $iserasable = 0; $canbedisabled = 0; + if (in_array($obj->code, array('banner'))) $canbedisabled = 1; + } if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) { $iserasable=0; } if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO')) || in_array($obj->type, array('systemauto'))) { $canbedisabled=0; $canbedisabled = 0; } $canbemodified=$iserasable; From fe89e158fe384bf103db7d653c83dca2256be7e4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Jul 2019 04:02:42 +0200 Subject: [PATCH 55/62] Fix: Avoid deletion of system entries in dictionary --- htdocs/admin/dict.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 11cd105137c..87e072b8d7e 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1622,7 +1622,11 @@ if ($id) elseif ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; } elseif ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; } } - + if ($id == 25 && in_array($obj->code, array('banner', 'blogpost', 'other', 'page'))) + { + $iserasable = 0; $canbedisabled = 0; + if (in_array($obj->code, array('banner'))) $canbedisabled = 1; + } if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) { $iserasable=0; } if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO')) || in_array($obj->type, array('systemauto'))) { $canbedisabled=0; $canbedisabled = 0; } $canbemodified=$iserasable; From e5801c0b6872059d9e08516f70f9d569fd90d92f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Jul 2019 04:06:22 +0200 Subject: [PATCH 56/62] Update bonprelevement.class.php --- .../class/bonprelevement.class.php | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 1574fc3eb60..7a5a190c465 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1133,24 +1133,24 @@ class BonPrelevement extends CommonObject /** - * Get object and lines from database + * Get object and lines from database * * @param User $user Object user that delete - * @param int $notrigger 1=Does not execute triggers, 0= execute triggers - * @return int >0 if OK, <0 if KO + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int >0 if OK, <0 if KO */ - function delete($user=null, $notrigger = 0) + function delete($user = null, $notrigger = 0) { $this->db->begin(); - $error = 0; - if (! $notrigger) - { - // Call trigger - $result=$this->call_trigger('BON_PRELEVEMENT_DELETE', $user); - if ($result < 0) $error++; - // End call triggers - } + $error = 0; + if (! $notrigger) + { + // Call trigger + $result=$this->call_trigger('BON_PRELEVEMENT_DELETE', $user); + if ($result < 0) $error++; + // End call triggers + } $sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_facture WHERE fk_prelevement_lignes IN (SELECT rowid FROM ".MAIN_DB_PREFIX."prelevement_lignes WHERE fk_prelevement_bons = ".$this->id.")"; $resql1=$this->db->query($sql); From 278c2d7152cfc5aef5bfb7e489eef304ba2b47a5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Jul 2019 12:58:21 +0200 Subject: [PATCH 57/62] Enhance the perf page --- htdocs/admin/system/perf.php | 20 ++++++++++++++++---- htdocs/langs/en_US/admin.lang | 6 +++--- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php index 66148fb01ab..fbf6fa3bb14 100644 --- a/htdocs/admin/system/perf.php +++ b/htdocs/admin/system/perf.php @@ -70,6 +70,18 @@ else } print '
'; +// Module log +print '
'; +print ''.$langs->trans("Syslog").': '; +$test=empty($conf->syslog->enabled); +if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled"); +else +{ + print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("Syslog")); + //print ' '.$langs->trans("MoreInformation").' XDebug admin page'; +} +print '
'; + // Module debugbar print '
'; print ''.$langs->trans("DebugBar").': '; @@ -77,7 +89,7 @@ $test=empty($conf->debugbar->enabled); if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled"); else { - print img_picto('', 'warning').' '.$langs->trans("DebugBarModuleActivated"); + print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("DebugBar")); //print ' '.$langs->trans("MoreInformation").' XDebug admin page'; } print '
'; @@ -110,20 +122,20 @@ $test=function_exists('xcache_info'); if (! $foundcache && $test) { $foundcache++; - print img_picto('', 'tick.png').' '.$langs->trans("XCacheInstalled"); + print img_picto('', 'tick.png').' '.$langs->trans("PHPModuleLoaded", "XCache"); print ' '.$langs->trans("MoreInformation").' Xcache admin page'; } $test=function_exists('eaccelerator_info'); if (! $foundcache && $test) { $foundcache++; - print img_picto('', 'tick.png').' '.$langs->trans("EAcceleratorInstalled"); + print img_picto('', 'tick.png').' '.$langs->trans("PHPModuleLoaded", "Eaccelerator"); } $test=function_exists('opcache_get_status'); if (! $foundcache && $test) { $foundcache++; - print img_picto('', 'tick.png').' '.$langs->trans("ZendOPCacheInstalled"); // Should be by default starting with PHP 5.5 + print img_picto('', 'tick.png').' '.$langs->trans("PHPModuleLoaded", "ZendOPCache"); // Should be by default starting with PHP 5.5 //$tmp=opcache_get_status(); //var_dump($tmp); } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 1765a7c6440..3b73cdb0bd6 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1226,8 +1226,8 @@ YouHaveXObjectUseSearchOptim=You have %s %s in the database. You should add the YouHaveXObjectAndSearchOptimOn=You have %s %s in the database and constant %s is set to 1 in Home-Setup-Other. BrowserIsOK=You are using the %s web browser. This browser is ok for security and performance. BrowserIsKO=You are using the %s web browser. This browser is known to be a bad choice for security, performance and reliability. We recommend using Firefox, Chrome, Opera or Safari. -XDebugInstalled=XDebug is loaded. -XCacheInstalled=XCache is loaded. +PHPModuleLoaded=PHP component %s is loaded +PreloadOPCode=Preloaded OPCode is used AddRefInList=Display Customer/Vendor ref. info list (select list or combobox) and most of hyperlink.
Third Parties will appear with a name format of "CC12345 - SC45678 - The Big Company corp." instead of "The Big Company corp". AddAdressInList=Display Customer/Vendor adress info list (select list or combobox)
Third Parties will appear with a name format of "The Big Company corp. - 21 jump street 123456 Big town - USA" instead of "The Big Company corp". AskForPreferredShippingMethod=Ask for preferred shipping method for Third Parties. @@ -1912,7 +1912,7 @@ LogsLinesNumber=Number of lines to show on logs tab UseDebugBar=Use the debug bar DEBUGBAR_LOGS_LINES_NUMBER=Number of last log lines to keep in console WarningValueHigherSlowsDramaticalyOutput=Warning, higher values slows dramaticaly output -DebugBarModuleActivated=Module debugbar is activated and slows dramaticaly the interface +ModuleActivated=Module %s is activated and slows the interface EXPORTS_SHARE_MODELS=Export models are share with everybody ExportSetup=Setup of module Export InstanceUniqueID=Unique ID of the instance From cd1a2d24eee0f0556ca1952df638f8519f7c9f72 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Jul 2019 13:07:07 +0200 Subject: [PATCH 58/62] Removed not used file --- htdocs/societe/notify/index.html | 0 htdocs/societe/notify/index.php | 109 ------------------------------- 2 files changed, 109 deletions(-) create mode 100644 htdocs/societe/notify/index.html delete mode 100644 htdocs/societe/notify/index.php diff --git a/htdocs/societe/notify/index.html b/htdocs/societe/notify/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/societe/notify/index.php b/htdocs/societe/notify/index.php deleted file mode 100644 index f4e5bd8554b..00000000000 --- a/htdocs/societe/notify/index.php +++ /dev/null @@ -1,109 +0,0 @@ - - * Copyright (C) 2004-2006 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 - * 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 . - */ - -/** - * \file htdocs/societe/notify/index.php - * \ingroup notification - * \brief List of done notifications - */ - -require '../../main.inc.php'; -$langs->loadLangs(array("companies", "banks")); - -// S�curit� acc�s client -if ($user->societe_id > 0) -{ - $action = ''; - $socid = $user->societe_id; -} - -if ($sortorder == "") -{ - $sortorder="ASC"; -} -if ($sortfield == "") -{ - $sortfield="s.nom"; -} - -if (empty($page) || $page == -1) { $page = 0 ; } - -$offset = $conf->liste_limit * $page ; -$pageprev = $page - 1; -$pagenext = $page + 1; - - - -/* - * View - */ - -llxHeader(); - -$sql = "SELECT s.nom as name, s.rowid as socid, c.lastname, c.firstname, a.label, n.rowid"; -$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c,"; -$sql.= " ".MAIN_DB_PREFIX."c_action_trigger as a,"; -$sql.= " ".MAIN_DB_PREFIX."notify_def as n,"; -$sql.= " ".MAIN_DB_PREFIX."societe as s"; -$sql.= " WHERE n.fk_contact = c.rowid"; -$sql.= " AND a.rowid = n.fk_action"; -$sql.= " AND n.fk_soc = s.rowid"; -$sql.= " AND s.entity IN (".getEntity('societe').")"; -if ($socid > 0) $sql.= " AND s.rowid = " . $user->societe_id; - -$sql.= $db->order($sortfield, $sortorder); -$sql.= $db->plimit($conf->liste_limit, $offset); - -$result = $db->query($sql); -if ($result) -{ - $num = $db->num_rows($result); - $i = 0; - - $paramlist=''; - print_barre_liste($langs->trans("ListOfNotificationsDone"), $page, $_SERVER["PHP_SELF"], $paramlist, $sortfield, $sortorder, '', $num); - - print ''; - print ''; - print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", "", "", 'valign="center"', $sortfield, $sortorder); - print_liste_field_titre("Contact", $_SERVER["PHP_SELF"], "c.lastname", "", "", 'valign="center"', $sortfield, $sortorder); - print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "a.titre", "", "", 'valign="center"', $sortfield, $sortorder); - print "\n"; - - while ($i < $num) - { - $obj = $db->fetch_object($result); - - print ''; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - $i++; - } - print "
socid."\">".$obj->name."".dolGetFirstLastname($obj->firstname, $obj->lastname)."".$obj->titre."
"; - $db->free(); -} -else -{ - dol_print_error($db); -} - -// End of page -llxFooter(); -$db->close(); From f745d01bf34f9e9d04abf9ded88f3ce3ed71d0c5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Jul 2019 13:22:54 +0200 Subject: [PATCH 59/62] Prepare change of properties "titre" into "title" --- htdocs/admin/menus/edit.php | 8 +++++--- htdocs/admin/menus/index.php | 4 ++-- htdocs/compta/facture/card.php | 4 ++-- htdocs/compta/facture/class/facture-rec.class.php | 12 +++++++----- htdocs/compta/facture/fiche-rec.php | 8 +++++--- htdocs/compta/facture/invoicetemplate_list.php | 4 ++-- htdocs/core/class/menubase.class.php | 3 ++- htdocs/core/modules/DolibarrModules.class.php | 3 ++- htdocs/fichinter/card-rec.php | 6 +++--- htdocs/projet/class/api_projects.class.php | 1 - htdocs/projet/class/project.class.php | 6 +----- 11 files changed, 31 insertions(+), 28 deletions(-) diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index cf42f294d03..6bacc97e92f 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -87,7 +87,8 @@ if ($action == 'update') $result=$menu->fetch(GETPOST('menuId', 'int')); if ($result > 0) { - $menu->titre=GETPOST('titre', 'alpha'); + $menu->titre=GETPOST('titre', 'alpha'); // deprecated + $menu->title=GETPOST('titre', 'alpha'); $menu->leftmenu=GETPOST('leftmenu', 'aZ09'); $menu->url=GETPOST('url', 'alpha'); $menu->langs=GETPOST('langs', 'alpha'); @@ -205,7 +206,8 @@ if ($action == 'add') $menu = new Menubase($db); $menu->menu_handler=preg_replace('/_menu$/', '', GETPOST('menu_handler', 'aZ09')); $menu->type=GETPOST('type', 'alpha'); - $menu->titre=GETPOST('titre', 'alpha'); + $menu->titre=GETPOST('titre', 'alpha'); // deprecated + $menu->title=GETPOST('titre', 'alpha'); $menu->url=GETPOST('url', 'alpha'); $menu->langs=GETPOST('langs', 'alpha'); $menu->position=GETPOST('position', 'int'); @@ -494,7 +496,7 @@ elseif ($action == 'edit') //print ''.$langs->trans('Level').''.$menu->level.''.$langs->trans('DetailLevel').''; // Title - print ''.$langs->trans('Title').''.$langs->trans('DetailTitre').''; + print ''.$langs->trans('Title').''.$langs->trans('DetailTitre').''; // Url print ''.$langs->trans('URL').''.$langs->trans('DetailUrl').''; diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index d1b56d51cee..1790eaf5aee 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -244,13 +244,13 @@ print "
\n"; // Confirmation for remove menu entry if ($action == 'delete') { - $sql = "SELECT m.titre"; + $sql = "SELECT m.titre as title"; $sql.= " FROM ".MAIN_DB_PREFIX."menu as m"; $sql.= " WHERE m.rowid = ".GETPOST('menuId', 'int'); $result = $db->query($sql); $obj = $db->fetch_object($result); - print $form->formconfirm("index.php?menu_handler=".$menu_handler."&menuId=".GETPOST('menuId', 'int'), $langs->trans("DeleteMenu"), $langs->trans("ConfirmDeleteMenu", $obj->titre), "confirm_delete"); + print $form->formconfirm("index.php?menu_handler=".$menu_handler."&menuId=".GETPOST('menuId', 'int'), $langs->trans("DeleteMenu"), $langs->trans("ConfirmDeleteMenu", $obj->title), "confirm_delete"); } $newcardbutton=''; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 968469ff1e0..2f017b485d6 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2773,7 +2773,7 @@ if ($action == 'create') $note_public = $invoice_predefined->note_public; $note_private = $invoice_predefined->note_private; - $sql = 'SELECT r.rowid, r.titre, r.total_ttc'; + $sql = 'SELECT r.rowid, r.titre as title, r.total_ttc'; $sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as r'; $sql .= ' WHERE r.fk_soc = ' . $invoice_predefined->socid; @@ -2797,7 +2797,7 @@ if ($action == 'create') print ' selected'; $exampletemplateinvoice->fetch(GETPOST('fac_rec')); } - print '>' . $objp->titre . ' (' . price($objp->total_ttc) . ' ' . $langs->trans("TTC") . ')'; + print '>' . $objp->title . ' (' . price($objp->total_ttc) . ' ' . $langs->trans("TTC") . ')'; $i ++; } print ''; diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index f6b148d308c..37a031198bc 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -123,7 +123,8 @@ class FactureRec extends CommonInvoice $now=dol_now(); // Clean parameters - $this->titre=trim($this->titre); + $this->titre=trim($this->titre); // deprecated + $this->title=trim($this->title); $this->usenewprice=empty($this->usenewprice)?0:$this->usenewprice; if (empty($this->suspended)) $this->suspended=0; @@ -180,7 +181,7 @@ class FactureRec extends CommonInvoice $sql.= ", multicurrency_tx"; $sql.= ", suspended"; $sql.= ") VALUES ("; - $sql.= "'".$this->db->escape($this->titre)."'"; + $sql.= "'".$this->db->escape($this->titre ? $this->titre : $this->title)."'"; $sql.= ", ".$facsrc->socid; $sql.= ", ".$conf->entity; $sql.= ", '".$this->db->idate($now)."'"; @@ -376,7 +377,7 @@ class FactureRec extends CommonInvoice */ public function fetch($rowid, $ref = '', $ref_ext = '', $ref_int = '') { - $sql = 'SELECT f.rowid, f.entity, f.titre, f.suspended, f.fk_soc, f.amount, f.tva, f.localtax1, f.localtax2, f.total, f.total_ttc'; + $sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc, f.amount, f.tva, f.localtax1, f.localtax2, f.total, f.total_ttc'; $sql.= ', f.remise_percent, f.remise_absolue, f.remise'; $sql.= ', f.date_lim_reglement as dlr'; $sql.= ', f.note_private, f.note_public, f.fk_user_author'; @@ -410,8 +411,9 @@ class FactureRec extends CommonInvoice $this->id = $obj->rowid; $this->entity = $obj->entity; - $this->titre = $obj->titre; - $this->ref = $obj->titre; + $this->titre = $obj->title; // deprecated + $this->title = $obj->title; + $this->ref = $obj->title; $this->ref_client = $obj->ref_client; $this->suspended = $obj->suspended; $this->type = $obj->type; diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index dd4a2af11ee..39f913fbf76 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -187,7 +187,8 @@ if (empty($reshook)) if (! $error) { - $object->titre = GETPOST('titre', 'alpha'); + $object->titre = GETPOST('titre', 'alpha'); // deprecated + $object->title = GETPOST('titre', 'alpha'); $object->note_private = GETPOST('note_private', 'none'); $object->note_public = GETPOST('note_public', 'none'); $object->modelpdf = GETPOST('modelpdf', 'alpha'); @@ -295,8 +296,9 @@ if (empty($reshook)) $result=$object->setValueFrom('titre', GETPOST('ref', 'alpha'), '', null, 'text', '', $user, 'BILLREC_MODIFY'); if ($result > 0) { - $object->titre = GETPOST('ref', 'alpha'); - $object->ref = $object->titre; + $object->titre = GETPOST('ref', 'alpha'); // deprecated + $object->title = GETPOST('ref', 'alpha'); + $object->ref = $object->title; } else dol_print_error($db, $object->error, $object->errors); } diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 5da37d46fd5..1226f7c8a79 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -213,7 +213,7 @@ $today = dol_mktime(23, 59, 59, $tmparray['mon'], $tmparray['mday'], $tmparray[' /* * List mode */ -$sql = "SELECT s.nom as name, s.rowid as socid, f.rowid as facid, f.titre, f.total, f.tva as total_vat, f.total_ttc, f.frequency, f.unit_frequency,"; +$sql = "SELECT s.nom as name, s.rowid as socid, f.rowid as facid, f.titre as title, f.total, f.tva as total_vat, f.total_ttc, f.frequency, f.unit_frequency,"; $sql.= " f.nb_gen_done, f.nb_gen_max, f.date_last_gen, f.date_when, f.suspended,"; $sql.= " f.datec, f.tms,"; $sql.= " f.fk_cond_reglement, f.fk_mode_reglement"; @@ -514,7 +514,7 @@ if ($resql) $invoicerectmp->unit_frequency=$objp->unit_frequency; $invoicerectmp->nb_gen_max=$objp->nb_gen_max; $invoicerectmp->nb_gen_done=$objp->nb_gen_done; - $invoicerectmp->ref=$objp->titre; + $invoicerectmp->ref=$objp->title; print ''; diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index d1d7534af23..26f96b93ec5 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -422,7 +422,8 @@ class Menubase $this->position=''; $this->url='http://dummy'; $this->target=''; - $this->titre='Specimen menu'; + $this->titre='Specimen menu'; // deprecated + $this->title='Specimen menu'; $this->langs=''; $this->level=''; $this->leftmenu=''; diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 4a8135800ae..16d3969652d 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1938,7 +1938,8 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $menu->type=$this->menu[$key]['type']; $menu->mainmenu=isset($this->menu[$key]['mainmenu'])?$this->menu[$key]['mainmenu']:(isset($menu->fk_mainmenu)?$menu->fk_mainmenu:''); $menu->leftmenu=isset($this->menu[$key]['leftmenu'])?$this->menu[$key]['leftmenu']:''; - $menu->titre=$this->menu[$key]['titre']; + $menu->titre=$this->menu[$key]['titre']; // deprecated + $menu->title=$this->menu[$key]['titre']; $menu->url=$this->menu[$key]['url']; $menu->langs=$this->menu[$key]['langs']; $menu->position=$this->menu[$key]['position']; diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 6ee445d68a1..63183c73d1d 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -129,7 +129,7 @@ if ($action == 'add') { if (! $error) { $object->id_origin = $id; - $object->titre = GETPOST('titre', 'alpha'); + $object->title = GETPOST('titre', 'alpha'); $object->description = GETPOST('description', 'alpha'); $object->socid = GETPOST('socid', 'alpha'); $object->fk_project = GETPOST('projectid', 'int'); @@ -773,7 +773,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime( /* * List mode */ - $sql = "SELECT f.rowid as fich_rec, s.nom as name, s.rowid as socid, f.rowid as facid, f.titre,"; + $sql = "SELECT f.rowid as fich_rec, s.nom as name, s.rowid as socid, f.rowid as facid, f.titre as title,"; $sql.= " f.duree, f.fk_contrat, f.fk_projet as fk_project, f.frequency, f.nb_gen_done, f.nb_gen_max,"; $sql.= " f.date_last_gen, f.date_when, f.datec"; @@ -844,7 +844,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime( print ''; print ''; - print img_object($langs->trans("ShowIntervention"), "intervention").' '.$objp->titre; + print img_object($langs->trans("ShowIntervention"), "intervention").' '.$objp->title; print "\n"; if ($objp->socid) { $companystatic->id=$objp->socid; diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php index 48ae3cbf337..b6f9acbf4b5 100644 --- a/htdocs/projet/class/api_projects.class.php +++ b/htdocs/projet/class/api_projects.class.php @@ -546,7 +546,6 @@ class Projects extends DolibarrApi // phpcs:enable $object = parent::_cleanObjectDatas($object); - unset($object->titre); unset($object->datec); unset($object->datem); unset($object->barcode_type); diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 9a651ec4a0a..0c7495efa7e 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -74,12 +74,9 @@ class Project extends CommonObject /** * @var string - * @deprecated - * @see $title */ - public $titre; - public $title; + public $date_start; public $date_end; public $date_close; @@ -465,7 +462,6 @@ class Project extends CommonObject $this->id = $obj->rowid; $this->ref = $obj->ref; $this->title = $obj->title; - $this->titre = $obj->title; // TODO deprecated $this->description = $obj->description; $this->date_c = $this->db->jdate($obj->datec); $this->datec = $this->db->jdate($obj->datec); // TODO deprecated From 1f308915ee8d9e5638f86d7017b82b7c78376ebb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Jul 2019 13:23:17 +0200 Subject: [PATCH 60/62] Fix trans --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index a05eb631e13..a1d042a07a1 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1698,7 +1698,7 @@ ExpenseReportNumberingModules=Expense reports numbering module NoModueToManageStockIncrease=No module able to manage automatic stock increase has been activated. Stock increase will be done on manual input only. YouMayFindNotificationsFeaturesIntoModuleNotification=You may find options for EMail notifications by enabling and configuring the module "Notification". ListOfNotificationsPerUser=List of notifications per user* -ListOfNotificationsPerUserOrContact=List of notifications per user* or per contact** +ListOfNotificationsPerUserOrContact=List of possible notifications per user* or per contact** ListOfFixedNotifications=List of fixed notifications GoOntoUserCardToAddMore=Go to the tab "Notifications" of a user to add or remove notifications for users GoOntoContactCardToAddMore=Go on the tab "Notifications" of a third party to add or remove notifications for contacts/addresses From fea810fb3b0a2c3c6e671149bbd7df4d58ae2537 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Jul 2019 13:44:30 +0200 Subject: [PATCH 61/62] Trans --- htdocs/langs/en_US/admin.lang | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 38096f37827..895b725a858 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -574,7 +574,7 @@ Module510Name=Salaries Module510Desc=Record and track employee payments Module520Name=Loans Module520Desc=Management of loans -Module600Name=Notifications +Module600Name=Notifications on business event Module600Desc=Send email notifications triggered by a business event: per user (setup defined on each user), per third-party contacts (setup defined on each third party) or by specific emails Module600Long=Note that this module sends emails in real-time when a specific business event occurs. If you are looking for a feature to send email reminders for agenda events, go into the setup of module Agenda. Module610Name=Product Variants @@ -1735,9 +1735,9 @@ ExpenseReportsRulesSetup=Setup of module Expense Reports - Rules ExpenseReportNumberingModules=Expense reports numbering module NoModueToManageStockIncrease=No module able to manage automatic stock increase has been activated. Stock increase will be done on manual input only. YouMayFindNotificationsFeaturesIntoModuleNotification=You may find options for email notifications by enabling and configuring the module "Notification". -ListOfNotificationsPerUser=List of notifications per user* -ListOfNotificationsPerUserOrContact=List of possible notifications (type of events) available per user* or per contact** -ListOfFixedNotifications=List of fixed notifications +ListOfNotificationsPerUser=List of automatic notifications per user* +ListOfNotificationsPerUserOrContact=List of possible automatic notifications (on business event) available per user* or per contact** +ListOfFixedNotifications=List of automatic fixed notifications GoOntoUserCardToAddMore=Go to the tab "Notifications" of a user to add or remove notifications for users GoOntoContactCardToAddMore=Go on the tab "Notifications" of a third party to add or remove notifications for contacts/addresses Threshold=Threshold From a55da8f8f889fd259093a5d97faa18d0884b4393 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Jul 2019 17:20:33 +0200 Subject: [PATCH 62/62] Fix migration --- htdocs/install/mysql/migration/10.0.0-11.0.0.sql | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index f8cc3062bde..1b9f52ffaed 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -28,6 +28,10 @@ -- Note: fields with type BLOB/TEXT can't have default value. +-- Missing in v10 +ALTER TABLE llx_account_bookkeeping ADD COLUMN date_export datetime DEFAULT NULL; + + create table llx_entrepot_extrafields ( rowid integer AUTO_INCREMENT PRIMARY KEY, @@ -50,3 +54,4 @@ ALTER TABLE llx_user ADD COLUMN iplastlogin varchar(250); ALTER TABLE llx_user ADD COLUMN ippreviouslogin varchar(250); ALTER TABLE llx_events ADD COLUMN prefix_session varchar(255) NULL; +