From d9cdaeb851671771c6a7ef483ebfe9fba03a0c9b Mon Sep 17 00:00:00 2001 From: AlainRnet Date: Mon, 24 Apr 2017 15:43:36 +0200 Subject: [PATCH 1/3] without html.formprojet.class.php called, not possible create invoice template cf. https://github.com/Dolibarr/dolibarr/issues/6614 without this class AND module Projects disabled, it's not possible to create an invoice template. So I pulled out the call of the class from the condition. --- htdocs/compta/facture/fiche-rec.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 706807c8f02..d164019b64d 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -35,8 +35,9 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; + //require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; } +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/invoice.lib.php'; From e2dbcb2b5a68083711a373f2eaee78513eb20fcb Mon Sep 17 00:00:00 2001 From: philippe grand Date: Tue, 25 Apr 2017 11:59:18 +0200 Subject: [PATCH 2/3] Update code using new css class --- htdocs/admin/loan.php | 4 +--- htdocs/admin/mails_templates.php | 9 ++++----- htdocs/admin/modules.php | 6 ++---- htdocs/admin/oauth.php | 13 ++++--------- htdocs/admin/perms.php | 4 +--- htdocs/admin/salaries.php | 2 +- htdocs/admin/supplier_invoice.php | 5 ++--- htdocs/admin/supplier_order.php | 5 ++--- htdocs/admin/supplier_payment.php | 3 +-- htdocs/admin/syslog.php | 3 +-- htdocs/admin/taxes.php | 10 +++++----- htdocs/admin/websites.php | 4 +--- htdocs/admin/workflow.php | 3 +-- 13 files changed, 26 insertions(+), 45 deletions(-) diff --git a/htdocs/admin/loan.php b/htdocs/admin/loan.php index ee6b9ef74ee..86d963ed54f 100644 --- a/htdocs/admin/loan.php +++ b/htdocs/admin/loan.php @@ -96,9 +96,7 @@ print "\n"; foreach ($list as $key) { - - - print ''; + print ''; // Param $label = $langs->trans($key); diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index f0bf5609adf..a4ec423b42f 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -4,7 +4,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2016 Juanjo Menent - * Copyright (C) 2011-2015 Philippe Grand + * Copyright (C) 2011-2017 Philippe Grand * Copyright (C) 2011 Remy Younes * Copyright (C) 2012-2015 Marcos GarcĂ­a * Copyright (C) 2012 Christophe Battarel @@ -651,11 +651,10 @@ if ($resql) // Lines with values while ($i < $num) { - $var = ! $var; $obj = $db->fetch_object($resql); //print_r($obj); - print ''; + print ''; if ($action == 'edit' && ($rowid == (! empty($obj->rowid)?$obj->rowid:$obj->code))) { $tmpaction='edit'; @@ -689,7 +688,7 @@ if ($resql) // Show value for field if ($showfield) { - print ''; // To create an artificial CR for the current tr we are on + print ''; // To create an artificial CR for the current tr we are on $okforextended = true; if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) $okforextended = false; @@ -781,7 +780,7 @@ if ($resql) // Show value for field if ($showfield) { - print ''; // To create an artificial CR for the current tr we are on + print ''; // To create an artificial CR for the current tr we are on $okforextended = true; if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) $okforextended = false; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 4eb82e6183c..c47586b2b2a 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -428,8 +428,6 @@ $h++; print "
\n"; -$var=true; - if ($mode == 'common') { @@ -782,7 +780,7 @@ if ($mode == 'marketplace') print ''; - print "\n"; + print "\n"; $url='https://www.dolistore.com'; print ''; print ''.$langs->trans("DoliStoreDesc").''; @@ -790,7 +788,7 @@ if ($mode == 'marketplace') print ''; - print "\n"; + print "\n"; $url='https://partners.dolibarr.org'; print ''; print ''.$langs->trans("DoliPartnersDesc").''; diff --git a/htdocs/admin/oauth.php b/htdocs/admin/oauth.php index 34aa49ea237..c1bb5909e15 100644 --- a/htdocs/admin/oauth.php +++ b/htdocs/admin/oauth.php @@ -93,7 +93,6 @@ print $langs->trans("ListOfSupportedOauthProviders").'

