Skip to content
Snippets Groups Projects
Commit 3d1ddbb9 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.9

parents 0b49d631 87e8ac51
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@
* Copyright (C) 2006-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
......@@ -602,17 +602,19 @@ class Categorie extends CommonObject
{
if ($this->db->num_rows($resql) > 0)
{
$objparent = $this->db->fetch_object($resql);
$objparent = $this->db->fetch_object($resql);
if (!empty($objparent->fk_parent))
{
$cat = new Categorie($this->db);
$cat->id=$objparent->fk_parent;
$result=$cat->add_type($obj, $type);
if ($result < 0)
{
$this->error=$cat->error;
$error++;
$cat->id = $objparent->fk_parent;
if (!$cat->containsObject($type, $obj->id)) {
$result = $cat->add_type($obj, $type);
if ($result < 0)
{
$this->error = $cat->error;
$error++;
}
}
}
}
......
......@@ -2,6 +2,7 @@
/* Copyright (C) 2012-2014 Charles-François BENKE <charles.fr@benke.fr>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* Copyright (C) 2016 Juan José Menent <jmenent@2byte.es>
*
* 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
......@@ -79,8 +80,10 @@ class box_project extends ModeleBoxes
$sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut ";
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
if($user->socid) $sql.= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid=p.fk_soc";
$sql.= " WHERE p.entity = ".$conf->entity;
$sql.= " AND p.fk_statut = 1"; // Seulement les projets ouverts
if($user->socid) $sql.= " AND s.rowid = ".$user->socid;
$sql.= " AND p.fk_statut = 1"; // Seulement les projets ouverts
$sql.= " ORDER BY p.datec DESC";
$sql.= $db->plimit($max, 0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment