From 4bd6f1111233af6594ef3048c2605d2879167bce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 Mar 2014 18:35:50 +0100 Subject: [PATCH 1/7] Backport fix to solve warning problems. --- htdocs/core/class/conf.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 903694128f9..957bec47088 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -201,6 +201,11 @@ class Conf //var_dump($this->modules); //var_dump($this->modules_parts['theme']); + // If you can't set timezone of your PHP, set this constant. Better is to set it to UTC. + // In future, this constant will be forced to 'UTC' so PHP server timezone will not have effect anymore. + //$this->global->MAIN_SERVER_TZ='Europe/Paris'; + if (! empty($this->global->MAIN_SERVER_TZ) && $this->global->MAIN_SERVER_TZ != 'auto') date_default_timezone_set($this->global->MAIN_SERVER_TZ); + // Object $mc if (! defined('NOREQUIREMC') && ! empty($this->multicompany->enabled)) { From 1061a650d200ad159d8fe5c2b2624561f30ebb7a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 Mar 2014 21:11:51 +0100 Subject: [PATCH 2/7] Fix: duplicate info --- .../commande/doc/pdf_einstein.modules.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 11a5e271dde..953212748f8 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -593,20 +593,6 @@ class pdf_einstein extends ModelePDFCommandes $posy=$pdf->GetY()+1; } */ - if (! empty($object->date_livraison)) - { - $pdf->SetXY($this->marge_gauche, $posy); - $pdf->SetFont('','B', $default_font_size - 2); - $text=$outputlangs->transnoentities("DeliveryDate").':'; - $pdf->MultiCell(80, 3, $text, 0, 'L', 0); - - $pdf->SetFont('','', $default_font_size - 2); - $pdf->SetXY($posxval, $posy); - $text=dol_print_date($object->date_livraison,'day','',$outputlangs); - $pdf->MultiCell(80, 3, $text, 0, 'L', 0); - - $posy=$pdf->GetY()+1; - } /* TODO else if (! empty($object->availability_code)) { @@ -619,7 +605,7 @@ class pdf_einstein extends ModelePDFCommandes $posy=$pdf->GetY()+1; }*/ - // Show shipping date + // Show planed date of delivery if ($object->date_livraison) { $outputlangs->load("sendings"); From e0b4bd9b0dbe0176a89a6226f39fb78bf765486f Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Sat, 22 Mar 2014 13:00:23 +0100 Subject: [PATCH 3/7] Fix: [ bug #1306 ] Fatal error when adding an external calendar --- ChangeLog | 1 + htdocs/admin/agenda_extsites.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 338a1406b8e..0978f65863b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -41,6 +41,7 @@ Fix: [ bug #1240 ] traduction. Fix: [ bug #1238 ] When creating accompte with a %, free product are used for calculation. Fix: [ bug #1280 ] service with not end of date was tagged as expired. Fix: [ bug #1295 ] Error when creating an agenda extrafield with a number as reference +Fix: [ bug #1306 ] Fatal error when adding an external calendar New: Added es_CL language ***** ChangeLog for 3.5 compared to 3.4.* ***** diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 4bb3cb8c4f3..b133485f866 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -1,6 +1,6 @@ - * Copyright (C) 2011-2013 Juanjo Menent + * Copyright (C) 2011-2014 Juanjo Menent * * 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 @@ -28,6 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; if (!$user->admin) accessforbidden(); From 466de67b5b8bec3c81fb43cc70e6bca6524c3051 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 23 Mar 2014 20:18:07 +0100 Subject: [PATCH 4/7] Fix: Solve pb of too many embedded tables --- .../doc/doc_generic_order_odt.modules.php | 22 +++++------------ .../doc/doc_generic_shipment_odt.modules.php | 22 +++++------------ .../doc/doc_generic_invoice_odt.modules.php | 20 ++++------------ .../pdf/doc_generic_project_odt.modules.php | 22 +++++------------ .../task/pdf/doc_generic_task_odt.modules.php | 24 ++++++------------- .../doc/doc_generic_proposal_odt.modules.php | 24 +++++-------------- .../societe/doc/doc_generic_odt.modules.php | 8 +------ 7 files changed, 37 insertions(+), 105 deletions(-) diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index e3ca8814a70..e717b92bf14 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -218,7 +218,7 @@ class doc_generic_order_odt extends ModelePDFCommandes if (! is_dir($tmpdir)) $texttitle.=img_warning($langs->trans("ErrorDirNotFound",$tmpdir),0); else { - $tmpfiles=dol_dir_list($tmpdir,'files',0,'\.odt'); + $tmpfiles=dol_dir_list($tmpdir,'files',0,'\.(ods|odt)'); if (count($tmpfiles)) $listoffiles=array_merge($listoffiles,$tmpfiles); } } @@ -228,34 +228,24 @@ class doc_generic_order_odt extends ModelePDFCommandes $texthelp.=$langs->transnoentitiesnoconv("FullListOnOnlineDocumentation"); // This contains an url, we don't modify it $texte.= $form->textwithpicto($texttitle,$texthelp,1,'help','',1); - $texte.= ''; - $texte.= ''; - $texte.= ''; - $texte.= '
'; + $texte.= '
'; $texte.= ''; - $texte.= '
  '; + $texte.= '
