From 5455130a03293088c8d46d68bdfba780e32b4abb Mon Sep 17 00:00:00 2001 From: gauthier Date: Mon, 13 Jan 2020 16:15:22 +0100 Subject: [PATCH 01/35] FIX : We want to be able to import data for extrafields of entity 0 too --- htdocs/core/modules/modSociete.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 23d92f53cb7..b57617b4582 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -449,7 +449,7 @@ class modSociete extends DolibarrModules 's.multicurrency_code' => 'MulticurrencyCurrency' ); // Add extra fields - $sql = "SELECT name, label, fieldrequired FROM " . MAIN_DB_PREFIX . "extrafields WHERE elementtype = 'societe' AND entity = " . $conf->entity; + $sql = "SELECT name, label, fieldrequired FROM " . MAIN_DB_PREFIX . "extrafields WHERE elementtype = 'societe' AND entity IN (0," . $conf->entity .")"; $resql = $this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { From 1eff733e1cb4a8983110897d6b7ba3bc896824f1 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Mon, 13 Jan 2020 18:23:50 +0100 Subject: [PATCH 02/35] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 861b49adde2..228a0583ac4 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6039,6 +6039,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__REFCLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : null)); $substitutionarray['__REFSUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null); $substitutionarray['__SUPPLIER_ORDER_DATE_DELIVERY__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, 'day', 0, $outputlangs) : ''); + $substitutionarray['__SUPPLIER_ORDER_DELAY_DELIVERY__'] = (isset($object->availability_code) ? $outputlangs->transnoentities("AvailabilityType".$object->availability_code) : ''); $birthday = dol_print_date($object->birth, 'day'); From 96674b2a7e47df4cf382c9b23cd4503892ed628d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 13 Jan 2020 21:19:32 +0100 Subject: [PATCH 03/35] FIX : Look & feel v11 --- htdocs/loan/card.php | 14 +++++++------- htdocs/loan/list.php | 22 ++++++++++++---------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index ca28b16261c..9e7b8f2565a 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -716,9 +716,9 @@ if ($id > 0) print ''.img_object($langs->trans("Payment"), "payment").' '.$objp->rowid.''; print ''.dol_print_date($db->jdate($objp->dp), 'day')."\n"; print "".$objp->paiement_type.' '.$objp->num_payment."\n"; - print ''.price($objp->amount_insurance, 0, $outputlangs, 1, -1, -1, $conf->currency)."\n"; - print ''.price($objp->amount_interest, 0, $outputlangs, 1, -1, -1, $conf->currency)."\n"; - print ''.price($objp->amount_capital, 0, $outputlangs, 1, -1, -1, $conf->currency)."\n"; + print ''.price($objp->amount_insurance, 0, $outputlangs, 1, -1, -1, $conf->currency)."\n"; + print ''.price($objp->amount_interest, 0, $outputlangs, 1, -1, -1, $conf->currency)."\n"; + print ''.price($objp->amount_capital, 0, $outputlangs, 1, -1, -1, $conf->currency)."\n"; print ""; $total_capital += $objp->amount_capital; $i++; @@ -728,14 +728,14 @@ if ($id > 0) if ($object->paid == 0) { - print ''.$langs->trans("AlreadyPaid").' :'.price($totalpaid, 0, $langs, 0, 0, -1, $conf->currency).''; - print ''.$langs->trans("AmountExpected").' :'.price($object->capital, 0, $outputlangs, 1, -1, -1, $conf->currency).''; + print ''.$langs->trans("AlreadyPaid").' :'.price($totalpaid, 0, $langs, 0, -1, -1, $conf->currency).''; + print ''.$langs->trans("AmountExpected").' :'.price($object->capital, 0, $outputlangs, 1, -1, -1, $conf->currency).''; $staytopay = $object->capital - $totalpaid; print ''.$langs->trans("RemainderToPay").' :'; - print ''; - print price($staytopay, 0, $langs, 0, 0, -1, $conf->currency); + print ''; + print price($staytopay, 0, $langs, 0, -1, -1, $conf->currency); print ''; } print ""; diff --git a/htdocs/loan/list.php b/htdocs/loan/list.php index 3b1ccfd2724..912b95c643a 100644 --- a/htdocs/loan/list.php +++ b/htdocs/loan/list.php @@ -124,14 +124,14 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit else { if ($limit) $sql .= $db->plimit($limit + 1, $offset); - + $resql = $db->query($sql); if (!$resql) { dol_print_error($db); exit; } - + $num = $db->num_rows($resql); } @@ -185,10 +185,10 @@ if ($resql) print ' '; print ''; print ''; - print ''; - print ''; + print ''; + $searchpicto=$form->showFilterAndCheckAddButtons(0); + print $searchpicto; print ''; - print ''; // Fields title label // -------------------------------------------------------------------- @@ -199,7 +199,9 @@ if ($resql) print_liste_field_titre("DateStart", $_SERVER["PHP_SELF"], "l.datestart", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("DateEnd", $_SERVER["PHP_SELF"], "l.dateend", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "l.paid", "", $param, '', $sortfield, $sortorder, 'right '); - print_liste_field_titre(''); + print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch '); + print "\n"; + print "\n"; // Loop on record @@ -210,7 +212,7 @@ if ($resql) { $obj = $db->fetch_object($resql); if (empty($obj)) break; // Should not happen - + $loan_static->id = $obj->rowid; $loan_static->ref = $obj->rowid; $loan_static->label = $obj->label; @@ -252,12 +254,12 @@ if ($resql) $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - + print ''."\n"; print ''."\n"; - + print ''."\n"; - + $db->free($resql); } else From a088c7827921b520a8cd8a05c41f2f6ef6382b3e Mon Sep 17 00:00:00 2001 From: atm-ph Date: Wed, 15 Jan 2020 09:46:44 +0100 Subject: [PATCH 04/35] Fix column type to be as llx_facture --- htdocs/install/mysql/migration/10.0.0-11.0.0.sql | 2 ++ htdocs/install/mysql/tables/llx_facture_rec.sql | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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 18972bc6b8f..350e3d2065a 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 @@ -564,3 +564,5 @@ ALTER TABLE llx_mrp_production ADD INDEX idx_mrp_production_fk_mo (fk_mo); ALTER TABLE llx_emailcollector_emailcollector ADD UNIQUE INDEX uk_emailcollector_emailcollector_ref(ref, entity); ALTER TABLE llx_website ADD COLUMN use_manifest integer; + +ALTER TABLE llx_facture_rec MODIFY COLUMN fk_cond_reglement integer NOT NULL DEFAULT 1; diff --git a/htdocs/install/mysql/tables/llx_facture_rec.sql b/htdocs/install/mysql/tables/llx_facture_rec.sql index d60537a36d0..d0e4486262a 100644 --- a/htdocs/install/mysql/tables/llx_facture_rec.sql +++ b/htdocs/install/mysql/tables/llx_facture_rec.sql @@ -48,7 +48,7 @@ create table llx_facture_rec fk_projet integer, -- projet auquel est associe la facture - fk_cond_reglement integer DEFAULT 0, -- condition de reglement + fk_cond_reglement integer DEFAULT 1 NOT NULL, -- condition de reglement fk_mode_reglement integer DEFAULT 0, -- mode de reglement (Virement, Prelevement) date_lim_reglement date, -- date limite de reglement fk_account integer, -- bank account id From 14d59f43afdedc772a989e3ba0f4883efa45f1fd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Jan 2020 11:33:02 +0100 Subject: [PATCH 05/35] Trans --- htdocs/langs/en_US/modulebuilder.lang | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 67002f622f9..ca3fd3e68b8 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -135,3 +135,5 @@ CSSClass=CSS Class NotEditable=Not editable ForeignKey=Foreign key TypeOfFieldsHelp=Type of fields:
varchar(99), double(24,8), real, text, html, datetime, timestamp, integer, integer:ClassName:relativepath/to/classfile.class.php[:1[:filter]] ('1' means we add a + button after the combo to create the record, 'filter' can be 'status=1 AND fk_user = __USER_ID AND entity IN (__SHARED_ENTITIES__)' for example) +AsciiToHtmlConverter=Ascii to HTML converter +AsciiToPdfConverter=Ascii to PDF converter \ No newline at end of file From 0442105bd499a33cbc75cd6fe2c92556b3f88d30 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Jan 2020 11:55:27 +0100 Subject: [PATCH 06/35] Fix Generation of zip of module --- htdocs/core/lib/files.lib.php | 6 ++++-- htdocs/modulebuilder/index.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index b84bef02910..b8595b435c1 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2071,9 +2071,10 @@ function dol_uncompress($inputfile, $outputdir) * @param string $outputfile Target file name (output directory must exists and be writable) * @param string $mode 'zip' * @param string $excludefiles A regex pattern. For example: '/\.log$|\/temp\//' + * @param string $rootdirinzip Add a root dir level in zip file * @return int <0 if KO, >0 if OK */ -function dol_compress_dir($inputdir, $outputfile, $mode = "zip", $excludefiles = '') +function dol_compress_dir($inputdir, $outputfile, $mode = "zip", $excludefiles = '', $rootdirinzip = '') { $foundhandler=0; @@ -2134,7 +2135,8 @@ function dol_compress_dir($inputdir, $outputfile, $mode = "zip", $excludefiles = { // Get real and relative path for current file $filePath = $file->getRealPath(); - $relativePath = substr($filePath, strlen($inputdir) + 1); + $relativePath = ($rootdirinzip ? $rootdirinzip.'/' : '').substr($filePath, strlen($inputdir) + 1); + if (empty($excludefiles) || ! preg_match($excludefiles, $filePath)) { // Add current file to archive diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index d67fa08fafa..f1de611051b 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1071,7 +1071,7 @@ if ($dirins && $action == 'generatepackage') if ($dirofmodule) { if (! dol_is_dir($dirofmodule)) dol_mkdir($dirofmodule); - $result = dol_compress_dir($dir, $outputfilezip, 'zip'); + $result = dol_compress_dir($dir, $outputfilezip, 'zip', '', $modulelowercase); } else { From b4a309a2514db27f54a513b5cf7b4cbc0d074959 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Jan 2020 12:00:25 +0100 Subject: [PATCH 07/35] Prepare 10.0.7 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index b3e743aa1a6..1f8d9bf3b8f 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE', 'Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION', '10.0.6'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION', '10.0.7'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO', chr(128)); From 1d3d26e185626f17a3df5ae3af4833aeef9cdde1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Jan 2020 12:26:11 +0100 Subject: [PATCH 08/35] Fix phpcs --- htdocs/core/class/html.form.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index fbd00c99281..fde26fa2e19 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3008,7 +3008,6 @@ class Form * @param int $productid Id of product * @param string $htmlname Name of HTML field * @param int $selected_supplier Pre-selected supplier if more than 1 result - * * @return string */ public function select_product_fourn_price($productid, $htmlname = 'productfournpriceid', $selected_supplier = '') From db17a081449209ac294c1c3071c331598bb654ef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Jan 2020 12:52:04 +0100 Subject: [PATCH 09/35] Fix distrib in ping --- build/debian/conf.php.install | 5 +++++ build/exe/doliwamp/doliwamp.iss | 2 +- htdocs/main.inc.php | 7 ++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/build/debian/conf.php.install b/build/debian/conf.php.install index 3fe41b98086..6741d7ea544 100644 --- a/build/debian/conf.php.install +++ b/build/debian/conf.php.install @@ -231,3 +231,8 @@ $dolibarr_main_prod='0'; # Default value: 0 (use database value if exist) # Examples: # $dolibarr_mailing_limit_sendbycli='0'; + +# dolibarr_distrib +# A key to identify the distribution used for first installation +$dolibarr_distrib = 'deb'; + diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index 93f515d3440..994beb95eff 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -110,7 +110,7 @@ Source: "C:\Program Files\Wamp\bin\mysql\mysql5.0.45\*.*"; DestDir: "{app}\bin\m ; Mysql data files (does not overwrite if exists) Source: "build\exe\doliwamp\mysql\*.*"; DestDir: "{app}\bin\mysql\data\mysql"; Flags: onlyifdoesntexist ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db" ; Dolibarr -Source: "htdocs\*.*"; DestDir: "{app}\www\dolibarr\htdocs"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,custom\*,custom2\*,documents\*,includes\ckeditor\_source\*,includes\savant\*,includes\phpmailer\*,jquery\plugins\template\*,nltechno*\*,PHPExcel\Shared\PDF\*,PHPExcel\Shared\PCLZip\*,tcpdf\fonts\dejavu-fonts-ttf-2.33\*,tcpdf\fonts\freefont-20100919\*,tcpdf\fonts\utils\*,*\conf.php,*\conf.php.mysql,*\conf.php.old,*\conf.php.postgres,*\conf.php.sav,*\install.forced.php" +Source: "htdocs\*.*"; DestDir: "{app}\www\dolibarr\htdocs"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,custom\*,custom2\*,documents\*,includes\ckeditor\_source\*,includes\savant\*,includes\phpmailer\*,jquery\plugins\template\*,nltechno*\*,sabre\sabre\*\tests,PHPExcel\Shared\PDF\*,PHPExcel\Shared\PCLZip\*,tcpdf\fonts\dejavu-fonts-ttf-2.33\*,tcpdf\fonts\freefont-20100919\*,tcpdf\fonts\utils\*,*\conf.php,*\conf.php.mysql,*\conf.php.old,*\conf.php.postgres,*\conf.php.sav,*\install.forced.php" Source: "dev\*.*"; DestDir: "{app}\www\dolibarr\dev"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,dbmodel\*,fpdf\*,initdata\*,initdemo\*,iso-normes\*,licence\*,phpcheckstyle\*,phpunit\*,samples\*,test\*,uml\*,vagrant\*,xdebug\*" Source: "doc\*.*"; DestDir: "{app}\www\dolibarr\doc"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,wiki\*,plaquette\*,dev\*,images\dolibarr_screenshot2.png,images\dolibarr_screenshot3.png,images\dolibarr_screenshot4.png,images\dolibarr_screenshot5.png,images\dolibarr_screenshot6.png,images\dolibarr_screenshot7.png,images\dolibarr_screenshot8.png,images\dolibarr_screenshot9.png,images\dolibarr_screenshot10.png,images\dolibarr_screenshot11.png,images\dolibarr_screenshot12.png" Source: "scripts\*.*"; DestDir: "{app}\www\dolibarr\scripts"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,product\materiel.net.php,product\import-product.php" diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index ad329a9efbc..c9def11e910 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2571,6 +2571,10 @@ if (!function_exists("llxFooter")) print "\n".''."\n"; print "\n\n"; $url_for_ping = (empty($conf->global->MAIN_URL_FOR_PING) ? "https://ping.dolibarr.org/" : $conf->global->MAIN_URL_FOR_PING); + // Try to guess the distrib used + $distrib = 'standard'; + if ($_SERVER["SERVER_ADMIN"] == 'doliwamp@localhost') $distrib = 'doliwamp'; + if (! empty($dolibarr_distrib)) $distrib = $dolibarr_distrib; ?>