From c46f76c0f2d1d25aea4e323ee0ca8993eaa25211 Mon Sep 17 00:00:00 2001 From: philippe grand Date: Sun, 9 Oct 2016 11:32:48 +0200 Subject: [PATCH 01/21] better help --- htdocs/install/step1.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/step1.php b/htdocs/install/step1.php index a07dbc48168..1c661a77f78 100644 --- a/htdocs/install/step1.php +++ b/htdocs/install/step1.php @@ -53,7 +53,7 @@ $db_pass=GETPOST('db_pass'); $db_port=GETPOST('db_port','int'); $db_prefix=GETPOST('db_prefix','alpha'); -session_start(); // To be able to keep info into session (used for not loosing pass during navigation. pass must not transit throug parmaeters) +session_start(); // To be able to keep info into session (used for not losing password during navigation. The password must not transmit through parameters) // Save a flag to tell to restore input value if we do back $_SESSION['dol_save_pass']=$db_pass; From ae249a964b888723dd6455306af1b0e9e56f026d Mon Sep 17 00:00:00 2001 From: Xebax Date: Sun, 16 Oct 2016 13:19:36 +0200 Subject: [PATCH 02/21] FIX #5849 Verification du champ Societe sur une modification adherent --- htdocs/adherents/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 347052f86be..b0f79ecf675 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -253,6 +253,7 @@ if (empty($reshook)) } $lastname=$_POST["lastname"]; $firstname=$_POST["firstname"]; + $societe=$_POST["societe"]; $morphy=$_POST["morphy"]; $login=$_POST["login"]; if ($morphy != 'mor' && empty($lastname)) { From 47ed731242e794df6a53a28afeb9e3af1f5d40f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Oct 2016 10:37:01 +0200 Subject: [PATCH 03/21] Fix group by --- htdocs/compta/facture/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 205f84c416f..b2b95d74963 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -530,7 +530,7 @@ if ($search_user > 0) } if (! $sall) { - $sql.= ' GROUP BY f.rowid, f.facnumber, ref_client, f.type, f.note_private, f.note_public, f.increment, f.total, f.tva, f.total_ttc,'; + $sql.= ' GROUP BY f.rowid, f.facnumber, ref_client, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.total, f.tva, f.total_ttc,'; $sql.= ' f.datef, f.date_lim_reglement,'; $sql.= ' f.paye, f.fk_statut,'; $sql.= ' s.nom, s.rowid, s.code_client, s.client'; From 6a944bb6a3f82387b732cbfff6844c58986ff467 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Tue, 18 Oct 2016 10:11:42 +0200 Subject: [PATCH 04/21] Fix: Bad localtaxes calc for Spain if VAT is 0 --- htdocs/core/lib/functions.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index fb577674b64..841edb130f3 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7,7 +7,7 @@ * Copyright (C) 2004 Christophe Combelles * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2010-2014 Juanjo Menent + * Copyright (C) 2010-2016 Juanjo Menent * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2013 Alexandre Spangaro * Copyright (C) 2014 Cédric GROSS @@ -3170,7 +3170,7 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="") { if ($local == 1) { - if(! $mysoc->localtax1_assuj) return 0; + if(! $mysoc->localtax1_assuj || $tva=="0") return 0; if ($thirdparty_seller->id==$mysoc->id) { if (! $thirdparty_buyer->localtax1_assuj) return 0; @@ -3183,7 +3183,7 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="") if ($local == 2) { - if(! $mysoc->localtax2_assuj) return 0; + if(! $mysoc->localtax2_assuj || $tva=="0") return 0; if ($thirdparty_seller->id==$mysoc->id ) { if (! $thirdparty_buyer->localtax2_assuj) return 0; From f28c7bbc6de857034ef03d40a9fa1eb36f120c29 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Tue, 18 Oct 2016 10:20:09 +0200 Subject: [PATCH 05/21] Fix: Bad localtaxes calc for Spain if VAT is 0. For >= 3.9.x --- htdocs/core/lib/functions.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b1e2610426c..46ff99b2898 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7,7 +7,7 @@ * Copyright (C) 2004 Christophe Combelles * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2010-2014 Juanjo Menent + * Copyright (C) 2010-2016 Juanjo Menent * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2013 Alexandre Spangaro * Copyright (C) 2014 Cédric GROSS @@ -3336,7 +3336,7 @@ function get_localtax($vatrate, $local, $thirdparty_buyer="", $thirdparty_seller $vatratecleaned = $vatrate; if (preg_match('/^(.*)\s*\((.*)\)$/', $vatrate, $reg)) // If vat is "xx (yy)" { - $vatratecleaned = $reg[1]; + $vatratecleaned = trim($reg[1]); $vatratecode = $reg[2]; } @@ -3350,7 +3350,7 @@ function get_localtax($vatrate, $local, $thirdparty_buyer="", $thirdparty_seller { if ($local == 1) { - if (! $mysoc->localtax1_assuj) return 0; + if (! $mysoc->localtax1_assuj || $vatratecleaned=="0") return 0; if ($thirdparty_seller->id == $mysoc->id) { if (! $thirdparty_buyer->localtax1_assuj) return 0; @@ -3363,7 +3363,7 @@ function get_localtax($vatrate, $local, $thirdparty_buyer="", $thirdparty_seller if ($local == 2) { - if (! $mysoc->localtax2_assuj) return 0; + if (! $mysoc->localtax2_assuj || $vatratecleaned=="0") return 0; if ($thirdparty_seller->id == $mysoc->id) { if (! $thirdparty_buyer->localtax2_assuj) return 0; From 81a31e8390e0a835d7856c2ae1c1dc67817aea60 Mon Sep 17 00:00:00 2001 From: Sergio Sanchis Date: Tue, 18 Oct 2016 10:52:07 +0200 Subject: [PATCH 06/21] Fix: Need declare $user for call trigger --- htdocs/expedition/class/expedition.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 00063729a20..a8602f0f7ee 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1965,6 +1965,7 @@ class Expedition extends CommonObject */ function set_billed() { + global $user; $error=0; $this->db->begin(); From 480091832358bf66949031e83e7e82383d8621e8 Mon Sep 17 00:00:00 2001 From: Sergio Sanchis Climent Date: Tue, 18 Oct 2016 23:17:45 +0200 Subject: [PATCH 07/21] FIX: Documents no change directory if change reference of the task. --- htdocs/projet/class/task.class.php | 26 ++++++++++++++++++++++++++ htdocs/projet/tasks/task.php | 1 + 2 files changed, 27 insertions(+) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 12799a6664f..b4c26b7d7e6 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -58,6 +58,8 @@ class Task extends CommonObject var $timespent_fk_user; var $timespent_note; + public $oldcopy; + /** * Constructor @@ -316,6 +318,30 @@ class Task extends CommonObject } } + if (! $error && (is_object($this->oldcopy) && $this->oldcopy->ref !== $this->ref)) + { + // We remove directory + if ($conf->projet->dir_output) + { + $project = new Project($this->db); + $project->fetch($this->fk_project); + + $olddir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($project->ref).'/'.dol_sanitizeFileName($this->oldcopy->ref); + $newdir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($project->ref).'/'.dol_sanitizeFileName($this->ref); + if (file_exists($olddir)) + { + include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; + $res=dol_move($olddir, $newdir); + if (! $res) + { + $langs->load("errors"); + $this->error=$langs->trans('ErrorFailToRenameDir',$olddir,$newdir); + $error++; + } + } + } + } + // Commit or rollback if ($error) { diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 0dd08bbd342..6e0648b61e6 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -82,6 +82,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->projet->creer) if (! $error) { $object->fetch($id,$ref); + $object->oldcopy = clone $object; $tmparray=explode('_',$_POST['task_parent']); $task_parent=$tmparray[1]; From 78f1b428b0bacd17c6df22607e24402ad6348c9a Mon Sep 17 00:00:00 2001 From: Sergio Sanchis Climent Date: Wed, 19 Oct 2016 21:42:53 +0200 Subject: [PATCH 08/21] FIX: Search provider by price --- htdocs/fourn/facture/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 11a7f37091d..47841195c83 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -300,7 +300,7 @@ if ($search_state) $sql.= natural_search("state.nom",$search_state); if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')'; if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')'; if ($search_company) $sql .= natural_search('s.nom', $search_company); -if ($search_montant_ht != '') $sql.= natural_search('f.total', $search_montant_ht, 1); +if ($search_montant_ht != '') $sql.= natural_search('f.total_ht', $search_montant_ht, 1); if ($search_montant_vat != '') $sql.= natural_search('f.total_tva', $search_montant_vat, 1); if ($search_montant_ttc != '') $sql.= natural_search('f.total_ttc', $search_montant_ttc, 1); if ($search_status != '' && $search_status >= 0) $sql.= " AND f.fk_statut = ".$db->escape($search_status); From 3ca3b7ab78e013b79c04bba7d280dbd26e66a0bd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 Oct 2016 10:36:11 +0200 Subject: [PATCH 09/21] Fix code comment --- htdocs/core/lib/functions.lib.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 279d1342580..fcb27d0cadc 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2426,9 +2426,9 @@ function img_printer($titlealt = "default", $other='') /** * Show help logo with cursor "?" * - * @param string $usehelpcursor Use help cursor - * @param string $usealttitle Text to use as alt title - * @return string Retourne tag img + * @param int $usehelpcursor Use help cursor + * @param int|string $usealttitle Text to use as alt title + * @return string Return tag img */ function img_help($usehelpcursor = 1, $usealttitle = 1) { @@ -3823,7 +3823,7 @@ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisi * @param int $idprod Id of product or 0 if not a predefined product * @param Societe $thirdparty_seller Thirdparty with a ->country_code defined (FR, US, IT, ...) * @param int $idprodfournprice Id product_fournisseur_price (for "supplier" order/invoice) - * @return int <0 if KO, Vat rate if OK + * @return float Vat rate * @see get_product_localtax_for_country */ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournprice=0) @@ -3973,7 +3973,7 @@ function get_product_localtax_for_country($idprod, $local, $thirdparty_seller) * @param Societe $thirdparty_buyer Objet societe acheteuse * @param int $idprod Id product * @param int $idprodfournprice Id product_fournisseur_price (for supplier order/invoice) - * @return float Taux de tva a appliquer, -1 si ne peut etre determine + * @return float Vat rate to use, -1 if we can't guess it * @see get_default_npr, get_default_localtax */ function get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer, $idprod=0, $idprodfournprice=0) @@ -4522,7 +4522,7 @@ function dol_nboflines_bis($text,$maxlinesize=0,$charset='UTF-8') else $pattern = '/(]*>)/U'; // /U is to have UNGREEDY regex to limit to one html tag. $a = preg_split($pattern, $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); - $nblines = floor((count($a)+1)/2); + $nblines = (int) floor((count($a)+1)/2); // count possible auto line breaks if($maxlinesize) { From c44aa8f4d710ac771fdaf9157ef3592480096b84 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 Oct 2016 13:23:39 +0200 Subject: [PATCH 10/21] Fix warnings --- htdocs/product/stats/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index 0bc4eafa316..3ff47496409 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -210,9 +210,9 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all') //print ''; // Generation des graphs + $dir = (! empty($conf->product->multidir_temp[$object->entity])?$conf->product->multidir_temp[$object->entity]:$conf->service->multidir_temp[$object->entity]); if ($object->id > 0) // We are on statistics for a dedicated product { - $dir = (! empty($conf->product->multidir_temp[$object->entity])?$conf->product->multidir_temp[$object->entity]:$conf->service->multidir_temp[$object->entity]); if (! file_exists($dir.'/'.$object->id)) { if (dol_mkdir($dir.'/'.$object->id) < 0) From 14227549a8df44ad3bb3c526507ab3c0610413dc Mon Sep 17 00:00:00 2001 From: philippe grand Date: Fri, 21 Oct 2016 16:03:56 +0200 Subject: [PATCH 11/21] Fix : Fatal error: Call to a member function fetch() on null --- htdocs/fichinter/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index c12eba0a7c4..1f795cf7bdc 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -918,6 +918,7 @@ if ($action == 'create') if ($socid > 0) { + $soc=new Societe($db); $soc->fetch($socid); print '
'; From 629af89986d0bd5d5dc1ab317b5b08710534e3b2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Oct 2016 16:18:28 +0200 Subject: [PATCH 12/21] FIX Solve backup when using mysqldump that return warning --- build/debian/copyright | 2 +- htdocs/core/class/utils.class.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build/debian/copyright b/build/debian/copyright index e568996551e..c0733bb5374 100644 --- a/build/debian/copyright +++ b/build/debian/copyright @@ -1,7 +1,7 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: Dolibarr Upstream-Contact: Laurent Destailleur -Source: http://www.dolibarr.org/files/stable/standard/ +Source: https://www.dolibarr.org/files/stable/standard/ Files: * Copyright: 2002-2009, Rodolphe Quiedeville diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 2724d64f17f..e244c2f2f8c 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -268,7 +268,8 @@ class Utils { $i++; // output line number $read = fgets($handlein); - if ($i == 1 && preg_match('/'.preg_quote('Warning: Using a password').'/i', $read)) continue; + // Exclude warning line we don't want + if ($i == 1 && preg_match('/'.preg_quote('Warning\*Using a password').'/i', $read)) continue; fwrite($handle,$read); if (preg_match('/'.preg_quote('-- Dump completed').'/i',$read)) $ok=1; elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i',$read)) $ok=1; From 1c5972129447a9714f22bbfde6804b9597c2a774 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Oct 2016 16:20:51 +0200 Subject: [PATCH 13/21] FIX Solve backup when using mysqldump that return warning --- htdocs/core/class/utils.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index e244c2f2f8c..6f01a4c1406 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -269,7 +269,7 @@ class Utils $i++; // output line number $read = fgets($handlein); // Exclude warning line we don't want - if ($i == 1 && preg_match('/'.preg_quote('Warning\*Using a password').'/i', $read)) continue; + if ($i == 1 && preg_match('/Warning.*Using a password/i', $read)) continue; fwrite($handle,$read); if (preg_match('/'.preg_quote('-- Dump completed').'/i',$read)) $ok=1; elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i',$read)) $ok=1; From ffcfe30529ae9598ce9544fe7d9aa212b4a07f74 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Oct 2016 16:51:54 +0200 Subject: [PATCH 14/21] FIX Avoid errors on debian --- .../modules/export/export_excel.modules.php | 37 ++++++++++--------- .../export/export_excel2007.modules.php | 35 ++++++++++-------- htdocs/core/modules/export/modules_export.php | 28 +++++++------- 3 files changed, 54 insertions(+), 46 deletions(-) diff --git a/htdocs/core/modules/export/export_excel.modules.php b/htdocs/core/modules/export/export_excel.modules.php index 91f78522973..00d06e8511a 100644 --- a/htdocs/core/modules/export/export_excel.modules.php +++ b/htdocs/core/modules/export/export_excel.modules.php @@ -64,24 +64,27 @@ class ExportExcel extends ModeleExports $this->picto='mime/xls'; // Picto $this->version='1.30'; // Driver version - // If driver use an external library, put its name here - if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) - { - require_once PHP_WRITEEXCEL_PATH.'class.writeexcel_workbookbig.inc.php'; - require_once PHP_WRITEEXCEL_PATH.'class.writeexcel_worksheet.inc.php'; - require_once PHP_WRITEEXCEL_PATH.'functions.writeexcel_utility.inc.php'; - $this->label_lib='PhpWriteExcel'; - $this->version_lib='unknown'; - } - else - { - require_once PHPEXCEL_PATH.'PHPExcel.php'; - require_once PHPEXCEL_PATH.'PHPExcel/Style/Alignment.php'; - $this->label_lib='PhpExcel'; - $this->version_lib='1.8.0'; // No way to get info from library - } - $this->disabled = (in_array(constant('PHPEXCEL_PATH'),array('disabled','disabled/'))?1:0); // A condition to disable module (used for native debian packages) + + if (empty($this->disabled)) + { + // If driver use an external library, put its name here + if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) + { + require_once PHP_WRITEEXCEL_PATH.'class.writeexcel_workbookbig.inc.php'; + require_once PHP_WRITEEXCEL_PATH.'class.writeexcel_worksheet.inc.php'; + require_once PHP_WRITEEXCEL_PATH.'functions.writeexcel_utility.inc.php'; + $this->label_lib='PhpWriteExcel'; + $this->version_lib='unknown'; + } + else + { + require_once PHPEXCEL_PATH.'PHPExcel.php'; + require_once PHPEXCEL_PATH.'PHPExcel/Style/Alignment.php'; + $this->label_lib='PhpExcel'; + $this->version_lib='1.8.0'; // No way to get info from library + } + } $this->row=0; } diff --git a/htdocs/core/modules/export/export_excel2007.modules.php b/htdocs/core/modules/export/export_excel2007.modules.php index dcb649e780d..df9fd9d5705 100644 --- a/htdocs/core/modules/export/export_excel2007.modules.php +++ b/htdocs/core/modules/export/export_excel2007.modules.php @@ -64,25 +64,28 @@ class ExportExcel2007 extends ExportExcel $this->picto='mime/xls'; // Picto $this->version='1.30'; // Driver version - // If driver use an external library, put its name here - if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) + $this->disabled = (in_array(constant('PHPEXCEL_PATH'),array('disabled','disabled/'))?1:0); // A condition to disable module (used for native debian packages) + + if (empty($this->disabled)) { - require_once PHP_WRITEEXCEL_PATH.'class.writeexcel_workbookbig.inc.php'; - require_once PHP_WRITEEXCEL_PATH.'class.writeexcel_worksheet.inc.php'; - require_once PHP_WRITEEXCEL_PATH.'functions.writeexcel_utility.inc.php'; - $this->label_lib='PhpWriteExcel'; - $this->version_lib='unknown'; - } - else - { - require_once PHPEXCEL_PATH.'PHPExcel.php'; - require_once PHPEXCEL_PATH.'PHPExcel/Style/Alignment.php'; - $this->label_lib='PhpExcel'; - $this->version_lib='1.8.0'; // No way to get info from library + // If driver use an external library, put its name here + if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) + { + require_once PHP_WRITEEXCEL_PATH.'class.writeexcel_workbookbig.inc.php'; + require_once PHP_WRITEEXCEL_PATH.'class.writeexcel_worksheet.inc.php'; + require_once PHP_WRITEEXCEL_PATH.'functions.writeexcel_utility.inc.php'; + $this->label_lib='PhpWriteExcel'; + $this->version_lib='unknown'; + } + else + { + require_once PHPEXCEL_PATH.'PHPExcel.php'; + require_once PHPEXCEL_PATH.'PHPExcel/Style/Alignment.php'; + $this->label_lib='PhpExcel'; + $this->version_lib='1.8.0'; // No way to get info from library + } } - $this->disabled = (in_array(constant('PHPEXCEL_PATH'),array('disabled','disabled/'))?1:0); // A condition to disable module (used for native debian packages) - $this->row=0; } diff --git a/htdocs/core/modules/export/modules_export.php b/htdocs/core/modules/export/modules_export.php index ee1c3b8e96c..8cbb3850c2b 100644 --- a/htdocs/core/modules/export/modules_export.php +++ b/htdocs/core/modules/export/modules_export.php @@ -65,22 +65,24 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac $moduleid=$reg[1]; // Loading Class - $file = $dir."/export_".$moduleid.".modules.php"; + $file = $dir."export_".$moduleid.".modules.php"; $classname = "Export".ucfirst($moduleid); require_once $file; - $module = new $classname($db); - - // Picto - $this->picto[$module->id]=$module->picto; - // Driver properties - $this->driverlabel[$module->id]=$module->getDriverLabel().(empty($module->disabled)?'':' __(Disabled)__'); // '__(Disabled)__' is a key - $this->driverdesc[$module->id]=$module->getDriverDesc(); - $this->driverversion[$module->id]=$module->getDriverVersion(); - // If use an external lib - $this->liblabel[$module->id]=$module->getLibLabel(); - $this->libversion[$module->id]=$module->getLibVersion(); - + if (class_exists($classname)) + { + $module = new $classname($db); + + // Picto + $this->picto[$module->id]=$module->picto; + // Driver properties + $this->driverlabel[$module->id]=$module->getDriverLabel().(empty($module->disabled)?'':' __(Disabled)__'); // '__(Disabled)__' is a key + $this->driverdesc[$module->id]=$module->getDriverDesc(); + $this->driverversion[$module->id]=$module->getDriverVersion(); + // If use an external lib + $this->liblabel[$module->id]=$module->getLibLabel(); + $this->libversion[$module->id]=$module->getLibVersion(); + } $i++; } } From 7ceb3cb62a480d2764d386abae18f25bcb831c84 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Oct 2016 16:53:22 +0200 Subject: [PATCH 15/21] FIX Avoid error 500 if phpexcel is disabled --- htdocs/includes/tcpdi/tcpdi_parser.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/includes/tcpdi/tcpdi_parser.php b/htdocs/includes/tcpdi/tcpdi_parser.php index c97d9c74dac..038994568ac 100644 --- a/htdocs/includes/tcpdi/tcpdi_parser.php +++ b/htdocs/includes/tcpdi/tcpdi_parser.php @@ -48,7 +48,8 @@ */ // include class for decoding filters -require_once(dirname(__FILE__).'/../tecnickcom/tcpdf/include/tcpdf_filters.php'); +if (defined('TCPDF_PATH')) require_once(constant('TCPDF_PATH').'/include/tcpdf_filters.php'); +else require_once(dirname(__FILE__).'/../tecnickcom/tcpdf/include/tcpdf_filters.php'); if (!defined ('PDF_TYPE_NULL')) define ('PDF_TYPE_NULL', 0); From 9c6933a796edbe17c0f84befb348154fc8213d46 Mon Sep 17 00:00:00 2001 From: Rembert Oldenboom Date: Sun, 23 Oct 2016 16:53:45 +0200 Subject: [PATCH 16/21] Fix pager --- htdocs/don/list.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/htdocs/don/list.php b/htdocs/don/list.php index 8c7f5b987be..f5ce8b0350b 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -72,9 +72,7 @@ $fieldstosearchall = array( 'd.lastname'=>'Lastname', 'd.firstname'=>'Firstname', ); - - - + /* * View */ @@ -115,6 +113,12 @@ if (trim($search_name) != '') if ($search_amount) $sql.= natural_search(array('d.amount'), price2num(trim($search_amount)), 1); $sql.= $db->order($sortfield,$sortorder); +$nbtotalofrecords = 0; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) +{ + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); +} $sql.= $db->plimit($limit+1, $offset); $resql = $db->query($sql); @@ -124,18 +128,18 @@ if ($resql) $i = 0; $param = '&statut='.$statut; - if ($page > 0) $param.= '&page='.$page; + //if ($page > 0) $param.= '&page='.$page; if ($optioncss != '') $param.='&optioncss='.$optioncss; if ($statut >= 0) { $donationstatic->statut=$statut; $label=$donationstatic->getLibStatut(0); - print_barre_liste($label, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num); + print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num,$nbtotalofrecords); } else { - print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num); + print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num,$nbtotalofrecords); } @@ -200,7 +204,7 @@ if ($resql) $var=True; while ($i < min($num,$limit)) { - $objp = $db->fetch_object($result); + $objp = $db->fetch_object($resql); $var=!$var; print "
"; $donationstatic->id=$objp->rowid; From 070980f5a61b64dda784f4181f571be3be570806 Mon Sep 17 00:00:00 2001 From: Rembert Oldenboom Date: Sun, 23 Oct 2016 16:59:57 +0200 Subject: [PATCH 17/21] Cleanup --- htdocs/don/list.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/don/list.php b/htdocs/don/list.php index f5ce8b0350b..9652947aa3c 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -72,7 +72,7 @@ $fieldstosearchall = array( 'd.lastname'=>'Lastname', 'd.firstname'=>'Firstname', ); - + /* * View */ @@ -128,7 +128,6 @@ if ($resql) $i = 0; $param = '&statut='.$statut; - //if ($page > 0) $param.= '&page='.$page; if ($optioncss != '') $param.='&optioncss='.$optioncss; if ($statut >= 0) From 65b986d9ecbd8f234892ccfef8ff843363e6c09c Mon Sep 17 00:00:00 2001 From: Rembert Oldenboom Date: Sun, 23 Oct 2016 17:04:21 +0200 Subject: [PATCH 18/21] Revert "Cleanup" This reverts commit 070980f5a61b64dda784f4181f571be3be570806. --- htdocs/don/list.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/don/list.php b/htdocs/don/list.php index 9652947aa3c..f5ce8b0350b 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -72,7 +72,7 @@ $fieldstosearchall = array( 'd.lastname'=>'Lastname', 'd.firstname'=>'Firstname', ); - + /* * View */ @@ -128,6 +128,7 @@ if ($resql) $i = 0; $param = '&statut='.$statut; + //if ($page > 0) $param.= '&page='.$page; if ($optioncss != '') $param.='&optioncss='.$optioncss; if ($statut >= 0) From 25a29c89829b23d5f7a9703997c4635825d26c85 Mon Sep 17 00:00:00 2001 From: Rembert Oldenboom Date: Sun, 23 Oct 2016 17:04:43 +0200 Subject: [PATCH 19/21] Revert "Cleanup" This reverts commit 070980f5a61b64dda784f4181f571be3be570806. --- htdocs/don/list.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/don/list.php b/htdocs/don/list.php index 9652947aa3c..f5ce8b0350b 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -72,7 +72,7 @@ $fieldstosearchall = array( 'd.lastname'=>'Lastname', 'd.firstname'=>'Firstname', ); - + /* * View */ @@ -128,6 +128,7 @@ if ($resql) $i = 0; $param = '&statut='.$statut; + //if ($page > 0) $param.= '&page='.$page; if ($optioncss != '') $param.='&optioncss='.$optioncss; if ($statut >= 0) From 246d09f979f1b91b4284a0b9eaac9f214a8fcd2f Mon Sep 17 00:00:00 2001 From: Rembert Oldenboom Date: Sun, 23 Oct 2016 17:11:55 +0200 Subject: [PATCH 20/21] Fix paging donations list --- htdocs/don/list.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/don/list.php b/htdocs/don/list.php index f5ce8b0350b..9652947aa3c 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -72,7 +72,7 @@ $fieldstosearchall = array( 'd.lastname'=>'Lastname', 'd.firstname'=>'Firstname', ); - + /* * View */ @@ -128,7 +128,6 @@ if ($resql) $i = 0; $param = '&statut='.$statut; - //if ($page > 0) $param.= '&page='.$page; if ($optioncss != '') $param.='&optioncss='.$optioncss; if ($statut >= 0) From 6bd219b117eebe7f6d88fdaad03331ff02d17534 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Oct 2016 17:47:31 +0200 Subject: [PATCH 21/21] Fix column task ref/label --- htdocs/projet/tasks/time.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index ada4156ad1c..96c849d8df9 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -570,7 +570,8 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) print ''; if (! $id && ! $ref) // Not a dedicated task { - print ''; + print ''; + print ''; } print ''; print ''; @@ -615,6 +616,9 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) $tasktmp->label = $task_time->label; print $tasktmp->getNomUrl(1, 'withproject', 'time'); print ''; + print ''; } // User @@ -702,7 +706,13 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) $total += $task_time->task_duration; $totalvalue += price2num($task_time->thm * $task_time->task_duration / 3600); } - print ''; + + $colspan=3; + if (! $id && ! $ref) // Not a dedicated task + { + $colspan+=2; + } + print ''; print ''; if ($conf->salaries->enabled) {
'.$langs->trans("Date").''.$langs->trans("Task").''.$langs->trans("RefTask").''.$langs->trans("LabelTask").''.$langs->trans("By").''.$langs->trans("Note").''; + print $tasktmp->label; + print '
'.$langs->trans("Total").'
'.$langs->trans("Total").''.convertSecondToTime($total,'allhourmin').'