Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0
This commit is contained in:
commit
dc0856413c
@ -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
|
||||
{
|
||||
|
||||
@ -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');
|
||||
|
||||
|
||||
@ -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');
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user