Changeset 4561


Ignore:
Timestamp:
Sep 30, 2014, 1:31:56 PM (8 years ago)
Author:
Fredrik Levander
Message:

Fixes #826. Updated project query to return also projects shared to the user.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/servlet/src/org/proteios/Service.java

    r4383 r4561  
    4747import org.proteios.core.Directory;
    4848import org.proteios.core.File;
     49import org.proteios.core.Include;
    4950import org.proteios.core.ItemAlreadyExistsException;
    5051import org.proteios.core.ItemFactory;
     
    6263import org.proteios.core.query.Orders;
    6364import org.proteios.core.query.Restriction;
     65import org.proteios.core.query.Restrictions;
    6466import org.proteios.gui.table.Filter;
    6567import org.proteios.io.Base64Util;
     
    358360      query.include(IN_PROJECT);
    359361      query.exclude(MINE);
     362      log.debug("Project"+sc.getActiveProjectId());
     363    }
     364    else
     365    {
     366      if (data.itemClass.equals(Project.class))
     367      {
     368        query = Project.getQuery();
     369        query.include(Include.SHARED);
     370        query.include(Include.MINE);
     371        query.restrict(Restrictions.neq(Hql.property("closed"), Expressions.parameter("closed")));
     372        query.setParameter("closed", true, null);
     373        log.debug("Project query including shared projects");
     374      }
     375      log.debug("Data item:"+data.itemClass);
    360376    }
    361377    log.debug("Query created");
Note: See TracChangeset for help on using the changeset viewer.