diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index f18a3fe86b6..8e550f98c99 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -46,14 +46,17 @@ $action=GETPOST('action'); */ // positionne la variable pour le nombre de rss externes -$sql ="SELECT MAX(".$db->decrypt('name').") as name FROM ".MAIN_DB_PREFIX."const"; +$sql ="SELECT ".$db->decrypt('name')." as name FROM ".MAIN_DB_PREFIX."const"; $sql.=" WHERE ".$db->decrypt('name')." LIKE 'EXTERNAL_RSS_URLRSS_%'"; -$result=$db->query($sql); +//print $sql; +$result=$db->query($sql); // We can't use SELECT MAX() because EXTERNAL_RSS_URLRSS_10 is lower than EXTERNAL_RSS_URLRSS_9 if ($result) { - $obj = $db->fetch_object($result); - preg_match('/([0-9]+)$/i',$obj->name,$reg); - if ($reg[1]) $lastexternalrss = $reg[1]; + while ($obj = $db->fetch_object($result)) + { + preg_match('/([0-9]+)$/i',$obj->name,$reg); + if ($reg[1] && $reg[1] > $lastexternalrss) $lastexternalrss = $reg[1]; + } } else { diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index ad05d000f8c..bff5c773cfc 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -46,6 +46,7 @@ if (!$user->rights->fournisseur->facture->lire) accessforbidden(); $langs->load("bills"); $langs->load("companies"); $langs->load('products'); +$langs->load('projects'); $socid = GETPOST('socid','int'); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index b4a9a549ea7..097537ac71a 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3471,7 +3471,9 @@ class Societe extends CommonObject */ public function setCategories($categories, $type) { - // Decode type + require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; + + // Decode type if ($type == 'customer') { $type_id = Categorie::TYPE_CUSTOMER; $type_text = 'customer'; @@ -3489,7 +3491,6 @@ class Societe extends CommonObject } // Get current categories - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $c = new Categorie($this->db); $existing = $c->containing($this->id, $type_id, 'id');