diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php
index 250a155ad57..d3aa3557c89 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
{
diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php
index 4d9b6bb53f5..79f18ad26ab 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 '
\n";
-
-
+
+
}
// Mode liste
diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php
index a1a1d1cc69a..37ec345295b 100644
--- a/htdocs/contrat/card.php
+++ b/htdocs/contrat/card.php
@@ -6,7 +6,7 @@
* Copyright (C) 2010-2015 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
* Copyright (C) 2015 Jean-François Ferry
*
@@ -1718,9 +1718,11 @@ else
{
$tmpaction='activateline';
if ($objp->statut == 4) $tmpaction='unactivateline';
- print 'id.'&ligne='.$object->lines[$cursorline-1]->id.'&action='.$tmpaction.'">';
- print img_edit();
- print '';
+ if (($tmpaction=='activateline' && $user->rights->contrat->activer) || ($tmpaction=='unactivateline' && $user->rights->contrat->unactiver)) {
+ print 'id . '&ligne=' . $object->lines[$cursorline - 1]->id . '&action=' . $tmpaction . '">';
+ print img_edit();
+ print '';
+ }
}
}
print '';
diff --git a/htdocs/core/modules/modECM.class.php b/htdocs/core/modules/modECM.class.php
index b185e2962f2..1aa5008032d 100644
--- a/htdocs/core/modules/modECM.class.php
+++ b/htdocs/core/modules/modECM.class.php
@@ -175,7 +175,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++;
diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php
index 30e276cca20..ccd10d7c550 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;
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 749899e345c..05fbc988c68 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -1735,7 +1735,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)