Changeset 7038


Ignore:
Timestamp:
Dec 4, 2015, 1:00:05 PM (6 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1976: Improve filtering in "All items" list

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/net/sf/basedb/core/User.java

    r7037 r7038  
    4343import net.sf.basedb.core.query.Expressions;
    4444import net.sf.basedb.core.query.ResultList;
    45 import net.sf.basedb.core.query.Selects;
    4645
    4746import java.util.ArrayList;
  • trunk/www/views/items/list_items.jsp

    r7037 r7038  
    3737  import="net.sf.basedb.core.Shareable"
    3838  import="net.sf.basedb.core.SharedItem"
     39  import="net.sf.basedb.core.Subtypable"
    3940  import="net.sf.basedb.core.File"
    4041  import="net.sf.basedb.core.Directory"
     
    106107    Restriction description = Restrictions.conditionalRestriction(new ReturnClassFilter(Nameable.class),
    107108      cc.getFilterRestriction("description", dc, null), null, true);
    108     Restriction restriction = Restrictions.nullSafeAnd(sharedTo, name, description, id);
     109    Restriction subtype = Restrictions.conditionalRestriction(new ReturnClassFilter(Subtypable.class),
     110      cc.getFilterRestriction("itemSubtype.name", dc, null), null, true);
     111    Restriction restriction = Restrictions.nullSafeAnd(sharedTo, name, description, id, subtype);
    109112
    110113    User loggedInUser = User.getById(dc, sc.getLoggedInUserId());
     
    168171        datatype="int"
    169172        title="ID"
     173        filterable="true"
     174      />
     175      <tbl:columndef
     176        id="itemSubtype"
     177        property="itemSubtype.name"
     178        datatype="string"
     179        title="Subtype"
    170180        filterable="true"
    171181      />
     
    353363                <tbl:cell column="name"><%=link%></tbl:cell>
    354364                <tbl:cell column="id"><%=item.getId()%></tbl:cell>
     365                <tbl:cell column="itemSubtype"><%
     366                if (item instanceof Subtypable)
     367                {
     368                  %><base:propertyvalue item="<%=item%>" property="itemSubtype" /><%
     369                }
     370                %></tbl:cell>
    355371                <tbl:cell column="description"><%=HTML.encodeTags(description)%></tbl:cell>
    356372                <tbl:cell column="sharedTo">
Note: See TracChangeset for help on using the changeset viewer.