From 71a2c20d4bb205a8e945160fbd78e9891345e15f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Feb 2021 14:32:04 +0100 Subject: [PATCH 1/9] massaction validate invoice do not regenerate pdf --- htdocs/core/actions_massactions.inc.php | 35 +++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 77fbea3c36a..abcdd690d5c 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -3,7 +3,7 @@ * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018 Juanjo Menent * Copyright (C) 2019 Ferran Marcet - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2021 Frédéric France * * 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 @@ -1167,7 +1167,38 @@ if (!$error && $massaction == 'validate' && $permissiontoadd) $error++; break; } - else $nbok++; + else { + // validate() rename pdf but do not regenerate + // Define output language + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + $newlang = GETPOST('lang_id', 'aZ09'); + } + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { + $newlang = $objecttmp->thirdparty->default_lang; + } + if (!empty($newlang)) { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlang); + $outputlangs->load('products'); + } + $model = $objecttmp->model_pdf; + $ret = $objecttmp->fetch($objecttmp->id); // Reload to get new records + // To be sure vars is defined + $hidedetails = !empty($hidedetails) ? $hidedetails : 0; + $hidedesc = !empty($hidedesc) ? $hidedesc : 0; + $hideref = !empty($hideref) ? $hideref : 0; + $moreparams = !empty($moreparams) ? $moreparams : null; + + $result = $objecttmp->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); + if ($result < 0) { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + } + } + $nbok++; + } } else { From 9a2e99e9e9678f1f781248dfb0b6e3e16022fc1b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 20 Feb 2021 11:09:23 +0100 Subject: [PATCH 2/9] Clean packager --- build/generate_filelist_xml.php | 6 ++++-- build/makepack-dolibarr.pl | 2 -- htdocs/main.inc.php | 2 +- htdocs/viewimage.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index 50eb6c84def..6bfbb9c5c9c 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -153,6 +153,7 @@ $files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom $regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; $regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|sabre\/sabre\/.*\/tests|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs $files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname'); + $dir=''; $needtoclose=0; foreach ($files as $filetmp) { @@ -160,9 +161,10 @@ foreach ($files as $filetmp) { //$newdir = str_replace(dirname(__FILE__).'/../htdocs', '', dirname($file)); $newdir = str_replace(DOL_DOCUMENT_ROOT, '', dirname($file)); if ($newdir!=$dir) { - if ($needtoclose) + if ($needtoclose) { fputs($fp, ' '."\n"); - fputs($fp, ' '."\n"); + } + fputs($fp, ' '."\n"); $dir = $newdir; $needtoclose=1; } diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 5c5baaac3bc..0fe73fd9fb8 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -579,7 +579,6 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/timesheet*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/webmail*`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/workstation*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/allscreen*`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/theme/common/octicons/LICENSE`; @@ -624,7 +623,6 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/ae_fonts_*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/vendor`; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 78ed3d82bda..9872ac67fc3 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -38,7 +38,7 @@ // For optional tuning. Enabled if environment variable MAIN_SHOW_TUNING_INFO is defined. $micro_start_time = 0; -if (!empty($_SERVER['MAIN_SHOW_TUNING_INFO'])) +if (!empty($_SERVER['MAIN_SHOW_TUNING_INFO']) ) { list($usec, $sec) = explode(" ", microtime()); $micro_start_time = ((float) $usec + (float) $sec); diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 983c7996898..b81931cc999 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -34,7 +34,7 @@ if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); -if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); +if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Some value of modulepart can be used to get resources that are public so no login are required. // Note that only directory logo is free to access without login. From 910fa6c041cb095738dcdd04dc24b639864a8bfd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 20 Feb 2021 11:16:26 +0100 Subject: [PATCH 3/9] Fix missing dir for fedora rpm --- build/rpm/dolibarr_fedora.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 99061b24eab..d50c91d1f05 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -212,6 +212,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/product %_datadir/dolibarr/htdocs/projet %_datadir/dolibarr/htdocs/public +%_datadir/dolibarr/htdocs/recruitment %_datadir/dolibarr/htdocs/reception %_datadir/dolibarr/htdocs/resource %_datadir/dolibarr/htdocs/salaries From 6f6352d9c467c69f4b300f1238cf4cd8d3414127 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 20 Feb 2021 11:33:25 +0100 Subject: [PATCH 4/9] Fix syntax --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 9872ac67fc3..78ed3d82bda 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -38,7 +38,7 @@ // For optional tuning. Enabled if environment variable MAIN_SHOW_TUNING_INFO is defined. $micro_start_time = 0; -if (!empty($_SERVER['MAIN_SHOW_TUNING_INFO']) ) +if (!empty($_SERVER['MAIN_SHOW_TUNING_INFO'])) { list($usec, $sec) = explode(" ", microtime()); $micro_start_time = ((float) $usec + (float) $sec); From 104cf5bdb5cf5b9e9d3e9c387206768644896aa1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 20 Feb 2021 11:34:11 +0100 Subject: [PATCH 5/9] Fix syntax --- htdocs/viewimage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index b81931cc999..983c7996898 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -34,7 +34,7 @@ if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); -if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); +if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Some value of modulepart can be used to get resources that are public so no login are required. // Note that only directory logo is free to access without login. From 8f91dd48c97ed7c403b828b9957d9cbddd368700 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 20 Feb 2021 11:46:48 +0100 Subject: [PATCH 6/9] Fix file integrity message --- htdocs/admin/system/filecheck.php | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 4ed21144346..42ebe6b97e5 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -374,14 +374,6 @@ if (!$error && $xml) } $out .= ''; $out .= ''; - - // Show warning - if (empty($tmpfilelist) && empty($tmpfilelist2) && empty($tmpfilelist3)) - { - setEventMessages($langs->trans("FileIntegrityIsStrictlyConformedWithReference"), null, 'mesgs'); - } else { - setEventMessages($langs->trans("FileIntegritySomeFilesWereRemovedOrModified"), null, 'warnings'); - } } else { print 'Error: Failed to found dolibarr_htdocs_dir into XML file '.$xmlfile; $error++; @@ -407,6 +399,8 @@ if (!$error && $xml) var_dump($checksumtoget); var_dump($checksumget == $checksumtoget);*/ + $resultcomment = ''; + $outexpectedchecksum = ($checksumtoget ? $checksumtoget : $langs->trans("Unknown")); if ($checksumget == $checksumtoget) { @@ -414,7 +408,7 @@ if (!$error && $xml) { $resultcode = 'warning'; $resultcomment = 'FileIntegrityIsOkButFilesWereAdded'; - $outcurrentchecksum = $checksumget.' - '.$langs->trans("FileIntegrityIsOkButFilesWereAdded").''; + $outcurrentchecksum = $checksumget.' - '.$langs->trans($resultcomment).''; } else { $resultcode = 'ok'; $resultcomment = 'Success'; @@ -426,7 +420,18 @@ if (!$error && $xml) $outcurrentchecksum = ''.$checksumget.''; } - print load_fiche_titre($langs->trans("GlobalChecksum")).'
'; + // Show warning + if (empty($tmpfilelist) && empty($tmpfilelist2) && empty($tmpfilelist3) && $resultcode == 'ok') { + setEventMessages($langs->trans("FileIntegrityIsStrictlyConformedWithReference"), null, 'mesgs'); + } else { + if ($resultcode == 'warning') { + setEventMessages($langs->trans($resultcomment), null, 'warnings'); + } else { + setEventMessages($langs->trans("FileIntegritySomeFilesWereRemovedOrModified"), null, 'errors'); + } + } + + print load_fiche_titre($langs->trans("GlobalChecksum")); print $langs->trans("ExpectedChecksum").' = '.$outexpectedchecksum.'
'; print $langs->trans("CurrentChecksum").' = '.$outcurrentchecksum; From 6eb179a6fb5cabf12b1dbc69aa42138d89048f7a Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sat, 20 Feb 2021 13:14:27 +0100 Subject: [PATCH 7/9] Update ChangeLog minor addings for 13.0.1 --- ChangeLog | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1b08a59db9d..6556db79da2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,13 +10,13 @@ FIX: 11.0 when a mandatory extrafield of type sellist contains '0' it should be FIX: 11.0 when a new intervention is created from an object, a new $extrafields object is instantiated but not initialized FIX: create MO, Column 'tms' cannot be null FIX: #14290 #15900 -FIX: #16076 -FIX: #16077 -FIX: #16079 -FIX: #16080 -FIX: 16084 +FIX: #16076 patch user/list.php for extrafields +FIX: #16077 patch wrong timezone +FIX: #16079 error of service date at duplicated invoice +FIX: #16080 mailing list title +FIX: #16084 DB error at projects FIX: #16107 -FIX: #16118 Timezone problem on some fields +FIX: #16118 Timezone problem on some fields FIX: #16131 FIX: #16135 FIX: #16143 @@ -47,7 +47,7 @@ FIX: select default mail template FIX: Select transport mode function when creating a supplier invoice and add unique key to the table llx_c_transport_mode in migrate sql FIX: Merge of thirdparties : "unknow column fk_soc" + "Delivery" label FIX: SQL Error in group by with postgres or mysql strict mode -FIX: takepos : load date function +FIX: TakePOS : load date function FIX: Timeout during import FIX: Trigger on expense report was not fired FIX: User creation of expense report not visible From c010cab47e85f9823d87570087caadfc77cb72c6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Feb 2021 15:51:00 +0100 Subject: [PATCH 8/9] Fix translation of default value for contacts --- htdocs/contact/card.php | 2 +- htdocs/core/class/commonobject.class.php | 12 +++++++++--- htdocs/langs/en_US/supplier_proposal.lang | 3 +++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 7bd88436e31..3e3e1894a75 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -843,7 +843,7 @@ else print ''.$langs->trans("ContactByDefaultFor").''; print ''; $contactType = $object->listeTypeContacts('external', '', 1); - print $form->multiselectarray('roles', $contactType); + print $form->multiselectarray('roles', $contactType, array(), 0, 0, 'minwidth500'); print ''; } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index d2853d48034..730546e0e6b 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1356,6 +1356,8 @@ abstract class CommonObject if ($resql) { $num = $this->db->num_rows($resql); if ($num > 0) { + $langs->loadLangs(array("propal", "orders", "bills", "suppliers", "contracts", "supplier_proposal")); + while ($obj = $this->db->fetch_object($resql)) { $modulename = $obj->element; if (strpos($obj->element, 'project') !== false) { @@ -1371,11 +1373,15 @@ abstract class CommonObject } if ($conf->{$modulename}->enabled) { $libelle_element = $langs->trans('ContactDefault_'.$obj->element); - $transkey = "TypeContact_".$obj->element."_".$source."_".$obj->code; + $tmpelement = $obj->element; + $transkey = "TypeContact_".$tmpelement."_".$source."_".$obj->code; $libelle_type = ($langs->trans($transkey) != $transkey ? $langs->trans($transkey) : $obj->libelle); - if (empty($option)) + if (empty($option)) { $tab[$obj->rowid] = $libelle_element.' - '.$libelle_type; - else $tab[$obj->rowid] = $libelle_element.' - '.$libelle_type; + } + else { + $tab[$obj->rowid] = $libelle_element.' - '.$libelle_type; + } } } } diff --git a/htdocs/langs/en_US/supplier_proposal.lang b/htdocs/langs/en_US/supplier_proposal.lang index ce5bdf0425a..2617cdfe9e9 100644 --- a/htdocs/langs/en_US/supplier_proposal.lang +++ b/htdocs/langs/en_US/supplier_proposal.lang @@ -52,3 +52,6 @@ SupplierProposalsToClose=Vendor proposals to close SupplierProposalsToProcess=Vendor proposals to process LastSupplierProposals=Latest %s price requests AllPriceRequests=All requests +TypeContact_supplier_proposal_external_SHIPPING=Vendor contact for delivery +TypeContact_supplier_proposal_external_BILLING=Vendor contact for billing +TypeContact_supplier_proposal_external_SERVICE=Representative following-up proposal From 7fd2ac6618e7d7295f2f7d07b374bc5f6a208299 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Feb 2021 16:20:13 +0100 Subject: [PATCH 9/9] Fix link to show line in pending account --- htdocs/accountancy/bookkeeping/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 882c51f40c0..bef8ece1d39 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -110,7 +110,7 @@ $form = new Form($db); if (!in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !GETPOSTISSET('formfilteraction') && GETPOST('page', 'int') == '' && !GETPOST('noreset', 'int') && $user->rights->accounting->mouvements->export) { - if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('restore_lastsearch_values')) + if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('restore_lastsearch_values') && !GETPOST('search_accountancy_code_start')) { $query = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear "; $query .= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."' limit 1";