From 23974daca47aee42dc14cf45e518b58fcaa6a3ee Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 1 Aug 2014 09:57:08 +0200 Subject: [PATCH 01/10] Fix : shipping list SQL request was not filtering on shipping element --- htdocs/expedition/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php index 33082aa9193..b567773bc69 100644 --- a/htdocs/expedition/index.php +++ b/htdocs/expedition/index.php @@ -67,7 +67,7 @@ $sql = "SELECT e.rowid, e.ref"; $sql.= ", s.nom, s.rowid as socid"; $sql.= ", c.ref as commande_ref, c.rowid as commande_id"; $sql.= " FROM ".MAIN_DB_PREFIX."expedition as e"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON e.rowid = el.fk_target"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON e.rowid = el.fk_target AND el.targettype = 'shipping'"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON el.fk_source = c.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc"; if (!$user->rights->societe->client->voir && !$socid) From 139dfa5b80ff82ef5acb128e303b298cef3caf22 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 1 Aug 2014 15:05:43 +0200 Subject: [PATCH 02/10] Fix : Fusion PDF button on unpaid invoice is no more displayed --- ChangeLog | 1 + htdocs/core/class/html.formfile.class.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c042efef003..e47d53211c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.5.5 compared to 3.5.4 ***** Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas. +Fix: Fusion PDF button on unpaid invoice is no more displayed ***** ChangeLog for 3.5.4 compared to 3.5.3 ***** Fix: Hide title of event when agenda module disabled. diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index d2cba220bcf..24365c6199a 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -509,7 +509,7 @@ class FormFile $genbutton.= ' '.img_warning($langs->transnoentitiesnoconv("WarningNoDocumentModelActivated")); } if (! $allowgenifempty && ! is_array($modellist) && empty($modellist) && empty($conf->dol_no_mouse_hover) && $modulepart != 'unpaid') $genbutton=''; - if (empty($modellist) && ! $showempty) $genbutton=''; + if (empty($modellist) && ! $showempty && $modulepart != 'unpaid') $genbutton=''; $out.= $genbutton; $out.= ''; From 44f06bef2272fa3ff219a2210b27fda6f9dea806 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 1 Aug 2014 15:21:29 +0200 Subject: [PATCH 03/10] Unpaid invoice launch fusion PDF action even if it is only search (with enter keyboard input instead of lens click) --- ChangeLog | 1 + htdocs/compta/facture/impayees.php | 3 ++- htdocs/core/class/html.formfile.class.php | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e47d53211c7..0f260470db4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.5.5 compared to 3.5.4 ***** Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas. Fix: Fusion PDF button on unpaid invoice is no more displayed +Fix: Unpaid invoice launch fusion PDF action even if it is only search (with enter keyboard input instead of lens click) ***** ChangeLog for 3.5.4 compared to 3.5.3 ***** Fix: Hide title of event when agenda module disabled. diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index fe16e03b6c6..57fc4e9b529 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -37,6 +37,7 @@ $langs->load("bills"); $id = (GETPOST('facid','int') ? GETPOST('facid','int') : GETPOST('id','int')); $action = GETPOST('action','alpha'); $option = GETPOST('option'); +$builddoc_generatebutton=GETPOST('builddoc_generatebutton'); // Security check if ($user->societe_id) $socid=$user->societe_id; @@ -50,7 +51,7 @@ if (! $user->rights->societe->client->voir || $socid) $diroutputpdf.='/private/' * Action */ -if ($action == "builddoc" && $user->rights->facture->lire && ! GETPOST('button_search')) +if ($action == "builddoc" && $user->rights->facture->lire && ! GETPOST('button_search') && !empty($builddoc_generatebutton)) { if (is_array($_POST['toGenerate'])) { diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 24365c6199a..88a931a3d8a 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -499,7 +499,7 @@ class FormFile // Button $addcolumforpicto=($delallowed || $printer || $morepicto); $out.= ''; - $genbutton = ' Date: Fri, 1 Aug 2014 16:48:16 +0200 Subject: [PATCH 04/10] Fix extrafield parameters for sellist --- htdocs/core/class/extrafields.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index d5b49ea9ef2..43afe19ecc0 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -939,11 +939,11 @@ class ExtraFields { $param_list=array_keys($params['options']); $InfoFieldList = explode(":", $param_list[0]); - + var_dump($InfoFieldList); $selectkey="rowid"; $keyList='rowid'; - if (count($InfoFieldList)==3) + if (count($InfoFieldList)>=3) { $selectkey = $InfoFieldList[2]; $keyList=$InfoFieldList[2].' as rowid'; From b0011d051459ace3059e512fda3fa0183604ed1e Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 1 Aug 2014 16:50:47 +0200 Subject: [PATCH 05/10] remove debug --- htdocs/core/class/extrafields.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 43afe19ecc0..63c84e17ae6 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -939,7 +939,7 @@ class ExtraFields { $param_list=array_keys($params['options']); $InfoFieldList = explode(":", $param_list[0]); - var_dump($InfoFieldList); + $selectkey="rowid"; $keyList='rowid'; From 0834178bf5df02f07d7c37d91ddb13fd7c486069 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Aug 2014 00:15:08 +0200 Subject: [PATCH 06/10] Add more colors to fix pb with agenda --- htdocs/theme/eldy/graph-color.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/graph-color.php b/htdocs/theme/eldy/graph-color.php index a4dc67db555..4b263c2be47 100644 --- a/htdocs/theme/eldy/graph-color.php +++ b/htdocs/theme/eldy/graph-color.php @@ -28,7 +28,7 @@ global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet; $theme_bordercolor = array(235,235,224); -$theme_datacolor = array(array(190,190,220), array(200,160,180), array(125,135,150), array(170,140,190), array(190,190,170)); +$theme_datacolor = array(array(190,190,220), array(200,160,180), array(125,135,150), array(170,140,190), array(190,190,170), array(190,170,190), array(170,190,190), array(150,135,125)); $theme_bgcolor = array(hexdec('F4'),hexdec('F4'),hexdec('F4')); $theme_bgcoloronglet = array(hexdec('DE'),hexdec('E7'),hexdec('EC')); From b5bb4c639c5dd98a2716734c63619582b99038bf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Aug 2014 00:15:23 +0200 Subject: [PATCH 07/10] Fix: Clean data --- htdocs/install/mysql/migration/3.5.0-3.6.0.sql | 2 +- htdocs/install/mysql/migration/repair.sql | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/3.5.0-3.6.0.sql b/htdocs/install/mysql/migration/3.5.0-3.6.0.sql index 91febed40d2..919fbee7d4d 100644 --- a/htdocs/install/mysql/migration/3.5.0-3.6.0.sql +++ b/htdocs/install/mysql/migration/3.5.0-3.6.0.sql @@ -1679,5 +1679,5 @@ INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, -- VPGSQL8.2 ALTER TABLE llx_facture_fourn ALTER fk_cond_reglement DROP NOT NULL; UPDATE llx_actioncomm set fk_user_action = fk_user_done where fk_user_done > 0 and (fk_user_action is null or fk_user_action = 0); - +UPDATE llx_actioncomm set fk_user_action = fk_user_author where fk_user_author > 0 and (fk_user_action is null or fk_user_action = 0); diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 6c758e56332..224a76cdf73 100644 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -153,4 +153,5 @@ UPDATE llx_projet_task SET fk_task_parent = 0 WHERE fk_task_parent = rowid UPDATE llx_actioncomm set fk_user_action = fk_user_done where fk_user_done > 0 and (fk_user_action is null or fk_user_action = 0); +UPDATE llx_actioncomm set fk_user_action = fk_user_author where fk_user_author > 0 and (fk_user_action is null or fk_user_action = 0); From 8167f308339308953267fae42aee1aa9397c8642 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Aug 2014 01:25:38 +0200 Subject: [PATCH 08/10] Fix: Exclude dev dir from bin package. --- build/makepack-dolibarr.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 1531c049f7d..77f19c1500a 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -416,6 +416,7 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/dev/spec`; $ret=`rm -fr $BUILDROOT/$PROJECT/dev/test`; $ret=`rm -fr $BUILDROOT/$PROJECT/dev/uml`; + $ret=`rm -fr $BUILDROOT/$PROJECT/dev/vagrant`; $ret=`rm -fr $BUILDROOT/$PROJECT/dev/xdebug`; $ret=`rm -f $BUILDROOT/$PROJECT/dev/dolibarr_changes.txt`; $ret=`rm -f $BUILDROOT/$PROJECT/dev/README`; From 863d57004ed232fbd397a7d422cd0330d6f5a98c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Aug 2014 10:44:19 +0200 Subject: [PATCH 09/10] Fix: Field must be invisible --- htdocs/user/fiche.php | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index d9ff9c7c71d..108619f66ae 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -1879,19 +1879,23 @@ else print "\n"; // Accountancy code - print ""; - print ''.$langs->trans("AccountancyCode").''; - print ''; - if ($caneditfield) + if (! empty($conf->global->USER_ENABLE_ACCOUNTANCY_CODE)) // For the moment field is not used so must not appeared. { - print ''; + print ""; + print ''.$langs->trans("AccountancyCode").''; + print ''; + if ($caneditfield) + { + print ''; + } + else + { + print ''; + print $object->accountancy_code; + } + print ''; + print ""; } - else - { - print ''; - print $object->accountancy_code; - } - print ''; // Status print ''.$langs->trans("Status").''; From 6a61587085f4fae34d9ce8bd1ea8b125486087b9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jul 2014 13:07:53 +0200 Subject: [PATCH 10/10] Try a fix when timezone string is not standard Conflicts: htdocs/includes/adodbtime/adodb-time.inc.php --- htdocs/core/js/dst.js | 21 +++++++++++---------- htdocs/core/lib/functions.lib.php | 22 +++++++++++++++------- htdocs/main.inc.php | 5 ++++- 3 files changed, 30 insertions(+), 18 deletions(-) diff --git a/htdocs/core/js/dst.js b/htdocs/core/js/dst.js index 5335906dc77..c22f83aec21 100644 --- a/htdocs/core/js/dst.js +++ b/htdocs/core/js/dst.js @@ -1,4 +1,4 @@ -// Copyright (C) 2011-2012 Laurent Destailleur +// Copyright (C) 2011-2014 Laurent Destailleur // Copyright (C) 2011-2012 Regis Houssin // // This program is free software; you can redistribute it and/or modify @@ -18,7 +18,8 @@ // // \file htdocs/core/js/dst.js -// \brief File that include javascript functions for detect user tz, dst_observed, dst_first, dst_second +// \brief File that include javascript functions for detect user tz, tz_string, dst_observed, dst_first, dst_second, +// screenwidth and screenheight // $(document).ready(function () { @@ -39,22 +40,22 @@ $(document).ready(function () { dst = "1"; // daylight savings time is observed } var now=new Date(); - var tz=now.toTimeString().match(/\(.*\)/); + var tz=now.toTimeString().match(/\(.*\)/); // now.toTimeString may return "12:39:59 GMT+0200 (CEST)" //alert('date=' + now + ' string=' + now.toTimeString()); var dst_first=DisplayDstSwitchDates('first'); var dst_second=DisplayDstSwitchDates('second'); //alert(dst); - $('#tz').val(std_time_offset); // returns TZ - // tz is null with IE + $('#tz').val(std_time_offset); // returns TZ + // tz is null with IE if (tz != null) { $('#tz_string').val(tz[0].replace('(','').replace(')','')); // returns TZ string } - $('#dst_observed').val(dst); // returns if DST is observed on summer - $('#dst_first').val(dst_first); // returns DST first switch in year - $('#dst_second').val(dst_second); // returns DST second switch in year + $('#dst_observed').val(dst); // returns if DST is observed on summer + $('#dst_first').val(dst_first); // returns DST first switch in year + $('#dst_second').val(dst_second); // returns DST second switch in year // Detect and save screen resolution - $('#screenwidth').val($(window).width()); // returns width of browser viewport - $('#screenheight').val($(window).height()); // returns width of browser viewport + $('#screenwidth').val($(window).width()); // returns width of browser viewport + $('#screenheight').val($(window).height()); // returns width of browser viewport }); function DisplayDstSwitchDates(firstsecond) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index db5de85015d..f6a901f3d3d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -871,7 +871,7 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e if (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?/i',$time,$reg) || preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])$/i',$time,$reg)) { - // This part of code should not be used. + // This part of code should not be used. TODO Remove this. dol_syslog("Functions.lib::dol_print_date function call with deprecated value of time in page ".$_SERVER["PHP_SELF"], LOG_WARNING); // Date has format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' or 'YYYYMMDDHHMMSS' $syear = (! empty($reg[1]) ? $reg[1] : ''); @@ -889,7 +889,7 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e // Date is a timestamps if ($time < 100000000000) // Protection against bad date values { - $ret=adodb_strftime($format,$time+$offsettz+$offsetdst,$to_gmt); + $ret=adodb_strftime($format,$time+$offsettz+$offsetdst,$to_gmt); // TODO Remove this } else $ret='Bad value '.$time.' for date'; } @@ -897,7 +897,7 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e if (preg_match('/__b__/i',$format)) { // Here ret is string in PHP setup language (strftime was used). Now we convert to $outputlangs. - $month=adodb_strftime('%m',$time+$offsettz+$offsetdst); + $month=adodb_strftime('%m',$time+$offsettz+$offsetdst); // TODO Remove this if ($encodetooutput) { $monthtext=$outputlangs->transnoentities('Month'.$month); @@ -916,7 +916,7 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e } if (preg_match('/__a__/i',$format)) { - $w=adodb_strftime('%w',$time+$offsettz+$offsetdst); + $w=adodb_strftime('%w',$time+$offsettz+$offsetdst); // TODO Remove this $dayweek=$outputlangs->transnoentitiesnoconv('Day'.$w); $ret=str_replace('__A__',$dayweek,$ret); $ret=str_replace('__a__',dol_substr($dayweek,0,3),$ret); @@ -1029,8 +1029,16 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1) } else if ($gm === 'user') { - $default_timezone=(empty($_SESSION["dol_tz_string"])?'UTC':$_SESSION["dol_tz_string"]); - $localtz = new DateTimeZone($default_timezone); + // We use dol_tz_string first because it contains dst. + $default_timezone=(empty($_SESSION["dol_tz_string"])?@date_default_timezone_get():$_SESSION["dol_tz_string"]); + try { + $localtz = new DateTimeZone($default_timezone); + } + catch(Exception $e) + { + dol_syslog("Warning dol_tz_string contains an invalid value ".$_SESSION["dol_tz_string"], LOG_WARNING); + $default_timezone=@date_default_timezone_get(); + } } else $localtz = new DateTimeZone('UTC'); $dt = new DateTime(null,$localtz); @@ -4533,4 +4541,4 @@ function natural_search($fields, $value) return " AND " . ($end > 1? '(' : '') . $res; } -?> \ No newline at end of file +?> diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 45ddc3d8734..ba12febd3d4 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -446,6 +446,9 @@ if (! defined('NOLOGIN')) $dol_authmode=$conf->authmode; // This properties is defined only when logged, to say what mode was successfully used $dol_tz=$_POST["tz"]; $dol_tz_string=$_POST["tz_string"]; + $dol_tz_string=preg_replace('\s*\(.+\)$','',$dol_tz_string); + $dol_tz_string=preg_replace(',','/',$dol_tz_string); + $dol_tz_string=preg_replace('\s','_',$dol_tz_string); $dol_dst=0; if (isset($_POST["dst_first"]) && isset($_POST["dst_second"])) { @@ -1880,4 +1883,4 @@ if (! function_exists("llxFooter")) } } -?> \ No newline at end of file +?>