'; $texte.= ''; - $texte.= '
'; - + $texte.= '
'; + // Scan directories if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': '.count($listoffiles).''; $texte.= ''; - - $texte.= ''; + $texte.= ''; $texte.= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte.= ''; $texte.= ''; - /*$texte.= ''; - $texte.= ''; - $texte.= ''; - $texte.= ''; - $texte.= '';*/ - $texte.= ''; $texte.= ''; diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 4b1433ddd77..6029769afb0 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -208,7 +208,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition if (! is_dir($tmpdir)) $texttitle.=img_warning($langs->trans("ErrorDirNotFound",$tmpdir),0); else { - $tmpfiles=dol_dir_list($tmpdir,'files',0,'\.odt'); + $tmpfiles=dol_dir_list($tmpdir,'files',0,'\.(ods|odt)'); if (count($tmpfiles)) $listoffiles=array_merge($listoffiles,$tmpfiles); } } @@ -218,34 +218,24 @@ class doc_generic_shipment_odt extends ModelePdfExpedition $texthelp.=$langs->transnoentitiesnoconv("FullListOnOnlineDocumentation"); // This contains an url, we don't modify it $texte.= $form->textwithpicto($texttitle,$texthelp,1,'help','',1); - $texte.= ''; - $texte.= ''; - $texte.= ''; - $texte.= '
'; + $texte.= '
'; $texte.= ''; - $texte.= '
  '; + $texte.= '
'; $texte.= ''; - $texte.= '
'; - + $texte.= '
'; + // Scan directories if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': '.count($listoffiles).''; $texte.= ''; - - $texte.= ''; + $texte.= ''; $texte.= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte.= ''; $texte.= ''; - /*$texte.= ''; - $texte.= ''; - $texte.= ''; - $texte.= ''; - $texte.= '';*/ - $texte.= ''; $texte.= ''; diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index d1642023c24..95484b232e4 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -219,7 +219,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures $texte.= ''; // List of directories area - $texte.= ''; - - $texte.= ''; $texte.= ''; - /*$texte.= ''; - $texte.= ''; - $texte.= '';*/ - $texte.= '
'; + $texte.= '
'; $texttitle=$langs->trans("ListOfDirectories"); $listofdir=explode(',',preg_replace('/[\r\n]+/',',',trim($conf->global->FACTURE_ADDON_PDF_ODT_PATH))); $listoffiles=array(); @@ -243,34 +243,24 @@ class doc_generic_invoice_odt extends ModelePDFFactures $texthelp.=$langs->transnoentitiesnoconv("FullListOnOnlineDocumentation"); // This contains an url, we don't modify it $texte.= $form->textwithpicto($texttitle,$texthelp,1,'help','',1); - $texte.= ''; - $texte.= ''; - $texte.= ''; - $texte.= '
'; + $texte.= '
'; $texte.= ''; - $texte.= '
  '; + $texte.= '