'; print ''; -$var = true; $i=0; foreach ($list as $key) @@ -116,31 +115,27 @@ foreach ($list as $key) if ($supported) { $redirect_uri=$urlwithroot.'/core/modules/oauth/'.$supportedoauth2array[$key[0]].'_oauthcallback.php'; - $var = !$var; - print ''; + print ''; print ''; print ''; } else { - $var = !$var; - print ''; + print ''; print ''; print ''; print ''; } // Api Id - $var = !$var; - print ''; + print ''; print ''; print ''; // Api Secret - $var = !$var; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index daafab71053..5acbeb2e627 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -140,7 +140,6 @@ if ($result) { $num = $db->num_rows($result); $i = 0; - $var = True; $oldmod = ""; while ($i < $num) @@ -187,8 +186,7 @@ if ($result) } - print ''; - + print ''; print ''; + print ''; // Param $label = $langs->trans($key); diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index 2619951e1b5..9e717ee125a 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -5,7 +5,7 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2010-2013 Juanjo Menent - * Copyright (C) 2011-2015 Philippe Grand + * Copyright (C) 2011-2017 Philippe Grand * * 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 @@ -361,7 +361,6 @@ foreach ($dirmodels as $reldir) if (is_dir($dir)) { - $var=true; $handle=opendir($dir); @@ -379,7 +378,7 @@ foreach ($dirmodels as $reldir) $module = new $classname($db, new FactureFournisseur($db)); - print "\n"; + print "\n"; print "\n"; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index d54f0e367aa..7bca2418df3 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -5,7 +5,7 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2010-2013 Juanjo Menent - * Copyright (C) 2011-2015 Philippe Grand + * Copyright (C) 2011-2017 Philippe Grand * * 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 @@ -382,7 +382,6 @@ print ''."\n"; clearstatcache(); -$var=true; foreach ($dirmodels as $reldir) { $dir = dol_buildpath($reldir."core/modules/supplier_order/pdf/"); @@ -403,7 +402,7 @@ foreach ($dirmodels as $reldir) $module = new $classname($db, new CommandeFournisseur($db)); - print "\n"; + print "\n"; print "\n"; diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index 40caa94c8a8..0f6cbff6179 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -367,7 +367,6 @@ foreach ($dirmodels as $reldir) if (is_dir($dir)) { - $var=true; $handle=opendir($dir); @@ -385,7 +384,7 @@ foreach ($dirmodels as $reldir) $module = new $classname($db, new PaiementFourn($db)); - print "\n"; + print "\n"; print "\n"; diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index 71d06ae8e64..40a94bffc71 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -194,7 +194,6 @@ print ''; print ''; print ''; print "\n"; -$var=true; foreach ($syslogModules as $moduleName) { @@ -207,7 +206,7 @@ foreach ($syslogModules as $moduleName) print ''; print ''; diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index 788d8604584..dbdce59c3c5 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -136,10 +136,10 @@ else print ''; print ''; print "\n"; - print ''; + print ''; print '\n"; - print ''; + print ''; print '\n"; print "
'.$langs->trans("UseTheFollowingUrlAsRedirectURI").''; print '
'.$langs->trans("UseTheFollowingUrlAsRedirectURI").''.$langs->trans("FeatureNotYetSupported").'
'; print '
'; print '
'.img_object('',$picto).' '.$objMod->getName(); print ' '; diff --git a/htdocs/admin/salaries.php b/htdocs/admin/salaries.php index a04b23ce4fe..52470be4106 100644 --- a/htdocs/admin/salaries.php +++ b/htdocs/admin/salaries.php @@ -99,7 +99,7 @@ foreach ($list as $key) { - print '
"; print (empty($module->name)?$name:$module->name); print "
"; print (empty($module->name)?$name:$module->name); print "
"; print (empty($module->name)?$name:$module->name); print "
'.$langs->trans("Type").''.$langs->trans("Value").'
'; - print ' '; + print ' '; print $module->getName(); print '
'.$langs->trans('OptionVatMode').''.$langs->trans('Description').'
'.$langs->trans('OptionVATDefault').'
'.$langs->trans('OptionVATDefault').''.nl2br($langs->trans('OptionVatDefaultDesc')); print "
'.$langs->trans('OptionVATDebitOption').'
'.$langs->trans('OptionVATDebitOption').''.nl2br($langs->trans('OptionVatDebitOptionDesc'))."
\n"; @@ -152,7 +152,7 @@ else print ' '.$langs->trans("Buy").''.$langs->trans("Sell").''; // Products - print ''.$langs->trans("Product").''; + print ''.$langs->trans("Product").''; print ''; print $langs->trans("OnDelivery"); print ' ('.$langs->trans("SupposedToBeInvoiceDate").')'; @@ -163,7 +163,7 @@ else print ''; // Services - print ''.$langs->trans("Services").''; + print ''.$langs->trans("Services").''; print ''; if ($tax_mode == 0) { @@ -206,7 +206,7 @@ foreach ($list as $key) { - print ''; + print ''; // Param $label = $langs->trans($key); diff --git a/htdocs/admin/websites.php b/htdocs/admin/websites.php index b0c81ec18af..f7e71555943 100644 --- a/htdocs/admin/websites.php +++ b/htdocs/admin/websites.php @@ -450,7 +450,6 @@ if ($id) { $num = $db->num_rows($resql); $i = 0; - $var=true; if ($num) { // There is several pages @@ -499,11 +498,10 @@ if ($id) // Lines with values while ($i < $num) { - $var = ! $var; $obj = $db->fetch_object($resql); //print_r($obj); - print ''; + print ''; if ($action == 'edit' && ($rowid == (! empty($obj->rowid)?$obj->rowid:$obj->code))) { print '
'; diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index d9595cd7fb0..af104fd4bfe 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -120,8 +120,7 @@ foreach($workflowcodes as $key => $params) $oldfamily = $family; } - $var = !$var; - print "\n"; + print "\n"; print "".img_object('', $picto).$langs->trans('desc'.$key); if (! empty($params['warning'])) { From 626c0d6d5e9308656777a9ff300dba88f0a3a054 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 May 2017 20:40:13 +0200 Subject: [PATCH 3/3] Add more substitution keys for PDFs. --- htdocs/admin/expensereport.php | 2 +- htdocs/admin/expensereport_extrafields.php | 2 +- htdocs/core/lib/pdf.lib.php | 9 ++++++++- htdocs/langs/en_US/admin.lang | 3 +++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index dad17585e2e..b8626827595 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -230,7 +230,7 @@ print load_fiche_titre($langs->trans("ExpenseReportsSetup"),$linkback,'title_set $head=expensereport_admin_prepare_head(); -dol_fiche_head($head, 'expensereport', $langs->trans("ExpenseReports"), 0, 'trip'); +dol_fiche_head($head, 'expensereport', $langs->trans("ExpenseReports"), -1, 'trip'); // Interventions numbering model /* diff --git a/htdocs/admin/expensereport_extrafields.php b/htdocs/admin/expensereport_extrafields.php index 65e1592eff8..d1d3aacc9cc 100644 --- a/htdocs/admin/expensereport_extrafields.php +++ b/htdocs/admin/expensereport_extrafields.php @@ -74,7 +74,7 @@ print load_fiche_titre($langs->trans("ExpenseReportsSetup"),$linkback,'title_set $head = expensereport_admin_prepare_head(); -dol_fiche_head($head, 'attributes', $langs->trans("ExpenseReports"), 0, 'trip'); +dol_fiche_head($head, 'attributes', $langs->trans("ExpenseReports"), -1, 'trip'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 2fc447daffd..e83faee6c8d 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -599,7 +599,14 @@ function pdf_getSubstitutionArray($outputlangs) $substitutionarray=array( '__MYCOMPANY_NAME__' => $mysoc->name, '__MYCOMPANY_EMAIL__' => $mysoc->email, - '__USER_ID__' => $user->id, + '__MYCOMPANY_PROFID1__' => $mysoc->idprof1, + '__MYCOMPANY_PROFID2__' => $mysoc->idprof2, + '__MYCOMPANY_PROFID3__' => $mysoc->idprof3, + '__MYCOMPANY_PROFID4__' => $mysoc->idprof4, + '__MYCOMPANY_PROFID5__' => $mysoc->idprof5, + '__MYCOMPANY_PROFID6__' => $mysoc->idprof6, + '__MYCOMPANY_CAPITAL__' => $mysoc->capital, + '__USER_ID__' => $user->id, '__USER_LOGIN__' => $user->login, '__USER_LASTNAME__' => $user->lastname, '__USER_FIRSTNAME__' => $user->firstname, diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 35037387c1f..1356a980164 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -434,6 +434,9 @@ PageUrlForDefaultValuesList=
For page that list thirdparties, it is % GoIntoTranslationMenuToChangeThis=A translation has been found for the key with this code, so to change this value, you must edit it fom Home-Setup-translation. WarningSettingSortOrder=Warning, setting a default sort order may result in a technical error when going on the list page if field is an unknown field. If you experience such an error, come back to this page to remove the default sort order and restore default behavior. Field=Field +ProductDocumentTemplates=Document templates to generate product document +FreeLegalTextOnExpenseReports=Free legal text on expense reports +WatermarkOnDraftExpenseReports=Watermark on draft expense reports # Modules Module0Name=Users & groups Module0Desc=Users / Employees and Groups management