| '.$langs->trans('MenuHandler').' | ';
print '';
- $formadmin->select_menu_families($menu_handler,'menu_handler',$dirmenu);
+ $formadmin->select_menu_families($menu_handler.(preg_match('/_menu/',$menu_handler)?'':'_menu'),'menu_handler',array_merge($dirstandard,$dirsmartphone));
print ' | ';
print ''.$langs->trans('DetailMenuHandler').' |
';
diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php
index 34a11663e2a..e59144abc2e 100644
--- a/htdocs/fourn/class/fournisseur.product.class.php
+++ b/htdocs/fourn/class/fournisseur.product.class.php
@@ -521,9 +521,10 @@ class ProductFournisseur extends Product
*
* @param int $prodid Product id
* @param int $qty Minimum quantity
+ * @param int $socid get min price for specific supplier
* @return int <0 if KO, 0=Not found of no product id provided, >0 if OK
*/
- function find_min_price_product_fournisseur($prodid, $qty=0)
+ function find_min_price_product_fournisseur($prodid, $qty=0, $socid=0)
{
global $conf;
@@ -556,6 +557,7 @@ class ProductFournisseur extends Product
$sql.= " AND pfp.fk_soc = s.rowid";
$sql.= " AND s.status = 1"; // only enabled society
if ($qty > 0) $sql.= " AND pfp.quantity <= ".$qty;
+ if ($socid > 0) $sql.= ' AND pfp.fk_soc = '.$socid;
dol_syslog(get_class($this)."::find_min_price_product_fournisseur", LOG_DEBUG);
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index 4460a335463..828809d43d3 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -1059,7 +1059,7 @@ if (empty($reshook))
$array_option = $lines[$i]->array_options;
}
- $result = $productsupplier->find_min_price_product_fournisseur($lines[$i]->fk_product, $lines[$i]->qty);
+ $result = $productsupplier->find_min_price_product_fournisseur($lines[$i]->fk_product, $lines[$i]->qty, $srcobject->socid);
if ($result>=0)
{
$tva_tx = $lines[$i]->tva_tx;
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index cc3a97fac5b..5817f44db65 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -970,7 +970,16 @@ else
{
if ($action != "edit" )
{
- // Modify
+
+ // Create event
+ if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a
+ // "workflow" action so should appears somewhere else on
+ // page.
+ {
+ print '