From d89955047b9e257dcb154fcd7baa376b41e77c2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 11 Jun 2015 10:37:30 +0200 Subject: [PATCH 01/23] FIX #3009: Better filtering to prevent SQL injection --- htdocs/product/liste.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index 69453cb2a50..99b80644310 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -49,8 +49,8 @@ $sall=GETPOST("sall"); $type=GETPOST("type","int"); $search_sale = GETPOST("search_sale"); $search_categ = GETPOST("search_categ",'int'); -$tosell = GETPOST("tosell"); -$tobuy = GETPOST("tobuy"); +$tosell = GETPOST("tosell", 'int'); +$tobuy = GETPOST("tobuy", 'int'); $fourn_id = GETPOST("fourn_id",'int'); $catid = GETPOST('catid','int'); From 87a00d6924ff34014eb74acf6373410f6d1db6af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 12 Jun 2015 15:02:05 +0200 Subject: [PATCH 02/23] FIX Close bug #2976: "Report" tab is the current tab but it is not marked as selected by the UI --- ChangeLog | 1 + htdocs/core/lib/report.lib.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 06e76dbfacc..0ab6cf0563d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,7 @@ Fix: [ bug #2577 ] Incorrect invoice status in "Linked objects" page of a projec Fix: [ bug #2576 ] Unable to edit a dictionary entry that has # in its ref Fix: [ bug #2758 ] Product::update sets product note to "null" when $prod->note is null Fix: [ bug #2757 ] Deleting product category photo gives "Forbidden access" error +Fix: [ bug #2976 ] "Report" tab is the current tab but it is not marked as selected by the UI ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/core/lib/report.lib.php b/htdocs/core/lib/report.lib.php index 13c30976a98..5cc810cc83f 100644 --- a/htdocs/core/lib/report.lib.php +++ b/htdocs/core/lib/report.lib.php @@ -39,7 +39,7 @@ */ function report_header($nom,$variante,$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array(),$calcmode='') { - global $langs, $hselected; + global $langs; print "\n\n\n"; @@ -48,7 +48,7 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat $head[$h][1] = $langs->trans("Report"); $head[$h][2] = 'report'; - dol_fiche_head($head, $hselected); + dol_fiche_head($head, 'report'); print '
'; foreach($moreparam as $key => $value) From 60711d35b8d4cf0190a3cdcb9897c5275b432434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 12 Jun 2015 15:53:58 +0200 Subject: [PATCH 03/23] FIX Close bug #2900 Courtesy title is not stored in create thirdparty form --- ChangeLog | 2 ++ htdocs/societe/soc.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 31a6c7266a1..9e17106bfca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,8 @@ You may also experience troubles with Mysql 5.5.41 with error "Lost connection" Upgrading to any other version or database system is abolutely required BEFORE trying to make a Dolibarr upgrade. +***** ChangeLog for 3.7.2 compared to 3.7.* ***** +Fix [ bug #2900 ] Courtesy title is not stored in create thirdparty form ***** ChangeLog for 3.7.1 compared to 3.7.* ***** FIX Bug in the new photo system diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 2a9e159558c..bddbd174f6e 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -137,7 +137,7 @@ if (empty($reshook)) $object->particulier = GETPOST("private"); $object->name = dolGetFirstLastname(GETPOST('firstname','alpha'),GETPOST('nom','alpha')?GETPOST('nom','alpha'):GETPOST('name','alpha')); - $object->civility_id = GETPOST('civility_id', 'int'); + $object->civility_id = GETPOST('civility_id'); // Add non official properties $object->name_bis = GETPOST('name','alpha')?GETPOST('name','alpha'):GETPOST('nom','alpha'); $object->firstname = GETPOST('firstname','alpha'); From 300cfd22931b0569668a096a912c9b9839ca1ef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 12 Jun 2015 16:10:23 +0200 Subject: [PATCH 04/23] FIX Close bug #2891 Category hooks do not work --- ChangeLog | 1 + htdocs/categories/edit.php | 3 +++ htdocs/categories/fiche.php | 3 +++ htdocs/categories/viewcat.php | 3 +++ 4 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3aae68b567a..c2dc484202a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -37,6 +37,7 @@ English Dolibarr ChangeLog - Fix: [ bug #2545 ] Missing object_margin.png in Amarok theme - Fix: [ bug #2542 ] Contracts store localtax preferences - Fix: Bad permission assignments for stock movements actions +- Fix: [ bug #2891 ] Category hooks do not work ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index 0c61ab8cca6..cdca440da13 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -56,6 +56,9 @@ $object = new Categorie($db); $extrafields = new ExtraFields($db); $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); +// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('categorycard')); + /* * Actions */ diff --git a/htdocs/categories/fiche.php b/htdocs/categories/fiche.php index 208cbb38331..566249748de 100644 --- a/htdocs/categories/fiche.php +++ b/htdocs/categories/fiche.php @@ -64,6 +64,9 @@ $object = new Categorie($db); $extrafields = new ExtraFields($db); $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); +// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('categorycard')); + /* * Actions */ diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 010306d1e00..f9df0aff71e 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -63,6 +63,9 @@ $type=$object->type; $extrafields = new ExtraFields($db); $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); +// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('categorycard')); + /* * Actions */ From 03358925215f3b512fcee4d18e4e1402b1188482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 12 Jun 2015 18:31:49 +0200 Subject: [PATCH 05/23] FIX Close bug #2861 Undefined variable $res when migrating from 3.6.2 to 3.7.0 --- htdocs/install/upgrade2.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 2bcb244690e..59f1864837c 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -3661,8 +3661,8 @@ function migrate_reload_modules($db,$langs,$conf) if (! empty($conf->global->MAIN_MODULE_SERVICE)) // Permission has changed into 2.7 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Service"); - if ($res) { - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php'; + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php'; + if ($res) { $mod=new modService($db); //$mod->remove('noboxes'); $mod->init('newboxdefonly'); @@ -3671,8 +3671,8 @@ function migrate_reload_modules($db,$langs,$conf) if (! empty($conf->global->MAIN_MODULE_COMMANDE)) // Permission has changed into 2.9 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Commande"); - if ($res) { - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php'; + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php'; + if ($res) { $mod=new modCommande($db); //$mod->remove('noboxes'); $mod->init('newboxdefonly'); @@ -3681,8 +3681,8 @@ function migrate_reload_modules($db,$langs,$conf) if (! empty($conf->global->MAIN_MODULE_FACTURE)) // Permission has changed into 2.9 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Facture"); - if ($res) { - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFacture.class.php'; + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFacture.class.php'; + if ($res) { $mod=new modFacture($db); //$mod->remove('noboxes'); $mod->init('newboxdefonly'); @@ -3732,8 +3732,8 @@ function migrate_reload_modules($db,$langs,$conf) if (! empty($conf->global->MAIN_MODULE_ECM)) // Permission has changed into 3.0 and 3.1 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module ECM"); - if ($res) { - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modECM.class.php'; + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modECM.class.php'; + if ($res) { $mod=new modECM($db); $mod->remove('noboxes'); // We need to remove because a permission id has been removed $mod->init('newboxdefonly'); From e3aa63f3c3bc319672008e430ddb72398d9ce79a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 12 Jun 2015 18:33:37 +0200 Subject: [PATCH 06/23] Added log --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 06e76dbfacc..cf279e5160c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,7 @@ Fix: [ bug #2577 ] Incorrect invoice status in "Linked objects" page of a projec Fix: [ bug #2576 ] Unable to edit a dictionary entry that has # in its ref Fix: [ bug #2758 ] Product::update sets product note to "null" when $prod->note is null Fix: [ bug #2757 ] Deleting product category photo gives "Forbidden access" error +Fix: [ bug #2861 ] Undefined variable $res when migrating ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 From 2051a66cd736ddf8cb671a5084d8b9e29bc037b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 12 Jun 2015 18:46:05 +0200 Subject: [PATCH 07/23] FIX Close #2837 Product list table column header does not match column body --- ChangeLog | 1 + htdocs/product/liste.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 06e76dbfacc..4a3a3ced9fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,7 @@ Fix: [ bug #2577 ] Incorrect invoice status in "Linked objects" page of a projec Fix: [ bug #2576 ] Unable to edit a dictionary entry that has # in its ref Fix: [ bug #2758 ] Product::update sets product note to "null" when $prod->note is null Fix: [ bug #2757 ] Deleting product category photo gives "Forbidden access" error +Fix: [ bug #2837 ] Product list table column header does not match column body ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index 28563edc5eb..c25ff6bbf7f 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -459,7 +459,7 @@ else } // Better buy price - if ($user->rights->produit->creer) { + if ($user->rights->fournisseur->lire) { print ''; if ($objp->minsellprice != '') { From f9574fa4588fb94491ec2b8c65dc2450000c3747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 12 Jun 2015 19:03:34 +0200 Subject: [PATCH 08/23] FIX Close #2835 Customer prices of a product shows incorrect history order --- ChangeLog | 1 + htdocs/product/price.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 06e76dbfacc..690d4a1abdd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,7 @@ Fix: [ bug #2577 ] Incorrect invoice status in "Linked objects" page of a projec Fix: [ bug #2576 ] Unable to edit a dictionary entry that has # in its ref Fix: [ bug #2758 ] Product::update sets product note to "null" when $prod->note is null Fix: [ bug #2757 ] Deleting product category photo gives "Forbidden access" error +Fix: [ bug #2835 ] Customer prices of a product shows incorrect history order ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 0a245093057..f53833b45d7 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -670,7 +670,7 @@ $sql.= " WHERE fk_product = ".$object->id; $sql.= " AND p.entity IN (".getEntity('productprice', 1).")"; $sql.= " AND p.fk_user_author = u.rowid"; if (! empty($socid) && ! empty($conf->global->PRODUIT_MULTIPRICES)) $sql.= " AND p.price_level = ".$soc->price_level; -$sql.= " ORDER BY p.date_price DESC, p.price_level ASC"; +$sql.= " ORDER BY p.date_price DESC, p.price_level ASC, p.rowid DESC"; dol_syslog("sql=".$sql); $result = $db->query($sql); From 12155029279fe748da1ce78275739f38230f1639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 13 Jun 2015 03:09:54 +0200 Subject: [PATCH 09/23] Fix Close bug #2814 JPEG photos are not displayed in Product photos page --- ChangeLog | 1 + htdocs/product/class/product.class.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 06e76dbfacc..727b8952d9c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,7 @@ Fix: [ bug #2577 ] Incorrect invoice status in "Linked objects" page of a projec Fix: [ bug #2576 ] Unable to edit a dictionary entry that has # in its ref Fix: [ bug #2758 ] Product::update sets product note to "null" when $prod->note is null Fix: [ bug #2757 ] Deleting product category photo gives "Forbidden access" error +Fix: [ bug #2814 ] JPEG photos are not displayed in Product photos page ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 10762d4e271..8fa11d15059 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2856,7 +2856,7 @@ class Product extends CommonObject if (! utf8_check($file)) $file=utf8_encode($file); // To be sure file is stored in UTF8 in memory - if (dol_is_file($dir.$file) && preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i', $dir.$file)) + if (dol_is_file($dir.$file) && preg_match('/(\.jp(e?)g|\.bmp|\.gif|\.png|\.tiff)$/i', $dir.$file)) { $nbphoto++; $photo = $file; From ea625628cea6930d785267f34f7424306863ba6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 13 Jun 2015 03:39:06 +0200 Subject: [PATCH 10/23] Fix Close bug #2786 Objectline_add template shows "0" for non-vat suppliers --- htdocs/core/tpl/objectline_create.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 7262a3b3bd9..a8c9434acec 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -184,7 +184,7 @@ else { tva_assuj == "0") echo '0'; + if ($seller->tva_assuj == "0") echo ' '.vatrate(0, true); else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?$_POST["tva_tx"]:-1), $seller, $buyer); } ?> From b96ed082605596c03b8befdc9246926918aa97a9 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 14 Jun 2015 12:29:47 +0200 Subject: [PATCH 11/23] Fix: select date problem with mobile device (#3039) --- htdocs/compta/bank/virement.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/virement.php b/htdocs/compta/bank/virement.php index 07541732bb0..a38e5a3e8a7 100644 --- a/htdocs/compta/bank/virement.php +++ b/htdocs/compta/bank/virement.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur - * Copytight (C) 2005-2009 Regis Houssin + * Copytight (C) 2005-2015 Regis Houssin * Copytight (C) 2012 Juanjo Menent * Copyright (C) 2015 Marcos García * @@ -180,7 +180,7 @@ print $form->select_comptes($account_to,'account_to',0,'',1); print "\n"; print ""; -$form->select_date($dateo,'','','','','add'); +$form->select_date((! empty($dateo)?$dateo:''),'','','','','add'); print "\n"; print ''; print ''; From b42f9a670601710ae35f9b623fc493bad22b74ab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Jun 2015 15:16:29 +0200 Subject: [PATCH 12/23] Fix phpcs --- htdocs/cashdesk/tpl/facturation1.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/cashdesk/tpl/facturation1.tpl.php b/htdocs/cashdesk/tpl/facturation1.tpl.php index 2d7d170f22e..76055fb635e 100644 --- a/htdocs/cashdesk/tpl/facturation1.tpl.php +++ b/htdocs/cashdesk/tpl/facturation1.tpl.php @@ -44,8 +44,8 @@ $langs->load("cashdesk"); From 14a8a2269ba4e8ac452c9b50bc46676de646b173 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Jun 2015 16:59:35 +0200 Subject: [PATCH 13/23] FIX End log must use same level then start log. --- htdocs/core/lib/functions.lib.php | 2 +- htdocs/main.inc.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7a07125f811..c530f612d29 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -165,7 +165,7 @@ function dol_shutdown() global $conf,$user,$langs,$db; $disconnectdone=false; $depth=0; if (is_object($db) && ! empty($db->connected)) { $depth=$db->transaction_opened; $disconnectdone=$db->close(); } - dol_syslog("--- End access to ".$_SERVER["PHP_SELF"].(($disconnectdone && $depth)?' (Warn: db disconnection forced, transaction depth was '.$depth.')':''), (($disconnectdone && $depth)?LOG_WARNING:LOG_DEBUG)); + dol_syslog("--- End access to ".$_SERVER["PHP_SELF"].(($disconnectdone && $depth)?' (Warn: db disconnection forced, transaction depth was '.$depth.')':''), (($disconnectdone && $depth)?LOG_WARNING:LOG_INFO)); } diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index da407b29ccc..b45d672b385 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -531,7 +531,7 @@ if (! defined('NOLOGIN')) { // We are already into an authenticated session $login=$_SESSION["dol_login"]; - dol_syslog("This is an already logged session. _SESSION['dol_login']=".$login); + dol_syslog("This is an already logged session. _SESSION['dol_login']=".$login, LOG_DEBUG); $resultFetchUser=$user->fetch('',$login); if ($resultFetchUser <= 0) From adc1998b7306ecdedce37b3e5735b5ae78e3cb21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garc=C3=ADa?= Date: Mon, 15 Jun 2015 09:18:58 +0200 Subject: [PATCH 14/23] Fixed undefined variable typo --- htdocs/core/class/html.formprojet.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 4cdd31d3b4c..bc5cfa2872c 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -124,7 +124,7 @@ class FormProjets } else if ($obj->fk_statut == 2) { - if ($discard_close == 2) $disabled=1; + if ($discard_closed == 2) $disabled=1; $labeltoshow.=' - '.$langs->trans("Closed"); } else if ($socid > 0 && (! empty($obj->fk_soc) && $obj->fk_soc != $socid)) From 5e25c698913fba31e3ce572a6dcf6d08c75cfb9a Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 16 Jun 2015 09:28:31 +0200 Subject: [PATCH 15/23] Fix: thumb "mini" not deleted --- htdocs/product/class/product.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index a0ade451c53..99b52dc84df 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3447,6 +3447,12 @@ class Product extends CommonObject { dol_delete_file($dirthumb.$photo_vignette); } + + $photo_vignette=preg_replace('/'.$regs[0].'/i','',$filename).'_mini'.$regs[0]; + if (file_exists(dol_osencode($dirthumb.$photo_vignette))) + { + dol_delete_file($dirthumb.$photo_vignette); + } } } From 3807fafc1aa68eadc9d4f5cd36f9c8372cf0d414 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 16 Jun 2015 16:42:33 +0200 Subject: [PATCH 16/23] Fix: no error message if extrafield is require --- htdocs/fichinter/card.php | 44 ++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 6fb4d374a7a..69ec8984cf6 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2014 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Ferran Marcet @@ -324,24 +324,34 @@ else if ($action == 'add' && $user->rights->ficheinter->creer) } else { - // Extrafields - $extrafields = new ExtraFields($db); - $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); - $array_option = $extrafields->getOptionalsFromPost($extralabels); + // Fill array 'array_options' with data from add form + $ret = $extrafields->setOptionalsFromPost($extralabels, $object); + if ($ret < 0) { + $error ++; + $action = 'create'; + } - $object->array_options = $array_option; + if (! $error) + { + // Extrafields + $extrafields = new ExtraFields($db); + $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); + $array_option = $extrafields->getOptionalsFromPost($extralabels); - $result = $object->create($user); - if ($result > 0) - { - $id=$result; // Force raffraichissement sur fiche venant d'etre cree - } - else - { - $langs->load("errors"); - setEventMessages($object->error, $object->errors, 'errors'); - $action = 'create'; - } + $object->array_options = $array_option; + + $result = $object->create($user); + if ($result > 0) + { + $id=$result; // Force raffraichissement sur fiche venant d'etre cree + } + else + { + $langs->load("errors"); + setEventMessages($object->error, $object->errors, 'errors'); + $action = 'create'; + } + } } } else From 844ca580962e57bde951bb71e031330a44c0411c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 17 Jun 2015 00:05:41 +0200 Subject: [PATCH 17/23] Fix: custom dir is missing --- build/makepack-dolibarr.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index f5d556eb2c5..f76d0b63880 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -456,10 +456,10 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/document`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/documents`; # Removed known external modules to avoir any error when packaging on test env + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom/*`; # For custome we want to keep dir $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/ancotec*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/calling*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/bootstrap*`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/factory*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/management*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/multicompany*`; From 9c6c3ad65d224e6ac44b8ac176ec7db83f7914c6 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 17 Jun 2015 16:33:18 +0200 Subject: [PATCH 18/23] Fix: wrong user right --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 99b52dc84df..f30874690fa 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2169,7 +2169,7 @@ class Product extends CommonObject $sql = "SELECT sum(d.qty), date_format(c.date_commande, '%Y%m')"; if ($mode == 'bynumber') $sql.= ", count(DISTINCT c.rowid)"; $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as d, ".MAIN_DB_PREFIX."commande_fournisseur as c, ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->fournisseur->lire && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE c.rowid = d.fk_commande"; $sql.= " AND d.fk_product =".$this->id; $sql.= " AND c.fk_soc = s.rowid"; From 63df278ecaf724199e087311d7566c7368d47925 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Tue, 23 Jun 2015 19:28:18 +0200 Subject: [PATCH 19/23] Fix: issue #3085 --- htdocs/core/js/lib_batch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/js/lib_batch.js b/htdocs/core/js/lib_batch.js index 65c138b73aa..b434083edd0 100644 --- a/htdocs/core/js/lib_batch.js +++ b/htdocs/core/js/lib_batch.js @@ -19,7 +19,7 @@ // \brief File that include javascript functions used when dispatching batch-enabled product // -function AddLineBatch(index) { +function addLineBatch(index) { var nme = 'dluo_0_'+index; $row=$("tr[name='"+nme+"']").clone(true); $row.find("input[name^='qty']").val(''); From c9c1247a2843a5dfbc2b7240810b45490e7b557d Mon Sep 17 00:00:00 2001 From: fmarcet Date: Wed, 24 Jun 2015 09:01:39 +0200 Subject: [PATCH 20/23] FIX: Payed invoices are showed as canceled FIX: Bad date filter on customer order --- htdocs/societe/consumption.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index f8b5829b03e..53d5daedb6e 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -2,6 +2,7 @@ /* Copyright (C) 2012-2013 Philippe Berthet * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2015 Ferran Marcet * * Version V1.1 Initial version of Philippe Berthet * Version V2 Change to be compatible with 3.4 and enhanced to be more generic @@ -197,7 +198,7 @@ if ($type_element == 'invoice') { // Customer : show products from invoices require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $documentstatic=new Facture($db); - $sql_select = 'SELECT f.rowid as doc_id, f.facnumber as doc_number, f.type as doc_type, f.datef as dateprint, f.fk_statut as status, '; + $sql_select = 'SELECT f.rowid as doc_id, f.facnumber as doc_number, f.type as doc_type, f.datef as dateprint, f.fk_statut as status, f.paye as paid, '; $tables_from = MAIN_DB_PREFIX."facture as f,".MAIN_DB_PREFIX."facturedet as d"; $where = " WHERE f.fk_soc = s.rowid AND s.rowid = ".$socid; $where.= " AND d.fk_facture = f.rowid"; @@ -228,7 +229,7 @@ if ($type_element == 'order') $where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".$socid; $where.= " AND d.fk_commande = c.rowid"; $where.= " AND c.entity = ".$conf->entity; - $dateprint = 'c.datef'; + $dateprint = 'c.date_commande'; $doc_number='c.ref'; $thirdTypeSelect='customer'; } @@ -335,11 +336,12 @@ if ($sql_select) { $documentstatic->id=$objp->doc_id; $documentstatic->ref=$objp->doc_number; - $documentstatic->type=$objp->type; + $documentstatic->type=$objp->doc_type; $documentstatic->fk_statut=$objp->status; $documentstatic->fk_status=$objp->status; $documentstatic->statut=$objp->status; $documentstatic->status=$objp->status; + $documentstatic->paye=$objp->paid; $var=!$var; print ""; From c218843cdbf7941d93222d2cd1fe75b0e67a6f1a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Jun 2015 18:29:29 +0200 Subject: [PATCH 21/23] FIX Save of filters into export profiles failed. --- htdocs/core/boxes/box_task.php | 15 +++++++-------- htdocs/core/class/rssparser.class.php | 4 ++-- htdocs/core/modules/modUser.class.php | 2 +- htdocs/exports/class/export.class.php | 22 ++++++++-------------- htdocs/exports/export.php | 26 ++++++++++++++------------ 5 files changed, 32 insertions(+), 37 deletions(-) diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index c15bc9831ce..fec676d8265 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -1,5 +1,6 @@ + * * 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 * the Free Software Foundation; either version 3 of the License, or @@ -18,7 +19,6 @@ * \file htdocs/core/boxes/box_task.php * \ingroup Projet * \brief Module to Task activity of the current year - * \version $Id: box_task.php,v 1.1 2012/09/11 Charles-François BENKE */ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); @@ -39,11 +39,11 @@ class box_task extends ModeleBoxes var $info_box_head = array(); var $info_box_contents = array(); - /** - * \brief Constructeur de la classe - * - * @return void - */ + /** + * Constructor + * + * @return void + */ function box_task() { global $langs; @@ -120,8 +120,7 @@ class box_task extends ModeleBoxes // Add the sum à the bottom of the boxes - $this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="left" ', 'text' => $langs->trans("Total")." ".$textHead); - $this->info_box_contents[$i][1] = array('td' => '', 'text' => ""); + $this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="left" colspan="2" ', 'text' => $langs->trans("Total")." ".$textHead); $this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')." ".$langs->trans("Tasks")); $this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalplannedtot,'all',25200,5)); $this->info_box_contents[$i][4] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totaldurationtot,'all',25200,5)); diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index 349b32d5104..56e338b7eb8 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -400,7 +400,7 @@ class RssParser { if (! empty($conf->global->EXTERNALRSS_USE_SIMPLEXML)) { - $itemLink = (string) $item['link']['href']; + $itemLink = (isset($item['link']['href']) ? (string) $item['link']['href'] : ''); $itemTitle = (string) $item['title']; $itemDescription = (string) $item['summary']; $itemPubDate = (string) $item['created']; @@ -409,7 +409,7 @@ class RssParser } else { - $itemLink = (string) $item['link']['href']; + $itemLink = (isset($item['link']['href']) ? (string) $item['link']['href'] : ''); $itemTitle = (string) $item['title']; $itemDescription = (string) $item['summary']; $itemPubDate = (string) $item['created']; diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index a59031b4a44..a339d65d54d 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -210,7 +210,7 @@ class modUser extends DolibarrModules $this->export_label[$r]='Liste des utilisateurs Dolibarr et attributs'; $this->export_permission[$r]=array(array("user","user","export")); $this->export_fields_array[$r]=array('u.rowid'=>"Id",'u.login'=>"Login",'u.lastname'=>"Lastname",'u.firstname'=>"Firstname",'u.office_phone'=>'Phone','u.office_fax'=>'Fax','u.email'=>'EMail','u.datec'=>"DateCreation",'u.tms'=>"DateLastModification",'u.admin'=>"Administrator",'u.statut'=>'Status','u.note'=>"Note",'u.datelastlogin'=>'LastConnexion','u.datepreviouslogin'=>'PreviousConnexion','u.fk_socpeople'=>"IdContact",'u.fk_societe'=>"IdCompany",'u.fk_member'=>"MemberId"); - $this->export_TypeFields_array[$r]=array('u.login'=>"Text",'u.lastname'=>"Text",'u.firstname'=>"Text",'u.office_phone'=>'Text','u.office_fax'=>'Text','u.email'=>'Text','u.datec'=>"Date",'u.tms'=>"Date",'u.admin'=>"Boolean",'u.statut'=>'Status','u.note'=>"Text",'u.datelastlogin'=>'Date','u.datepreviouslogin'=>'Date','u.fk_societe'=>"List:societe:nom:rowid",'u.fk_member'=>"List:adherent:nom"); + $this->export_TypeFields_array[$r]=array('u.login'=>"Text",'u.lastname'=>"Text",'u.firstname'=>"Text",'u.office_phone'=>'Text','u.office_fax'=>'Text','u.email'=>'Text','u.datec'=>"Date",'u.tms'=>"Date",'u.admin'=>"Boolean",'u.statut'=>'Status','u.note'=>"Text",'u.datelastlogin'=>'Date','u.datepreviouslogin'=>'Date','u.fk_societe'=>"Text",'u.fk_member'=>"Text"); $this->export_entities_array[$r]=array('u.rowid'=>"user",'u.login'=>"user",'u.lastname'=>"user",'u.firstname'=>"user",'u.office_phone'=>'user','u.office_fax'=>'user','u.email'=>'user','u.datec'=>"user",'u.tms'=>"user",'u.admin'=>"user",'u.statut'=>'user','u.note'=>"user",'u.datelastlogin'=>'user','u.datepreviouslogin'=>'user','u.fk_socpeople'=>"contact",'u.fk_societe'=>"company",'u.fk_member'=>"member"); if (empty($conf->adherent->enabled)) diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index d49e2f561c9..415fd35f05e 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -46,7 +46,6 @@ class Export // To store export modules var $hexa; - var $hexafilter; var $hexafiltervalue; var $datatoexport; var $model_name; @@ -627,9 +626,6 @@ class Export $this->db->begin(); $filter=''; - if (! empty($this->hexafilter) && ! empty($this->hexafiltervalue)) { - $filter = json_encode(array('field' => $this->hexafilter, 'value' => $this->hexafiltervalue)); - } $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'export_model ('; $sql.= 'label,'; @@ -638,12 +634,12 @@ class Export $sql.= 'filter'; $sql.= ') VALUES ('; $sql.= "'".$this->db->escape($this->model_name)."',"; - $sql.= "'".$this->datatoexport."',"; - $sql.= "'".$this->hexa."',"; - $sql.= (! empty($filter)?"'".$filter."'":"null"); + $sql.= "'".$this->db->escape($this->datatoexport)."',"; + $sql.= "'".$this->db->escape($this->hexa)."',"; + $sql.= "'".$this->db->escape($this->hexafiltervalue)."'"; $sql.= ")"; - dol_syslog("Export::create", LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -667,7 +663,7 @@ class Export */ function fetch($id) { - $sql = 'SELECT em.rowid, em.field, em.label, em.type, em.filter'; + $sql = 'SELECT em.rowid, em.label, em.type, em.field, em.filter'; $sql.= ' FROM '.MAIN_DB_PREFIX.'export_model as em'; $sql.= ' WHERE em.rowid = '.$id; @@ -679,13 +675,11 @@ class Export if ($obj) { $this->id = $obj->rowid; - $this->hexa = $obj->field; $this->model_name = $obj->label; $this->datatoexport = $obj->type; - - $filter = json_decode($obj->filter, true); - $this->hexafilter = (isset($filter['field'])?$filter['field']:''); - $this->hexafiltervalue = (isset($filter['value'])?$filter['value']:''); + + $this->hexa = $obj->field; + $this->hexafiltervalue = $obj->filter; return 1; } diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index d76350e878f..4eac9e03342 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -99,7 +99,7 @@ $entitytolang = array( ); $array_selected=isset($_SESSION["export_selected_fields"])?$_SESSION["export_selected_fields"]:array(); -$array_filtervalue=isset($_SESSION["export_FilterValue_fields"])?$_SESSION["export_FilterValue_fields"]:array(); +$array_filtervalue=isset($_SESSION["export_filtered_fields"])?$_SESSION["export_filtered_fields"]:array(); $datatoexport=GETPOST("datatoexport"); $action=GETPOST('action', 'alpha'); $confirm=GETPOST('confirm', 'alpha'); @@ -222,7 +222,6 @@ if ($action=='downfield' || $action=='upfield') if ($step == 1 || $action == 'cleanselect') { $_SESSION["export_selected_fields"]=array(); - //$_SESSION["export_FilterValue_fields"]=array(); $_SESSION["export_filtered_fields"]=array(); $array_selected=array(); $array_filtervalue=array(); @@ -280,12 +279,15 @@ if ($action == 'add_export_model') } $hexafiltervalue=''; - foreach($array_filtervalue as $key=>$val) + if (! empty($array_filtervalue) && is_array($array_filtervalue)) { - if ($hexafilter) $hexafiltervalue.=','; - $hexafiltervalue.=$key.'='.$val; + foreach($array_filtervalue as $key=>$val) + { + if ($hexafiltervalue) $hexafiltervalue.=','; + $hexafiltervalue.=$key.'='.$val; + } } - + $objexport->model_name = $export_name; $objexport->datatoexport = $datatoexport; $objexport->hexa = $hexa; @@ -311,10 +313,11 @@ if ($action == 'add_export_model') } } +// Reload an predefined export model if ($step == 2 && $action == 'select_model') { $_SESSION["export_selected_fields"]=array(); - $_SESSION["export_FilterValue_fields"]=array(); + $_SESSION["export_filtered_fields"]=array(); $array_selected=array(); $array_filtervalue=array(); @@ -331,16 +334,15 @@ if ($step == 2 && $action == 'select_model') } $_SESSION["export_selected_fields"]=$array_selected; - $fieldsarray=explode(',',$objexport->hexafilter); $fieldsarrayvalue=explode(',',$objexport->hexafiltervalue); $i=1; - foreach($fieldsarray as $val) + foreach($fieldsarrayvalue as $val) { $tmp=explode('=',$val); $array_filtervalue[$tmp[0]]=$tmp[1]; $i++; } - $_SESSION["export_FilterValue_fields"]=$array_filtervalue; + $_SESSION["export_filtered_fields"]=$array_filtervalue; } } @@ -350,7 +352,7 @@ if ($step == 4 && $action == 'submitFormField') // on boucle sur les champs selectionne pour recuperer la valeur if (is_array($objexport->array_export_TypeFields[0])) { - $_SESSION["export_FilterValue_fields"]=array(); + $_SESSION["export_filtered_fields"]=array(); //var_dump($_POST); foreach($objexport->array_export_TypeFields[0] as $code => $type) // $code: s.fieldname $value: Text|Boolean|List:ccc { @@ -366,7 +368,7 @@ if ($step == 4 && $action == 'submitFormField') } } $array_filtervalue=(! empty($objexport->array_export_FilterValue[0])?$objexport->array_export_FilterValue[0]:''); - $_SESSION["export_FilterValue_fields"]=$array_filtervalue; + $_SESSION["export_filtered_fields"]=$array_filtervalue; } } From 3adf6b1a73af7acf55f6bd48d089150d8451bba2 Mon Sep 17 00:00:00 2001 From: Fab Date: Thu, 25 Jun 2015 08:50:48 +0200 Subject: [PATCH 22/23] Missing space after title tag. When using textwithpicto() from core/class/html.form.class.php, if you are reading source code with firefox, you will see that a part of the generated html is highlighted in red. should be : --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index eeac381cff8..c65a164a303 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -394,9 +394,9 @@ class Form $htmltext=str_replace("\n","",$htmltext); $htmltext=str_replace('"',""",$htmltext); - if ($tooltipon == 2 || $tooltipon == 3) $paramfortooltipimg=' class="classfortooltip'.($extracss?' '.$extracss:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td img tag to store tooltip + if ($tooltipon == 2 || $tooltipon == 3) $paramfortooltipimg=' class="classfortooltip'.($extracss?' '.$extracss:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'" '; // Attribut to put on td img tag to store tooltip else $paramfortooltipimg =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag - if ($tooltipon == 1 || $tooltipon == 3) $paramfortooltiptd=' class="classfortooltip'.($extracss?' '.$extracss:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td tag to store tooltip + if ($tooltipon == 1 || $tooltipon == 3) $paramfortooltiptd=' class="classfortooltip'.($extracss?' '.$extracss:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'" '; // Attribut to put on td tag to store tooltip else $paramfortooltiptd =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag $s=""; if (empty($notabs)) $s.=''; From 9505d3a528fd575eec2446a1a5575aeb17b4f4ba Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 25 Jun 2015 17:22:37 +0200 Subject: [PATCH 23/23] fix multicompny bug with getEntites without shared test --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 0f7ad41de14..06648b42ea2 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -81,7 +81,7 @@ abstract class CommonObject $sql = "SELECT rowid, ref, ref_ext"; $sql.= " FROM ".MAIN_DB_PREFIX.$element; - $sql.= " WHERE entity IN (".getEntity($element).")" ; + $sql.= " WHERE entity IN (".getEntity($element,1).")" ; if ($id > 0) $sql.= " AND rowid = ".$db->escape($id); else if ($ref) $sql.= " AND ref = '".$db->escape($ref)."'";