From b359afd084ecd460b572adb893fb1d093c6b058b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Dec 2018 16:08:36 +0100 Subject: [PATCH 01/10] Prepare 9.0 --- 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 484229a1de2..b98c91add1a 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','9.0.0-beta'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION','9.0.0'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO',chr(128)); From e9e6d8b9b5f16dca6e345edb19e72bf095cb9189 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 4 Dec 2018 14:04:02 +0100 Subject: [PATCH 02/10] Fix: bug :The method _tab_signature() does not seem to exist on object --- .../core/modules/contract/doc/pdf_strato.modules.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 2dc2acbcb6d..24dcf8743b0 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -370,7 +370,7 @@ class pdf_strato extends ModelePDFContract $pdf->writeHTMLCell(0, 0, $curX, $curY, dol_concatdesc($txtpredefinedservice, dol_concatdesc($txt, $desc)), 0, 1, 0); $pageposafter=$pdf->getPage(); $posyafter=$pdf->GetY(); - + if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text { if ($i == ($nblines-1)) // No more lines, and no space left to show total, so we create a new page @@ -394,7 +394,7 @@ class pdf_strato extends ModelePDFContract $nexY = $pdf->GetY() + 2; $pageposafter=$pdf->getPage(); - + $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. @@ -423,7 +423,7 @@ class pdf_strato extends ModelePDFContract $pdf->setPage($pagenb); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. } - + if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak) { if ($pagenb == 1) @@ -447,7 +447,7 @@ class pdf_strato extends ModelePDFContract if ($pagenb == 1) { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); - $this->_tab_signature($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, $outputlangs); + $this->tabSignature($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, $outputlangs); $bottomlasttab=$this->page_hauteur - $heightforfooter - $heightforfooter + 1; } else @@ -456,7 +456,7 @@ class pdf_strato extends ModelePDFContract $this->tabSignature($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, $outputlangs); $bottomlasttab=$this->page_hauteur - $heightforfooter - $heightforfooter + 1; } - + $this->_pagefoot($pdf,$object,$outputlangs); if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages(); From ae834416e9a22482eca799cbba61b0d78b6c5323 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Dec 2018 17:35:22 +0100 Subject: [PATCH 03/10] Fix add include for binary --- build/debian/source/include-binaries | 1 + 1 file changed, 1 insertion(+) create mode 100644 build/debian/source/include-binaries diff --git a/build/debian/source/include-binaries b/build/debian/source/include-binaries new file mode 100644 index 00000000000..401eae93712 --- /dev/null +++ b/build/debian/source/include-binaries @@ -0,0 +1 @@ +htdocs/install/doctemplates/websites/website_template-corporate.zip \ No newline at end of file From 163cac534937ef570382fdd62490ff72833d7ace Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 6 Dec 2018 20:25:22 +0100 Subject: [PATCH 04/10] Trans lead --- htdocs/langs/en_US/projects.lang | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 2655ebbdc05..75987cc621e 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -148,13 +148,13 @@ TaskCreatedInDolibarr=Task %s created TaskModifiedInDolibarr=Task %s modified TaskDeletedInDolibarr=Task %s deleted OpportunityStatus=Lead status -OpportunityStatusShort=Opp. status +OpportunityStatusShort=Lead status OpportunityProbability=Lead probability -OpportunityProbabilityShort=Opp. probab. +OpportunityProbabilityShort=Lead probab. OpportunityAmount=Lead amount -OpportunityAmountShort=Opp. amount -OpportunityAmountAverageShort=Average Opp. amount -OpportunityAmountWeigthedShort=Weighted Opp. amount +OpportunityAmountShort=Lead amount +OpportunityAmountAverageShort=Average lead amount +OpportunityAmountWeigthedShort=Weighted lead amount WonLostExcluded=Won/Lost excluded ##### Types de contacts ##### TypeContact_project_internal_PROJECTLEADER=Project leader @@ -233,4 +233,4 @@ DontHaveTheValidateStatus=The project %s must be open to be closed RecordsClosed=%s project(s) closed SendProjectRef=Information project %s ModuleSalaryToDefineHourlyRateMustBeEnabled=Module 'Payment of employee wages' must be enabled to define employee hourly rate to have time spent valorized -NewTaskRefSuggested=Task ref already used, a new task ref is suggested \ No newline at end of file +NewTaskRefSuggested=Task ref already used, a new task ref is suggested From 65d492efedc700689668fe8f3facab369add2e31 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 6 Dec 2018 19:29:11 +0100 Subject: [PATCH 05/10] Minor fix --- htdocs/install/upgrade2.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 6ea7940d7a0..bbdc82b1b8b 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4848,16 +4848,20 @@ function migrate_user_photospath() { while ($obj = $db->fetch_object($resql)) { + print '.'; + $fuser->fetch($obj->uid); //echo '
'.$fuser->id.' -> '.$fuser->entity; - $entity = (!empty($fuser->entity)) ? $fuser->entity : 1; + $entity = (empty($fuser->entity) ? 1 : $fuser->entity); if ($entity > 1) { $dir = DOL_DATA_ROOT . '/' . $entity . '/users'; } else { $dir = $conf->user->multidir_output[$entity]; // $conf->user->multidir_output[] for each entity is construct by the multicompany module } + if ($dir) + { $origin = $dir .'/'. get_exdir($fuser->id,2,0,0,$fuser,'user'); - $destin = $dir.'/'.$fuser->id; + $destin = $dir .'/'. $fuser->id; $error = 0; @@ -4895,6 +4899,7 @@ function migrate_user_photospath() } } } + } } } From 572366c6c22639cddc53f389e3b3e4e708eeddcd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 6 Dec 2018 21:16:02 +0100 Subject: [PATCH 06/10] FIX status of user --- htdocs/projet/tasks/time.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 4ac6f8a4621..bf293db9387 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -400,7 +400,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) print ''; // Bill time - if (! empty($conf->global->PROJECT_BILL_TIME_SPENT)) + if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_BILL_TIME_SPENT)) { print ''.$langs->trans("BillTime").''; print yn($projectstatic->bill_time); @@ -661,7 +661,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) $arrayfields['t.note']=array('label'=>$langs->trans("Note"), 'checked'=>1); $arrayfields['t.task_duration']=array('label'=>$langs->trans("Duration"), 'checked'=>1); $arrayfields['value'] =array('label'=>$langs->trans("Value"), 'checked'=>1, 'enabled'=>(empty($conf->salaries->enabled)?0:1)); - $arrayfields['valuebilled'] =array('label'=>$langs->trans("AmountInvoiced"), 'checked'=>1, 'enabled'=>(empty($conf->global->PROJECT_BILL_TIME_SPENT)?0:1)); + $arrayfields['valuebilled'] =array('label'=>$langs->trans("AmountInvoiced"), 'checked'=>1, 'enabled'=>((! empty($conf->global->PROJECT_HIDE_TASKS) || empty($conf->global->PROJECT_BILL_TIME_SPENT))?0:1)); // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { @@ -678,7 +678,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) $sql = "SELECT t.rowid, t.fk_task, t.task_date, t.task_datehour, t.task_date_withhour, t.task_duration, t.fk_user, t.note, t.thm,"; $sql .= " pt.ref, pt.label,"; - $sql .= " u.lastname, u.firstname, u.login, u.photo,"; + $sql .= " u.lastname, u.firstname, u.login, u.photo, u.statut as user_status,"; $sql .= " il.fk_facture as invoice_id, il.total_ht"; $sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facturedet as il ON il.rowid = t.invoice_line_id"; @@ -1037,6 +1037,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) $userstatic->lastname = $task_time->lastname; $userstatic->firstname = $task_time->firstname; $userstatic->photo = $task_time->photo; + $userstatic->statut = $task_time->user_status; print $userstatic->getNomUrl(-1); } print ''; From d3a6b160215add15daaa0a472391c780e5a6e881 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 6 Dec 2018 21:25:04 +0100 Subject: [PATCH 07/10] FIX Show declared progress --- htdocs/projet/tasks/time.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index bf293db9387..48167edcc1d 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -515,7 +515,10 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) // Planned workload print ''.$langs->trans("PlannedWorkload").''; - print convertSecondToTime($object->planned_workload,'allhourmin'); + if ($object->planned_workload) + { + print convertSecondToTime($object->planned_workload,'allhourmin'); + } print ''; print ''; @@ -528,7 +531,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) // Progress declared print ''.$langs->trans("ProgressDeclared").''; - print $object->progress.' %'; + print $object->progress != '' ? $object->progress.' %' : ''; print ''; // Progress calculated @@ -960,7 +963,6 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) $totalarray=array(); foreach ($tasks as $task_time) { - print ''; $date1=$db->jdate($task_time->task_date); From f7554572366807a440e9ec59a10fd9cf04f8fc85 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 6 Dec 2018 21:40:51 +0100 Subject: [PATCH 08/10] Test imap available --- htdocs/admin/emailcollector_card.php | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index ff037f67aa1..2fb5013b4f9 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -380,11 +380,24 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $sourcedir = $object->source_directory; $targetdir = ($object->target_directory ? $object->target_directory : ''); // Can be '[Gmail]/Trash' or 'mytag' - $connectstringserver = $object->getConnectStringIMAP(); - $connectstringsource = $connectstringserver.imap_utf7_encode($sourcedir); - $connectstringtarget = $connectstringserver.imap_utf7_encode($targetdir); + $connection = null; + $connectstringserver = ''; + $connectstringsource = ''; + $connectstringtarget = ''; + + if (function_exists('imap_open')) + { + $connectstringserver = $object->getConnectStringIMAP(); + $connectstringsource = $connectstringserver.imap_utf7_encode($sourcedir); + $connectstringtarget = $connectstringserver.imap_utf7_encode($targetdir); - $connection = imap_open($connectstringsource, $object->user, $object->password); + $connection = imap_open($connectstringsource, $object->user, $object->password); + } + else + { + $morehtml .= 'IMAP functions not available on your PHP'; + } + if (! $connection) { $morehtml .= 'Failed to open IMAP connection '.$connectstringsource; @@ -395,8 +408,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtml .= imap_num_msg($connection); } - imap_close($connection); - + if ($connection) + { + imap_close($connection); + } + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref.'
'.$morehtml.'
', '', 0, '', '', 0, ''); print '
'; From 37fe8afea30226319876f92bad2d5244f682535d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 6 Dec 2018 21:32:39 +0100 Subject: [PATCH 09/10] Code comment --- htdocs/install/mysql/migration/8.0.0-9.0.0.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql index 20b0a874879..040739e8ce7 100644 --- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql +++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql @@ -150,6 +150,9 @@ UPDATE llx_c_payment_term SET decalage = nbjour, nbjour = 0 where decalage IS NU UPDATE llx_holiday SET ref = rowid WHERE ref IS NULL; +-- DROP TABLE llx_emailcollector_emailcollectorfilter; +-- DROP TABLE llx_emailcollector_emailcollectoraction; +-- DROP TABLE llx_emailcollector_emailcollector; CREATE TABLE llx_emailcollector_emailcollector( -- BEGIN MODULEBUILDER FIELDS From 3538e9ab3b0d6dff057cd19573372d25afd5f25b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 Dec 2018 19:05:24 +0100 Subject: [PATCH 10/10] Fix migration --- htdocs/install/upgrade2.php | 91 ++++++++++++++++++++----------------- 1 file changed, 49 insertions(+), 42 deletions(-) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index bbdc82b1b8b..13d7d341961 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -2922,9 +2922,9 @@ function migrate_project_task_actors($db,$langs,$conf) * @param Conf $conf Object conf * @param string $table Table name * @param int $fk_source Id of element source - * @param type $sourcetype Type of element source + * @param string $sourcetype Type of element source * @param int $fk_target Id of element target - * @param type $targettype Type of element target + * @param string $targettype Type of element target * @return void */ function migrate_relationship_tables($db,$langs,$conf,$table,$fk_source,$sourcetype,$fk_target,$targettype) @@ -4833,7 +4833,7 @@ function migrate_reload_menu($db,$langs,$conf,$versionto) */ function migrate_user_photospath() { - global $conf, $db, $langs; + global $conf, $db, $langs, $user; print ''; @@ -4842,14 +4842,14 @@ function migrate_user_photospath() include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; $fuser = new User($db); + if (! is_object($user)) $user = $fuser; // To avoid error during migration + $sql = "SELECT rowid as uid from ".MAIN_DB_PREFIX."user"; // Get list of all users $resql = $db->query($sql); if ($resql) { while ($obj = $db->fetch_object($resql)) { - print '.'; - $fuser->fetch($obj->uid); //echo '
'.$fuser->id.' -> '.$fuser->entity; $entity = (empty($fuser->entity) ? 1 : $fuser->entity); @@ -4860,45 +4860,52 @@ function migrate_user_photospath() } if ($dir) { - $origin = $dir .'/'. get_exdir($fuser->id,2,0,0,$fuser,'user'); - $destin = $dir .'/'. $fuser->id; + $origin = $dir .'/'. get_exdir($fuser->id,2,0,0,$fuser,'user'); + $destin = $dir .'/'. $fuser->id; - $error = 0; + $origin_osencoded=dol_osencode($origin); - $origin_osencoded=dol_osencode($origin); - $destin_osencoded=dol_osencode($destin); - dol_mkdir($destin); - //echo '
'.$origin.' -> '.$destin; - if (dol_is_dir($origin)) - { - $handle=opendir($origin_osencoded); - if (is_resource($handle)) - { - while (($file = readdir($handle)) !== false) - { - if ($file != '.' && $file != '..' && is_dir($origin_osencoded.'/'.$file)) - { - $thumbs = opendir($origin_osencoded.'/'.$file); - if (is_resource($thumbs)) - { - dol_mkdir($destin.'/'.$file); - while (($thumb = readdir($thumbs)) !== false) - { - dol_move($origin.'/'.$file.'/'.$thumb, $destin.'/'.$file.'/'.$thumb); - } - // dol_delete_dir($origin.'/'.$file); - } - } - else - { - if (dol_is_file($origin.'/'.$file) ) - { - dol_move($origin.'/'.$file, $destin.'/'.$file); - } - } - } - } - } + dol_mkdir($destin); + //echo '
'.$origin.' -> '.$destin; + if (dol_is_dir($origin)) + { + $handle=opendir($origin_osencoded); + if (is_resource($handle)) + { + while (($file = readdir($handle)) !== false) + { + if ($file == '.' || $file == '..') continue; + + if (dol_is_dir($origin.'/'.$file)) // it is a dir (like 'thumbs') + { + $thumbs = opendir($origin_osencoded.'/'.$file); + if (is_resource($thumbs)) + { + dol_mkdir($destin.'/'.$file); + while (($thumb = readdir($thumbs)) !== false) + { + if (! dol_is_file($destin.'/'.$file.'/'.$thumb)) + { + if ($thumb == '.' || $thumb == '..') continue; + + print '.'; + dol_move($origin.'/'.$file.'/'.$thumb, $destin.'/'.$file.'/'.$thumb, 0, 0, 0, 0); + } + } + // dol_delete_dir($origin.'/'.$file); + } + } + else // it is a file + { + if (! dol_is_file($destin.'/'.$file)) + { + print '.'; + dol_move($origin.'/'.$file, $destin.'/'.$file, 0, 0, 0, 1); + } + } + } + } + } } } }