'; $texte.= ''; - $texte.= '
'; + $texte.= '
'; // Scan directories if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': '.count($listoffiles).''; $texte.= '
'; + $texte.= ''; $texte.= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte.= '
'; - $texte.= ''; - $texte.= '
'; $texte.= ''; diff --git a/htdocs/core/modules/project/pdf/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/pdf/doc_generic_project_odt.modules.php index 68cf3de470c..0e7ec535ac6 100644 --- a/htdocs/core/modules/project/pdf/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/pdf/doc_generic_project_odt.modules.php @@ -322,7 +322,7 @@ class doc_generic_project_odt extends ModelePDFProjects if (! is_dir($tmpdir)) $texttitle.=img_warning($langs->trans("ErrorDirNotFound",$tmpdir),0); else { - $tmpfiles=dol_dir_list($tmpdir,'files',0,'\.odt'); + $tmpfiles=dol_dir_list($tmpdir,'files',0,'\.(ods|odt)'); if (count($tmpfiles)) $listoffiles=array_merge($listoffiles,$tmpfiles); } } @@ -332,34 +332,24 @@ class doc_generic_project_odt extends ModelePDFProjects $texthelp.=$langs->transnoentitiesnoconv("FullListOnOnlineDocumentation"); // This contains an url, we don't modify it $texte.= $form->textwithpicto($texttitle,$texthelp,1,'help','',1); - $texte.= ''; - $texte.= ''; - $texte.= ''; - $texte.= '
'; + $texte.= '
'; $texte.= ''; - $texte.= '
  '; + $texte.= '
'; $texte.= ''; - $texte.= '
'; - + $texte.= '
'; + // Scan directories if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': '.count($listoffiles).''; $texte.= ''; - - $texte.= ''; + $texte.= ''; $texte.= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte.= ''; $texte.= ''; - /*$texte.= ''; - $texte.= ''; - $texte.= ''; - $texte.= ''; - $texte.= '';*/ - $texte.= ''; $texte.= ''; diff --git a/htdocs/core/modules/project/task/pdf/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/pdf/doc_generic_task_odt.modules.php index d9960269d3d..fd63ae5a404 100644 --- a/htdocs/core/modules/project/task/pdf/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/pdf/doc_generic_task_odt.modules.php @@ -323,7 +323,7 @@ class doc_generic_task_odt extends ModelePDFTask if (! is_dir($tmpdir)) $texttitle.=img_warning($langs->trans("ErrorDirNotFound",$tmpdir),0); else { - $tmpfiles=dol_dir_list($tmpdir,'files',0,'\.odt'); + $tmpfiles=dol_dir_list($tmpdir,'files',0,'\.(ods|odt)'); if (count($tmpfiles)) $listoffiles=array_merge($listoffiles,$tmpfiles); } } @@ -333,34 +333,24 @@ class doc_generic_task_odt extends ModelePDFTask $texthelp.=$langs->transnoentitiesnoconv("FullListOnOnlineDocumentation"); // This contains an url, we don't modify it $texte.= $form->textwithpicto($texttitle,$texthelp,1,'help','',1); - $texte.= ''; - $texte.= ''; - $texte.= ''; - $texte.= '
'; + $texte.= '
'; $texte.= ''; - $texte.= '
  '; + $texte.= '
'; $texte.= ''; - $texte.= '
'; - + $texte.= '
'; + // Scan directories if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': '.count($listoffiles).''; $texte.= ''; - - $texte.= ''; + $texte.= ''; $texte.= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte.= ''; $texte.= ''; - /*$texte.= ''; - $texte.= ''; - $texte.= ''; - $texte.= ''; - $texte.= '';*/ - $texte.= ''; $texte.= ''; @@ -431,7 +421,7 @@ class doc_generic_task_odt extends ModelePDFTask { //print "srctemplatepath=".$srctemplatepath; // Src filename $newfile=basename($srctemplatepath); - $newfiletmp=preg_replace('/\.odt/i','',$newfile); + $newfiletmp=preg_replace('/\.(ods|odt)/i','',$newfile); $newfiletmp=preg_replace('/template_/i','',$newfiletmp); $newfiletmp=preg_replace('/modele_/i','',$newfiletmp); $newfiletmp=$objectref.'_'.$newfiletmp; diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 23f0fc020d3..80fb073b964 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -129,7 +129,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales if (! is_dir($tmpdir)) $texttitle.=img_warning($langs->trans("ErrorDirNotFound",$tmpdir),0); else { - $tmpfiles=dol_dir_list($tmpdir,'files',0,'\.odt'); + $tmpfiles=dol_dir_list($tmpdir,'files',0,'\.(ods|odt)'); if (count($tmpfiles)) $listoffiles=array_merge($listoffiles,$tmpfiles); } } @@ -139,17 +139,14 @@ class doc_generic_proposal_odt extends ModelePDFPropales $texthelp.=$langs->transnoentitiesnoconv("FullListOnOnlineDocumentation"); // This contains an url, we don't modify it $texte.= $form->textwithpicto($texttitle,$texthelp,1,'help','',1); - $texte.= ''; - $texte.= ''; - $texte.= ''; - $texte.= '
'; + $texte.= '
'; $texte.= ''; - $texte.= '
  '; + $texte.= '
