diff --git a/dev/skeletons/skeleton_list.php b/dev/skeletons/skeleton_list.php index 0ca6962bbef..7715b17b4d8 100644 --- a/dev/skeletons/skeleton_list.php +++ b/dev/skeletons/skeleton_list.php @@ -296,7 +296,7 @@ if ($resql) $moreforfilter = ''; $moreforfilter.='
'; - $moreforfilter.= $langs->trans('MyFilter') . ': '; + $moreforfilter.= $langs->trans('MyFilter') . ': '; $moreforfilter.= '
'; $parameters=array(); diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 5fb3d8140bd..7520bdbf6a5 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -33,17 +33,28 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class AdherentType extends CommonObject { - public $table_element = 'adherent_type'; - public $element = 'adherent_type'; + public $table_element = 'adherent_type'; + public $element = 'adherent_type'; - var $id; - var $ref; - var $libelle; - var $subscription; // Subscription required - var $note; - var $vote; // Can vote - var $mail_valid; // mail sent during validation - var $statut; + /** @var string Label */ + public $libelle; + /** + * @var bool + * @deprecated Use subscription + * @see subscription + */ + public $cotisation; + /** + * @var bool Subsription required + * @since 5.0 + */ + public $subscription; + /** @var string Public note */ + public $note; + /** @var bool Can vote*/ + public $vote; + /** @var bool Email sent during validation */ + public $mail_valid; /** diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index afe56aa8dcf..0a2669e960d 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -2,6 +2,7 @@ /* Copyright (C) 2007 Patrick Raguin * Copyright (C) 2007-2012 Laurent Destailleur * Copyright (C) 2009-2011 Regis Houssin + * Copyright (C) 2016 Meziane Sof * * 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 @@ -33,10 +34,14 @@ $langs->load('other'); if (! $user->admin) accessforbidden(); -$dirstandard = "/core/menus/standard"; -$dirsmartphone = "/core/menus/smartphone"; - -$dirmenu = array($dirstandard,$dirsmartphone); +$dirstandard = array(); +$dirsmartphone = array(); +$dirmenus=array_merge(array("/core/menus/"),(array) $conf->modules_parts['menus']); +foreach($dirmenus as $dirmenu) +{ + $dirstandard[]=$dirmenu.'standard'; + $dirsmartphone[]=$dirmenu.'smartphone'; +} $action=GETPOST('action'); @@ -244,7 +249,7 @@ if ($action == 'confirm_delete' && $_POST["confirm"] == 'yes') $this->db->begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX."menu WHERE rowid = ".GETPOST('menuId', 'int'); - $db->query($sql); + $result=$db->query($sql); if ($result == 0) { @@ -331,7 +336,7 @@ if ($action == 'create') // Handler print ''.$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 ''; + } + + // Modify if ($object->statut != 2 && $user->rights->projet->creer) { if ($userWrite > 0)