From 1a956cce9a1524a9fb502a72cda8b2e2c3841952 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 1 Sep 2017 10:31:22 +0200 Subject: [PATCH 1/8] Fix : insert line extrafield --- htdocs/core/class/commonobject.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 4b6c1263026..bd1f6198a95 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4156,6 +4156,10 @@ abstract class CommonObject foreach($this->array_options as $key => $value) { $attributeKey = substr($key,8); // Remove 'options_' prefix + + // array_option may contain extrafields from an origin object that doesn't exist in current object, we should not try to insert them + if(empty($extrafields->attribute_type[$attributeKey])) continue; + $attributeType = $extrafields->attribute_type[$attributeKey]; $attributeLabel = $extrafields->attribute_label[$attributeKey]; $attributeParam = $extrafields->attribute_param[$attributeKey]; From cf49c274a642c721ef6074127ba8369f95e2363b Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 1 Sep 2017 10:38:50 +0200 Subject: [PATCH 2/8] Better fix --- htdocs/core/class/commonobject.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index bd1f6198a95..fed6ef1df3d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4156,9 +4156,12 @@ abstract class CommonObject foreach($this->array_options as $key => $value) { $attributeKey = substr($key,8); // Remove 'options_' prefix - - // array_option may contain extrafields from an origin object that doesn't exist in current object, we should not try to insert them - if(empty($extrafields->attribute_type[$attributeKey])) continue; + + // array_option may contain extrafields from an origin object that doesn't exist in current object, we should not try to insert them + if(empty($extrafields->attribute_type[$attributeKey])) { + unset($this->array_options[$key]); + continue; + } $attributeType = $extrafields->attribute_type[$attributeKey]; $attributeLabel = $extrafields->attribute_label[$attributeKey]; From ac08dec2c356c0b1fe9a528b5f0290c54a0f4368 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2017 15:20:29 +0200 Subject: [PATCH 3/8] Avoid warnings --- htdocs/compta/bank/index.php | 42 ++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index 5f6e30016d4..3625d32cff7 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -57,7 +57,7 @@ $limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1) { $page = 0; } +if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -127,9 +127,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP $search_number=''; $search_statut=''; } - - - + + + /* * View */ @@ -299,9 +299,9 @@ if (! empty($arrayfields['toreconcile']['checked'])) print_liste_field_titr // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) + foreach($extrafields->attribute_label as $key => $val) { - if (! empty($arrayfields["ef.".$key]['checked'])) + if (! empty($arrayfields["ef.".$key]['checked'])) { $align=$extrafields->getAlignFlag($key); print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); @@ -435,7 +435,7 @@ $var=true; foreach ($accounts as $key=>$type) { if ($i >= $limit) break; - + $found++; $acc = new Account($db); @@ -452,7 +452,7 @@ foreach ($accounts as $key=>$type) { $lastcurrencycode=$acc->currency_code; } - + print ''; // Ref @@ -461,14 +461,14 @@ foreach ($accounts as $key=>$type) print ''.$acc->getNomUrl(1).''; if (! $i) $totalarray['nbfield']++; } - + // Label if (! empty($arrayfields['b.label']['checked'])) { print ''.$acc->label.''; if (! $i) $totalarray['nbfield']++; } - + // Account type if (! empty($arrayfields['accountype']['checked'])) { @@ -477,14 +477,14 @@ foreach ($accounts as $key=>$type) print ''; if (! $i) $totalarray['nbfield']++; } - + // Number if (! empty($arrayfields['b.number']['checked'])) { print ''.$acc->number.''; if (! $i) $totalarray['nbfield']++; } - + // Account number if (! empty($arrayfields['b.account_number']['checked'])) { @@ -492,7 +492,7 @@ foreach ($accounts as $key=>$type) print ''.length_accountg($acc->account_number).''; if (! $i) $totalarray['nbfield']++; } - + // Accountancy journal if (! empty($arrayfields['b.accountancy_journal']['checked'])) { @@ -500,7 +500,7 @@ foreach ($accounts as $key=>$type) print ''.length_accountg($acc->accountancy_journal).''; if (! $i) $totalarray['nbfield']++; } - + // Transactions to reconcile if (! empty($arrayfields['toreconcile']['checked'])) { @@ -519,13 +519,13 @@ foreach ($accounts as $key=>$type) print ''; if (! $i) $totalarray['nbfield']++; } - + // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) + foreach($extrafields->attribute_label as $key => $val) { - if (! empty($arrayfields["ef.".$key]['checked'])) + if (! empty($arrayfields["ef.".$key]['checked'])) { print 'getAlignFlag($key); @@ -558,14 +558,14 @@ foreach ($accounts as $key=>$type) print ''; if (! $i) $totalarray['nbfield']++; } - + // Statut if (! empty($arrayfields['b.clos']['checked'])) { print ''.$acc->getLibStatut(5).''; if (! $i) $totalarray['nbfield']++; } - + // Balance if (! empty($arrayfields['balance']['checked'])) { @@ -576,7 +576,7 @@ foreach ($accounts as $key=>$type) if (! $i) $totalarray['totalbalancefield']=$totalarray['nbfield']; $totalarray['totalbalance'] += $solde; } - + // Action column print ''; if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined @@ -587,7 +587,7 @@ foreach ($accounts as $key=>$type) } print ''; if (! $i) $totalarray['nbfield']++; - + print ''; $total[$acc->currency_code] += $solde; From f92129dcdb667eccb88f0657f912a31d061299a1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Sep 2017 00:55:49 +0200 Subject: [PATCH 4/8] Fix packager to avoid symlinks into custom --- build/makepack-dolibarr.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index fdd14fcf5a2..a6f052efa82 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -594,7 +594,9 @@ if ($nboftargetok) { print "Remove subdir of custom dir\n"; print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n"; - $ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to keep dir + $ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to keep files only + print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\;\n"; + $ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to keep files only } # Build package for each target From 65b6b142bd186805f3a1b714c48d346cc05455bf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Sep 2017 09:29:44 +0200 Subject: [PATCH 5/8] Tag only whe publishing on sf --- build/makepack-dolibarr.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index a6f052efa82..5ec53b0a080 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -334,7 +334,7 @@ foreach my $target (sort keys %CHOOSEDTARGET) { } foreach my $target (sort keys %CHOOSEDPUBLISH) { if ($CHOOSEDPUBLISH{$target} < 0) { next; } - if ($target eq 'ASSO') { $nbofpublishneedchangelog++; $nbofpublishneedtag++; } + if ($target eq 'ASSO') { $nbofpublishneedchangelog++; } if ($target eq 'SF') { $nbofpublishneedchangelog++; $nbofpublishneedtag++; } $nboftargetok++; } From 61ee071f438ce022fd45e103c3e4f421038ab2ab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Sep 2017 10:17:51 +0200 Subject: [PATCH 6/8] Fix regression --- htdocs/core/class/commonobject.class.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9bc53a46b19..16450fd9feb 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4261,13 +4261,6 @@ abstract class CommonObject foreach($new_array_options as $key => $value) { $attributeKey = substr($key,8); // Remove 'options_' prefix - - // array_option may contain extrafields from an origin object that doesn't exist in current object, we should not try to insert them - if(empty($extrafields->attribute_type[$attributeKey])) { - unset($this->array_options[$key]); - continue; - } - $attributeType = $extrafields->attribute_type[$attributeKey]; $attributeLabel = $extrafields->attribute_label[$attributeKey]; $attributeParam = $extrafields->attribute_param[$attributeKey]; From a158f5ab9db752a8d821e4e2bcee7b83083f299d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Sep 2017 12:01:51 +0200 Subject: [PATCH 7/8] Doc --- ChangeLog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ChangeLog b/ChangeLog index e82fdf33d8a..b566652226b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 5.0.6 compared to 5.0.5 ***** +FIX: Removed a bad symbolic link into custom directory. +FIX: Renaming a resouce ref rename also the directory of attached files. ***** ChangeLog for 5.0.5 compared to 5.0.4 ***** FIX: #7075 : bad path for document From d66fac5662b85539469bf9fc3edac6f5ee9f9426 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Sep 2017 12:12:50 +0200 Subject: [PATCH 8/8] Prepare 5.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 f3f60885697..422a26d1866 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','5.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','5.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));