'; $texte.= ''; - $texte.= '
'; - + $texte.= '
'; + // Scan directories if (count($listofdir)) { @@ -181,22 +178,13 @@ class doc_generic_proposal_odt extends ModelePDFPropales } } - - $texte.= ''; - - $texte.= ''; + $texte.= ''; $texte.= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte.= ''; $texte.= ''; - /*$texte.= ''; - $texte.= ''; - $texte.= ''; - $texte.= ''; - $texte.= '';*/ - $texte.= ''; $texte.= ''; diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index 77d1e76eea1..563444a51a3 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -135,17 +135,11 @@ class doc_generic_odt extends ModeleThirdPartyDoc $texte.= ''; - - $texte.= ''; + $texte.= ''; $texte.= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte.= ''; $texte.= ''; - /*$texte.= ''; - $texte.= ''; - $texte.= ''; - $texte.= '';*/ - $texte.= ''; $texte.= ''; From 57bd043f59227dfbcce34ffe79d446da98a6403e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 23 Mar 2014 20:30:54 +0100 Subject: [PATCH 5/7] Fix: Missing lang loading --- htdocs/compta/facture.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index f8655c7c850..4823bb636fc 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -51,6 +51,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $langs->load('bills'); $langs->load('companies'); +$langs->load('compta'); $langs->load('products'); $langs->load('banks'); $langs->load('main'); From 6039c81845ce705c35f2acdea1a1b24419d75ec4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 23 Mar 2014 20:56:41 +0100 Subject: [PATCH 6/7] Fix: copy to clipboard does not work with jmobile Fix: Bad translation --- htdocs/core/lib/company.lib.php | 9 +++++---- htdocs/langs/en_US/admin.lang | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 4de405e3567..3bc2eb5982c 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -726,7 +726,8 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') $coords .= "
".addslashes($object->country); } - print ''; + print ''; // hideonsmatphone because copyToClipboard call jquery dialog that does not work with jmobile + print ''; print img_picto($langs->trans("Address"), 'object_address.png'); print ''; @@ -771,15 +772,15 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print "
\n"; ?> - + + $("#dialog").dialog() function copyToClipboard (text) { text = text.replace(/
/g,"\n"); var newElem = "

'.$langs->trans('HelpCopyToClipboard').'"; $("#dialog").html(newElem); - $( "#dialog" ).dialog(); + $("#dialog").dialog(); $("#coords").select(); return false; } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index ee651563845..b46f2c57be4 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1435,7 +1435,7 @@ AccountancyCodeBuy=Purchase account. code AgendaSetup=Events and agenda module setup PasswordTogetVCalExport=Key to authorize export link PastDelayVCalExport=Do not export event older than -AGENDA_USE_EVENT_TYPE=Use events types (managed into Configuration->Dictionnary->llx_c_actioncomm) +AGENDA_USE_EVENT_TYPE=Use events types (managed into menu Setup -> Dictionnary -> Type of agenda events) ##### ClickToDial ##### ClickToDialDesc=This module allows to add an icon after phone numbers. A click on this icon will call a server with a particular URL you define below. This can be used to call a call center system from Dolibarr that can call the phone number on a SIP system for example. ##### Point Of Sales (CashDesk) ##### From 3f78fe8c936302dbb78c1aab9e1cf209828cfebb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 23 Mar 2014 21:01:05 +0100 Subject: [PATCH 7/7] Fix: Avoid to get duplicate field --- htdocs/core/lib/company.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 3bc2eb5982c..b6e8e4c6786 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -641,7 +641,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p"; $sql .= " WHERE p.fk_soc = ".$object->id; if ($search_status!='') $sql .= " AND p.statut = ".$db->escape($search_status); - if ($search_name) $sql .= " AND (p.lastname LIKE '%".$db->escape(strtolower($search_name))."%' OR p.firstname LIKE '%".$db->escape(strtolower($search_name))."%')"; + if ($search_name) $sql .= " AND (p.lastname LIKE '%".$db->escape($search_name)."%' OR p.firstname LIKE '%".$db->escape($search_name)."%')"; $sql.= " ORDER BY $sortfield $sortorder"; dol_syslog('core/lib/company.lib.php :: show_contacts sql='.$sql,LOG_DEBUG); @@ -737,7 +737,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print ''; if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - print ''; + print ''; print img_object($langs->trans("Rendez-Vous"),"action_rdv"); print ' '; }