From f0c9513fa9de5b1dd73741375f395840199dcdcf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Aug 2014 17:18:53 +0200 Subject: [PATCH 1/6] Fix: [ bug #1558 ] Product/service edit page title shows new Ref instead of old ref --- ChangeLog | 11 ++++++----- htdocs/product/fiche.php | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6e81703b33a..a22ec7b1b80 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,20 +5,21 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.5.5 compared to 3.5.4 ***** Fix: Holiday module was broken. Initializaion of amount of holidays failed. 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) +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). Fix: Pb when showing log list of holiday module with some mysql versions. Fix: Error with bad timezone pushed by some browsers. Fix: shipping list SQL request was not filtering on shipping element Fix: debian package provided by dolibarr team must use embedded libraries. Fix: [ bug #1528 ] Leopard Services numeration module description is not translated. -Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas -Fix: [ bug #1534 ] Unknown error when deleting a product photo under special circumstances +Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas. +Fix: [ bug #1534 ] Unknown error when deleting a product photo under special circumstances. Fix: Update impayees.php Fix: Link product, In list view and label product Fix: visible task into area "time" for "My task" must limit task to tasks i am assigned to. Fix: When disabled, all fields to add time into task line must be disabled. -Fix: Missing include files.lib.php in some pages ti use dol_delete_recursive +Fix: Missing include files.lib.php in some pages ti use dol_delete_recursive. +Fix: [ bug #1558 ] Product/service edit page title shows new Ref instead of old ref. ***** ChangeLog for 3.5.4 compared to 3.5.3 ***** Fix: Hide title of event when agenda module disabled. diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 1ec4855155e..e6a5075bd3b 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2006 Andre Cianfarani @@ -870,7 +870,7 @@ else $type = $langs->trans('Product'); if ($object->isservice()) $type = $langs->trans('Service'); - print_fiche_titre($langs->trans('Modify').' '.$type.' : '.$object->ref, ""); + print_fiche_titre($langs->trans('Modify').' '.$type.' : '.(is_object($object->oldcopy)?$object->oldcopy->ref:$object->ref), ""); // Main official, simple, and not duplicated code print '
'."\n"; From 3336b5bdcede4664e11886b3f739fb14fd7a807f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Aug 2014 17:35:19 +0200 Subject: [PATCH 2/6] Fix: [ bug #1553 ] Saving User displays setup removes menu --- ChangeLog | 3 ++- htdocs/user/param_ihm.php | 6 +----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index a22ec7b1b80..325a6589418 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,11 +15,12 @@ Fix: [ bug #1528 ] Leopard Services numeration module description is not transla Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas. Fix: [ bug #1534 ] Unknown error when deleting a product photo under special circumstances. Fix: Update impayees.php -Fix: Link product, In list view and label product +Fix: Link product, In list view and label product. Fix: visible task into area "time" for "My task" must limit task to tasks i am assigned to. Fix: When disabled, all fields to add time into task line must be disabled. Fix: Missing include files.lib.php in some pages ti use dol_delete_recursive. Fix: [ bug #1558 ] Product/service edit page title shows new Ref instead of old ref. +Fix: [ bug #1553 ] Saving User displays setup removes menu. ***** ChangeLog for 3.5.4 compared to 3.5.3 ***** Fix: Hide title of event when agenda module disabled. diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 44686e9277e..977e2724cb6 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2005-2014 Laurent Destailleur * Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2013 Florian Henry * @@ -87,8 +87,6 @@ if ($action == 'update' && ($caneditfield || ! empty($user->admin))) if ($_POST["check_MAIN_LANG_DEFAULT"]=="on") $tabparam["MAIN_LANG_DEFAULT"]=$_POST["main_lang_default"]; else $tabparam["MAIN_LANG_DEFAULT"]=''; - $tabparam["MAIN_MENU_STANDARD"]=$_POST["MAIN_MENU_STANDARD"]; - if ($_POST["check_SIZE_LISTE_LIMIT"]=="on") $tabparam["MAIN_SIZE_LISTE_LIMIT"]=$_POST["main_size_liste_limit"]; else $tabparam["MAIN_SIZE_LISTE_LIMIT"]=''; @@ -101,8 +99,6 @@ if ($action == 'update' && ($caneditfield || ! empty($user->admin))) $result=dol_set_user_param($db, $conf, $fuser, $tabparam); - $_SESSION["mainmenu"]=""; // Le gestionnaire de menu a pu changer - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); exit; } From b0ebaec0dab012d205908fddf2f192eabdc17268 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Aug 2014 12:43:24 +0200 Subject: [PATCH 3/6] Fix: Add more log and missing error message --- htdocs/admin/dict.php | 6 ++++-- htdocs/core/db/mysql.class.php | 6 +++--- htdocs/core/db/mysqli.class.php | 6 +++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index b72dff643b5..305843f7188 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -473,7 +473,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'
'; }*/ } - if (isset($_POST["country"]) && $_POST["country"]=='0') { + if (isset($_POST["country"]) && $_POST["country"]=='0') + { $ok=0; setEventMessage($langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")),'errors'); } @@ -532,7 +533,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $result = $db->query($sql); if ($result) // Add is ok { - $_POST=array('id'=>$id); // Clean $_POST array, we keep only + setEventMessage($langs->transnoentities("RecordSaved")); + $_POST=array('id'=>$id); // Clean $_POST array, we keep only } else { diff --git a/htdocs/core/db/mysql.class.php b/htdocs/core/db/mysql.class.php index ab9d6e5850e..bfd7c55b4c2 100644 --- a/htdocs/core/db/mysql.class.php +++ b/htdocs/core/db/mysql.class.php @@ -271,7 +271,7 @@ class DoliDBMysql extends DoliDB $this->lastqueryerror = $query; $this->lasterror = $this->error(); $this->lasterrno = $this->errno(); - dol_syslog(get_class($this)."::query SQL error: ".$query." ".$this->lasterrno, LOG_WARNING); + dol_syslog(get_class($this)."::query SQL error: ".$query." ".$this->lasterrno." ".$this->lasterror, LOG_WARNING); } $this->lastquery=$query; $this->_results = $ret; @@ -825,12 +825,12 @@ class DoliDBMysql extends DoliDB $resql=$this->query($sql); if (! $resql) { - if ($this->lasterrno != 'DB_ERROR_USER_ALREADY_EXISTS') + if ($this->lasterrno != 'DB_ERROR_USER_ALREADY_EXISTS') { dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR); return -1; } - else + else { // If user already exists, we continue to set permissions dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_WARNING); diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 40061a4fa1a..7a964d07afc 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -273,7 +273,7 @@ class DoliDBMysqli extends DoliDB $this->lastqueryerror = $query; $this->lasterror = $this->error(); $this->lasterrno = $this->errno(); - dol_syslog(get_class($this)."::query SQL error: ".$query." ".$this->lasterrno, LOG_WARNING); + dol_syslog(get_class($this)."::query SQL error: ".$query." ".$this->lasterrno." ".$this->lasterror, LOG_WARNING); } $this->lastquery=$query; $this->_results = $ret; @@ -829,12 +829,12 @@ class DoliDBMysqli extends DoliDB $resql=$this->query($sql); if (! $resql) { - if ($this->lasterrno != 'DB_ERROR_USER_ALREADY_EXISTS') + if ($this->lasterrno != 'DB_ERROR_USER_ALREADY_EXISTS') { dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR); return -1; } - else + else { // If user already exists, we continue to set permissions dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_WARNING); From 0632cbdad060362070abac770f366365c1a66abd Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 17 Aug 2014 15:12:20 +0200 Subject: [PATCH 4/6] Fix: broken feature: add param for use only "disabled" with delConstant and "enabled" with setConstant --- htdocs/core/js/lib_head.js | 21 ++++++++++++--------- htdocs/core/lib/ajax.lib.php | 14 ++++++++------ 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/htdocs/core/js/lib_head.js b/htdocs/core/js/lib_head.js index a5e1410d503..40b1473698e 100644 --- a/htdocs/core/js/lib_head.js +++ b/htdocs/core/js/lib_head.js @@ -1,5 +1,5 @@ // Copyright (C) 2005-2014 Laurent Destailleur -// Copyright (C) 2005-2012 Regis Houssin +// Copyright (C) 2005-2014 Regis Houssin // // 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 @@ -633,7 +633,7 @@ function hideMessage(fieldId,message) { /* * TODO Used by admin page only ? */ -function setConstant(url, code, input, entity) { +function setConstant(url, code, input, entity, strict) { $.get( url, { action: "set", name: code, @@ -644,7 +644,7 @@ function setConstant(url, code, input, entity) { $("#del_" + code).show(); $.each(input, function(type, data) { // Enable another element - if (type == "disabled") { + if (type == "disabled" && strict != 1) { $.each(data, function(key, value) { var newvalue=((value.search("^#") < 0 && value.search("^\.") < 0) ? "#" : "") + value; $(newvalue).removeAttr("disabled"); @@ -656,7 +656,10 @@ function setConstant(url, code, input, entity) { } else if (type == "enabled") { $.each(data, function(key, value) { var newvalue=((value.search("^#") < 0 && value.search("^\.") < 0) ? "#" : "") + value; - $(newvalue).attr("disabled", true); + if (strict == 1) + $(newvalue).removeAttr("disabled"); + else + $(newvalue).attr("disabled", true); if ($(newvalue).hasClass("butAction") == true) { $(newvalue).removeClass("butAction"); $(newvalue).addClass("butActionRefused"); @@ -688,7 +691,7 @@ function setConstant(url, code, input, entity) { /* * TODO Used by admin page only ? */ -function delConstant(url, code, input, entity) { +function delConstant(url, code, input, entity, strict) { $.get( url, { action: "del", name: code, @@ -708,7 +711,7 @@ function delConstant(url, code, input, entity) { $(newvalue).addClass("butActionRefused"); } }); - } else if (type == "enabled") { + } else if (type == "enabled" && strict != 1) { $.each(data, function(key, value) { var newvalue=((value.search("^#") < 0 && value.search("^\.") < 0) ? "#" : "") + value; $(newvalue).removeAttr("disabled"); @@ -742,7 +745,7 @@ function delConstant(url, code, input, entity) { /* * TODO Used by admin page only ? */ -function confirmConstantAction(action, url, code, input, box, entity, yesButton, noButton) { +function confirmConstantAction(action, url, code, input, box, entity, yesButton, noButton, strict) { var boxConfirm = box; $("#confirm_" + code) .attr("title", boxConfirm.title) @@ -758,9 +761,9 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton, text : yesButton, click : function() { if (action == "set") { - setConstant(url, code, input, entity); + setConstant(url, code, input, entity, strict); } else if (action == "del") { - delConstant(url, code, input, entity); + delConstant(url, code, input, entity, strict); } // Close dialog $(this).dialog("close"); diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index f36dc59c43a..e0b1bba891d 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -1,6 +1,6 @@ - * Copyright (C) 2007-2012 Regis Houssin + * Copyright (C) 2007-2014 Regis Houssin * Copyright (C) 2012 Christophe Battarel * * This program is free software; you can redistribute it and/or modify @@ -391,9 +391,10 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0) * @param array $input Array of type->list of CSS element to switch. Example: array('disabled'=>array(0=>'cssid')) * @param int $entity Entity to set * @param int $revertonoff Revert on/off + * @param bool $strict Use only "disabled" with delConstant and "enabled" with setConstant * @return void */ -function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0) +function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0) { global $conf, $langs; @@ -406,6 +407,7 @@ function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0) var url = \''.DOL_URL_ROOT.'/core/ajax/constantonoff.php\'; var code = \''.$code.'\'; var entity = \''.$entity.'\'; + var strict = \''.$strict.'\'; var yesButton = "'.dol_escape_js($langs->transnoentities("Yes")).'"; var noButton = "'.dol_escape_js($langs->transnoentities("No")).'"; @@ -414,9 +416,9 @@ function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0) if (input.alert && input.alert.set) { if (input.alert.set.yesButton) yesButton = input.alert.set.yesButton; if (input.alert.set.noButton) noButton = input.alert.set.noButton; - confirmConstantAction("set", url, code, input, input.alert.set, entity, yesButton, noButton); + confirmConstantAction("set", url, code, input, input.alert.set, entity, yesButton, noButton, strict); } else { - setConstant(url, code, input, entity); + setConstant(url, code, input, entity, strict); } }); @@ -425,9 +427,9 @@ function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0) if (input.alert && input.alert.del) { if (input.alert.del.yesButton) yesButton = input.alert.del.yesButton; if (input.alert.del.noButton) noButton = input.alert.del.noButton; - confirmConstantAction("del", url, code, input, input.alert.del, entity, yesButton, noButton); + confirmConstantAction("del", url, code, input, input.alert.del, entity, yesButton, noButton, strict); } else { - delConstant(url, code, input, entity); + delConstant(url, code, input, entity, strict); } }); }); From dd9a08120ffc33026cda86ad3e3afc8f3f934323 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Aug 2014 17:13:00 +0200 Subject: [PATCH 5/6] Fix: no ' on command to create user on pgsql --- htdocs/core/db/pgsql.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 155977cc8d1..1200deee93e 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -981,7 +981,8 @@ class DoliDBPgsql extends DoliDB */ function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name) { - $sql = "CREATE USER '".$this->escape($dolibarr_main_db_user)."' with password '".$this->escape($dolibarr_main_db_pass)."'"; + // Note: using ' on user does not works with pgsql + $sql = "CREATE USER ".$this->escape($dolibarr_main_db_user)." with password '".$this->escape($dolibarr_main_db_pass)."'"; dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log $resql=$this->query($sql); From 4f206a21258a977eb0ed26e2739956231cf42aaa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Aug 2014 19:27:25 +0200 Subject: [PATCH 6/6] Fix: Missing empty field --- htdocs/core/class/extrafields.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 8304c626fb0..2f6a63b6d8c 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -681,6 +681,7 @@ class ExtraFields } $out.='