From 2b7b7e014d5c7ae10985975d26284cca58d36995 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 22 Jan 2016 13:20:21 +0100 Subject: [PATCH 1/6] Fix: for avoid conflict with "global $m" in memory.lib.php --- htdocs/comm/mailing/cibles.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index b73f8a0743b..2a1defe5319 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -484,24 +484,24 @@ if ($object->fetch($id) >= 0) if ($obj->source_type == 'member') { include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; - $m=new Adherent($db); - $m->fetch($obj->source_id); - print $m->getNomUrl(2); + $objectstatic=new Adherent($db); + $objectstatic->fetch($obj->source_id); + print $objectstatic->getNomUrl(2); } else if ($obj->source_type == 'user') { include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; - $m=new User($db); - $m->fetch($obj->source_id); - $m->id=$obj->source_id; - print $m->getNomUrl(2); + $objectstatic=new User($db); + $objectstatic->fetch($obj->source_id); + $objectstatic->id=$obj->source_id; + print $objectstatic->getNomUrl(2); } else if ($obj->source_type == 'thirdparty') { include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; - $m=new Societe($db); - $m->fetch($obj->source_id); - print $m->getNomUrl(2); + $objectstatic=new Societe($db); + $objectstatic->fetch($obj->source_id); + print $objectstatic->getNomUrl(2); } else { From 83263e242e72effdcd4038e59971f3780895ed0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 23 Jan 2016 20:32:22 +0100 Subject: [PATCH 2/6] Corrected typo of PR #4444 --- htdocs/product/class/product.class.php | 4 ++-- htdocs/product/price.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 2bf92821c1e..37f7d228869 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1510,7 +1510,7 @@ class Product extends CommonObject $sql.= " WHERE entity IN (".getEntity('productprice', 1).")"; $sql.= " AND price_level=".$i; $sql.= " AND fk_product = '".$this->id."'"; - $sql.= " ORDER BY date_price, rowid DESC"; + $sql.= " ORDER BY date_price DESC, rowid DESC"; $sql.= " LIMIT 1"; $resql = $this->db->query($sql); if ($resql) @@ -1571,7 +1571,7 @@ class Product extends CommonObject $sql.= " price_base_type, tva_tx, tosell, price_by_qty, rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."product_price"; $sql.= " WHERE fk_product = '".$this->id."'"; - $sql.= " ORDER BY date_price, rowid DESC"; + $sql.= " ORDER BY date_price DESC, rowid DESC"; $sql.= " LIMIT 1"; $resql = $this->db->query($sql); if ($resql) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 79ee0dd0f55..f338a0b4dd9 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -687,7 +687,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, p.rowid DESC, p.price_level ASC"; +$sql .= " ORDER BY p.date_price DESC, p.rowid DESC, p.price_level ASC"; // $sql .= $db->plimit(); dol_syslog("sql=" . $sql); From c2efee8a2923be093f159dbb87f4a3aed693cab2 Mon Sep 17 00:00:00 2001 From: fmarcet Date: Tue, 26 Jan 2016 13:02:21 +0100 Subject: [PATCH 3/6] FIX: Contrat card don't consider user permissions to show active/unactive service button --- htdocs/contrat/card.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index e7075b4f22c..021479dd99d 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -6,7 +6,7 @@ * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2013 Christophe Battarel * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2014 Ferran Marcet + * Copyright (C) 2014-2016 Ferran Marcet * Copyright (C) 2014 Marcos GarcĂ­a * * This program is free software; you can redistribute it and/or modify @@ -1548,9 +1548,11 @@ else { $tmpaction='activateline'; if ($objp->statut == 4) $tmpaction='unactivateline'; - print ''; - print img_edit(); - print ''; + if (($tmpaction=='activateline' && $user->rights->contrat->activer) || ($tmpaction=='unactivateline' && $user->rights->contrat->unactiver)) { + print ''; + print img_edit(); + print ''; + } } } print ''; From 8a80e065801686e3d9791cdd3c1f4cbbc737f4b1 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 28 Jan 2016 11:42:00 +0100 Subject: [PATCH 4/6] Fix: missing field "label" --- htdocs/commande/orderstoinvoice.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 50bf0eefbb5..7a8814edd4d 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -300,7 +300,8 @@ if (($action == 'create' || $action == 'add') && !$error) $lines[$i]->rowid, $fk_parent_line, $lines[$i]->fk_fournprice, - $lines[$i]->pa_ht + $lines[$i]->pa_ht, + $lines[$i]->label ); if ($result > 0) { @@ -396,9 +397,9 @@ if ($action == 'create' && !$error) print ''; print ''; print ''; - + dol_fiche_head(); - + print ''; // Ref @@ -501,15 +502,15 @@ if ($action == 'create' && !$error) } dol_fiche_end(); - + // Button "Create Draft" print '
'; print "\n"; print ''; print "
\n"; - - + + } // Mode liste From 6eecf2f29a15fa15cc427bd1c84aae567270792f Mon Sep 17 00:00:00 2001 From: phf Date: Thu, 28 Jan 2016 12:30:49 +0100 Subject: [PATCH 5/6] FIX filter by socid if from customer card --- htdocs/expedition/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index aa629955f53..8794222c88e 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -30,6 +30,7 @@ $langs->load("sendings"); $langs->load("deliveries"); $langs->load('companies'); +$socid=GETPOST('socid','int'); // Security check $expeditionid = GETPOST('id','int'); if ($user->societe_id) $socid=$user->societe_id; From cd58c93de67446d912021b6cbbf02b959b335e00 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Jan 2016 12:51:34 +0100 Subject: [PATCH 6/6] FIX If option to hide automatic ECM is on, dont show menu. --- htdocs/core/modules/modECM.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modECM.class.php b/htdocs/core/modules/modECM.class.php index 2bf3542186a..c1334b81e63 100644 --- a/htdocs/core/modules/modECM.class.php +++ b/htdocs/core/modules/modECM.class.php @@ -174,7 +174,7 @@ class modECM extends DolibarrModules 'langs'=>'ecm', 'position'=>103, 'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload', - 'enabled'=>'$user->rights->ecm->read || $user->rights->ecm->upload', + 'enabled'=>'($user->rights->ecm->read || $user->rights->ecm->upload) && ! empty($conf->global->ECM_AUTO_TREE_ENABLED)', 'target'=>'', 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both $r++;